Bay 12 Games Forum

Please login or register.

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

Author Topic: Speeding up the game, not the framerate.  (Read 8326 times)

HiEv

  • Bay Watcher
  • Denizen of Counter-Earth
    • View Profile
Re: Speeding up the game, not the framerate.
« Reply #15 on: March 11, 2012, 08:57:26 pm »

I'm curious about this for aesthetic reasons. I'd much rather have 50 'Wooden Doors' than 50 different entries for oak, ceder, pine, whatever... even if there were no performance gain.

Details?
He's talking about his Masterwork Dwarf Fortress mod.  Check the link in his signature for details.
Logged
The difference between intelligence and stupidity is that intelligence has its limits.

Draco18s

  • Bay Watcher
    • View Profile
Re: Speeding up the game, not the framerate.
« Reply #16 on: March 12, 2012, 10:33:12 am »

As for integers, as far as I know Toady uses only them. Memory hacking guys would probably know for sure.
But using integers only doesn't mean using whole numbers only. Actually default dwarf speed is like 1000, so 1% faster is 1010, no fractions are even needed. Such dwarf would probably need 9,9 ticks per move, which can be realized by moving him each 10 ticks in 9 moves, then after 9 ticks in 10th move, then repeat.

1010 is actually 1% slower.  Lower number is faster.

The value indicates the amount of "energy" required to perform the action, with a set amount gained each frame (100).

And being someone who's modded dwarves to have a speed of 0, it isn't that much of an improvement.  They still take 1 tick to move each tile, and when a significant pathing event occurs (i.e. a dwarf takes a new task) every single dwarf on the map freezes in place for a frame or two.  It's actually quite noticeable.
Logged

NTJedi

  • Bay Watcher
    • View Profile
Re: Speeding up the game, not the framerate.
« Reply #17 on: March 12, 2012, 12:42:02 pm »

I only have 1 of each. Leather is Leather, every Leather item is just that, "leather" item.
I personally feel this would take away too much, because dog leather is no where near as tough as rhino leather or dragon leather.  For this example I think different levels of leather should be introduced to respect the toughness of stronger creatures.  Levels such as "thin" leather, "normal" leather, "thick" leather, "extra thick" leather, etc., etc., .
I realize this is probably way too much work, but I thought I would share my view.
Logged

Rafal99

  • Bay Watcher
    • View Profile
Re: Speeding up the game, not the framerate.
« Reply #18 on: March 13, 2012, 08:39:42 am »

1010 is actually 1% slower.  Lower number is faster.

I meant the ingame speed not the raws speed.
Ingame speed is calculated as the equation of the raw speed, and it works like the higher value the faster the dwarf is.
You see it in the adventure mode for example.
Logged
The spinning Tantrum Spiral strikes The Fortress in the meeting hall!
It explodes in gore!
The Fortress has been struck down.

slothen

  • Bay Watcher
    • View Profile
Re: Speeding up the game, not the framerate.
« Reply #19 on: March 13, 2012, 11:30:53 am »

if FPS death is mostly due to accumulated items, dwarfs, and revealed or dug out area of the map, then making dwarves accomplish tasks quicker will just lead to fps death faster.  All those things are related to how much playing you've done in terms of building your fort, and it don't depend on weather its taken 1 year or 10 years to do it.
Logged
While adding magma to anything will make it dwarfy, adding the word "magma" to your post does not necessarily make it funny.
Thoughts on water
MILITARY: squad, uniform, training
"DF doesn't mold players into its image - DF merely selects those who were always ready for DF." -NW_Kohaku

GreatWyrmGold

  • Bay Watcher
  • Sane, by the local standards.
    • View Profile
Re: Speeding up the game, not the framerate.
« Reply #20 on: March 14, 2012, 06:41:28 am »

Wait...so you want dwarves to do things twice as fast, leading to roughly twice as many calculations per frame? How would that make the game run faster?

1010 is actually 1% slower.  Lower number is faster.

I meant the ingame speed not the raws speed.
Ingame speed is calculated as the equation of the raw speed, and it works like the higher value the faster the dwarf is.
You see it in the adventure mode for example.
Um, actually the "ingame speed" is just a number used to show you how fast you are. The game uses the raw speed--with a (raw) speed of 1010, the creature moves once every 10 frames, with a 10% chance of waiting 11 instead.
Logged
Sig
Are you a GM with players who haven't posted? TheDelinquent Players Help will have Bay12 give you an action!
[GreatWyrmGold] gets a little crown. May it forever be his mark of Cain; let no one argue pointless subjects with him lest they receive the same.

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Speeding up the game, not the framerate.
« Reply #21 on: March 14, 2012, 06:57:27 pm »

Quote
I personally feel this would take away too much, because dog leather is no where near as tough as rhino leather or dragon leather.  For this example I think different levels of leather should be introduced to respect the toughness of stronger creatures.  Levels such as "thin" leather, "normal" leather, "thick" leather, "extra thick" leather, etc., etc., .
I realize this is probably way too much work, but I thought I would share my view.

 Did you check the raws and saw a difference in the skin of dogs and rhino ? Or a dragon  ? Because there is none. In vanilla all leathers are the same, they just have different names. Also: The end product you get is also not necessarily related to the material, but the reaction class. My creatures have different skin types, and you have an entire leather upgrade system in the mod. Cut leather into suede to get 3 thinner stripes, boil in leather, stud with bone, make lamellar, many options. The monsters have 7 different skin/scale/chitin types to reflect how strong they are.
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 :::

bombzero

  • Bay Watcher
    • View Profile
Re: Speeding up the game, not the framerate.
« Reply #22 on: March 14, 2012, 08:34:28 pm »

Meph, im not sure you can mention Masterwork in an fps thread WITHOUT highjacking it, anyways if Toady implemented your ideas it would actually help a decent amount.
Logged

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Speeding up the game, not the framerate.
« Reply #23 on: March 15, 2012, 04:33:35 pm »

It would also take away his goal of a simulation, in contrast to a strategy game. He'd never use any of these ideas. /offtopic
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 :::

Spiderking50

  • Bay Watcher
  • Lumberjack of Hearts
    • View Profile
    • Pik-Pik Fortress: A Pikmin Mod
Re: Speeding up the game, not the framerate.
« Reply #24 on: March 15, 2012, 05:42:46 pm »

Pathing happens relatively rarely; 1 path to find its way to its destination, and only more if something gets in the way.

This is a false assumption. They create a path once they have an objective, however everytime they move they have to recheck their path to make sure their is still acceptable, in essence repath. You can lock a door at any point along a dwarfs path and he will cancel it and find a new route/objective. To double the speed would double the number of checks. What you seek to achieve would require making a pathing system with few checks, not faster movement.

Your second false assumption

Any steady, non-incredibly fluxuating framerate is not being significantly slowed by pathing.

That is incredibly untrue. There is not a single player that can claim that a fort of 200, with cats, being sieged, and having traders all at the same wouldnt not impact their frame rate or CPU usage. It's simply not true. I'm sorry to say it, but it isn't true. It doesn't even make sense. To say that having more calculations plus more units and items to keep track of (because they have to create a destination (item) for their path) would have little effect is ridiculous. If anyone were to write a piece of code that did one thing one time, it would be safe to say that it would require more energy to run it 700 more times. To say otherwise is ridiculous.
Logged
Currently on vacation. I have internet, but will update sporadically due to vacation.

kaijyuu

  • Bay Watcher
  • Hrm...
    • View Profile
Re: Speeding up the game, not the framerate.
« Reply #25 on: March 15, 2012, 07:58:05 pm »

stuff
Step 1: Build a bridge.
Step 2: Order a dwarf from some distance away to walk across it somehow.
Step 3: Raise bridge.
Step 4. Watch as dwarf walks straight up to the bridge, hits the edge, then moves around it.


It's true that they have to check if they're bumping into things, but that does not require the pathing algorithm to be run again. It is simple collision, which is a million times faster. If DF runs the pathing algorithm for every step a unit takes, then damn, that's some fucking fast pathing! I do not believe Toady's discovered a new algorithm 100x faster than any previously made one, however.
Logged
Quote from: Chesterton
For, in order that men should resist injustice, something more is necessary than that they should think injustice unpleasant. They must think injustice absurd; above all, they must think it startling. They must retain the violence of a virgin astonishment. When the pessimist looks at any infamy, it is to him, after all, only a repetition of the infamy of existence. But the optimist sees injustice as something discordant and unexpected, and it stings him into action.

Spiderking50

  • Bay Watcher
  • Lumberjack of Hearts
    • View Profile
    • Pik-Pik Fortress: A Pikmin Mod
Re: Speeding up the game, not the framerate.
« Reply #26 on: March 15, 2012, 09:29:59 pm »

Step 1: Build a bridge.
Step 2: Order a dwarf from some distance away to walk across it somehow.
Step 3: Raise bridge.
Step 4. Watch as dwarf cancels their job because they cant path to their objective.

If you block their path totally they just stop and canceled the job. If that's not checking for path and having to repath at each step idk what is. They constantly make sure they have SOME path.

Your second assumption, that multiple paths wouldn't have more of an effect is still very very much untrue, not that your first one was right.

Nice job quoting me though ;)
Logged
Currently on vacation. I have internet, but will update sporadically due to vacation.

RabblerouserGT

  • Bay Watcher
  • ETHIC:NONBELIEVER:SHUN
    • View Profile
Re: Speeding up the game, not the framerate.
« Reply #27 on: March 16, 2012, 04:09:50 am »

I hope this isn't off-topic, but DFhack has a "fastdwarf" option that speeds up dwarves. Could be used for some science.
It only speeds up intelligent creatures, though. Don't think it speeds dogs and wild animals, leaving for some interesting cheating (I think) since they can apparently dodge and attack really fast. Also, seasons go by at their normal rate. The fastdwarf option only makes them faster.

Has some.. interesting side-effects.
Logged

..and then the child Praiseincest shall be dipped in the river of Pregnantjuices! Rejoice! The son of Armok has been born!
My dwarf worships the goddess of suicide. This can only bode well.

andrewas

  • Bay Watcher
    • View Profile
Re: Speeding up the game, not the framerate.
« Reply #28 on: March 16, 2012, 07:36:31 am »

If you block their path totally they just stop and canceled the job. If that's not checking for path and having to repath at each step idk what is. They constantly make sure they have SOME path.

Its much easier to check if a path is still valid than to find that path all over again. Paths longer than a thousand tiles are fairly rare,  whereas pathfinding may easily check tens or hundreds of thousands of tiles to find that path. You can check this fairly easily by seeing if dwarves readily respond to new paths becoming available or if they will continue on the older, longer but already known path.
Logged

Talanic

  • Bay Watcher
  • Struggling author / pizza delivery guy.
    • View Profile
Re: Speeding up the game, not the framerate.
« Reply #29 on: March 16, 2012, 01:37:59 pm »

Step 1: Build a bridge.
Step 2: Order a dwarf from some distance away to walk across it somehow.
Step 3: Raise bridge.
Step 4. Watch as dwarf cancels their job because they cant path to their objective.

If you block their path totally they just stop and canceled the job. If that's not checking for path and having to repath at each step idk what is. They constantly make sure they have SOME path.

Your second assumption, that multiple paths wouldn't have more of an effect is still very very much untrue, not that your first one was right.

Nice job quoting me though ;)

That doesn't mean that it checks pathing every step.  That may mean that it flags areas as accessible to each other, and cancels movement entirely if there is no path anymore.

Since that sentence seems clear as mud to me, what I mean is this:

If a dwarf is trying to go from point A to point B, he runs a pathing check and finds that route 1 is the fastest route.  So he starts on route 1. 

-If the player opens a drawbridge and route 2 is suddenly the better path, does the dwarf stop going down route 1 and instead go on route 2 right away? 

-If the player closes a drawbridge on route 1, making the path invalid, does the dwarf continue until he hits the bridge and then search for a new path, or does he immediately turn? 

-If the change is not immediate, will the dwarf suddenly stop if BOTH paths become invalid and there is no possible route from point A to point B anymore?
Logged
I'm an aspiring Science Fiction and Fantasy writer.  I'm telling the tale of a hapless cyborg everyman lost in a savage fantasy world.

My first review from a real magazine!
Pages: 1 [2] 3