Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: 2d -> 3d: cleaning up  (Read 1002 times)

Silverionmox

  • Bay Watcher
    • View Profile
2d -> 3d: cleaning up
« on: March 25, 2009, 05:29:35 am »

There are still remnant discrepancies from the 2d era. They'll undoubtedly be adressed in the future, but let's list them here together for reference, along with suggestions how to deal with them, if applicable. Everything that gets us more out the third dimension is welcome also.

- material selection: currently, the z dimension is ignored while selecting material, leading dwarves to prefer the gabbro at the bottom of the mine, rather than the marble in the stockpile around the workshop.
- pathfinding: fliers, swimmers
- selecting 3d: for mining, cutting trees, etc.
- 3d flow rooms: for legendary dining halls worthy of their name
- different tunnel heigth for different races: races should mine corridors and build dwellings according to their size
- tree height (and width, later)
- multi-tile creatures
- ...
« Last Edit: March 25, 2009, 09:02:50 am by Silverionmox »
Logged
Dwarf Fortress cured my savescumming.

Footkerchief

  • Bay Watcher
  • The Juffo-Wup is strong in this place.
    • View Profile
Re: 2d -> 3d: cleaning up
« Reply #1 on: March 25, 2009, 06:25:26 am »

- different tunnel heigth for different races: races should mine corridors and build dwellings according to their size (1 for dwarves & kobolds, 2 for humans & elves, goblins: might vary. I picture them as a race with large natural variations and quick genetic drift in physical characteristics)

You might want to remove this from the OP.  It's only going to provoke the usual pointless "how many angels can dance on the head of a pin" discussion.

Also, for reference, here's all the z-axis related stuff I could find in the dev notes:

# Req54, FOCUS 3D, (Future): Focus should respect z-coord. Focus is what tells the game you can be hit from behind.
# Req475, SIEGE ENGINES AND THE Z AXIS, (Future): Siege engines need to respect the z axis.
# Req582, UPWARD DIAGONAL MOVEMENT RATES, (Future): It only applies a speed modifier to horizontal diagonal movement.
# Bloat255, INCIDENTAL HANGINGS, (Future): If a creature is attached by the neck to a chain building and falls down in the z direction or into a chasm, it should start strangling.
« Last Edit: March 25, 2009, 06:34:27 am by Footkerchief »
Logged

Derakon

  • Bay Watcher
    • View Profile
Re: 2d -> 3d: cleaning up
« Reply #2 on: March 25, 2009, 10:21:26 am »

Material selection respects the z-axis. What it doesn't do is calculate distance based on walking distance. Instead you get a straight-line distance (with each step, whether it be across a z-level or staying on the current one, counting as 1 distance), which is much, much faster to calculate but not really as helpful.

In other words, this isn't really so much a holdover from the 2D days as something that was never implemented in the first place.
Logged
Jetblade - an open-source Metroid/Castlevania game with procedurally-generated levels

Footkerchief

  • Bay Watcher
  • The Juffo-Wup is strong in this place.
    • View Profile
Re: 2d -> 3d: cleaning up
« Reply #3 on: March 25, 2009, 10:35:14 am »

Material selection respects the z-axis. What it doesn't do is calculate distance based on walking distance. Instead you get a straight-line distance (with each step, whether it be across a z-level or staying on the current one, counting as 1 distance), which is much, much faster to calculate but not really as helpful.

I think this is true for the manual item selection that you get when building a piece of furniture or whatever, but the OP is talking about the automated selection that takes place when you queue a job at the mason's shop at whatever.  THAT doesn't take even take Z-axis into account for its straight-line calculation.
Logged

Derakon

  • Bay Watcher
    • View Profile
Re: 2d -> 3d: cleaning up
« Reply #4 on: March 25, 2009, 11:38:23 am »

Do you have any evidence for that? It's not like we see the calculated distances anywhere.
Logged
Jetblade - an open-source Metroid/Castlevania game with procedurally-generated levels

Footkerchief

  • Bay Watcher
  • The Juffo-Wup is strong in this place.
    • View Profile
Re: 2d -> 3d: cleaning up
« Reply #5 on: March 25, 2009, 11:50:36 am »

Do you have any evidence for that? It's not like we see the calculated distances anywhere.

I tested it a couple times by surrounding a mason's shop with a stockpile full of untasked stones, with a couple more stones lying around in a mine 9 z-levels directly below the shop.  IIRC the mason repeatedly went for the stones below first, only using the stones around the shop when there were no more beneath it.
Logged

Draconius

  • Bay Watcher
    • View Profile
Re: 2d -> 3d: cleaning up
« Reply #6 on: March 25, 2009, 03:25:06 pm »

I tested it a couple times by surrounding a mason's shop with a stockpile full of untasked stones, with a couple more stones lying around in a mine 9 z-levels directly below the shop.  IIRC the mason repeatedly went for the stones below first, only using the stones around the shop when there were no more beneath it.

Wow, that explains why my masons keep running down to the deepest levels for ore, and get all lost trying to get to the spot directly beneath their workshop.
Logged

Draco18s

  • Bay Watcher
    • View Profile
Re: 2d -> 3d: cleaning up
« Reply #7 on: March 25, 2009, 03:28:10 pm »

Do you have any evidence for that? It's not like we see the calculated distances anywhere.

You can also get this behavior if you build a trade depot above a stockpile, the items directly below the depot are 0 distance away.
Logged

Soadreqm

  • Bay Watcher
  • I'm okay with this. I'm okay with a lot of things.
    • View Profile
Re: 2d -> 3d: cleaning up
« Reply #8 on: March 25, 2009, 03:31:38 pm »

The manual material selection when building walls and stuff does proper pathfinding, I think. If I have lots and lots of stone sitting around in the depths, there's a perceptible (quite long in some forts) pause between placing the wall and the game drawing the material selecting screen. And it can tell which materials are available, and which are on the other side of an uncrossable chasm or in the bottom of a river.
Logged

Footkerchief

  • Bay Watcher
  • The Juffo-Wup is strong in this place.
    • View Profile
Re: 2d -> 3d: cleaning up
« Reply #9 on: March 25, 2009, 04:01:00 pm »

The manual material selection when building walls and stuff does proper pathfinding, I think. If I have lots and lots of stone sitting around in the depths, there's a perceptible (quite long in some forts) pause between placing the wall and the game drawing the material selecting screen. And it can tell which materials are available, and which are on the other side of an uncrossable chasm or in the bottom of a river.

You might be right, although none of that requires actual pathfinding -- the game can just check the map component number of the tile containing the object to see whether it's accessible or not.  It would be straightforward to test whether the distance number represents an actual walking distance or just a rounded straight-line distance.
Logged