Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Allow raw changes without breaking everything  (Read 1087 times)

Random832

  • Bay Watcher
    • View Profile
Allow raw changes without breaking everything
« on: February 13, 2009, 01:26:11 pm »

I assume the reason raw changes break saves is that the saves refer to creatures, reactions, etc by an index into an array of creature (etc) data structures, rather than by a token name. I propose the following solution: Store with the save a list of tokens for each type of raw-thingy. When the save is loaded, walk through its data structures and fix up the values to refer to the index in the current loaded data. Refuse to load the save if a token is not found.
Logged

Greiger

  • Bay Watcher
  • Reptilian Illuminati member. Keep it secret.
    • View Profile
Re: Allow raw changes without breaking everything
« Reply #1 on: February 13, 2009, 01:44:56 pm »

I'm not certain I fully understand.  Many raw changes won't prevent a save from loading, it mostly just happens if you completely delete an entry or move txt files around.

Completely new creatures don't cause the save to not load, they just won't appear because they have a population of 0 because none were created during worldgen.

Deleting a creature causes the game to not load because suddenly it has no information on creatures that already exists.  Which it sounds like would happen with yer system anyway.

Changing a creature works correctly most of the time, just as long as the tag the game uses to identify it isn't changed.  You could completely recreate almost anything from stone types to Dwarves, just as long as it still has the same header in the raw.

Changing a civ usually does not work because all those things are handled in worldgen.

If yer talking about seed compatibility, with new creatures civs will always be different because members will have gotten killed by different creatures that don't exist in the modded world, which would essentially change history. Serge lives to become a superpowerful fighter that saves the day in one world.  But in another world Serge gets killed in his youth by a modded large carnivorous cat before he can become powerful.

With new materials they will be changed because an item could be made out of a materiel can end up being important to worldgen, changing history again, as well as the materiel itself changing the layout of the terrain.

Maybe I just misunderstood though.

EDIT: Chrono cross reference added
« Last Edit: February 13, 2009, 02:00:45 pm by Greiger »
Logged
Disclaimer: Not responsible for dwarven deaths from the use or misuse of this post.
Quote
I don't need friends!! I've got knives!!!

PTTG??

  • Bay Watcher
  • Kringrus! Babak crulurg tingra!
    • View Profile
    • http://www.nowherepublishing.com
Re: Allow raw changes without breaking everything
« Reply #2 on: February 13, 2009, 01:49:58 pm »

Like Greiger said, I don't understand what you want this to do.

I think this means the game would refuse to load a save if the raws have changed since- is that correct?

If that's the case, a lot of players will be upset if only because raw-hacking is the only way to achieve certain settings.

Then there's cheating... Having to start a new game just to add [SPEED:1] to my dwarves?

But I'm not sure what you're trying to explain.
Logged
A thousand million pool balls made from precious metals, covered in beef stock.

Sowelu

  • Bay Watcher
  • I am offishially a penguin.
    • View Profile
Re: Allow raw changes without breaking everything
« Reply #3 on: February 13, 2009, 02:25:44 pm »

Pretty sure what he's getting at is the bugs when you re-order some stuff in the raws by adding an entry, and suddenly the elf civ is a wizard civ or something.  That happens because the indexing gets thrown off, and it's possible to fix by adding a lookup table exactly as suggested.  Won't even take much space.  Also can even tell you things like "This world needs a raw that defines ROBOTS to function.  Please use those raws to play."

The "won't load if not found", I assume is an acknowledgement that yeah, if you delete an existing civ, the game will pitch a fit and that just won't work so don't try to recover from that.  But if you ADD a civ that's not present in the world, there's no reason for that to break anything.

This would make it a lot easier to use mods that expand on vanilla.  If you have a vanilla world, and a mod that only adds stuff, this would allow you to migrate to that mod perfectly safely--useful if the mod also includes other changes to existing critters that you like.  It wouldn't let you use a mod that removes things from vanilla though.
Logged
Some things were made for one thing, for me / that one thing is the sea~
His servers are going to be powered by goat blood and moonlight.
Oh, a biomass/24 hour solar facility. How green!

Random832

  • Bay Watcher
    • View Profile
Re: Allow raw changes without breaking everything
« Reply #4 on: February 14, 2009, 12:08:48 am »

Like Greiger said, I don't understand what you want this to do.

I think this means the game would refuse to load a save if the raws have changed since- is that correct?

No - if an entry (by type and token name) which _is in use_ is missing. Right now, the problem is it _doesn't_ use the names, which is why it reacts particularly badly to deletion and reordering.

So basically - a better way to cope with changes that _shouldn't_ break things but do (like adding an entry in the middle of a file), and better diagnostic messages when you do something that honestly breaks things (like deleting the entry for dwarfs). All changes that work well now (adding stuff on the end, and modifying the contents of entries) would still work.

another thing that would be interesting would be a "[NOWORLDGEN]" tag that makes it ignore the entry for new worlds, but allows loading worlds that used it. So if I wanted to delete dwarfs entirely I could add that tag to the entry and then still be able to use saves from when they existed.
« Last Edit: February 14, 2009, 12:14:38 am by Random832 »
Logged

KaelGotDwarves

  • Bay Watcher
  • [CREATURE:FIRE_ELF]
    • View Profile
Re: Allow raw changes without breaking everything
« Reply #5 on: February 14, 2009, 12:58:41 am »

Something that would be cool is the ability to load up different RAW files in different folders, so a mod module loading GUI system similar to Mount & Blade's or various other games that would not require swapping out RAW files all the time.

But it's a time consuming fix that Toady could be using to work on gameplay, so for now I'm content copy/pasting.

EDIT: also, shouldn't this be in "suggestions forum"?

Captain Mayday

  • Bay Watcher
  • A Special Kind of Terrible
    • View Profile
Re: Allow raw changes without breaking everything
« Reply #6 on: February 14, 2009, 02:16:21 am »

Something that would be cool is the ability to load up different RAW files in different folders, so a mod module loading GUI system similar to Mount & Blade's or various other games that would not require swapping out RAW files all the time.

But it's a time consuming fix that Toady could be using to work on gameplay, so for now I'm content copy/pasting.

EDIT: also, shouldn't this be in "suggestions forum"?

Actually that would be exceptionally easy to do, so long as people conformed to correct directory structure for their mods.
ie, the mods placed in DF\mods\modname\
Under that any folders that contain modified files. Obviously less use for minimods than big mod projects.
Sean Mirrsen's ModBase attempts to do stuff similarly by parsing mods together automatically.
Unfortunately, mods the size of my own can't make use of this since the files are so drastically different that adding mods to it is not going to work without actual work involved.
Logged
Why not join us on IRC? irc.newnet.net #bay12games

Footkerchief

  • Bay Watcher
  • The Juffo-Wup is strong in this place.
    • View Profile
Re: Allow raw changes without breaking everything
« Reply #7 on: February 14, 2009, 04:13:19 am »

This is a sensible suggestion.  Ever since I learned how the indexing problem works, I've wondered why the game doesn't re-index on loading.

Something that would be cool is the ability to load up different RAW files in different folders, so a mod module loading GUI system similar to Mount & Blade's or various other games that would not require swapping out RAW files all the time.

Next version will copy raws into save folders, so you'll be able to load saves from various mods without swapping stuff in and out of the raws folder.

But it would be nice if world creation let you pick from a list of existing raws rather than whatever's currently in raw/objects.
Logged

SolarShado

  • Bay Watcher
  • Psi-Blade => Your Back
    • View Profile
Re: Allow raw changes without breaking everything
« Reply #8 on: February 14, 2009, 03:34:07 pm »

Next version will copy raws into save folders, so you'll be able to load saves from various mods without swapping stuff in and out of the raws folder.
:o really? that should make a lot of stuff easier! i hadn't heard that... guess i need to read more of the dev-related stuff...
Logged
Avid (rabid?) Linux user. Preferred flavor: Arch

Keiseth

  • Bay Watcher
    • View Profile
Re: Allow raw changes without breaking everything
« Reply #9 on: February 14, 2009, 03:52:36 pm »

Shouldn't this be in suggestions? Not that I'm complaining or anything.

I imagine the only reason this hasn't been done yet is that Toady is waiting to redo the raws or something. It's a good idea though.
Logged

Random832

  • Bay Watcher
    • View Profile
Re: Allow raw changes without breaking everything
« Reply #10 on: February 15, 2009, 08:14:46 pm »

Shouldn't this be in suggestions? Not that I'm complaining or anything.

I imagine the only reason this hasn't been done yet is that Toady is waiting to redo the raws or something. It's a good idea though.

I'm pretty sure I did post it in suggestions - what happened?
Logged