Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2 3

Author Topic: Best Pathfinding/FPS fortress - unconventional idea -  (Read 10987 times)

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Best Pathfinding/FPS fortress - unconventional idea -
« on: February 05, 2012, 12:56:44 am »

Hi,

After I read everything I could find in this forum about pathfinding I came up with an idea about a fortress design. This is pure theory, so feel free to prove me right or wrong.

The best pathfinding, most efficient and FPS-friendliest fortress would be a sphere completely composed out of up/down-staircases. The bottom of course only up-staircases, the top only down-staircases. Dwarves could now move in a direct, 3-dimensional path, from A to B, no matter on what z-level it is.

For buildings/rooms you would add little islands, 3*3 (workshop) or 3*1 (sleeping room) "islands" of normal floor. Stockpiles and zones can still be placed over up/down-staircases and dont hinder the traffic.

Of course this would be a nightmare to defend, and farming would be difficult. One might add 1-3 zlevels for defense and farms, then start the sphere.
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

MrWiggles

  • Bay Watcher
  • Doubt Everything
    • View Profile
Re: Best Pathfinding/FPS fortress - unconventional idea -
« Reply #1 on: February 05, 2012, 01:00:01 am »

I think the !!!Science!!! has shown that having multiple Z levels is a great hindrance toward efficient path finding. That's what the DF wiki seems to suggest anyhow.
Logged
Doesn't like running from bears = clearly isn't an Eastern European
I'm Making a Mush! Navitas: City Limits ~ Inspired by Dresden Files and SCP.
http://www.bay12forums.com/smf/index.php?topic=113699.msg3470055#msg3470055
http://www.tf2items.com/id/MisterWigggles666#

Lumix

  • Bay Watcher
    • View Profile
Re: Best Pathfinding/FPS fortress - unconventional idea -
« Reply #2 on: February 05, 2012, 01:01:20 am »

Hi,

After I read everything I could find in this forum about pathfinding I came up with an idea about a fortress design. This is pure theory, so feel free to prove me right or wrong.

The best pathfinding, most efficient and FPS-friendliest fortress would be a sphere completely composed out of up/down-staircases. The bottom of course only up-staircases, the top only down-staircases. Dwarves could now move in a direct, 3-dimensional path, from A to B, no matter on what z-level it is.

For buildings/rooms you would add little islands, 3*3 (workshop) or 3*1 (sleeping room) "islands" of normal floor. Stockpiles and zones can still be placed over up/down-staircases and dont hinder the traffic.

Of course this would be a nightmare to defend, and farming would be difficult. One might add 1-3 zlevels for defense and farms, then start the sphere.

I dont believe that it will help FPS, But jesus christ would it be confusing.
Give it a shot, I would like to see how it turns out
Logged
I know it's fairly common but I killed 180+ people in his civilization before I went after him. I was kind of hoping for something a bit more substantial than a sucker punch and penis theft.

daishi5

  • Bay Watcher
    • View Profile
Re: Best Pathfinding/FPS fortress - unconventional idea -
« Reply #3 on: February 05, 2012, 01:27:33 am »

I tried a cube like this, and my FPS just ground to a halt.  I have recently tried a flat fortress on only 1 z level, and I was able to maintain very high fps with 200 dwarves. 
Logged

Caz

  • Bay Watcher
  • [PREFSTRING:comforting whirs]
    • View Profile
Re: Best Pathfinding/FPS fortress - unconventional idea -
« Reply #4 on: February 05, 2012, 05:51:29 am »

I tried a cube like this, and my FPS just ground to a halt.  I have recently tried a flat fortress on only 1 z level, and I was able to maintain very high fps with 200 dwarves.

Interesting. I do similar to what the OP suggested (just a central staircase with the fortress circling around the stairs in a cylinder, no fancy sphere stuff... think Umbrella's Hive) because I thought it was efficient and doesn't look so bad. But maybe one on less z-levels would be faster to play even if the dwarves had to walk a long distance?

To DF... for science!
Logged

Crossroads Inc.

  • Bay Watcher
  • Joined in the great Migration of 2009
    • View Profile
Re: Best Pathfinding/FPS fortress - unconventional idea -
« Reply #5 on: February 05, 2012, 07:33:06 am »

From what I understand of the game SCIENCE,
Dwarfs go back and forth easier then they do up and down.
Since the game is broken up, one  z level at a time, the game has to think harder about going between z levels then it does moving about a single z level.

Logged
Ask not what the Dwarfs can do for you...
But ask.... why are they drunk all the time?

Wastedlabor

  • Bay Watcher
    • View Profile
Re: Best Pathfinding/FPS fortress - unconventional idea -
« Reply #6 on: February 05, 2012, 08:09:21 am »

Best pathfinding is no pathfinding. Burrow them in their factories, China style.

Logged
He stole an onion. Off with his head.
I wonder, what would they do if someone killed their king.
Inevitable, who cares. Now an onion...

RenoFox

  • Bay Watcher
    • View Profile
Re: Best Pathfinding/FPS fortress - unconventional idea -
« Reply #7 on: February 05, 2012, 09:17:44 am »

I found out that horizontal pathfinding when I started building stuff on one level for better screenshots. I used to build along a central staircase, but flatter forts don't show any signs of slowing down even at 200 dwarves.

daishi5

  • Bay Watcher
    • View Profile
Re: Best Pathfinding/FPS fortress - unconventional idea -
« Reply #8 on: February 05, 2012, 10:17:24 am »

Yeah, I had been building vertical forts, with every floor having different role like housing or workshops.  I tried a flat fort just as a change of pace, and it really seems to make a huge difference.
Logged

Genoraven

  • Bay Watcher
  • 4 Ichy Tasty
    • View Profile
Re: Best Pathfinding/FPS fortress - unconventional idea -
« Reply #9 on: February 05, 2012, 10:31:37 am »

I don't use up/down staircases anymore. They are a HUGE drain on FPS. Normally with pathfinding you have to check the 8 spaces around you. When you add an up/down staircase it has to check even more making it like 10 checks per check.
Logged
Urist McPeasant cancels point and laugh at Philosopher - Philosopher no longer exists.
Philosopher cancels job: abstractualize existence: interrupted by personal nonexistence.

MonkeyHead

  • Bay Watcher
  • Yma o hyd...
    • View Profile
Re: Best Pathfinding/FPS fortress - unconventional idea -
« Reply #10 on: February 05, 2012, 10:56:19 am »

An entire volume of starcases means that the game will treat every rote as a valid one, instead of eliminating invalid pats early. Bye bye FPS as your CPU calculates many thousands of pointless paths.
Logged
This is a blank sig.

darkrider2

  • Bay Watcher
    • View Profile
Re: Best Pathfinding/FPS fortress - unconventional idea -
« Reply #11 on: February 05, 2012, 11:33:29 am »

Hey, I'm not sure who theorized this (retro I think?) but they said that {b}>{C}>{f}ing everything actually increases FPS because it lessons the amount of tiles that the game has to load out of world information and generation. Reason being, put a {b}>{o} on something then {k} it, and you'll see the natural floor is still listed under the {b}>{o}, but when using {b}>{C}>{f}, it only displays the {b}>{C}>{f}, and doesn't load the natural world tile under it anymore.

It actually stops recognizing the natural world tile is even there now. I was building a fort once where I was obsidian casting the ocean, after doing about two levels I started building some houses on top. I messed up and had to remove some {b}>{C}>{w}'s. When I removed them, the natural floor under them was not obsidian, it was red sand or silty loam or some such. The game had no idea what the natural tile was (wasn't stored in memory), and had to pull it from world gen (which I guess for that spot would have been red sand if it had been above the ocean).

TL;DR

Putting {b}>{C}>{f} over everything reduces the amount of memory DF needs to run, and increases FPS.



Multiple level pathfinding does slow things down. I'm not sure how pathfinding algorithms work, but I'm pretty sure having multiple levels (with dwarves on them) forces DF to have to load more levels into its memory, hence slowing things down a bit. Don't quote me on any of that.
« Last Edit: February 05, 2012, 11:37:56 am by darkrider2 »
Logged

Blah

  • Bay Watcher
    • View Profile
Re: Best Pathfinding/FPS fortress - unconventional idea -
« Reply #12 on: February 05, 2012, 11:39:48 am »

Hi,

After I read everything I could find in this forum about pathfinding I came up with an idea about a fortress design. This is pure theory, so feel free to prove me right or wrong.

The best pathfinding, most efficient and FPS-friendliest fortress would be a sphere completely composed out of up/down-staircases. The bottom of course only up-staircases, the top only down-staircases. Dwarves could now move in a direct, 3-dimensional path, from A to B, no matter on what z-level it is.

For buildings/rooms you would add little islands, 3*3 (workshop) or 3*1 (sleeping room) "islands" of normal floor. Stockpiles and zones can still be placed over up/down-staircases and dont hinder the traffic.

Of course this would be a nightmare to defend, and farming would be difficult. One might add 1-3 zlevels for defense and farms, then start the sphere.

Pathfinding becomes more complex the more possible paths there are. Less staircases are better. Ramps are better than staircases too, I suspect because ramps only go 2 ways whereas staircases potentially go 8 ways.

The most pathfinding friendly fort is a single long hallway that branches off into single rooms that have only one access door. The hallway is large enough to accommodate all traffic and is not twisted but straight. If multiple z-levels are used, use ramps instead of staircases.

If you insist on having a central staircase, make spiral ramps instead of the popular 3x3 staircase block.
« Last Edit: February 05, 2012, 11:47:31 am by Blah »
Logged

Rafal99

  • Bay Watcher
    • View Profile
Re: Best Pathfinding/FPS fortress - unconventional idea -
« Reply #13 on: February 05, 2012, 12:45:48 pm »

Actually one center staircase is pretty bad for pathfinding and FPS from my experience. Dwarves must walk long way to the starcase and from it.

The best layout would be one that:
1. most paths are as straight as possible, so in others words as short as possible
2. number of walkable tiles to check is minimized, this means no unnecessary walkable spaces

The layout from the first post fulfills the first rule but violates the second rule.
While single staircase fullfills the second but violates the first.

Note that number of possible paths to the target doesn't matter much, as the pathfinder will check the tiles that go into the direction of the target, whether they are part of the valid path or not.

Personally I prefer multiple shafts in various parts of the fort, where each shaft is made of spiral of ramps or from single column of up-down stairs. I never use blocks of up-down stairs, also they the violate second rule.
Marking dead ends and other unused areas as High pathing cost will mean pathfinder has less tiles to check, and can save a few FPS as well.
Logged
The spinning Tantrum Spiral strikes The Fortress in the meeting hall!
It explodes in gore!
The Fortress has been struck down.

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Best Pathfinding/FPS fortress - unconventional idea -
« Reply #14 on: February 05, 2012, 01:41:43 pm »

Well, there is a huge difference in FPS/Pathfinding and efficiency.

1-z level fortress would sprawl out, and a path would be hundrets of tiles long. But FPS is high.
20-z level fortress would be compact, and a path would be tenths of tiles long, but FPS might suffer.

Does that sound about right ? With the Sphere of Staircases I was mostly thinking about the shortest way a dwarf must go... I hoped that shorter path = better FPS, since the algorithm arrives sooner, but obvisously I was wrong.
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::
Pages: [1] 2 3