Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: A way to do gradual transformations/metamorphosis  (Read 698 times)

IndigoFenix

  • Bay Watcher
  • All things die, but nothing dies forever.
    • View Profile
    • Boundworlds: A Browser-Based Multiverse Creation and Exploration Game
A way to do gradual transformations/metamorphosis
« on: May 11, 2016, 11:20:37 am »

Little known fact: Support for changing the size of body parts using a syndrome is already in the game.  BP_APPEARANCE_MODIFIER not only allows you to change the description of a target, but if you change LENGTH, WIDTH, or HEIGHT, the altered size of the body part will have an influence on combat calculations.

Tissue layer growth based on age is also in the game.  It is used for hair.

The question of metamorphosis has come up before, and Toady has mentioned wanting to implement it.  By combining these two things that are already in the game, it should be possible to do so.

Basically, there should be a tag similar to TISSUE_LAYER_APPEARANCE_MODIFIER, but as BP_APPEARANCE_MODIFIER instead.  The APP_MOD_RATE, might be be based on a percentage of the body part's 'normal' size (according to the unmodified body plan of the creature) instead of being an absolute value like tissue layers have.

The second rule is as follows: Any body part or tissue layer with a size of 0 should be regarded as if it is missing; the part cannot be targeted, damaged, or used for attacking.

Let's use a toad as an example.  A toad's metamorphosis from a tadpole to an adult involves it losing its tail, and growing legs.  The base creature's body plan should therefore have both a tail and legs.

At birth, the size of its legs are 0% and therefore do not exist - just like humans do not have beards until they reach a certain age.  When the tadpole reaches a particular age, its legs start growing, reaching 100% of their final size after several days.  At a slightly later point, the tail begins shrinking, ending up at size 0 when the toad is an adult.

Adding and removing body parts from the body plan without completely rebuilding a new body is probably very hard from a programming perspective, but this should be both simpler and more realistic.

It should also be possible to alter the size of tissue layers with syndromes, or remove body parts or tissue layers entirely by reducing their size to 0.  Certain creatures can also be given extra body parts that start out with size 0, so that syndromes can 'add' them back by altering their size.  This is functionally similar to the long teeth of vampires.

helmacon

  • Bay Watcher
  • Just a smol Angel
    • View Profile
Re: A way to do gradual transformations/metamorphosis
« Reply #1 on: May 11, 2016, 12:24:09 pm »

The only limitation i see is that you cant change the way the creature is defined by this method. I could make a syndrome that slowly turns a dwarf into an elf, but the game would still recognise it as a dwarf. Not to mention, you would need to change the AI. I imagine that if tadpoles shared the same brain as frogs they would air drown themselves trying to hop around on land.
I like the idea, but you would need a few more little things to support it.
Logged
Science is Meta gaming IRL. Humans are cheating fucks.

IndigoFenix

  • Bay Watcher
  • All things die, but nothing dies forever.
    • View Profile
    • Boundworlds: A Browser-Based Multiverse Creation and Exploration Game
Re: A way to do gradual transformations/metamorphosis
« Reply #2 on: May 11, 2016, 12:50:24 pm »

The only limitation i see is that you cant change the way the creature is defined by this method. I could make a syndrome that slowly turns a dwarf into an elf, but the game would still recognise it as a dwarf. Not to mention, you would need to change the AI. I imagine that if tadpoles shared the same brain as frogs they would air drown themselves trying to hop around on land.
I like the idea, but you would need a few more little things to support it.

Naturally, for more complex transformations you would need the ability to add and remove more tags, which would be nice to have in any event.

Toads will actually need a bunch of new things to be implemented properly, being aquatic as tadpoles and terrestrial as adults.  They will also need the addition of a pathing system that prefers water but can live on land, which they will need in order to seek out water to lay eggs in.

As for gradually changing one species into another, that's a whole new topic.  We might deal with that when and if Toady ever starts dealing with crossbreeds, as they will involve many of the same mechanics.