Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Worldgen pause/resume  (Read 969 times)

AdamK

  • Bay Watcher
    • View Profile
Worldgen pause/resume
« on: July 10, 2016, 07:28:52 am »

As 64 bit binaries are out in the world, we could do a lot longer woerld genertion then before. Unfortunately, making time takes time ;) So, I would be nice if we could pause worldge, save it, to resume later.
Logged

Bumber

  • Bay Watcher
  • REMOVE KOBOLD
    • View Profile
Re: Worldgen pause/resume
« Reply #1 on: July 10, 2016, 08:18:51 pm »

I'm not sure that's feasible. You could put your computer in hibernation mode, which dumps your entire system state to disk to resume later. Trying to save the state of a complex world gen, and then pick up where you left off, is not worth the development time for whatever other (non-hibernating) reason you'd want to do that.
« Last Edit: July 10, 2016, 08:21:28 pm by Bumber »
Logged
Reading his name would trigger it. Thinking of him would trigger it. No other circumstances would trigger it- it was strictly related to the concept of Bill Clinton entering the conscious mind.

THE xTROLL FUR SOCKx RUSE WAS A........... DISTACTION        the carp HAVE the wagon

A wizard has turned you into a wagon. This was inevitable (Y/y)?

AdamK

  • Bay Watcher
    • View Profile
Re: Worldgen pause/resume
« Reply #2 on: July 11, 2016, 10:31:31 am »

My best guess is that saving the worldgen is not much diffrent from saving ordinary game - restoring it might be more problematic.

1000000 old world history anyone? :D
Logged

vjmdhzgr

  • Bay Watcher
  • Hehehe
    • View Profile
Re: Worldgen pause/resume
« Reply #3 on: July 12, 2016, 12:08:19 pm »

Toady has said previously that for technical reasons, he's probably never going to be able to implement starting world generation again after it's already over. However, that's not really what's being asked for here. I mean, you can pause it already. Just press escape I think? It's at the bottom, there's a stop worldgen now button and you press that and it'll ask you if you want to generate a new world the same way, generate a new world a different way, use it as it is, or just continue world generation again. So I'm not really sure why you'd need much more than that. Still it does mean that it's probably possible at least, since it already is done in a different form.
Logged
Its a feature. Impregnating booze is a planned tech tree for dwarves and this is a sneak peek at it.
Unless you're past reproductive age. Then you're pretty much an extension of your kids' genitalia

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: Worldgen pause/resume
« Reply #4 on: July 12, 2016, 12:15:49 pm »

Toady has said previously that for technical reasons, he's probably never going to be able to implement starting world generation again after it's already over. However, that's not really what's being asked for here. I mean, you can pause it already. Just press escape I think? It's at the bottom, there's a stop worldgen now button and you press that and it'll ask you if you want to generate a new world the same way, generate a new world a different way, use it as it is, or just continue world generation again. So I'm not really sure why you'd need much more than that. Still it does mean that it's probably possible at least, since it already is done in a different form.
Toady could try to serialize the whole worldgen state to disk in that menu, but I think it'd be in the gigabytes range.
Logged
Just got back, updating:
(0.42 & 0.43) The Earth Strikes Back! v2.15 - Pay attention...  It's a mine!  It's-a not yours!
(0.42 & 0.43) Appearance Tweaks v1.03 - Tease those hippies about their pointy ears.
(0.42 & 0.43) Accessibility Utility v1.04 - Console tools to navigate the map

Bumber

  • Bay Watcher
  • REMOVE KOBOLD
    • View Profile
Re: Worldgen pause/resume
« Reply #5 on: July 12, 2016, 10:42:39 pm »

Saving isn't really an issue. It's the loading. The loops and functions have to resume exactly how they left off, and probably weren't designed to do that. AFAIK, they're just temporarily halted when you pause world gen.

The ordinary game, on the other hand, was designed for that. Everything is complete each tick, because that's how game loops are designed.

To nobody in particular: I don't think we can just reload the execution state of a program, because the stack and memory addresses change. (As opposed to an entire hibernating OS.)
« Last Edit: July 12, 2016, 10:54:19 pm by Bumber »
Logged
Reading his name would trigger it. Thinking of him would trigger it. No other circumstances would trigger it- it was strictly related to the concept of Bill Clinton entering the conscious mind.

THE xTROLL FUR SOCKx RUSE WAS A........... DISTACTION        the carp HAVE the wagon

A wizard has turned you into a wagon. This was inevitable (Y/y)?

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: Worldgen pause/resume
« Reply #6 on: July 12, 2016, 10:57:33 pm »

I suspect that pauses happen at the beginning of a new year, which can be thought of as a worldgen "tick."  That would make it easier (but not trivial) to serialize the game's state into something that can be written to disk and read back.

Now try to resume your worldgen in a new version and watch your computer explode!  8)
Logged
Just got back, updating:
(0.42 & 0.43) The Earth Strikes Back! v2.15 - Pay attention...  It's a mine!  It's-a not yours!
(0.42 & 0.43) Appearance Tweaks v1.03 - Tease those hippies about their pointy ears.
(0.42 & 0.43) Accessibility Utility v1.04 - Console tools to navigate the map

Bumber

  • Bay Watcher
  • REMOVE KOBOLD
    • View Profile
Re: Worldgen pause/resume
« Reply #7 on: July 13, 2016, 12:11:01 am »

I suspect that pauses happen at the beginning of a new year, which can be thought of as a worldgen "tick."
I suspect it's more like an iteration. To the best of my knowledge, game loops keep lists and variables that are read at the beginning of each tick to determine what to do. The world generator may or may not be a mess of spaghetti code that is relying on a chain of function calls to keep track of everything. Really only Toady would know.
Logged
Reading his name would trigger it. Thinking of him would trigger it. No other circumstances would trigger it- it was strictly related to the concept of Bill Clinton entering the conscious mind.

THE xTROLL FUR SOCKx RUSE WAS A........... DISTACTION        the carp HAVE the wagon

A wizard has turned you into a wagon. This was inevitable (Y/y)?

Migrant

  • Bay Watcher
    • View Profile
Re: Worldgen pause/resume
« Reply #8 on: July 13, 2016, 07:51:00 am »

Guys the solition is obvious. We simply have to
Spoiler (click to show/hide)
Logged