[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

AngleWyrm

Quote from: dburgdorf on March 14, 2017, 09:56:41 AM
Should I add filtering capabilities at all, and if so, what sort might be most desireable? (Bear in mind that any filtering would depend upon new tags in the backstory definitions, and so would be completely optional. I'm not planning to mandate anything.)

I have a few ideas, but I want to see what y'all think would be useful.

When using Prepare Carefully to set up my starting colonists I run into some content issues, which this mod is definitely helping address:
  • Many of the backstories available lean heavily toward melee bonus, and more generally combatants, probably a favorite of some backstory author
  • Looking for a specific skill is sometimes confounded in that the full spectrum of skills is not equitably distributed across the needs of an operational colony
  • Some of the stories also present forced anomalies, such as the cook who can't garden, but they feel more like an exception to an unwritten generality.
In my opinion the Disable Trait feature gets over-used instead of a skill debuff. The interaction of two buffs/debuffs provides the same type of low-resolution bell-curve as the sum of rolling two dice, and the closer the whole set is to a net-zero on each skill the closer the match to that model.

Suggestion: Rarity
When creating a population that forms a heap of common/uncommon/rare, the outer reaches need a lot of variety when compared to the more central normative types. I theorize that the pool of backstory authors will naturally be inclined to generate stories in an inverse to rarity, with lots of Legendary and few Common, which would perfectly fill the need for variety. But it makes equal chance of drawing a pawn from the pool an invalid technique.

Something that could assist in the creation & balance of a population would be the ability to assign a given character backstory a rarity classification {Common, Uncommon, Rare, Legendary}

And a global adjustable proportion of the population to go with each category, that can be changed according the current set on a player's system.
My 5-point rating system: Yay, Kay, Meh, Erm, Bleh

dburgdorf

Quote from: AngleWyrm on March 14, 2017, 10:40:46 PMSomething that could assist in the creation & balance of a population would be the ability to assign a given character backstory a rarity classification....

I really like this idea, and it would be very easy to implement. Any backstory without a tag would be considered "common," and would automatically be used if it came up in the random draw. A backstory tagged "uncommon" might only be used half the time it comes up randomly, a story tagged "rare" maybe only one time out of five, and "legendary" one time out of ten. The specific odds of course are off the top of my head, but I think the basic idea is quite sound.
- Rainbeau Flambe (aka Darryl Burgdorf) -
Old. Short. Grumpy. Bearded. "Yeah, I'm a dorf."



Buy me a Dr Pepper?

AngleWyrm


Adding some detail to the proportions
An initial model could be a normal distribution curve so that common is the central +/- 1 standard deviation from average, uncommon is the +/- 2 Z bands, rare is +/- 3 sigma from the mean, and legendary is the remainder.

Then the proportions could be tuned according to what's actually available in the set, or unseen outside factors that influence the results seen while playing the game.
My 5-point rating system: Yay, Kay, Meh, Erm, Bleh

SpaceDorf

I am trying the Editable Backstories in my new playthrough.
I give you some feedback, as soon as I know more.

Another request for my Sanity would be to add the date of the last update with your mods. So less checking and rechecking and guessing would be involved.
Maxim 1   : Pillage, then burn
Maxim 37 : There is no overkill. There is only open fire and reload.
Rule 34 of Rimworld :There is a mod for that.
Avatar Made by Chickenplucker

dburgdorf

Quote from: SpaceDorf on March 19, 2017, 01:30:09 PMAnother request for my Sanity would be to add the date of the last update with your mods. So less checking and rechecking and guessing would be involved.

But... but.... That would actually make sense!  ;)

Yeah, another simple thing I should have thought of myself.
- Rainbeau Flambe (aka Darryl Burgdorf) -
Old. Short. Grumpy. Bearded. "Yeah, I'm a dorf."



Buy me a Dr Pepper?

SpaceDorf

Quote from: dburgdorf on March 19, 2017, 02:46:17 PM

But... but.... That would actually make sense!  ;)
Yeah, another simple thing I should have thought of myself.

Just keep on making great mods.
Being anyoing and pointing out the obvious is my job :-D
Maxim 1   : Pillage, then burn
Maxim 37 : There is no overkill. There is only open fire and reload.
Rule 34 of Rimworld :There is a mod for that.
Avatar Made by Chickenplucker

dburgdorf



Last update: 4/23/2017

"Fewer Ruins" is a tiny little mod that reduces the number of ruins and "ancient shrines" that generate on new maps, possibly, but not necessarily, all the way down to none at all. (The maximum number that can appear on a map is half of vanilla's minimum number.) So you'll no longer find yourself starting the game in an area that looks like it might once have been someone's town square. Additionally, the mod ensures that amongst the ruins that do generate, buildings will be significantly more common than unattached wall segments, and those buildings will be shaped like rooms rather than like hallways.

- Rainbeau Flambe (dburgdorf)


Steam Workshop Link

Dropbox Link

Compatibility:

Since "Fewer Ruins" does nothing but alter initial map generation, adding it to or removing it from a game in progress will have no impact whatsoever. It should be compatible with any other mods except perhaps those that also modify map generation. (For the record, "Fewer Ruins" is compatible with my "Fertile Fields" mod, as the two alter completely different aspects of map generation.)

Credits:

The initial idea for this mod came from Mittsies' "Tweaks" mod, which completely eliminates ruins generation.

The mod utilizes Pardeike's "Harmony Patch Library." (No additional download is required, as the library is included with the mod.)
- Rainbeau Flambe (aka Darryl Burgdorf) -
Old. Short. Grumpy. Bearded. "Yeah, I'm a dorf."



Buy me a Dr Pepper?

AngleWyrm

I've been playing around with the Editable Backstories mod in LiquidStudio XML editor (free community copy for the price of an email address) and have a schema suggestion.

Here's what the auto-parser came up with when given both adult and child backstory xml files to examine:


But schemas can do much better as far as both catching and preventing errors. With a good schema the interface will show you what values are valid while you're typing up a backstory, including offering lists of options where appropriate.

Here's what I came up with:


The resulting XML documents have more error proofing than the original; they insist on mandatory fields, don't mind re-ordering where sequence is unimportant, and enforce ranges and values. Example xml entry from this schema (attached as a zip)<?xml version="1.0" encoding="utf-8"?>
<Defs xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="D:\Docs\Prog\Rimworld\BackStories\Schemas\BackStories.xsd">
    <REB_Code.BackstoryDef>
        <descriptor>
            <title>Pet Detective</title>
            <titleShort>Ace</titleShort>
            <description>NAME has found HIS calling rescuing cats from trees.</description>
            <ageGroup>Adulthood</ageGroup>
            <defName>AngleWyrm001</defName>
        </descriptor>
        <jobRequirements>
            <job>Caring</job>
            <job>Animals</job>
        </jobRequirements>
        <skillGains>
            <skill>Animals</skill>
            <bonus>2</bonus>
        </skillGains>
        <developedTraits>
            <trait>Extra Special</trait>
        </developedTraits>
        <EligibleFactions>
            <Faction>Civil</Faction>
            <Faction>Traveler</Faction>
        </EligibleFactions>
        <BodyTypeGlobal>thin</BodyTypeGlobal>
    </REB_Code.BackstoryDef>
</Defs>


[attachment deleted by admin due to age]
My 5-point rating system: Yay, Kay, Meh, Erm, Bleh

dburgdorf

AngleWyrm:

I know this may sound ridiculous, but I do all my XML editing in plain old Notepad. I've been doing so for years, and I don't expect to change. I have only the vaguest idea what a "schema" even is. That said, if you want to create a fancy editor for backstories and make it available for others to utilize, you're more than welcome to. But....

Whatever created the example XML file you provided is full of problems. If you try to read that file into the game, you'll get a lot of errors in your log file.

Possible problem: I have no idea where the <descriptor> tag came from, and don't know if its presence would cause any problems or simply be ignored. But it's unnecessary, even if it isn't problematic.

Definite problems: The file shouldn't have a <description> tag. It should be <baseDesc>. Likewise, <ageGroup> should be <Slot>. <jobRequirements> should be <requiredWorkTags>, and the entries within it should be designated by <li> tags, not <job> tags. Your <skill> and <bonus> tags should be <key> and <value> tags, and each set should be within <li> tags. <developedTraits> should be <forcedTraits>, and the traits listed should be defined with <key> and <value> tags (within <li> tags), not <trait> tags. <EligibleFactions> should be <spawnCategories>, and <li> tags, not <Faction> tags, should be defining the entries.

It looks like you've just replaced a lot of tags with new tags with names you've made up, but you can't do that. While those names may make a bit more sense to you, the game won't have the slightest idea what to do with them.

Finally, on a side note, your body type definition is incorrect, as well. "Thin" needs to be capitalized; the game won't recognize "thin" as a valid body type.
- Rainbeau Flambe (aka Darryl Burgdorf) -
Old. Short. Grumpy. Bearded. "Yeah, I'm a dorf."



Buy me a Dr Pepper?

AngleWyrm

Quote from: dburgdorf on March 23, 2017, 01:51:12 PM
If you want to create a fancy editor for backstories and make it available for others to utilize, you're more than welcome to.



LiquidStudio is a technological leap forward in XML editors, and the interface resembles Eclipse in functionality and information provisions.

QuoteThe game won't have the slightest idea what to do with [different tag names].
How is it then that the tag REB_Code.BackstoryDef appears in the xml?

QuoteOn a side note, your body type definition is incorrect, as well. "Thin" needs to be capitalized
This is the type of data error that should be caught and prevented by a schema and a good editor.

Thanks for your corrections, my appreciation for them will come in the form of an improvement.
If we can agree that there is a set of data tags which form an API between story data and the game, then it is possible to map desirable transforms to something more legible to a backstory author and back again.

The transform can then create expected structure, such as enforcing unique key status, required fields vs optional fields, complete substructures such as key/value pairs and so on. That level of strict compliance to a design pattern then makes it possible for advanced editors to supply options such as enumerations or a list of valid tags as the author is writing.

Thus far I've automatically converted a subset of the fields in the adults data file into something with a degree of structure.



It may be possible to use the combination of schemas and data mappings to produce a method for assembling a wide variety of backstory documents into one file consumable by the game.

So I'm going to continue pursuing this with an eye toward making a way for authors to share their sets of backstories as a sort of bookshelf of backstories that can be included in the set.
My 5-point rating system: Yay, Kay, Meh, Erm, Bleh

dburgdorf

Quote from: AngleWyrm on March 24, 2017, 12:26:07 AMLiquidStudio is a technological leap forward in XML editors, and the interface resembles Eclipse in functionality and information provisions.

That's nice, but as I said, for my own purposes, I'm quite happy editing XML files in Notepad. It's quick and simple.

Quote from: AngleWyrm on March 24, 2017, 12:26:07 AM
QuoteThe game won't have the slightest idea what to do with [different tag names].
How is it then that the tag REB_Code.BackstoryDef appears in the xml?

I'm honestly not sure what you're getting at, here. That tag is, of course, the tag that defines a particular XML definition as a backstory to be read by the REB mod. Like the other correct tags, it's a tag that the game's code expects and knows what to do with. I wasn't suggesting, obviously, that XML tags simply can't ever be added or changed; my point was that you can't just change XML tags without making corresponding changes in the code. And frankly, I see no particular reason to make any such code changes. The tags in the XML files utilized by REB are the same as the tags in the default backstory files, which simplifies things for those who just want to make minor changes to default backstories.

Quote from: AngleWyrm on March 24, 2017, 12:26:07 AM
QuoteOn a side note, your body type definition is incorrect, as well. "Thin" needs to be capitalized
This is the type of data error that should be caught and prevented by a schema and a good editor.

If you load a backstory definitions file into the game which includes a body type defined as "thin" rather than "Thin," you will in fact get an error message in your log file notifying you of the problem. The same is true for other sorts of mistakes which might show up in your XML files. And while some problems are just quietly ignored in the current version of REB, I'm making a few adjustments to try to make sure that those errors get noted in the log file, as well.  I want to try to make sure that users get notified of errors in their files even if they *don't* choose to utilize a third-party editor.  :)

Quote from: AngleWyrm on March 24, 2017, 12:26:07 AMThus far I've automatically converted a subset of the fields in the adults data file into something with a degree of structure.

Again, you can't arbitrarily "convert" XML files' structure or tag names into something that you think makes more sense, and expect the game to still be able to read them. If the files' structure and tags aren't what the game expects, you'll simply get errors.

Quote from: AngleWyrm on March 24, 2017, 12:26:07 AMSo I'm going to continue pursuing this with an eye toward making a way for authors to share their sets of backstories as a sort of bookshelf of backstories that can be included in the set.

If someone creates a set of backstories they'd like to share, I'd be more than happy to include that set (with full credit to the author, of course) as part of the REB distribution.
- Rainbeau Flambe (aka Darryl Burgdorf) -
Old. Short. Grumpy. Bearded. "Yeah, I'm a dorf."



Buy me a Dr Pepper?

Granitecosmos

Quote from: AngleWyrm on March 24, 2017, 12:26:07 AM
Quote from: dburgdorf on March 23, 2017, 01:51:12 PM
If you want to create a fancy editor for backstories and make it available for others to utilize, you're more than welcome to.

LiquidStudio is a technological leap forward in XML editors, and the interface resembles Eclipse in functionality and information provisions...

...so I'm going to continue pursuing this with an eye toward making a way for authors to share their sets of backstories as a sort of bookshelf of backstories that can be included in the set.

If you know oh so much better, how about you make a mod for it yourself? With all the fancy images, thoughts and whatnot, I'm sure you'll be done in no time! Right?

AngleWyrm

The purpose of this discussion isn't to solicit opinions on the merits of data mapping, it's to see if there is a willingness to abide by an API so that mods may derive from the xml. Since there has been significant effort to describe the xml as stable/unchangeable, can we assume that we will adhere to that?

Quote from: Granitecosmos on March 24, 2017, 11:29:01 AM
Quote from: AngleWyrm on March 24, 2017, 12:26:07 AM
Quote from: dburgdorf on March 23, 2017, 01:51:12 PM
If you want to create a fancy editor for backstories and make it available for others to utilize, you're more than welcome to.
...how about you make a mod for it yourself?


Now we're getting somewhere.

Data transform completed.

Two questions
  • What is the purpose of the tag Shuffleable, which appears in only one record?
  • What are the valid values for the tag BodyTypeGlobal?
I'm gonna start a [WIP] thread for further work, so as not to intrude on Rainbeau's mod development thread.
My 5-point rating system: Yay, Kay, Meh, Erm, Bleh

dburgdorf

Quote from: AngleWyrm on March 24, 2017, 11:44:18 AM
The purpose of this discussion... [is] to see if there is a willingness to abide by an API so that mods may derive from the xml.

Actually, the purpose of this discussion thread is to discuss my mods, but that point aside, honestly, I'm not even sure what you're trying to get at here. Mods don't "derive" from XML, they read data from XML files. And those XML files are either in the format the mod/game code expects, in which case they'll be read correctly, or they're not, in which case the game will generate errors. It really couldn't be much simpler.

Quote from: AngleWyrm on March 24, 2017, 11:44:18 AMData transform completed.

Again, your "data transformation" seems simply to be an arbitrary renaming of tags in the XML files. And as I've said repeatedly, THAT WON'T WORK. If you change the names of the XML tags, the XML file WILL NOT be read correctly.

If you want to use "Editable Backstories" to put backstories in the game, you have to create XML files that define backstories correctly.  Your "data transformed" XML files DO NOT DO THAT.

Quote from: AngleWyrm on March 24, 2017, 11:44:18 AMTwo questions.... What is the purpose of the tag Shuffleable, which appears in only one record? What are the valid values for the tag BodyTypeGlobal?

The <Shuffleable> tag determines whether the backstory can be part of randomly-determined backgrounds, or can only appear attached to a specific name. By default, it's true; there's no need for a backstory to even use the tag unless it's being set false.

Valid body types are "Male," "Female", "Fat," "Thin" and "Hulk."

(Yes, I'll be improving the documentation in the next update.)

Quote from: AngleWyrm on March 24, 2017, 11:44:18 AMI'm gonna start a [WIP] thread for further work, so as not to intrude on Rainbeau's mod development thread.

On the one hand, I'm certainly not going to complain if you stop cluttering this thread with long, largely irrelevant messages and oversized graphics. On the other hand, though, I can't help but wonder how questions and misunderstandings about how to correctly create XML data files constitute a "work in progress"....
- Rainbeau Flambe (aka Darryl Burgdorf) -
Old. Short. Grumpy. Bearded. "Yeah, I'm a dorf."



Buy me a Dr Pepper?

SpaceDorf

Playing Mediator here.

@Rainbeau ..
What Angelwyrm is doing is to scan the XML Data of the Backstories for usable Information. Mapping, in the mathematical sense, it onto a Datastructure  that is more readable for humans and employed by the editor.

This process is generally used to create Interfaces between two systems using a common language. In most cases this will be XML.
The Interface then creates Files or temporary Data Structures for each involved Programm to use.
Most commonly this process is used to migrate Data between different Database Types.

But putting it right .. your mod thread is not the place to discuss the details of this .. but the resulting Tool would be great for everybody. :)

@AngelWyrm ..
This Tool would surely be awesome and quite useful .. but maybe quite the PITA to update if Versions Change to much.
Maxim 1   : Pillage, then burn
Maxim 37 : There is no overkill. There is only open fire and reload.
Rule 34 of Rimworld :There is a mod for that.
Avatar Made by Chickenplucker