Streaming turn-based strategy

Started by
6 comments, last by hplus0603 10 years, 4 months ago

Any ideas on how to stream a turn-based strategy map? Need to take care of other player movements happening in client's view.

Advertisement

What do you already have, and what do you want to accomplish?

"Stream turn-based strategy map" makes little sense. If it's turn-based, why not batch download the map at the start of the game?

"Need to take care of other players movements" also isn't clear -- players are not maps, right?

Finally, "happening in clients' view" is also unclear -- if there is a client, is there also a server?

enum Bool { True, False, FileNotFound };

I think what polyfrag is asking is how to deal with the moves other players make, going from their client to your client. All you really need to do is send through what happened, like the unit at (4, 7) moved to (7, 8) and then fired, or unit Q was made at (3, 2). Come up with a few commands or keywords you pass through with coordinates.

I need quick download times and can't have the whole game world downloaded each time players log in. It's a mobile game.

I'm not sure how your game works, but for me when I'm playing a TBS i like to know what the entire map looks like so I can plan my moves and not put myself into a corner or bottleneck. Perhaps download in chunks, first where both players are, then the in-between areas, then expand outward. Download just the current map, keep it on the device, and when a new map is played on, get rid of the old one and download the new one.

I need quick download times and can't have the whole game world downloaded each time players log in. It's a mobile game.

How large are your maps? Mobile phones download huge hi-resolution images all the time, and a saved map file is smaller in size than a large photograph, if it's properly compressed. Don't save your maps as text files.

You can also procedurally generate your maps - you can then distribute your maps as a single integer - the procedural generation 'seed' - and re-generate it on the phone from that seed. Using a mix of the two, sending map files to mobile apps shouldn't be an issue.

You can make your map fit into amazingly small sizes, if you think about it long enough.

I tried sending 2.8 megabytes of height map data (packet headers included) in 98304 individual packets for 6 maps and it took several minutes. Could it be blockage if I'm trying to send and receive such a large number of packets in one frame (reliable UDP)? I'm no longer making the height data modifiable and just need to send the buildings, units, etc.

First: Are maps randomly generated, or pre-built? If pre-built, then you can install them with the main program and download nothing.

If they are randomly generated, then you have two options to improve download speed:

1) Send just the seed, and re-randomly-generate the map on each device, using a deterministic algorithm.

2) Figure out a better way to compress the data.

Also, trying to download bulk files (such as static maps) over reliable UDP is a poor match for the technology -- this is what TCP is for!

enum Bool { True, False, FileNotFound };

This topic is closed to new replies.

Advertisement