Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2

Author Topic: Request: Script that changes animal variations to castes.  (Read 4916 times)

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Request: Script that changes animal variations to castes.
« on: September 07, 2013, 05:27:47 am »

I did spend some thought about creature_variations and how I'd like to add more of them. Only giant and man is boring, but mutated and small and curious and mischievious and speedy and intelligent... that would spice things up a bit.

But unfortunately this would mean adding more and more creatures, which will result in a lower variety of creatures, as strange as it sounds. Because worldgen will only place so many creatures in so many biomes, people would get a lot of these variations, which are more or less the same creature with 1-2 tags changed. So instead of "animal, rare animal, monster, rare monster" they would get "animal, animal variation x, animal variation y, rare animal". I hope I explained that somehow correctly. People would see more variations of the same creature.

Using castes instead of creature variations would fix several problems. The creatures would already have a sprite. Creatures could appear in groups with 3 normal ones, 1 small and 1 large version, instead of 5 normal, OR 5 large OR 5 small. It would fix the above-mentioned problem with variety, because adding castes does not muck up worldgen and biomes. It would also make it a lot easier to balance the occurence of these castes by using pop-ratio. And animal farming would be more interesting, because your captured bagder+badger might give birth to a mutated badger, or a mischievious badger and so on.

All in all I think it would add to the atmosphere of the game.

The problem? Its a ton of work to do this. I count 175 giant animals in my mod, I am not sure how many vanilla has, but probably around 100 or so. Leaving Animal Man aside (I am unsure if they should be added, since they can appear in camps with weapons and armor) thats still a lot of creatures, especially if I'd want to add 10 variations or so.

A script that finds all giant creature variations, deleted them, and adds the castes to the base-creature would make it a lot easier. I am not entirely sure how much work this would be, or which language (python? perl?) would be best, but I wanted to put that idea out here.

Creature Variations could include:
  • Tiny
  • Small
  • Large
  • Giant/Montrous
  • Speedy
  • Lazy
  • Mischievious
  • Curious_item
  • Curious_guzzler
  • Curious_eater
  • Mutated (some interaction)
  • Aggresive (prone to rage)
  • Intelligent (can learn social skills)
  • Alpha (natural combat skill, like the Alpha Wolf of a pack)
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

Roses

  • Bay Watcher
    • View Profile
Re: Request: Script that changes animal variations to castes.
« Reply #1 on: September 07, 2013, 10:44:43 pm »

With my current python scripts for adding bits to creatures (I use them to add extra butcher objects) I don't think it would be too difficult to do. Some difficulties I foresee are if you want caste descriptions to be different (you could just have it say the standard description plus a little piece that is that same for each type of caste), or if you want different size differences (for example a giant lion is 3 times bigger, but a giant mosquito is 300 times bigger), or any other differences.
Logged

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Request: Script that changes animal variations to castes.
« Reply #2 on: September 08, 2013, 02:29:51 am »

That sounds way more positive then I would have expected. I thought it would be quite complex.

The change in the creatures would mostly be adding tags, like adding:
[CASTE:MALE]
[MALE]
[CASTE:MALE_CURIOUS_EATER]
[MALE]
[CURIOUSBEAST_EATER]
[CASTE_NAME:curious 'creature-name':curious 'creature-names':'adj']
[DESCRIPTION:'creature descriptions' + This animal is more interested in food then self-preservation.]

The texts in the descriptions could be like you said, just an addition to the normal line. I am not sure how bodysize is handled, if a creature can have BODY_SIZE:1:0:10000 and BODY_SIZE:1:0:20000 in a caste, which overrides the previous one. I think that would work, but I dont know how growthbug.rb would handle this with fortress born creatures. I do know for a fact that multiple bodysize entries in a creature work and that the last one is taken.

What about deleting the old giant-animal versions? It wouldnt be too bad to do this by hand, they are easy to find, just asking.

And extra butcher objects are probably your souls. ;) Could be added to rare castes with the same name but different ID then the original that drop items when butcher. Or... I dont know. ^^

Anyway, if you are interested I can compile a list with all the raw-entries that would be required. :)
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

Snaake

  • Bay Watcher
    • View Profile
Re: Request: Script that changes animal variations to castes.
« Reply #3 on: September 08, 2013, 09:03:57 am »

Depending on what you think of animal men as (in your world/mod), could they also have a small proportion of castes that instead of being regular animal men, would be eg. the mutated caste of the regular animal? What I mean is, do you consider animal men to be "mutants" already as in eg. Teenage Mutant Ninja Turtles, or are they naturally-occurring somehow? Or maybe some, like antmen, could be regular populations from "stable" mutations, and the wild ones on the surface/in caves with just little tribes, would be mutants with some of them as throwbacks to the original animal, or just mutations of another sort.
Logged

Roses

  • Bay Watcher
    • View Profile
Re: Request: Script that changes animal variations to castes.
« Reply #4 on: September 08, 2013, 01:50:30 pm »

Deleting the old giant versions is already done (I have a script that goes through the raws and puts the giant versions in their own file). I don't know how different body sizes work but I suppose it would be easy enough to test. I can just make the framework for it and then you can add whatever tags you want into script. I figure it would be best to do file by file instead of all the creatures, since then you would end up with the castes added to dwarves and such. Or I could make it a gui that allows you to select which creature you want to add castes too and which castes you want to add (e.g. add mutated and giant to lion, add giant and curious eater to lynx, etc...). The only downside to that is that there are a lot of creatures, it would make selecting each one in the gui rather tedious.

EDIT: Should also figure out where to add the castes in the creatures raws. Since there isn't a universal method for the ordering of tags, it might need to be a configurable option. I will have to think about it.

EDIT2: Animal men variation would be harder, since they are already creature variations of other creatures. I'm not sure how well adding castes would work, but I can definitely try and see.
« Last Edit: September 08, 2013, 03:05:26 pm by Roses »
Logged

Snaake

  • Bay Watcher
    • View Profile
Re: Request: Script that changes animal variations to castes.
« Reply #5 on: September 08, 2013, 03:28:25 pm »

By-file sounds smart, creature_standard is a prime candidate to be left out, with mostly humanoids/fantasy creatures. Maybe beak dogs could have the new castes.

And yea, animal people probably aren't as easy. I just remembered them being marked with their own [CREATURE:(animal)_MAN] tags, dunno if adding castes to them can be done normally or not.
Logged

Roses

  • Bay Watcher
    • View Profile
Re: Request: Script that changes animal variations to castes.
« Reply #6 on: September 09, 2013, 01:45:52 pm »

I will spend some time working on it this week and see what I come up with. Since most of the heavy lifting is already done with previous scripts I have written I can probably get something out in the next day or two that you can experiment with. Still unsure where best to add the castes... Maybe by default I should just add them where the other castes are.

EDIT: Found a little time to work on it today. It is all working right now on a per-file basis, and adding the extra castes right before the [CASTE:MALE] in the raws. It currently handles any direct imput of tokens. I still need to add the description change, caste name, caste tile, and make the body size a mathematical increase/decrease (can [CHANGE_BODY_SIZE_PERC] be used in castes? if so that solves that problem).
« Last Edit: September 09, 2013, 05:03:46 pm by Roses »
Logged

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Request: Script that changes animal variations to castes.
« Reply #7 on: September 09, 2013, 11:58:29 pm »

[CHANGE_BODY_SIZE_PERC] => Dont know.

Thanks for working on this :)

I dont have much internet the last/next days, but you seem to make enough progress without help. ;) As I understood it you will present a script, and I add the tags/names/descriptions myself? Thats would be fine for me. :)
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

Roses

  • Bay Watcher
    • View Profile
Re: Request: Script that changes animal variations to castes.
« Reply #8 on: September 10, 2013, 01:00:36 pm »

[CHANGE_BODY_SIZE_PERC] => Dont know.

Thanks for working on this :)

I dont have much internet the last/next days, but you seem to make enough progress without help. ;) As I understood it you will present a script, and I add the tags/names/descriptions myself? Thats would be fine for me. :)

Yeah, I put a sample in there so you can see how to add your own and will add some comments. Everything is set up and working properly except for the body size. I will ask in the modding questions thread if anyone knows about [CHANGE_BODY_SIZE_PERC], but otherwise it is working well. I am sure there are a couple bugs, but I have done the testing on the Masterwork raws so its a good bet it will work with most raws.
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Request: Script that changes animal variations to castes.
« Reply #9 on: September 10, 2013, 04:02:33 pm »

CHANGE_BODY_SIZE_PERC is caste level.

Roses

  • Bay Watcher
    • View Profile
Re: Request: Script that changes animal variations to castes.
« Reply #10 on: September 10, 2013, 04:54:49 pm »

CHANGE_BODY_SIZE_PERC is caste level.

Excellent, then the scripts are done. I will upload them in my python scripts package shortly.
Logged

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Request: Script that changes animal variations to castes.
« Reply #11 on: September 11, 2013, 05:24:19 am »

Ha, then I have to download, install and learn how to use Python :) But its probably worth it, your first code already helped so much with the manual.

But I guess I'll wait till I am in germany, one week from now. Better then fiddling around with slow wifi and a netbook all the time.
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

Roses

  • Bay Watcher
    • View Profile
Re: Request: Script that changes animal variations to castes.
« Reply #12 on: September 11, 2013, 11:50:31 am »

Added the scripts to my package. http://www.bay12forums.com/smf/index.php?topic=130140.0

Let me know if you have any questions
Logged

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Request: Script that changes animal variations to castes.
« Reply #13 on: September 11, 2013, 12:44:36 pm »

How to Python? would be my first question, as I know absolutely nothing. But Google is probably enough, I only ask you, if I cant find another way.

I will see what I can do with that script, although I did find the first bug just by looking at your example screenshot. 200kg max-size is in the creature description, which is fine for grizzly, but way bigger then the tiny grizzly can get, and way smaller then the giant grizzly. So your other script cant quite read out the CHANGE_BODY_SIZE_PERC. ;) Not a huge issue, especially since I dont have this extra description for now, and you probably knew that already, but hey, at least I try to help ;)

But really, thanks, and I will let you know as soon as I did something useful with it. If you download the current mod version you can see in the manual what your other script did... I now link to all building and reactions raws directly from the manual, individually from each workshop. :)
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Request: Script that changes animal variations to castes.
« Reply #14 on: September 11, 2013, 02:30:35 pm »

How to Python? would be my first question, as I know absolutely nothing. But Google is probably enough, I only ask you, if I cant find another way.

http://www.python.org/getit/
Pages: [1] 2