Sunday, February 25, 2024

New Agent: All in One Status Menu

I finished an agent I've had in my back pocket for a while, adding lil features to over time. It's pretty much a vitals monitor tracking various stats of a creature like their food stores, water level, immune chemicals, heart health, drives and so on.

A lot of extra information is stuff you'd only find in TWB/TCBs but it still can be useful for vanillas and other genomes.

Since you have to poke a creature to see info about it, it works with CRAG creatures that are unselectable (like Nurse Bots without the patch or Gaia...Though Gaia is missing organs so she will show a little weird)

It'll be up for download on Eemfoo And Creatures Caves soon!

Thursday, December 28, 2023

Nurse Bots 2.25 and what is CRAG?




 I've released the Nurse Bots 2.25 version, with a bunch of small tweaks and fixes, including:

  • Variant based cloak colors
  • Genetic-ish Rotation and Swap
  • The Nurse Doozy

But mainly, I want to dive into something specific: What is CRAG?

CRAG

CRAG, short for probably Creature Agent, might at first sound a bit weird. After all, aren't call creature's agents? You'd be right, and the main difference between the two is the skeleton. A non-CRAG creature's skeleton is made from many different sprite files all stitched together by the engine which controls all sorts of things to how it functions.

Creature Agents on the other hand don't have this engine-controlled skeleton, their "skeleton" is the agent that was created when you use the NEW: CRAG command to make one. Let's look at that command for a bit.

NEW: CRAG (FAMILY) (GENE AGENT) (GENE SLOT) (SEX) (VARIANT) (SPRITE FILE) (IMAGE COUNT) (FIRST IMAGE) (PLANE)

If you ever worked with NEW: SIMP or NEW: COMP, everything after variant might be familiar to you. That's because those are the same arguments needed for said commands.

But you might be confused by FAMILY, GENE AGENT, and GENE SLOT

FAMILY is what family the Creature Agent belongs to. It's the first number in a classifier you'll see. Skeletal creatures are usually family 4, though using the NEW: CREA command you can also change it to a different family. What family your Creature Agent is will be important when making scripts, just pick any number between 5-255, as that's the range that no official agents use and 255 is as big as you can get before the FMLY command starts wrapping around the number. So for Nurse Bots 582 is a valid FAMILY, but when gotten through the FMLY command it's 70, which can be confusing, so be careful!

GENE AGENT and GENE SLOT are usually used in the context of eggs. GENE AGENT holds a genome that will be moved into the CRAG, while GENE SLOT is what slot that genome is in. You can think of gene slots like VAXX variables but for genomes only. Usually you only ever have to worry about gene slot 0 (the genome of a creature) and gene slot 1 (where most agents put stored genomes, like eggs). For testing you can do GENE LOAD PNTR 1 "(name of genetics file without the .gen)" and have the GENE AGENT be PNTR and the GENE SLOT be 1.

SEX and VARIANT are pretty simple, as they control what the created creature's sex and variant is. Most of the time you'll want these to be 0, as that'll randomize their final sex and variant to any of the normal values.

Now that you know how the NEW:CRAG command works, you may want to use it to make a CRAG. Use the NEW: CRAG command and make sure to move the created creature somewhere safe. You should realize what you'd created doesn't move, and only maybe baables a bit, but why?

Creature Scripts

I recommend going into your Docking Station Bootstrap and opening up DS creatureDecisions.cos. If you scroll through you should realize this is what the game is running on creatures when they decide to take an action. Script numbers 16-31 each correspond to an action, which each must be defined in CAOS for creatures to do anything. If you remove this file from the game and hatch a creature in a new world, you should see it doesn't do anything at all like your CRAG creature.

So if you want your CRAG creature to do anything, you're going to have to remake these scripts to fit them. Some things to note:

  • _IT_ is the object of a creature's attention, without an _IT_ most of these scripts will not run
    • Quiescent (look), Drop, Need (express), Rest, East, and West, and the unused actions never require an agent.
  • Most of these scripts might need to be run with INST, as losing target will always lead to an error, and without INST only 5 commands will be run each tick
  • Deactivate, and 2 spare actions are unimplemented. Deactivate you can use if you just expand your CRAG creature's verb, decision, and combination lobe to account for a whole new action, but the other two would require editing the Docking Station.catalogue. and engine rewrites to work.
  • APPR is a very important command for getting your CRAG creature anywhere, more on it will be in the next section
  • Don't use TOUC (the single command) or BYIT, since they won't really work when your CRAG doesn't have a skeleton.
  • Don't be afraid to not have these actions be completely different from how skeletal creatures do things! Nurse Bots for instance can't push things at all, and that action is them singing to things only. As long as you know what you're doing, you can tweak these to better fit what you want your CRAG to be.
Now that we've looked a scripts 16-31, let's open DS creatureToCreature.cos. This has scripts 32-47 in it. The only difference to the former scripts we've looked at is _IT_ is a creature. CRAG and skeletal Creatures are both creatures, so when a CRAG wants to interact with one, it'll try to call these scripts. If one of these scripts doesn't exist the corresponding agent version of the script (the ones we looked at earlier) will be called instead. This is so you don't have to make say two retreat that do the exact same thing no matter the target.

The last few scripts we'll look at are mostly in DS creatureInvoluntary.cos. Scripts 64-72 are all the involuntary actions a creature is forced to take when receptors in their genome tell them to. You can make these different from the normal scripts as well, but you should leave 72 as Die, because using the DEAD command or the game making a creature die will always call this script.

Those are all the creature-specific commands, but you might want to look at scripts 0-14. Some of these you won't use at all (impact), or shouldn't (timer, collision, and bump because decision scripts will override the timer constantly, and collision + bump because likely your agent will collide with everything to an extent.) 13 and 14 might actually work, but I didn't try them out with Nurse Bots so that's something you'd have to test yourself. The rest of these scripts should be familiar if you ever worked on an agent before. These just defined what happens when your CRAG is pushed, pulled, gotten, dropped, etc. You can look at the DS creatureDoneTo.cos to see how creatures react in general.

Script number 160 is called when your CRAG is aging up, with _p1_ having the next life stage. Do note creatures can skip life stages sometimes, so if you're having a creature change sprites as they age you will have to account for this. This should be an inst otherwise a creature may skip it.

Before we move on to how APPR works, you may also want to check out scripts 101-105, as those are called on the pointer when it interacts with your agent. This is where you'd make the pointer do a tickle animation when clicking on your CRAG and such.

APPR, and how it works

Now we've gotten to the big one. I've said to use APPR but if you just put the command in your CRAG scripts, nothing happens. We'll look at scripts 150-154, one at a time to see how we can make them work.

Do note: All of these scripts need to be done in 1 tick, as APPR will every tick call another one of these scripts, and if they aren't done you'll have many CALL'd scripts happening at once and the engine will crash on your for doing something it does not like. Likewise, don't use STPT here, which stops all scripts. The engine also really doesn't like that.

Script 150: Creature can see _IT_

Script 150 happens when a creature can see it's _IT_ agent next to it. Usually in this script you'd make the creature move towards _IT_, using the coordinates provided by _P1_ and _P2_. If you ever made a critter movement script, this is basically that.

Script 151: Creature isn't in a room

The engine is smart enough to not try to attempt CA tracking when said creature isn't even in the room system. This doesn't happen very often but for one reason or another this means the creature is where it should be. The only recommendation I have for this script is to make your creature either do nothing, or teleport somewhere you know is safe (like maybe a creature in a room! Or the injector room)


Script 152: Creature is following CA to a neighboring room

This is called when a creature can't see _IT_, so instead is using CAs, or Cellular Automata, to decided where it needs to go. _P1_ and _P2_ here are coordinates to the center of a room with the highest CA that associated with what we're tracking. So if your CRAG is seeking out fruit, this would return the room with the highest protein smell. You can use basically the same script you used in 150 for the most part, if you didn't do anything that required _IT_ to be seen.


Script 153: Creature is following CA to a link

This is called like script 152, but instead of a neighboring room, the room with a higher CA is through a link. You could try like DS to calculate whether you should stim a creature with Up drive, down drive, exit or enter etc to get them to use an agent to travel, but most of the time doors and lifts won't pick up CRAGs. _P1_ and _P2_ are the linked rooms coordinates, so you can make your CRAG teleport or fly there, depending on what you're making.


Script 154: Creature is in the Highest CA room

You know how creature pace around norn home when following it because they can't see it but have followed the smell all the way? That's kind of what this script is. You can still use _P1_ and _P2_ if you want here to simulate the pacing around creatures do. Another thing to note here is usually, creature's get stimmed with "Reached Peak of Smell (CA)", which you'll want to replicate to a degree if you want creature's to stop being homesick when reaching a home smell.


Closing

That's the very basics of how CRAG works, and with all of this you'd be able to start tinkering around with making your own. In essence, CRAG are just critters who have their actions controlled by AI you didn't quite make yourself. If you have some practice making those, you could make a CRAG ok.

I didn't get into it here, but if you want CRAGs to reproduce, I recommend looking at DS CreatureBreeding.cos for some inspiration. Unlike a lot of things, MATE will work fine for CRAGs if you use it how skeletal creatures use it.

I hope this provided some insight to how these guys work. Feel free to also poke around Nurse Bot files, where you can see what I did to them compared to their skeletal equivalents.




Tuesday, December 26, 2023

Welcome to Order and CAOS!

 I won't really be posting much here, as it's mainly to host a place where you can find all Agents/COBs/Breeds I've made/collaborated on.

You can probably tell by the above line I usually make agents, with a focus on Creatures 3 and Docking Station specifically.

Posts will probably mainly either be to announce updates of stuff I make, or maybe to talk about some things about CAOS. For now, it's mostly downloads!