Just as a side note DirectPlay can be troublesome if you are going to be
running the game behind proxy/NAT/firewall devices.

Paul

-----Original Message-----
From: Thomas Tomiczek [mailto:[EMAIL PROTECTED]]
Sent: 30 April 2002 15:10
To: [EMAIL PROTECTED]
Subject: Re: [DOTNET] Big map for games


Sorry to join in here so late - the new topic called me :-)

Have you thought of using DirectPlay for synchronising the map?

Also, I am not so sure whether you are not wasting TONS ot space.

Your field (hex) currently consists of one byte plus a pointer.

Now, this limits you in two ways:
(a) you can not have more than one object on a hex (rules may change,
what about minefields?)
(b) the pointer is pretty huge compared to the byte. At the same time,
most hexes will not contain a unit.

My idea would be to store the position of a unit either in the unit
class or in a helper class.

Use hashtables on various grids to find all units in a given sector
fast.

Save memory :-)

This also is better because the map will change VERY seldom (i.e. Be
static), if you take the objet on top of it out :-)

Regards

Thomas Tomiczek
THONA Consulting Ltd.
(Microsoft MVP C#/.NET)



-----Original Message-----
From: Peter Laan [mailto:[EMAIL PROTECTED]]
Sent: Dienstag, 30. April 2002 15:58
To: [EMAIL PROTECTED]
Subject: [DOTNET] Big map for games


(changed the subject)

Right now each hex only contains one byte (terrain, resource and
control), and one pointer to a unit (null if there's no unit in the
hex). I'll probably need a few more bytes for rivers, roads and
railroads.

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?

What's a sparse array?

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?

Peter

From: "Chris Anderson" <[EMAIL PROTECTED]>
> But do you need all of them at the same time, and are all the elements

> populated?
>
> There are many more data structures you can use that will streamline
> this, and allow yourself to have even bigger maps
>
> Sparse arrays can be massive as long as they contain information about
only
> a relatively few elements
>
> Breaking the map into pages will allow you to only load the areas
> being
used
>
> A form of MipMapping will allow you to pan out and see the entire map
> by selectively "losing" data that is irrelevant when viewed at the
> higher
scale
> (eg precise tree placements will be irrelevant when viewing a map of
> the Earth..tree placements can be "promoted" to blocks or even pages
> with more than 1000 trees (so you know to paint these green as they
> are forest
areas))
>
> Merak

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

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

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