Data send format

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.

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.

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?

[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?
[/quote]
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 :slight_smile:

Thanks!

M

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 :slight_smile: I can’t stand how so many projects use XML where is just doesn’t make sense.

Mike

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

But to the computer it’s ALL binary data :stuck_out_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.