- Joined
- Sep 2, 2005
- Messages
- 1,029
This I did not know. I guess I don't have to worry about it then.all arrays in warcraft 3 have a fixed length of 8192. Whether you only use 10 or not, if an array is defined, there's memory reserved to hold 8k values...
I can't see any other way to do it, so yeh.So this confirms the fact that groundclaiming will turn a dirttile into one of the corresponding playertiles?
the grid needs to be used for the placing of rooms, traps, etc, as well as the doodads that grow when you have a 3x3 room. When you sell a room, it needs to check to see if its a room tile or just claimed land, and do nothing if its just claimed land. if it IS a roomtile, you need to know WHICH type of room tile so you can get the price you get back for selling it. You also need to store which player owns it here so you don't try to 'claim' a room you already own.I think this time you're overcomplicating...
The main reason we decided to add the whole grid system is that there would be too many units on the map. By using a grid, you could check if a unit has to be placed (because it's in sightrange) or not. The only times we'll be using the grid is when a dirttile collapses, so we can create surrounding tiles, so we don't stress the pc too much with massing units.
Thus, in fact the grid only needs to contain the following information: 0: digged; 1: any room; 2: dirt tile; 3: gold tile; 4: rock tile; ...
Because we only use the grid when tiles have to visually be created, all the algorithm needs to know is if something has to be created (case 2, 3 or 4) or not. Whenever a room is going to be build, all you need to check is if the tile on position of the constructing room indeed is a "claimed ground" tile (1 of the 16 textures, right?) So the grid doesn't need to know anything about what room is on what gridlocation. As you said, the actual rooms will be stored in different arrays, so...
storing the rooms in separate locations is for the pathing of creatures, so they can find it and so you dont have ot search the whole array. if you already have the coordinates, you don't have to do any searching, so using the tiles directly would be more quick.
plus whenever you change whats on a tile (like with destroy wall) you change the value of said tile as well.
maybe your way would work better and I'm just misunderstanding you. if so, please explain better.
Why? Warcraft 3 pathfinding algorithms will work fine, won't they?
if you build your dungeons with straight line hallways sure. I never do that though, and I imaging some other players don't either.
In DK1, about a week ago it said. "the lord of the land is approaching". it took him like 20 minutes to navigate my dungeon and he got lost like 6 times and ended up back outside it.
warcraft 3 pathing is designed for mostly open areas, not complicated networks of tunnels, thats why I think it might not work.