Bay 12 Games Forum

Dwarf Fortress => DF Modding => Topic started by: atracious on July 30, 2014, 07:11:26 pm

Title: Slow down time/ speed up dwarves?
Post by: atracious on July 30, 2014, 07:11:26 pm
Hi all! I have a small issue with dwarf fortress and I'm wondering if there is a way I can fix it through modding.

It seems like every time I play, my dwarves take quite alot of time to do everything. For example, digging a simple tunnel into a hillside at the start of a game usually take a month. And the dwrves only seem to eat/drink/sleep 2 or 3 times a season. I'm wondering if there is a way to make it so that a 'tick' in game represents less time on the calendar, or if there is a way to speed up dwarves so that they actually get stuff done in a timely matter. Any help would be appreciated

~Atracious
Title: Re: Slow down time/ speed up dwarves?
Post by: samanato on July 30, 2014, 07:16:21 pm
Time ticks are hard coded to span 1200 ticks for a day in fort mode and 86400  in adventure mode.  Fort mode is supposed to be fast-paced, so it runs on weird time.

There was a SPEED tag in older versions, which controlled both agility and work speed, but that tag has been replaced by gaits, which only control movement speed.
Title: Re: Slow down time/ speed up dwarves?
Post by: atracious on July 30, 2014, 07:31:01 pm
Time ticks are hard coded to span 1200 ticks for a day in fort mode and 86400  in adventure mode.  Fort mode is supposed to be fast-paced, so it runs on weird time.

There was a SPEED tag in older versions, which controlled both agility and work speed, but that tag has been replaced by gaits, which only control movement speed.

so there's no way to modify it to say...12000 ticks per day in fort mode?
Title: Re: Slow down time/ speed up dwarves?
Post by: locustgate on July 30, 2014, 07:47:20 pm
Time ticks are hard coded to span 1200 ticks for a day in fort mode and 86400  in adventure mode.  Fort mode is supposed to be fast-paced, so it runs on weird time.

There was a SPEED tag in older versions, which controlled both agility and work speed, but that tag has been replaced by gaits, which only control movement speed.

Isn't it possible by affecting the max FPS or is that just slow down?
Title: Re: Slow down time/ speed up dwarves?
Post by: i2amroy on July 30, 2014, 08:15:28 pm
Isn't it possible by affecting the max FPS or is that just slow down?
If your computer was good enough to be hitting the maximum FPS cap then you could raise that yes, but you would need to have a good enough computer for it to make a difference.
Title: Re: Slow down time/ speed up dwarves?
Post by: Roses on July 30, 2014, 10:52:16 pm
That will speed up how fast dwarves do things in your time, but if you want them to dig a tunnel in faster than a month in game time FPS will have no effect. Changing GAIT will make them move faster, but it is currently unknown if there is a way to increase job speed in the new version.
Title: Re: Slow down time/ speed up dwarves?
Post by: Deon on July 31, 2014, 01:09:40 am
ALT+- and ALT+= decreases/increases game speed as well.
Title: Re: Slow down time/ speed up dwarves?
Post by: Lucelle on July 31, 2014, 02:08:44 am
When Dfhack gets updated, it has an excellent tool to make the dwarves do everything at ultra-speed. Of course, this also includes attacking; so I like to turn it off whenever we get besieged.
Title: Re: Slow down time/ speed up dwarves?
Post by: Meph on July 31, 2014, 06:15:33 am
Guys, I think more FPS is not what the OP wants. If the game runs twice as fast, the dwarves move twice as fast, but also twice as much times passes. He wants to slow down the calender days, not run a faster game. Or speed up the creatures, without speeding up the time.
Title: Re: Slow down time/ speed up dwarves?
Post by: JediaKyrol on July 31, 2014, 10:06:28 am
Don't they work faster as their skills go up?  Of course a new fortress with a "miner" that's never even seen a pickaxe in his life before is going to take a while...and yeah, they only eat/drink/sleep a few times a season because fort mode ignores the day/night cycle and puts all of their rest cycles into one chunk...I would hate it if they had to run home and go to bed every 15 seconds.
Title: Re: Slow down time/ speed up dwarves?
Post by: Dirst on July 31, 2014, 02:20:28 pm
Don't they work faster as their skills go up?  Of course a new fortress with a "miner" that's never even seen a pickaxe in his life before is going to take a while...and yeah, they only eat/drink/sleep a few times a season because fort mode ignores the day/night cycle and puts all of their rest cycles into one chunk...I would hate it if they had to run home and go to bed every 15 seconds.
"Gaaaa... these eight-second workdays are killing me!"
Title: Re: Slow down time/ speed up dwarves?
Post by: IndigoFenix on July 31, 2014, 02:53:43 pm
The SPEED token no longer works, but I think speed multipliers in syndromes still do (zombies are slowed down in both movement and attack speed, so I'm guessing the code is unchanged).  You can give dwarves a self-targeting interaction that multiplies their speed by a given amount.  Might also want to give it to the other races, to keep dwarves from having an unfair combat advantage.

Slowing down the calendar itself isn't possible without some rather intensive dfhacking.
Title: Re: Slow down time/ speed up dwarves?
Post by: Putnam on July 31, 2014, 02:54:28 pm
Since nobody seems to have answered your question straight-up: no, you can't do that, and I don't think DFHack can either.
Title: Re: Slow down time/ speed up dwarves?
Post by: IndigoFenix on July 31, 2014, 03:22:40 pm
You can write a script that periodically resets the counter that advances the calendar ticks (which normally advance every 10 ticks), lengthening the time it takes to advance the date.  That's how the masterwork gnomish time machine works.
Title: Re: Slow down time/ speed up dwarves?
Post by: Meph on July 31, 2014, 03:26:14 pm
...which messes up military training schedules and everything else that depends on calender time (?)

Otherwise a slow, normal and fast game speed would be a nice setting to have. :)
Title: Re: Slow down time/ speed up dwarves?
Post by: IndigoFenix on August 01, 2014, 01:10:42 am
...which messes up military training schedules and everything else that depends on calender time (?)

Otherwise a slow, normal and fast game speed would be a nice setting to have. :)

Only if you actually stop time.

There are certain events that only update when the calendar tick updates (like designating most 'idle' jobs, including military training, eating, drinking, and sleeping), but if the calendar updates every 100 ticks instead of every 10 ticks the difference should be negligible.  Beyond this the only difference should be logical changes - a month-long training session will last 10 times as long, because the month is longer.  (Though this might lead to bad thoughts about long patrols.)

There are other bugs associated with speeding up time too much (skipping calendar events, not updating seasons properly), but I think that as long as it doesn't go faster than 10 times normal speed, it shouldn't be a problem.

I suppose I could try to whip up a quick script, although I have no idea whether it could be ported to DF2014, given all the changes made to the passage of time.
Title: Re: Slow down time/ speed up dwarves?
Post by: IndigoFenix on August 01, 2014, 04:09:21 am
Here it is: timestream.lua (https://gist.github.com/IndigoFenix/cf358b8c994caa0f93d5)

It multiplies the speed of calendar time by a specified value.  0-1 will slow down time, over 1 will speed it up.  It seems to work as intended, but be warned that inputting a factor over 10 may cause buggy behavior.
Title: Re: Slow down time/ speed up dwarves?
Post by: Meph on August 01, 2014, 04:15:39 am
I theory I could slap that in, with "timestream 1" in the dfhack init, and it wont change anything? I will run some tests with it today, and add it as an experimental feature if all checks out. Its actually something several people requested without knowing it... I often read posts like "I wish migrants wouldnt come so soon" or "I get spammed with traders" or "With low FPS nothing happens, no sieges, no attacks..."

These could be influenced a bit. You want more attacks? Timestream 9. You want more time in between the migrant waves? Timestream 0.5.

Just to make extra sure:
What happens when there is a 0 ?
What happens if there is >10 ? (Just asking, I will cap it at 10)
The numbers between 0 and 1 can have any number of decimals? 0.1 ? 0.25 ? 0.333333 ?

I think that script is very neat. :) 
Title: Re: Slow down time/ speed up dwarves?
Post by: IndigoFenix on August 01, 2014, 04:40:41 am
If it is 0, time will stop.  This is not advised, as it will prevent anyone from taking idle jobs and everyone will eventually starve.
A value greater than 10 works (a value of 1000 will let you run through a year in a matter of seconds) but it will have to skip over calendar ticks to do so.  Since certain checks and updates are made only on particular calendar ticks, going too fast may have unintended behavior which gets worse the faster you go, like visitors getting stuck in limbo if their arrival date passes, seasonal temperature changes not updating properly, and possible crashes due to skipped events piling up.
The numbers between 0 and 1 can be any decimal.
Title: Re: Slow down time/ speed up dwarves?
Post by: atracious on August 07, 2014, 05:13:55 pm
Here it is: timestream.lua (https://gist.github.com/IndigoFenix/cf358b8c994caa0f93d5)

It multiplies the speed of calendar time by a specified value.  0-1 will slow down time, over 1 will speed it up.  It seems to work as intended, but be warned that inputting a factor over 10 may cause buggy behavior.
So how do I run this? I D/L dfhack but I can't seem to run the timestream file.
I've tried:
Code: [Select]
timestream.lua(#)                    timestream a nil value
timestream.lua[#]                    nothing happens '>>>'
timestream.lua (#)                   syntax error near timestream
timestream.lua [#]                   nothing happens '>>>'
timestream(#)                        timestream a nil value
timestream[#]                        nothing happens '>>>'
timestream (#)                       timestream a nil value
timestream [#]                       nothing happens '>>>'
and I've tried entering a number when I'm given '>>>', but then i just get syntax error near #
note: I'm not typing '#' I'm trying numbers
Title: Re: Slow down time/ speed up dwarves?
Post by: Putnam on August 07, 2014, 05:41:41 pm
Timestream is a script; you do not need to put in "lua" before it, it's a dfhack command.
Title: Re: Slow down time/ speed up dwarves?
Post by: Meph on August 07, 2014, 05:54:25 pm
Its "timestream X" with X being a number from 0.1 to 10. It multiplies the speed with that number, so 0.1 is ten times slower, 1 is normal and 10 is 10 times speed. Anything in between is accepted.
Title: Re: Slow down time/ speed up dwarves?
Post by: atracious on August 07, 2014, 06:43:00 pm
Timestream is a script; you do not need to put in "lua" before it, it's a dfhack command.
Thanks for the help, I had put the file in the lua folder instead of the scripts folder, but now it works.

The script is exactly what I was looking for! Hopefully there are no hidden surprise effects from this script :)

Thank you all for your help,
~Atracious