Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 18 19 [20]

Author Topic: Roses' Script, System, and Utilities Collection (03/15/2019)  (Read 40718 times)

bloop_bleep

  • Bay Watcher
  • U want sum seed?
    • View Profile
Re: Roses' Script, System, and Utilities Collection (01/29/2019)
« Reply #285 on: March 06, 2019, 12:17:15 am »

PTW
Logged
bloop_bleep's Moving Fortress Parts Mod!

Quote from: KittyTac
The closest thing Bay12 has to a flamewar is an argument over philosophy that slowly transitioned to an argument about quantum mechanics.
Quote from: thefriendlyhacker
The trick is to only make predictions semi-seriously.  That way, I don't have a 98% failure rate. I have a 98% sarcasm rate.

Roses

  • Bay Watcher
    • View Profile
Re: Roses' Script, System, and Utilities Collection (03/15/2019)
« Reply #286 on: March 15, 2019, 03:27:43 pm »

Updated the journal to include a search functionality and a help screen.

Spoiler: Search example (click to show/hide)

Updated github repo
Logged

Roses

  • Bay Watcher
    • View Profile
Re: Roses' Script, System, and Utilities Collection (03/15/2019)
« Reply #287 on: April 04, 2019, 02:10:13 pm »

I continue to make progress on the Encyclopedia, although it has slowed down a bit recently, I've got sorting in by different parameters now (e.g. sort inorganic by their shear value, sort shields by their block value, etc...), pretty much any number associated with a particular raw can now be sorted by. I still need to implement complex sortings (e.g. sort by best material for edge weapon) that are based on more than one value, but that should be a fairly easy extension. I've also implemented a couple more options for hiding information, such as only viewing things that your civ knows about, as well as making any raw entry with a special character (!,$,#,*,=) in either the name or the token (e.g. [CREATURE:==THIS_CREATURE_SHOULD_BE_HIDDEN==]) be automatically hidden. This doesn't impact the vanilla raws, but several modders use such entries to make in game menus prettier. This allows those to remain, while not cluttering up the encyclopedia

Additionally I'm experimenting a little bit with generating random raws by modifying a random world D&D-like creator I wrote a while back. The random world creator makes creatures, plants, metals, spells, items, and all sorts of other stuff. The trick so far has been to write a "translation" script that takes the D&D-like information and puts it into raws. Below is a copy of two randomly generated plant. Basically the DESCRIPTION is what is generated by the random world creator, and the raws below that are what my script generates. The names still need a bit of work, as I basically used random words to generate names before.
Code: [Select]
{DESCRIPTION:a grand ovate magenta fungus, with light blue cap. it grows in the summer, autumn, and winter in desert badlands. it has short spreading dark magenta daises. the daises smell pungent. the daises can be used to mill a dark magenta dye}

[NAME:grand ovate magenta desert fungus]
[NAME_PLURAL:grand ovate magenta desert fungi]
[ADJ:grand ovate magenta desert fungus]
[PICKED_TILE:58][PICKED_COLOR:5:0:0][SHRUB_COLOR:5:0:0]
[VALUE:2]
[FREQUENCY:50]
[CLUSTERSIZE:5]
[SUMMER][FALL][WINTER]
[WET]
[BIOME:DESERT_BADLAND]
[PREFSTRING:light blue cap]
[PREFSTRING:short spreading dark magenta daises]
[PREFSTRING:white petals]
[PREFSTRING:silver stigma]
[PREFSTRING:dark magenta dye]

# Structure Details
[USE_MATERIAL_TEMPLATE:STRUCTURAL:STRUCTURAL_PLANT_TEMPLATE]
        [MATERIAL_REACTION_PRODUCT:SEED_MAT:LOCAL_PLANT_MAT:SEED]
        [MATERIAL_REACTION_PRODUCT:POWDER_MAT:LOCAL_PLANT_MAT:MILL]
[BASIC_MAT:LOCAL_PLANT_MAT:STRUCTURAL]

# Seed Details
[USE_MATERIAL_TEMPLATE:SEED:SEED_TEMPLATE]
        [MATERIAL_VALUE:1]
        [EDIBLE_VERMIN]
[SEED:grand ovate magenta desert fungus seed:0:0:0:LOCAL_PLANT_MAT:SEED]

# Growth Details
[USE_MATERIAL_TEMPLATE:FLOWER:FLOWER_TEMPLATE]
        [STATE_COLOR:ALL:#COLOR_STATE_GROWTH_FLOWER]
        [DISPLAY_COLOR:5:0:0]
        [EDIBLE_VERMIN]
        [MATERIAL_REACTION_PRODUCT:POWDER_MAT:LOCAL_PLANT_MAT:MILL]
[GROWTH:FLOWER]
        [GROWTH_NAME:short spreading dark magenta daises]
        [GROWTH_ITEM:PLANT_GROWTH:NONE:LOCAL_PLANT_MAT:FLOWER]
        [GROWTH_TIMING:60000:119999]
        [GROWTH_PRINT:5:5:5:0:0:60000:119999:2]

# Product Details
[USE_MATERIAL_TEMPLATE:MILL:PLANT_POWDER_TEMPLATE]
        [STATE_NAME_ADJ:ALL_SOLID:dark magenta dye]
        [STATE_COLOR:#COLOR_STATE_PRODUCT_MILL]
        [DISPLAY_COLOR:5:0:0]
        [REACTION_CLASS:PLANT_MILL]
[MILL:LOCAL_PLANT_MAT:MILL]

Code: [Select]
{DESCRIPTION:a crawling scaly ivory algae. it grows in the spring and summer in sandy deserts. it has giant square saffron soft fruit, and short whorled gold leaves. the soft fruit smell musky and taste sweet and have round and tiny seeds. the leaves smell pleasant and have pungent edges. the soft fruit can be used to mill a saffron dye. the soft fruit can be used to brew a sweet spirit}
[NAME:crawling scaly ivory desert algae]
[NAME_PLURAL:crawling scaly ivory desert algae]
[ADJ:crawling scaly ivory desert algae]
[PICKED_TILE:58][PICKED_COLOR:7:0:1][SHRUB_COLOR:7:0:1]
[VALUE:2]
[FREQUENCY:50]
[CLUSTERSIZE:5]
[SPRING][SUMMER]
[WET]
[BIOME:DESERT_SAND]
[PREFSTRING:giant square saffron soft fruit]
[PREFSTRING:short whorled gold leaves]
[PREFSTRING:red veins]
[PREFSTRING:saffron dye]
[PREFSTRING:sweet spirit]

# Structure Details
[USE_MATERIAL_TEMPLATE:STRUCTURAL:STRUCTURAL_PLANT_TEMPLATE]
        [MATERIAL_REACTION_PRODUCT:SEED_MAT:LOCAL_PLANT_MAT:SEED]
        [MATERIAL_REACTION_PRODUCT:POWDER_MAT:LOCAL_PLANT_MAT:MILL]
        [MATERIAL_REACTION_PRODUCT:DRINK_MAT:LOCAL_PLANT_MAT:DRINK]
[BASIC_MAT:LOCAL_PLANT_MAT:STRUCTURAL]

# Seed Details
[USE_MATERIAL_TEMPLATE:SEED:SEED_TEMPLATE]
        [MATERIAL_VALUE:1]
        [EDIBLE_VERMIN]
[SEED:crawling scaly ivory desert algae seed:0:0:0:LOCAL_PLANT_MAT:SEED]

# Growth Details
[USE_MATERIAL_TEMPLATE:SOFT_SHELL:FRUIT_TEMPLATE]
        [EDIBLE_VERMIN]
        [EDIBLE_RAW]
        [EDIBLE_COOKED]
        [STOCKPILE_PLANT_GROWTH]
        [MATERIAL_REACTION_PRODUCT:SEED_MAT:LOCAL_PLANT_MAT:SEED]
        [MATERIAL_REACTION_PRODUCT:POWDER_MAT:LOCAL_PLANT_MAT:MILL]
        [MATERIAL_REACTION_PRODUCT:DRINK_MAT:LOCAL_PLANT_MAT:DRINK]
[USE_MATERIAL_TEMPLATE:LEAF:LEAF_TEMPLATE]
        [STATE_COLOR:ALL:#COLOR_STATE_GROWTH_LEAF]
        [DISPLAY_COLOR:6:0:1]
        [EDIBLE_VERMIN]
[GROWTH:SOFT_SHELL]
        [GROWTH_NAME:giant square saffron soft fruit]
        [GROWTH_ITEM:PLANT_GROWTH:NONE:LOCAL_PLANT_MAT:SOFT_SHELL]
        [GROWTH_TIMING:120000:200000]
        [GROWTH_DROPS_OFF]
        [GROWTH_PRINT:'%':'%':6:0:1:120000:200000:3]
        [GROWTH_HAS_SEED]
[GROWTH:LEAF]
        [GROWTH_NAME:short whorled gold leaves]
        [GROWTH_ITEM:PLANT_GROWTH:NONE:LOCAL_PLANT_MAT:LEAF]
        [GROWTH_PRINT:0:6:6:0:1:ALL:1]

# Product Details
[USE_MATERIAL_TEMPLATE:MILL:PLANT_POWDER_TEMPLATE]
        [STATE_NAME_ADJ:ALL_SOLID:saffron dye]
        [STATE_COLOR:#COLOR_STATE_PRODUCT_MILL]
        [DISPLAY_COLOR:6:0:1]
        [REACTION_CLASS:PLANT_MILL]
[USE_MATERIAL_TEMPLATE:DRINK:PLANT_ALCOHOL_TEMPLATE]
        [STATE_NAME_ADJ:ALL_SOLID:frozen sweet spirit]
        [STATE_NAME_ADJ:LIQUID:sweet spirit]
        [STATE_NAME_ADJ:GAS:boiling sweet spirit]
        [DISPLAY_COLOR:6:0:1]
        [REACTION_CLASS:PLANT_BREW]
        [EDIBLE_VERMIN]
        [EDIBLE_RAW]
        [EDIBLE_COOKED]
[MILL:LOCAL_PLANT_MAT:MILL]
[DRINK:LOCAL_PLANT_MAT:DRINK]

My ultimate goal for this little side project is to be able to generate a completely random world with however many creatures, plants, etc... you want. Then, combined with the Encyclopedia you can "discover" a whole new world each time you play.
Logged

Roses

  • Bay Watcher
    • View Profile
Re: Roses' Script, System, and Utilities Collection (03/15/2019)
« Reply #288 on: April 07, 2019, 04:16:13 pm »

Code: [Select]
Created 9907 plants out of 10000 in 65.0 seconds
category 2
        MUNDANE     :   98.9%
        MAGICAL     :   1.1%
type 7
        SAVAGE      :   36.0%
        WILD        :   33.2%
        DOMESTIC    :   29.7%
        ARCANE      :   0.3%
        NATURE      :   0.3%
        ELEMENTAL   :   0.3%
        DIVINE      :   0.2%
subtype 6
        TREE        :   21.7%
        BUSH        :   20.5%
        GRASS       :   18.9%
        VINE        :   16.0%
        FUNGUS      :   12.5%
        MOSS        :   10.4%
growths 8
        LEAF        :   26.0%
        HERB        :   21.0%
        FLOWER      :   18.6%
        POD         :   18.2%
        SOFT_SHELL  :   16.9%
        GRAIN       :   16.2%
        HARD_SHELL  :   14.4%
        UNDERGROUND :   11.2%
products 5
        MILL        :   68.4%
        BREW        :   68.0%
        THRESH      :   16.5%
        EXTRACT     :   16.0%
        PULP        :   10.7%
biomes 51
        SHRUBLAND_TROPICAL              :       341     3.4%
        DESERT_ROCK                     :       335     3.4%
        MOUNTAIN                        :       327     3.3%
        SUBTERRANEAN_CHASM              :       326     3.3%
        MARSH_TEMPERATE_FRESHWATER      :       326     3.3%
        GLACIER                         :       322     3.3%
        SAVANNA_TEMPERATE               :       317     3.2%
        SWAMP_TEMPERATE_FRESHWATER      :       313     3.2%
        SWAMP_TROPICAL_FRESHWATER       :       312     3.1%
        FOREST_TAIGA                    :       309     3.1%
        DESERT_BADLAND                  :       309     3.1%
        FOREST_TEMPERATE_BROADLEAF      :       306     3.1%
        MARSH_TROPICAL_FRESHWATER       :       305     3.1%
        SUBTERRANEAN_LAVA               :       304     3.1%
        SWAMP_TEMPERATE_SALTWATER       :       303     3.1%
        MARSH_TEMPERATE_SALTWATER       :       302     3.0%
        FOREST_TROPICAL_DRY_BROADLEAF   :       300     3.0%
        SAVANNA_TROPICAL                :       298     3.0%
        FOREST_TEMPERATE_CONIFER        :       298     3.0%
        GRASSLAND_TROPICAL              :       293     3.0%
        TUNDRA                          :       291     2.9%
        DESERT_SAND                     :       290     2.9%
        MARSH_TROPICAL_SALTWATER        :       287     2.9%
        FOREST_TROPICAL_MOIST_BROADLEAF :       286     2.9%
        SWAMP_TROPICAL_SALTWATER        :       284     2.9%
        SHRUBLAND_TEMPERATE             :       284     2.9%
        GRASSLAND_TEMPERATE             :       280     2.8%
        SWAMP_MANGROVE                  :       275     2.8%
        SUBTERRANEAN_WATER              :       275     2.8%
        FOREST_TROPICAL_CONIFER         :       251     2.5%
        POOL_TEMPERATE_BRACKISHWATER    :       52      0.5%
        POOL_TROPICAL_FRESHWATER        :       48      0.5%
        LAKE_TEMPERATE_BRACKISHWATER    :       48      0.5%
        RIVER_TEMPERATE_BRACKISHWATER   :       47      0.5%
        OCEAN_TEMPERATE                 :       46      0.5%
        RIVER_TROPICAL_BRACKISHWATER    :       45      0.5%
        OCEAN_TROPICAL                  :       44      0.4%
        RIVER_TROPICAL_FRESHWATER       :       43      0.4%
        RIVER_TEMPERATE_SALTWATER       :       42      0.4%
        LAKE_TEMPERATE_SALTWATER        :       42      0.4%
        RIVER_TEMPERATE_FRESHWATER      :       41      0.4%
        OCEAN_ARCTIC                    :       41      0.4%
        LAKE_TROPICAL_SALTWATER         :       40      0.4%
        LAKE_TROPICAL_FRESHWATER        :       40      0.4%
        LAKE_TROPICAL_BRACKISHWATER     :       40      0.4%
        POOL_TEMPERATE_SALTWATER        :       38      0.4%
        POOL_TEMPERATE_FRESHWATER       :       35      0.4%
        RIVER_TROPICAL_SALTWATER        :       31      0.3%
        POOL_TROPICAL_SALTWATER         :       31      0.3%
        POOL_TROPICAL_BRACKISHWATER     :       31      0.3%
        LAKE_TEMPERATE_FRESHWATER       :       31      0.3%
« Last Edit: April 07, 2019, 04:35:41 pm by Roses »
Logged

Roses

  • Bay Watcher
    • View Profile
Re: Roses' Script, System, and Utilities Collection (03/15/2019)
« Reply #289 on: August 20, 2019, 04:52:24 pm »

I have been working on and off on a new set of scripts that reads in a set of templates and generates an entirely random world, everything from the plants and creatures to the metals and soils. Essentially a randomized total conversion. The templates are written in json format and read in with a python script that puts them together to create objects for DF. The original purpose of these scripts was to create random D&D worlds to play through, and I've been working on getting it working with DF raws. Why? Because I thought it would be fun to start a single human adventurer in a totally unknown world, where creatures, materials, items, everything has unfamiliar names and properties and, using my Encyclopedia utility, catalogue everything and try to survive. Below is an example template for a creatures arm, just to give an idea of what the templates look like.

Code: [Select]
"6PART_ARM":    {"__comment": "shoulder, upper arm, elbow, lower arm, wrist, hand (2,4,6)",
"TYPE":     "ARM_BASIC",
"WEIGHT":   100,
"MATERIAL": ["SURFACE","INSULATION","MEAT","STRUCTURE"],
"DIGITS":   {"MIN": 1, "REQUIRED": ["FINGERS"]},
"ATTACK":   ["PUNCH"],
"REPEAT": {
"2": [1.0,
["L","left","[LEFT]"],["R","right","[RIGHT]"]],
"4": [0.5,
["UL","upper left","[LEFT]"],["UR","upper right","[RIGHT]"],
["LL","lower left","[LEFT]"],["LR","lower right","[RIGHT]"]],
"6": [0.1,
["TL","top left","[LEFT]"],   ["TR","top right","[RIGHT]"],
["ML","mid left","[LEFT]"],   ["MR","mid right","[RIGHT]"],
["BL","bottom left","[LEFT]"],["BR","bottom right","[RIGHT]"]]
},
"EXTERNAL": {
"BODY": [
"[BP:^1UA_J:^2 shoulder:STP] [CATEGORY:ARM_JOINT]^3 [JOINT][SMALL][INTERNAL][DEFAULT_RELSIZE:100][CONTYPE:UPPERBODY]",
"[BP:^1UA:^2 upper arm:STP]  [CATEGORY:ARM_UPPER]^3 [LIMB]                  [DEFAULT_RELSIZE:200][CON:^1UA_J]",
"[BP:^1LA_J:^2 elbow:STP]    [CATEGORY:ARM_JOINT]^3 [JOINT][SMALL][INTERNAL][DEFAULT_RELSIZE:20] [CON:^1UA]",
"[BP:^1LA:^2 lower arm:STP]  [CATEGORY:ARM_LOWER]^3 [LIMB]                  [DEFAULT_RELSIZE:200][CON:^1LA_J]",
"[BP:^1H_J:^2 wrist:STP]     [CATEGORY:ARM_JOINT]^3 [JOINT][SMALL][INTERNAL][DEFAULT_RELSIZE:20] [CON:^1LA]",
"[BP:^1HAND:^2 hand:STP]     [CATEGORY:HAND]     ^3 [GRASP]                 [DEFAULT_RELSIZE:80] [CON:^1H_J]"],
"BODY_DETAIL_PLAN": [
"[BP_LAYERS:BY_CATEGORY:ARM_JOINT:STRUCTURE:4:MEAT:1]",
"[BP_LAYERS:BY_CATEGORY:ARM_UPPER:STRUCTURE:25:MEAT:25:INSULATION:5:SURFACE:1]",
"[BP_LAYERS:BY_CATEGORY:ARM_LOWER:STRUCTURE:25:MEAT:25:INSULATION:5:SURFACE:1]",
"[BP_LAYERS:BY_CATEGORY:HAND:STRUCTURE:25:MEAT:25:INSULATION:5:SURFACE:1]"]
},
"RAWS": {
"BODY": ["{#KEY}"],
"BDP":  ["[BODY_DETAIL_PLAN:#KEY]"]
}
}

I'm finally at a point where everything is working as intended and generating nearly everything (some work still needs to be done on entities and their buildings), but now I need to come up with a large amount of template entries in order to get some proper good randomization.

If anyone is interested in helping out, what I would like are any custom creatures (either entire ones or just their bodies), plants, items, inorganics, materials, entities, syndromes (e.g. poisons), etc... that you are particularly proud of. I won't bother asking you to put it in a template format, just the relevant raws so that I can parse them into templates that can be randomized.

For those of you interested in the python scripts and the currently created templates you can find them in the Utilities section of my github collection, and if you are very interested and would like to learn exactly what each of the entries in a template does and make your own templates just let me know and I can put together a little ReadMe
Logged

Roses

  • Bay Watcher
    • View Profile
Re: Roses' Script, System, and Utilities Collection (03/15/2019)
« Reply #290 on: August 30, 2019, 03:03:21 pm »

The Random World Creator (RWC) continues to make progress. With the current set of templates there are about ~1 million combinations of plants that can be created and ~20 million creatures. Of course the more combinations the longer it takes to generate the random raws, which is why creatures take longer than plants which take longer than syndromes (also the shear complexity of creature contributes to the time needed to create). Below is a run with 1000 of each of the currently enabled templates. (More than 1000 inorganics are created, because some of the templates require a companion inorganic, like ores that require metals)

Code: [Select]
RANDOM WORLD CREATOR STARTING

Reading templates/raws.json
Created 1000 syndromes     out of 1000 in 5.3 seconds
Created 1000 environments  out of 1000 in 4.1 seconds
Created 1000 materials     out of 1000 in 2.6 seconds
Created 1159 inorganics    out of 1000 in 6.1 seconds
Created 1000 plants        out of 1000 in 10.5 seconds
No weapons created
Created 1000 creatures     out of 1000 in 48.8 seconds
No buildings created
No reactions created
No entities created
Writing EXTERNAL raws
Logged
Pages: 1 ... 18 19 [20]