Some code design on the binding agents

I’m trying to take a small break from thrive coding. To do that effectively I’m going to list down some thoughts about the binding agents design / a todo list I have currently in my head.

  • Add binding agents to organelles.json
  • Add a scene for the binding agents, just use a cube for now
  • Add the GUI thing in the editor (NEEDS AN ICON)
  • Check that placing the organelle and saving / loading in game doesn’t cause issues
  • Add property for microbe to check if it has binding agents
  • Add binding agents mode
    • Prevented if no binding agents
    • Cell flashes green or something
    • Consumes a bit of ATP per second
    • Enables extra collision callback
  • When cell hits another with the binding mode on and it is of the same species (and isn’t the player, so no AI can hijack the player) it binds
  • AI and movement is disabled on cells in a colony, except the leader
  • There probably needs to be some properties like PartOfColony, ColonyLeader, list of attached cells
  • The attached cells are parented under the leader cell’s Node
  • I’m a bit undecided but there’s two choices: try to make physics constraints between cells behave nicely or make it so that the extra organelle physics are added to the primary cell physics
  • Colony cells need to share their compounds so that each has the same amount
  • Reproduction probably needs to be blocked while part of a colony
  • The player GUI should probably show the total amount of compounds in their colony
  • Unbind key for ditching all the colony members
  • Once you leave a colony it should behave nicely with the reproduction indicator so you know when to ditch and go to the editor
  • Another thing that needs deciding: how to detect damage? Is it per cell or colony wide. Depending on the physics choice it might be a bit difficult to detect which cell was hit (especially with the godot physics index problem
  • Colonies need to have a movement speed that depends on all the cells in them
  • Saving while in a colony needs to work without problems
  • Agent shooting likely needs changes while in a colony (unless it is a single physics body and the collision ignore works correctly)
  • If dying is separate, the colony owner dying might need special handling.

I hope this goes to show that binding agents is a pretty massive feature with a lot of corner cases to fix.

  • The binding agent is just one hex.
  • The cell that is in binding mode that hits another cell (that is not already part of a colony) becomes the colony leader. In the case of player cell, the player can’t become a colony member, only a leader.
  • Two colonies can’t merge (if this is wanted to be added later then just one of the colony leaders stays the leader and all the new cells just move over to being members of the other colonies)
  • Collisions for attaching with binding agents is done by the normal collision detection between cells
  • AI should not be able to mutate binding agents, at least before the AI knows how to use them
1 Like

One more question: what happens if two cells in binding mode hit each other? Who gets leadership? Random chance?

Random chance, unless one of them is the player, in which case the player is always the colony leader.