[A16] Rainbeau's Other Mods - Editable Backstories, Smooth Stone Walls, and More

Started by dburgdorf, February 22, 2017, 01:01:16 PM

Previous topic - Next topic

Napple

Editable Backstories is incompatible with the humanoid alien framework and children and pregnancy. it It's replacing the backstories for these to work with completely random ones.

dburgdorf

Quote from: Napple on March 28, 2017, 12:28:29 PM
Editable Backstories is incompatible with the humanoid alien framework and children and pregnancy. it It's replacing the backstories for these to work with completely random ones.

I'm not familiar with the children mod at all, but I'm aware that there are problems with HAF. Simply editing the HAF backstory files as noted in my documentation worked with HAF 1, but apparently HAF 2 changed a lot more than I'd realized. It's not a mod I actually use, but I plan to look into it further this week and see if I can figure out what's actually going on. It's apparently referencing backstories in a way completely different than the default game does, and so my overriding of the default mechanism isn't working correctly for it.
- Rainbeau Flambe (aka Darryl Burgdorf) -
Old. Short. Grumpy. Bearded. "Yeah, I'm a dorf."



Buy me a Dr Pepper?

AngleWyrm


I'd like to propose an improvement to the method of storage for story rarity. We can't add new structure to the Rimworld backstory API because the game engine would throw a fit, and so the first draft is to multi-task the most appropriate field.

Well and good so far, but there's a refinement sequence in the construction of information storage and retrieval called Normal Forms, and there are three tiers to it. There's even a 4th theoretical normal form, but it doesn't survive in our world because it requires more processing than it's worth. It's a case of bumping up against the resolution of the universe in which we live, and further polishing doesn't produce more shiny.

Quote from: 1st Normal Form as defined on the wiki
A relation is in first normal form if and only if the domain of each attribute contains only atomic (indivisible) values, and the value of each attribute contains only a single value from that domain.

And so we get to see why my OCD is bothering me, domain entanglement :P

Research and development has revealed that although we cannot add new fields, new optional attributes are acceptable. This would separate the two domains of information into distinct parts, and make any future work based on the contents of those pieces of information much easier and less error-prone.

<SpawnCategories rarity="uncommon">
    <li>Civil</li>
    <li>Trader</li>
    <li>Traveler</li>
</SpawnCategories>

PS: If that looks like it would require a lot of edits to a data file, I can remap those changes without data entry.
My 5-point rating system: Yay, Kay, Meh, Erm, Bleh

dburgdorf

Quote from: AngleWyrm on March 28, 2017, 06:04:40 PMI'd like to propose an improvement to the method of storage for story rarity....

(First, for the benefit of anyone wondering, Angle's referring to a feature that's being added in the "Editable Backstories" update I'll be releasing later this week.)

Your proposed change definitely makes for nicer-looking XML. No question on that point. Unfortunately, though, to have the code read it, I'd have to rewrite rather than simply call the methods that read data from XML files. And that's far more work than I'm willing to do for a minor aesthetic improvement in the XML formatting.  ;)

- Rainbeau Flambe (aka Darryl Burgdorf) -
Old. Short. Grumpy. Bearded. "Yeah, I'm a dorf."



Buy me a Dr Pepper?

AngleWyrm



XmlDocument doc = new XmlDocument();
   doc.LoadXml(  "<reply success="true">More nodes go here</reply>"  );
   XmlElement root = doc.DocumentElement;

   string s = root.Attributes["success"].Value;



If it seems difficult to grasp the rules of data integrity then the best thing to do is abide by them until the reasons for their existence become apparent. That is what it takes to play beyond the limits of one's own knowledge.
My 5-point rating system: Yay, Kay, Meh, Erm, Bleh

dburgdorf

AngleWyrm, "spawnCategories" is the one field in the backstory database which allows the addition of arbitrary string content as additional values. And conveniently, its values are already used as filters, anyway. So the new rarity filter will be contained within the <spawnCategories> XML tag, as will the other filter I'll be adding for the next release, and as will any other filters I add in the future.

Just think of <spawnCategories> as a generic filter container, and move along.
- Rainbeau Flambe (aka Darryl Burgdorf) -
Old. Short. Grumpy. Bearded. "Yeah, I'm a dorf."



Buy me a Dr Pepper?

Razzoriel

Thank you for this amazing mod, dear sir. I only have one problem with it:

I don't want my colonists to have Pirate King/tribal backstories. How do I proceed about making the backstories' rationale work as vanilla, and only have the editting/adding/removing aspect preserved?

dburgdorf

Quote from: Razzoriel on March 30, 2017, 08:21:49 AMI don't want my colonists to have Pirate King/tribal backstories. How do I proceed about making the backstories' rationale work as vanilla, and only have the editting/adding/removing aspect preserved?

Tribal backstories shouldn't be a problem at all, as backstories flagged with only the "Tribal" spawn category will show up only on tribal pawns.

As to the Pirate King backstories, note first that unless you specifically recreate them, the "linked" stories -- where a specific name, childhood and adulthood always appear together -- no longer exist when you're using "Editable Backstories." So they won't be showing up as colonists.

Additionally, I'd suggest you simply not include overpowered nonsense like "This pawn is an insanely famous pop idol who decided to become a space pirate with his most loyal fans as his crew" in your database at all.

As to the backstories you do utilize, if there are any that you don't want available for starting colonists, don't give them the "Civil" spawn category tag. This won't stop them from being available if you're using "Prepare Carefully," but it will prevent them from showing up in randomly-generated starting pawns.

Finally, in the update I'll be releasing soon (possibly tomorrow, but more likely on Saturday), it will be possible to define the relative rarity of backstories, so you can have some that simply show up less often than others, no matter what the context.

I realize this doesn't quite address your desire to have things work "as vanilla," but hopefully, it'll give you a better idea what options you have to tailor the way backstories show up in your game.
- Rainbeau Flambe (aka Darryl Burgdorf) -
Old. Short. Grumpy. Bearded. "Yeah, I'm a dorf."



Buy me a Dr Pepper?

Razzoriel

Yes, we're on the same page. I've reviewed and editted all 'standard" colonist backstories (including the snowflakes) to become more in-line with the game, and even had some changes to some overpowered vanilla backstories (space janitors) to become less OP.

Completely forgot about the tags, thanks.

Can you make background restrictions based on the pawn's sex?

BlackSmokeDMax

Besides being "easier" as in you don't have all the micro to do, does this also take less work overall?

What I am asking is if:

(Mining Work) + (Stonecutting Work) + (Construct Wall Work) > (Smooth Wall Work)

Basically, ignoring hauling, is this more, less, or equal in work value to the vanilla process? I'm guessing it is still much less work, just wondering if you've done the math or not?

dburgdorf

Quote from: Razzoriel on March 30, 2017, 10:30:05 AMCompletely forgot about the tags, thanks.

No problem at all. I'm also improving the documentation, so hopefully, in the future, it'll be harder to forget about stuff like that.  :D

Quote from: Razzoriel on March 30, 2017, 10:30:05 AMCan you make background restrictions based on the pawn's sex?

That's not something I'd thought of, but it should be a simple one-line addition to the code, so, yeah, expect it in the update.  ;)
- Rainbeau Flambe (aka Darryl Burgdorf) -
Old. Short. Grumpy. Bearded. "Yeah, I'm a dorf."



Buy me a Dr Pepper?

dburgdorf

Re: "Smooth Stone Walls":

Quote from: BlackSmokeDMax on March 30, 2017, 10:32:31 AM
Basically, ignoring hauling, is this more, less, or equal in work value to the vanilla process? I'm guessing it is still much less work, just wondering if you've done the math or not?

I haven't actually checked all the numbers, but I'd assume the work to smooth a wall is noticeably less than the work to mine, make blocks, and build a wall. 

Which is probably another good argument in favor of having the smoothed walls be a new wall type that doesn't provide blocks when deconstructed.  :D
- Rainbeau Flambe (aka Darryl Burgdorf) -
Old. Short. Grumpy. Bearded. "Yeah, I'm a dorf."



Buy me a Dr Pepper?

dburgdorf

Kind of a major update to Editable Backstories:

- Added the ability to define the relative rarity of backstories. (They can now be common, uncommon, rare, or "Legendary.")

- Added the ability to filter backstories by pawn gender.

- Added the ability to define "sets" of backstories, such that stories which belong to a particular set will always and only be attached to other stories in the same set.

- Childhood and adulthood backstories will no longer be combined if one "favors" and the other "disfavors" a particular skill. (A backstory that adds at least 4 points to a skill will be treated as though it requires the relevant work tag for matching purposes, and a backstory that subtracts at least 4 points from a skill will be treated as though it disables the relevant work tag.)

- Fat and Hulk body types now have a (small) chance to show up randomly, just as the Thin body type already did. (This only applies to backstories for which generic "male" or "female" body types have been defined, or for which no body types are defined. Backstories for which "hulk," "thin" or "fat" body types are defined will always use those body types.)

- Added a TraitDefs file with a revised def for the Pyromaniac trait, making it much less common.

- Any errors in backstory or name definitions files caught by the code will now generate messages in the log file. (Previously, a few were silently ignored.)

- The log file also now prints a tally of the number of backstories and names added, so even if errors in the XML aren't caught by the code, you'll be able to tell if something's missing.

- The mod is now compatible with "Humanoid Alien Framework," albeit through an inelegant kludge. I'll try to clean things up in the next release.

- Expanded and improved the default backstory set.

- Greatly expanded the detail in the mod's documentation.

- Rainbeau Flambe (aka Darryl Burgdorf) -
Old. Short. Grumpy. Bearded. "Yeah, I'm a dorf."



Buy me a Dr Pepper?

Pokk720

Is there a way to change the rate at which thin body types show up? I've disabled it from every back story yet still half of my colonists show up with it.

dburgdorf

Quote from: Pokk720 on April 02, 2017, 08:03:43 PM
Is there a way to change the rate at which thin body types show up? I've disabled it from every back story yet still half of my colonists show up with it.

At the moment, no. The body type thing was a change I made sort of on a whim when I started working on this update, then forgot about in the midst of working on other stuff. It doesn't really work as well as I'd hoped it would. If I don't revert it completely, I'll at least make sure that the random body type assignment only applies to backstories with legitimately undefined body types, and not to those with generic "male" or "female" body type definitions, which is what's happening right now. I'll try and get that done tomorrow.
- Rainbeau Flambe (aka Darryl Burgdorf) -
Old. Short. Grumpy. Bearded. "Yeah, I'm a dorf."



Buy me a Dr Pepper?