IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New What is the density of the data?
Is every tile occupied or are most (some) empty?

For instance, a relatively sparse space can be a dictionary of points (integer pairs). It'll work fine. You don't have to have arrays of arrays and if you don't have fully populated space its wasteful.

One more thing to think about.



"Packed like lemmings into shiny metal boxes.
Contestants in a suicidal race."
    - Synchronicity II - The Police
Expand Edited by tuberculosis Aug. 21, 2007, 06:31:00 AM EDT
New Well, that depends.
For a game like "Empire", you have two terrain types:

Water
Land

For a game like Civilization, you have about 8-10 different terrain types, plus two different specials per terrain type.

For a game like SMAC, you have 3 nutrient levels, plus 3 mineral levels (9 types), plus three resource bonus types (27 combinations) plus altitude variable from ~-3000 feet to ~3000 feet, plus a whole HOST of terraforming types... (Boreholes, Echelon Mirrors, Water Condensors, Solar, Forest, Fungus, Farm, Nutrient Enrichers, Kelp Farms, Tidal Generators, Deep-Sea Mines) Plus you need to keep stateful information about terraforming as it progresses on a square.

Oh, and then there's special terrain like the Borehole Cluster, or Mount Planet, or the Uranium Flats... ;)

Yeah, there's a lot there.
After 9/11, Bush made two statements:
1. "Terrorists hate America because America is a land of freedom and opportunity."
2. "We intend to attack the root causes of terrorism."

Sounds like everything is going according to plan.
New My advice...
unless memory/disk usage is a constraint (it shouldn't be), track each tile.

Furthermore, definitely go with an object-orienteed model, each tile should have a x,y,z - special attribute, terrain type (including ocean), movement modifiers, etc.

FreeCiv has some (limited) stuff on this - their code is in C and they really only track the x,y (they create and throw away the z iirc).
New Sparse data
I think Todd meant sparse in the sense, does every array entry have something in it? In that sense density is going to be 100% for most games, as every square is going to have something in it.

As for SMAC, you would be nuts to try and create a seperate terrain type for every possible combination. Create terrain types for the basic types and then have properties of each square that cover improvements and terraforming. This is part of what I was talking about before with overlaying tiles. You create a grass area with a road by drawing the grass then drawing the road on top of it.

Also, I think Civ and SMAC keep terraforming progress in the units not the square. But doing it in the square would be simpler at the expense of using more memory.

Jay
New Oh GOD no I'm not insane...
Yeah, seperate properties for each distinct property of the terrain type. Good LORD, I'm not THAT dumb. :)

As towards whether each square will have data in it:

It depends.

I'm currently looking at an indexed list for the map array - using the (x,y) position as the index. This will let me play some fun games with map handling, including the possibility for the entire map to actually be a fractal formula, or whatever...
After 9/11, Bush made two statements:
1. "Terrorists hate America because America is a land of freedom and opportunity."
2. "We intend to attack the root causes of terrorism."

Sounds like everything is going according to plan.
     Map storage theory. - (inthane-chan) - (8)
         You might investigate quadtrees - (admin)
         Thoughts - (JayMehaffey) - (1)
             Generic map function. - (inthane-chan)
         What is the density of the data? - (tuberculosis) - (4)
             Well, that depends. - (inthane-chan) - (3)
                 My advice... - (Simon_Jester)
                 Sparse data - (JayMehaffey) - (1)
                     Oh GOD no I'm not insane... - (inthane-chan)

She can do the Kessel run in under 2 parsecs!
77 ms