Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 6 7 [8] 9 10 ... 12

Author Topic: Biome Manipulator, a world gen/pre embark biome region manipulation tool  (Read 60092 times)

PatrikLundell

  • Bay Watcher
    • View Profile
Re: Biome Manipulator, a world gen/pre embark biome region manipulation tool
« Reply #105 on: December 12, 2019, 07:14:18 am »

Ugh! There turned out to be quite a few bugs that showed up once I poked at it (and I've used the script a fair bit without encountering them!). Thanks for the bug report.

- For some reason the freshwater swamps and mashes were missing from the matching code (both temperate and tropical), leading to them not being generated (resulting in the [now corrected] error message).
- Testing the changes by generating each possible biome in a single tile turned up another issue: DF has separate parameters for Rainfall and Vegetation, and tests one of them for some biomes and the other for other biomes, but seems to always have them at the same value. Trying to change a biome that relied on one to one that checked the other sometimes resulted in no actual change, so both parameters are now changed in lockstep.
- For some reason I must have failed to test the code that generated biomes in the "maybe tropical" zone, as those checks relied on a parameter that doesn't exist (probably cut-and-paste, originally).

Version 0.37 has been released, as reflected by the first post.
Logged

Fleeting Frames

  • Bay Watcher
  • Spooky cart at distance
    • View Profile
Re: Biome Manipulator, a world gen/pre embark biome region manipulation tool
« Reply #106 on: December 12, 2019, 10:40:05 am »

Quote
DF has separate parameters for Rainfall and Vegetation, and tests one of them for some biomes and the other for other biomes, but seems to always have them at the same value.

Huh, anything useful? Getting 0-4 vegetation or 0-4 rainfall rainforests could both be useful, (the other way on deserts wouldn't be as useful but still something).

PatrikLundell

  • Bay Watcher
    • View Profile
Re: Biome Manipulator, a world gen/pre embark biome region manipulation tool
« Reply #107 on: December 12, 2019, 12:30:40 pm »

It looks like the separate parameters were intended to be used as separated parameters, but that they never actually became separated in practice. I haven't done any investigation to see if separating them does anything useful, and to know if you can separate them without getting a different biome you'd have to read the code (or play with the parameters in the Biome Manipulator as the script's logic is a Lua adaptation of Ragundo's disassembly of the real thing, so the logic ought to be faithful to the DF one).
You'd then have to embark to see what DF does with the mismatched parameters.
Logged

Rekov

  • Bay Watcher
  • Elf Aficionado
    • View Profile
Re: Biome Manipulator, a world gen/pre embark biome region manipulation tool
« Reply #108 on: December 20, 2019, 01:00:04 pm »

I'm not aware of anything particular that can be done/is necessary to get reanimated animals, but there are unidentified fields all over the place in DF, so it wouldn't be impossible for this to be something that's not mapped (e.g. the nearby boolean fields unk_1e5 and unk_1e6, but they can be "true" when the region is neither evil nor reanimating, so they're probably not candidates. Other possibilities would be unidentified flags in the region map entries [where most of the world tile data resides]).
I haven't tried to correlate the Dead Percentage field to appearance of reanimated animals either, only to the amount of dead vegetation.

Short answer: The reanimating "weather" has been correlated with reanimation of slain creatures, with little to no notice taken to undead wildlife, although the assumption has been that both are controlled by the same field. If that's incorrect, further research is needed (or there's an unknown bug lurking in the script).

In testing this I have found a naturally generated 'reanimating' biome. As far as I can tell, 'reanimating' and 'undead wildlife' are always linked in default Dwarf Fortress worlds. There doesn't seem to be a link to % dead vegetation, as I have found many reanimating biomes with or without this. Reanimating biomes tend to be medium or low savagery, as Terrifying evil biomes have evil clouds instead. I'm not sure this is 100% consistent though.


Link to region in case it helps.

If you apply that same Region's weather to another region, it will get reanimation, but no natural undead wildlife.



I should also note that you can introduce non-undead wildlife to a region that was originally reanimating with undead wildlife. For example, I started out with an undead/reanimating evil embark. I modified one of the biomes on an embark to be Good instead of evil. It was still reanimating, but I got a mixture of undead and living wildlife. When I edited the weather on one of these biomes, it was also updated on the other. They were linked some how.
« Last Edit: December 20, 2019, 03:30:51 pm by Rekov »
Logged

PatrikLundell

  • Bay Watcher
    • View Profile
Re: Biome Manipulator, a world gen/pre embark biome region manipulation tool
« Reply #109 on: December 20, 2019, 05:28:46 pm »

It sounds like there is a terminology issue here. Evil weather is associated with a Region, and a Region can have multiple biomes of the same general type (Steppe/Jungle, etc.). Natively, DF doesn't have Regions with multiple Evilness types in them (this is set to change with the Villains release, due to necro towers spreading Evilness). It's possible to hack the Evilness of individual world tiles within a Region, but they still remain part of the same Region (unless the hacking separates them, as the script does when you change the biome). I would guess both of your biomes were actually part of the same Region.

It's an interesting observation that a "transplantation" of reanimating evil weather doesn't bring with it the reanimated wildlife, only reanimation of dead critters, but, unfortunately, I have no idea of where that info would reside. My attempts to find unmapped flags correlated to various evil phenomena have failed. It's possible, of course that the Evilness itself would be involved, but if that's the case, transplanting both weather and the evilness value from a known undead wildlife embark to one that wasn't originally should make the new one having undead wildlife as well. Note that it can be a bit messy to see with multi-region embarks, as different critter groups could come from different regions.
Logged

Nahere

  • Bay Watcher
    • View Profile
Re: Biome Manipulator, a world gen/pre embark biome region manipulation tool
« Reply #110 on: January 11, 2020, 09:31:03 pm »

Is there a particular time in world gen that I'm meant to call the script?
I keep getting this error:
Code: [Select]
...\DF\RotMK 0.5.5/hack/scripts/biomemanipulator.lua:551: Cannot read fie
ld world.T_worldgen_status.width: not found.
stack traceback:
        [C]: in metamethod '__index'
        ...cuments\DF\RotMK 0.5.5/hack/scripts/biomemanipulator.lua:551: in glob
al 'biomemanipulator'
        ...cuments\DF\RotMK 0.5.5/hack/scripts/biomemanipulator.lua:10104: in lo
cal 'script_code'
        C:\Users\L\Documents\DF\RotMK 0.5.5\hack\lua\dfhack.lua:680: in function
 'dfhack.run_script_with_env'
        (...tail calls...)
Logged

PatrikLundell

  • Bay Watcher
    • View Profile
Re: Biome Manipulator, a world gen/pre embark biome region manipulation tool
« Reply #111 on: January 12, 2020, 05:36:01 am »

The script should be called after Evilness has been generated, although it probably can be used for some things before that.

The cause of your problem, however, is that the script hadn't been updated to handle corrections to a couple of field names that are used only when the script is called during world gen. I've updated the script and verified it works with the new field names. The update should be backwards compatible, but I haven't actually tested that the old names still work (I don't have any old DF versions installed).
The first post has been updated to reflect the update to version 0.38.
Logged

Nahere

  • Bay Watcher
    • View Profile
Re: Biome Manipulator, a world gen/pre embark biome region manipulation tool
« Reply #112 on: January 12, 2020, 02:18:36 pm »

Thanks, it works now.

Edit: Ok, it mostly works. I'm getting an error when I try to use weather manipulation and the screen doesn't appear:
Code: [Select]
...cuments\DF\RotMK 0.5.5/hack/scripts/biomemanipulator.lua:6819: Cannot read fi
eld vector<interaction*>.-1: index out of bounds.
stack traceback:
        [C]: in metamethod '__index'
        ...cuments\DF\RotMK 0.5.5/hack/scripts/biomemanipulator.lua:6819: in fun
ction <...cuments\DF\RotMK 0.5.5/hack/scripts/biomemanipulator.lua:6810>
        [C]: in field 'on_select'
        ...sers\L\Documents\DF\RotMK 0.5.5\hack\lua\gui\widgets.lua:546: in meth
od 'moveCursor'
        ...sers\L\Documents\DF\RotMK 0.5.5\hack\lua\gui\widgets.lua:477: in meth
od 'setSelected'
        ...cuments\DF\RotMK 0.5.5/hack/scripts/biomemanipulator.lua:8480: in fun
ction <...cuments\DF\RotMK 0.5.5/hack/scripts/biomemanipulator.lua:8326>
        [C]: in ?
For reference, I'm playing with a mod that adds regional interactions to non evil regions.
« Last Edit: January 12, 2020, 02:42:39 pm by Nahere »
Logged

PatrikLundell

  • Bay Watcher
    • View Profile
Re: Biome Manipulator, a world gen/pre embark biome region manipulation tool
« Reply #113 on: January 12, 2020, 06:38:45 pm »

I'll try to look into it tomorrow, but some questions before then: Does this happen pre embark or during world gen, and, if during world gen, at which stage?
As far as I can see from the traceback, the script tries to address a null interaction reference. It may be a bug in the script, or it may be a bug in the mod, e.g. one where all the parts of the interactions haven't been hooked up correctly but still works as long as you're not trying to make use of the missing parts (as the script does).
If the mod just adds interactions to the raws, the bug is probably in this script, but it there's some script/code involved in setting things up it may well miss something.

If I understand it correctly, you order the script to bring up the weather manipulation screen, and it doesn't appear (as opposed to something going wrong when trying to perform some manipulation through an order on it)?
Logged

Nahere

  • Bay Watcher
    • View Profile
Re: Biome Manipulator, a world gen/pre embark biome region manipulation tool
« Reply #114 on: January 12, 2020, 07:25:09 pm »

The mod is Rise of the Mushroom Kingdom, which is RAW only.
I run worldgen until evilness has been generated, then pause as soon as I can, which usually ends up being during the creation of cave civs.
I press w to open the weather manipulation screen, and all that happens is I lose all control until I hit escape. There are no changes to the display whatsoever.
Logged

PatrikLundell

  • Bay Watcher
    • View Profile
Re: Biome Manipulator, a world gen/pre embark biome region manipulation tool
« Reply #115 on: January 13, 2020, 05:31:27 am »

Thanks for the additional info.

The crashing was, sort of, caused by the mod: I had to install the mod (in a copy of my normal DF installation) to replicate the crash. The script implicitly relied on region interactions being named REGIONAL_X in that entries for the Weather page were sorted alphabetically, but the script also assumed the NONE entry would always be the first one..
That's been fixed by adding a sort operations that skips the first entry, ensuring it remains there.
That, however, uncovered another bug, namely the handling of unexpected interaction types; in the mod's case CREATUREST ones. I've only done the bare minimum here, ensuring the info is printed correctly, so all the mod interactions will say there's an unsupported interaction of the (now) printed type, but I would expect the mod user to know what these are anyway.

I've updated the first post to refer to the new release.
Logged

Telgin

  • Bay Watcher
  • Professional Programmer
    • View Profile
Re: Biome Manipulator, a world gen/pre embark biome region manipulation tool
« Reply #116 on: January 13, 2020, 12:35:29 pm »

I skimmed the thread and haven't tested the tool yet, but does this let you make changes to changes to the in game map tiles, or only world tiles?  Or move in game map tiles between biomes?

Specifically, what I'd like to be able to do is to embark in a reanimating biome but set up a safe zone in the center of my fort that isn't affected by the reanimation interaction.  Is that possible?
Logged
Through pain, I find wisdom.

Nahere

  • Bay Watcher
    • View Profile
Re: Biome Manipulator, a world gen/pre embark biome region manipulation tool
« Reply #117 on: January 13, 2020, 02:21:26 pm »

Thanks, everything works now. And yeah, anyone going this in depth can probably figure out how to read an interaction file  :P.
Logged

PatrikLundell

  • Bay Watcher
    • View Profile
Re: Biome Manipulator, a world gen/pre embark biome region manipulation tool
« Reply #118 on: January 13, 2020, 04:52:55 pm »

@Nahere: Even if you can't read interaction raw files, I assumed the interactions were described in the documentation, and if they are not, someone trying to shift them around presumably has learnt what they do, or the exercise seems rather pointless (unless it was an attempt of learning what they do, in which case they're out of luck...).

@Telgin: This script works strictly at the world tile level. However, the Region Manipulator http://www.bay12forums.com/smf/index.php?topic=164136.msg7454345#msg7454345 can manipulate Mid Level Tiles (a.k.a. Embark Tiles) within the bounds of what DF allows. This means that it should be possible to manipulate the Mid Level Tiles within the embark world tile (pre embark) such that the tile in the middle of the embark belongs to a "safe" region, while the rest belongs to a reanimating one. I use that logic to create an embark with 9 biomes (the biome of the embark world tile, plus the biomes of the surrounding world tiles), although I use a custom script for that (and the world is a PSV world, so the world tiles have the "correct" biomes in all the 9 tiles).

The vanilla way to achieve this is to make an embark that's split into one non reanimating biome and one (or more) reanimating ones and place the fortress on the "safe" half/edge/corner, but I'm sure you know that (Showbiomes http://www.bay12forums.com/smf/index.php?topic=160856.msg7194572#msg7194572 can be used to show where the borders are).

It's not possible to hack in-game tiles (the 2*2 meter ones) prior to embark, because they literally do not exist: they're created from some unknown seeds when embarking (or approaching with an adventurer, and discarded when out of focus again in the adventurer case).
It might be possible to hack in-game tiles after embark, assuming you obey DF's rules of which biome a tile belongs to, but I don't think there's any tool do do it. I know hacking these tiles work to some extent (hacking and placing farm plots on air tiles, to see what crops they can grow when investigating air biomes and anomalies in them), but I don't think there's been much research beyond that. Someone recently considered making a script that carried the surface biomes (and their boundaries) up into the air, but I haven't heard of any results.
Logged

Telgin

  • Bay Watcher
  • Professional Programmer
    • View Profile
Re: Biome Manipulator, a world gen/pre embark biome region manipulation tool
« Reply #119 on: January 13, 2020, 07:24:57 pm »

Okay, thanks, that's more or less what I was afraid of.  I'll take a look at the region manipulator tool and see if it can do what I'm aiming for.  If not I may have to resort to some DFHack Lua script to fake something close to it.
Logged
Through pain, I find wisdom.
Pages: 1 ... 6 7 [8] 9 10 ... 12