> There will surely be more action in specific parts of the map
> (the game is a simple online multiplayer simulation of
> operation Barbarossa), so splitting the map into smaller
> parts is something I have been thinking about. And I don't
> want to send the complete map to every client either. I had
> hopes that I could rely on windows doing the swapping for me
> here. Or should I do it myself?

Why send the map to the clients?
This would only need to be done once (if it's not already installed)
The terrain information will be fixed, so the only details you need to pass
around are the more volatile elements (player locations, etc), and this can
be passed as a sparse array (see below)

>
> What's a sparse array?

Basically it a structure that looks and feels like an array, but it's
accessors use the coordinates as a key to an internal collection of data
elements

ie it looks like it could hold all 10000x10000 items, but actually only
holds the 700 items you have in there
If an element that is not in the collection is accessed, instead of raising
an error, you return a default value (usually zero)

There's a very basic C sample here:
http://tomcat.bu.edu/sc447/sarray.htm


> I need to do some kind of sampling to show an overview map
> (the map is a simple civ-like 2d map). Is mipmapping good for this?

Probably, yeah
The overview map will only need to show certain types of detail, so when
operating on the entire map, just have a data structure that contains *this*
information, and none of the stuff that is irrelevant at this scale

Mipmapping itself is actually geared up for fast graphical work, but the
concept is the same..ie why hold and try to display a panel of 200x200
pixels when that panel is far away from the viewer, and will only require
5x5 pixels on screen.  (Games like Quake, etc use this technique to reduce
on memory bandwidth in large rooms.)
I say this because you'll probably not find any directly relevant examples
of mipmapping, but the ideas behind the technique may be useful.

In addition, some games like this showing/updating only "player-visible"
items in the overview map
Not only does this make sense in some games..but it's also a technique for
reducing the memory use and bandwidth some more ;-)

Merak

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to