Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (539)
Games in Android Showcase (132)
games submitted by our members
Games in WIP (603)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Data send format  (Read 1769 times)
0 Members and 1 Guest are viewing this topic.
Offline MickeyB

Senior Devvie




my game will work, my game will work!


« Posted 2003-11-26 12:45:02 »

A sector in my game could have at max 164 objects in it.

Each static object will have an x and y, id number, type num, int angle degrees, speed of 0.  Each movable object will have the same, with a speed of 0 or greater.  What would be the recommended method for sending that initial "sector" load to a client?  Arrays of ints, loop through ints, serialized objects, etc...?

Keep in mind this is a pseudo real-time(movement will be as close as possible to true), but projectiles are skill based within the game.  When A shoots at B, all players in sector will recieve an A shoots B data message and then actual drawing of projectile type, location and movement will be handled on each client and success of hit is handle by server calcing a skill test.  

MickeyB

Current Project: http://www22.brinkster.com/mbowles/
Offline Jeff

JGO Coder




Got any cats?


« Reply #1 - Posted 2003-11-27 00:34:33 »

If a sector is a "level load" then you might as well do it the easiest way as game play is paused anyway.

If not then I need to understand your game design better.

Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!

http://wiki.java.net/bin/view/Games/JeffFAQ
Offline MickeyB

Senior Devvie




my game will work, my game will work!


« Reply #2 - Posted 2003-11-27 12:20:25 »

pretty much a level load....you can nav a sector taht can be as large as 10k*10k pixels.

WHen you "hyperspace" to another sector it is like zoning or leveling...you pause while all data of current sector loads. Are objects easiest for this?

MickeyB

Current Project: http://www22.brinkster.com/mbowles/
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Jeff

JGO Coder




Got any cats?


« Reply #3 - Posted 2003-11-27 17:46:05 »

Quote
pretty much a level load....you can nav a sector taht can be as large as 10k*10k pixels.

WHen you "hyperspace" to another sector it is like zoning or leveling...you pause while all data of current sector loads. Are objects easiest for this?


As long as you have a reasonably tight (or pruned with Transient) tree then yeah you could potentially just serialize one object (a "Map" or "Board" object and since serialization follows the references it would do all the work for you Smiley

Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!

http://wiki.java.net/bin/view/Games/JeffFAQ
Offline MickeyB

Senior Devvie




my game will work, my game will work!


« Reply #4 - Posted 2003-11-27 21:23:42 »

Thanks!

M

MickeyB

Current Project: http://www22.brinkster.com/mbowles/
Offline webgeek

Junior Newbie




Java games rock!


« Reply #5 - Posted 2003-12-30 18:27:05 »

If much of the data is static then you could use XML to describe the map and then send an object of the dynamic data. This way you can maintain all the static maps via a convenient format. We do this using XML so we can have a simple editor generate "zones" or levels. This also lets you fine-tune levels or areas by hand if you want to.

If transmission speed is an issue, then you can simple "Zip" the XML using the Java libraries and be done with it.

If the data isn't static, DON'T USE XML Smiley I can't stand how so many projects use XML where is just doesn't make sense.

Mike
Offline Jeff

JGO Coder




Got any cats?


« Reply #6 - Posted 2003-12-31 21:22:22 »

Well.. where XML makes sense is a judgement call ofcourse...

I tend to think it makes sense a lot less often then many people do.  In general, it semes a waste to me to convert binary data into a text representation which then just has to be parsed back to binary data at the other end.

YMMV

Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!

http://wiki.java.net/bin/view/Games/JeffFAQ
Offline swpalmer

JGO Coder


Exp: 12 years


Where's the Kaboom?


« Reply #7 - Posted 2004-01-02 21:50:47 »

But to the computer it's ALL binary data  Tongue

I use XML when I want to represent hierarchal data in a portable format that is easy to edit.   Binary data has endian issues if you go outside the Java world.  C-style structures have byte packing issues, etc..  sometimes it is worth giving up some efficiency just so some of those problems go away.  The ability to throw your files and data structures into a text editor can really help debugging too.

but for large tables like bitmaps or 3D models yeah XML sucks.  Though it might be useful to glue together 3D models and say what texture goes with what model and other higher level binding to binary data.  Or for config files etc.

The project I'm working on store all the data in XML format.  There is one ugly place where some small  opaque data structure is dumped as base64 in the XML, but otherwise the data is very readable in XML form and the files are generally only a few KB.  I also needed to share my data with a native application that was already done.  The fact that it used XML made my job a bit easier.

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

rwatson462 (30 views)
2014-12-15 09:26:44

Mr.CodeIt (23 views)
2014-12-14 19:50:38

BurntPizza (50 views)
2014-12-09 22:41:13

BurntPizza (84 views)
2014-12-08 04:46:31

JscottyBieshaar (45 views)
2014-12-05 12:39:02

SHC (59 views)
2014-12-03 16:27:13

CopyableCougar4 (57 views)
2014-11-29 21:32:03

toopeicgaming1999 (123 views)
2014-11-26 15:22:04

toopeicgaming1999 (114 views)
2014-11-26 15:20:36

toopeicgaming1999 (32 views)
2014-11-26 15:20:08
Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!