Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: New syndrome tag: [CE_APPLY_CREATURE_VARIATION]  (Read 843 times)

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
New syndrome tag: [CE_APPLY_CREATURE_VARIATION]
« on: January 25, 2013, 01:33:43 am »

A bit in self-interest, but I feel that this would add a lot of capability to modding. Since there would need to be a tag added for each individual token that has arguments (extra butcher objects, for example), this could bypass some of that early on. Plus, some syndromes could take up a lot less room this way.

Advantages:
1. It would allow for wide-scale changing of a creature with no fuss--for example, prosthetic limbs without having to make a new creature for each combination of limb replacements. (If my math is correct, that would be seventy creatures--quite daunting! With this, it would require only 4 creature variations)

2. The creature variation syntax is known and fairly elegant.

3. It would make total body part changes far easier in syndromes, as well as tissue adding--but that would probably count as a full body transformation anyway! See below.

Issues:

1. I have no idea how difficult this would be to actually program, since, well, I don't have access to the code and I really have no idea quite how creature variations work in-code.

1a. Subordinate to the above--you need to make a whole new creature to have creature variations. This makes it seem a bit more complex than I think--in fact, it's fully possible that, to make syndromes work with creature variations, Toady would have to code all the syndrome effects for every tag anyway! It would probably be easier to do that in the first place, though, of course, it would still be a bit easier to just make a creature variation and call that in the syndrome, even if that's identical to using all of the CE_ADD_TAG and CE_EXTRA_BUTCHER_OBJECT or whatever comes up later in the syndrome itself.

1b. Still mostly subordinate--creature variation'd creature may still count as creatures in their own right and, thus, incur a memory overhead from their existence. This might seem minor, until you realize that--using the above example of prosthetic limbs--your 2 castes of dwarves would balloon to 140 castes from the prosthetics. If you include not just limbs, but each individual set of limbs and digits (Foot, foot + lower leg, foot + lower leg + upper leg, left first finger, etc.) it balloons to over 20000 castes, (again, if my math holds right) which I can tell you right now, in my experience, would lead to using more RAM than DF can. This should be avoided. (My math for RAM usage comes from Fortbent, which has 144*30 castes involving creature variations to make 4320 castes total, which causes over a GB of RAM usage--pretty extreme, but not as extreme as this would be).

1c. If 1b is true, then creature variations shouldn't be used at all--just syndrome effects. Oh well. Creature variations would mostly be a convenience, but a very nice one.
« Last Edit: January 25, 2013, 09:59:42 am by Putnam »
Logged

Knight Otu

  • Bay Watcher
  • ☺4[
    • View Profile
Re: New syndrome tag: [CE_APPLY_CREATURE_VARIATION]
« Reply #1 on: January 25, 2013, 07:00:20 am »

Kind of, sort of already suggested, and you even posted in that thread.  :P

Toady mentioned earlier that creature variations and syndromes work at completely different levels - variations work at the text level, syndromes affect fully realized creatures, so it wouldn't be easy, at least.

Quote
CV_NEW_TAG alters the raw text before it is even processed, where CE_ADD_TAG has to deal with a creature def that is a processed raw through a unit that has already processed the creature def.  Various optimizations are already in place, so it can't alter the text directly.  I'm not sure if it's better to stop processing multiple tags and treat it exactly like creature raws, because that would really lengthen the syndrome raws (you'd have to deal with a zillion START/PEAK/END/etcs or globalize to groups of tags or something) and there might be cases where a syndrome would want a very different parameter list than the creature uses (so making them use an assumed identical format would add confusion, although having things live outside CE_ADD_TAG is also confusing).  This and the whole interaction system is certainly subject to suggestions.
Logged
Direforged Original
Random Raw Scripts - Randomly generated Beasts , Vermin, Hags, Vampires, and Civilizations
Castle Otu

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: New syndrome tag: [CE_APPLY_CREATURE_VARIATION]
« Reply #2 on: January 25, 2013, 09:59:33 am »

Kind of, sort of already suggested, and you even posted in that thread.  :P

My search-fu is indeed weak. I thought I had remembered something like that, and searched for it pretty thoroughly, but never found that topic :P