Creating Agents

I’ve been working on the GDD a little today, mostly writing up the functionality of the editor, and I was about to explain how the player would create agents when I realised I have absolutely no idea myself.

Looking through this thread it seems the plan is to make all agents out of the same ingredients, which seems sensible:

Will the player just pick a specific function they want, or will the results be random? In that case, does the player even need to do anything at all other than tell the agent where it’s stored and what agent secretor(s) it comes out of? What’s the trigger for an agent becoming available then?

It’s also obvious that agents need to evolve in AI species. Given that there needs to be parity between player and NPC agents (i.e. both should theoretically have access to the same types and work at similar speeds), how would they develop agents?

We’ve talked about this quite a lot and come to no conclusions.

Basically being allowed to make an agent which has a set effect on all species is much too powerful, it just becomes “kill juice.”

The way round this is to have each agent have a code and each organelle have a code and those have to match sufficiently closely before there is any effect.

The question then became how many different agents should you be able to store and should you be able to produce new ones on the fly. Moreover how do you manage this large amount of agents.

I think that was as far as we got.

I think the most reasonable solution we came up with is this:

  • The player (or auto-evo for the AI) adds an agent vacuole/producer organelle
  • The organelle is assigned a random, low power (or effect-less) agent, which may be benificial or harmful to both the player and other cells
  • Over time the player can choose to upgrade or get rid of both the organelle and the agent
  • We could design a tech tree for this, or use Moopli’s bitstring-comparison idea, either would work fine.
    Once the player has evolved a few agents this way, we could give them a library to choose or evolve from for more control, but up to this point what they get is effectively random.

Since I have been on the team, the concept of agents has been brought up 5 times, and each time we haven’t really gotten anywhere. So I have decided to take the initiative and build the first draft of agent secretors/vacuoles (that is, after I finished the editor do-over). Basically, this is what I plan on implementing:

  1. To simplify prototyping, I will lump the agent vacuole and the agent-secretor gland into one big organelle, much like the toxin vacuole is right now.
  2. Agent vacuoles can only be placed as the outside layer of hexes, so they cannot be inside the microbe. Well, technically they can, but this would cause the agents to be released inside the membrane, which would result in the agent affecting the player’s organelles.
  3. At the start of the game, every organelle is randomly assigned a 6-bit string. By every I mean every type. So all mitochondria could get 010011 and all chloroplasts could get 111101 in one game, and in another all mitochondria could get 110100.
  4. When you place the agent organelle there is a pop-out window that looks a bit like this (pardon the quick sketch)

    You can press the arrows to change the code to any 6-bit string.
  5. The color of the toxin organelle will be generated by these bits (the first pair is for red, second is for green, third is for blue)
  6. When you upgrade the toxin organelle, you can change any one bit for 10mp. It’s up to you to decide which bit you want to change.
  7. When you upgrade a normal organelle, one of the bits is randomly changed to another value by the simulation.
  8. When an agent touches the membrane of the cell, it checks the code of the membrane and compares it to this particular toxins code. If more than half (4) of the bits match, the membrane is halfway affected. If 5 bits match, the membrane is affected by 75%, and if all of the bits match the membrane is completely affected. All we need to decide is what parameter of the membrane can be affected.
  9. Next the agent passes through the membrane into the cell and keeps going in a straight line.
  10. Every single time it touches an organelle it does the same bit string comparison.
  11. After traveling for a while, the agent is diffused into nothing.
  12. The point of playing with agents will then be to figure out what the code for each organelle is in this playthrough.

Eh, now that I think about it, this might be too hard for the player to comprehend, what do you think?

Amazing. I think it’s a great idea to just get on with this.

Man this is a great idea! That’s going to look really great (I love trippy primary colours, as you can tell from all my prototypes).

How about when an agent affects an organelle the organelle flashes or goes red? It’d be nice to have a really obvious alert.

On tactics. Agents are too good if they are “kill juice” where you have figured out the code that kills every mitochonria, for example. Agents are too weak if they don’t affect anything (and if it’s impossible to know what they will affect). So we’re looking for a balance in between these two extremes.


  1. All Mitochodira have the same code
  2. Have each speicies have it’s own codes. So A’s mitochondria are 000000 and B’s are 110010.
  3. Have each microbe have it’s own codes, so if your species base is 000011 you’re might be any 2 digits different from this.

A) Codes never change.
B) Codes change slowly.
C) The ai adapts fast each generation to being attacked. (this of course could be programmed later)

Up to you how strong you want them, this gives you some options.

Options for player strength:

  1. The player gets no info other than by using the agent.
  2. The player gets some coarse grain info when creating the agent (this will affect 4 organelles)
  3. The players gets fine grain info when creating the agent (this will affect A’s mitochondria 50% etc)
  4. The player only gets info when they use the agent BUT that info is stored automatically in a database the player can use later to pick codes (you know species B’s mitochondria was affected by 110011 etc)

I’ve been kind of imagining it a bit like magic in rpg’s (because I have played a lot of action rpg’s and they are fun (Dark Souls FTW)) and basically that agents could work like magic. If you meet an ice golem and you fire a fireball at them then they are done, immediately. However if you meet a rock golem and use a fireball against them it does very little. The wizard / agent user is very powerful in a specialised way. The warrior is good against everything but never has an easy time of it. I think this would transfer quite well to microbe gameplay. If you are a heavy agent user (like you have 4 vaculoles) there are some species you can just instantly dominate, whether they have mellee or not, but there are others who can hunt and kill you with impunity. If we wanted to take the wizard analogy to the limit then good gameplay would be about collecting knowledge about which species were weak to what codes (and knowing a lot of this data was outdated) [a bit like having a dusty old spellbook when no one’s seen a dragon for 4 generations, does frost bolt still work?]

However I don’t know about realism when it comes to memory. We can’t stop the human having memory who is playing so it’s not too problematic to give them a database which is auto remembered. Of course this is kind of the realism issue in general, a microbe is just a stimulus responder (and would evolve it’s codes by having those who picked bad codes die out) how much are we going to allow the player to circumvent trial and error?

All very interesting. Thanks for starting out on it. [Of course you guys may not like wizard analogy, I’ve just been working from that because I know it’s fun.] There’s a good argument for just making what’s easiest to program and seeing if that is fun.

So here is a prototype I just quickly knocked up for an agent guessing game. Basically in this video moving the mouse close to a microbe will shut down one of the coloured organelles and your job is to guess which one it is!

Ok that sounds kind of dumb but the larger point as it relates to the discussion above is that I think it’s fine for the agents and organelles to have codes and for the player to never be able to see the codes. I think if the only info they get is by spraying the agent on other microbes and seeing what it does then that is enough for them to quickly figure out when it is effective and when it is not, much like in the video. Having the organelles flash is plenty of info, you don’t need to worry about codes.

What do you guys think?

I think that’s pretty good. Obviously, one toxin should have a similar effect on other organisms, so Toxin A shouldn’t destroy mitochondria in one species, but impede movement in another. The player should then be able to realize what his toxin does and decided whether he wants to try his luck with another toxin or upgrade this one.

Right now I support building something to test it, doesn’t matter so much what it is.

I’m not sure about agents having the same effect. I think the biggest thing we want to avoid is “kill juice.” We don’t want there to be one best agent (like the one which shuts down mitochondria for example) which you just need to find and then stick with forever. Moreover if you just spray your agent on one microbe and find “it’s the flagella one” then your discovery is done and you’ve got 100% of the info already, which isn’t very deep gameplay wise.

I really like the idea of codes, where each organelle for each species has a code, and the agents have a code. This is based on the biological reality (it’s proteins binding to receptors to mess them up) and it gives a lot of depth, you can tailor your agent to specifically help you with one species or you can try and have a general one which gives a little help a lot of the time.

There may be come middle ground where all mitochondria have similar codes and can’t change them that much but I feel this is still pretty prescriptive.

Of course we will need to test it. IMO in general we want to make a robust system which means you need to keep adapting and the best setup is based on what is going on around you (with lots of red queen hypothesis). For this reason I am suspicious of upgrades however I know they are popular.

1 Like

As soon as I get organelle models into the game and we release, I will start creating prototypes.

The thing is that organelles are very similar in nature since they share evolutionary roots with other species. As you mentioned, toxins are very specific and bind to specific receptors that similar organelles (such as all mitochondria) share. Because of this it will be scientifically incorrect to have Toxin X affect chloroplasts of one species, but mitochondria of another. However, I agree against having a kill juice and I think the player should have to tailor his toxins to specific species—so for example Toxin X completely shuts down the mitochondria of Species A, but only slightly slows down production for Species B. The player will then have to make a choice as to which species most affects him. The real problem will be making an intuitive UI that allows the player to modify and tailor his toxins.

I don’t fully agree with you here. You bring up a valid point, but we don’t want the player to have absolutely no idea how his toxin will react in a particular situation; it will get frustrating very fast. I suggest the player has an understanding—if somewhat vague—as to what his toxins do. He should be like "Okay, Toxin X slows down my prey, but I have never seen this species before, so I don’t know to what extent its flagellum will be affected. Additionally, we allow the player to choose which storage and production organelles they place, so why can’t we allow them to choose which toxin organelles to place?

Definitely, but we’re walking on the blade of a knife here. One one side, allowing the player to make his organelles more and more OP will result in an overpowered kill juice that no-one can get close to. On the other, forcing the player to constantly change his microbe will give him a feeling on hopelessness—that everything he does is useless and that he is not in control of the game. We are looking for a goldilocks zone here.

I’m not sure if you’re talking about upgrades for toxins or organelles in general. Evolution doesn’t go in a circle—at least the way I was taught. It is in a constant cycle of perfection with every node in the evolutionary tree being better adapted and more fit than the previous. Take mitochondria. In the image below you can see the current state of the oxidative phosphorylation cascade, the part of the mitochondria that generate the most ATP. You can see that the line of best fit is slowly going down before it abruptly stops and falls to oxygen. Many longer this line goes before falling down to oxygen, the more ATP is generated. Hundreds of millions of years ago, there were only 2 to 3 proteins in this chain and cellular respiration wasn’t very efficient. On the other hand, in the far future, mitochondria could keep evolving and continue adding proteins along this line until we get 40-50 moles of ATP per mole of Glucose.

Sorry it’s always 1000 words from me :stuck_out_tongue:

This is interesting as to how many species there will be in your patch. It’s a very different game if there are 5 or if there are 1000. If you put too many then a lot of them will be very similar, if you put too few it will get boring. Though there is an argument for only having a few as then somehow you can get into an arms race with the others and understand the patch as a whole. If there are 1000 species you will never really understand what is happening around you. Needs a balance.

You put this very well. I’m glad you’re thinking this way. I think we are going to have to work pretty hard to get compelling gameplay, that feels challenging without being hopeless. I think we can do it.

Well I’m no expert so I may well be just spouting nonsense here however I think there is always a draw back to complexity. As humans we are very complex and so we like to think that things which are more complex are better than things which are simple. But tip a load of bacteria and a load of mammals into a boiling vat of acid and see how much complexity helps you then (please don’t do this, lol, “but officer this guy on the internet told me to!”). Simple things are much more robust and have a much easier time of adapting (because they can reproduce quickly) whereas complex things have a lot of advantages but are vulnerable to rapid environmental change because they have to take a long time to reproduce because it takes a lot of energy to build the complex structures.

So in a human cell it’s definitely better for the mitochondria to be more complex because we have abandoned ourselves completely to massive maturation times. To a bacteria that will live for a day delaying it’s reproduction by 3 hours for the benefit of more complexity might be a drawback that isn’t worth it. I think, in general, the life on this planet is stable in inverse proportion to it’s complexity. So the micro-organisms are incredibly difficult to get rid of and to imagine how the last one might die is very hard (conditions would have to become very bad, even Mars may have some of it’s micro-organisms remaining). To imagine every mammal dying is easy.

Anyway I know loads of people here know much more about Biology than me so I yield to their (and your) expertise.

In general game design terms I think it’s better if you start as a rifleman and can then level up to become a sniper (long range, low health) or a machine gunner (short range, high health) rather than becoming a rifleman 2 (just better). However as we are not balancing any multiplayer I think it would be ok to make a narrative where the player just gets stronger and stronger. Though of course if they player can level up but so can all the other microbes then there is no benefit in it and it might feel hopeless in the same way, but giving the player upgrades the other microbes can’t have is unrealistic, though could be fun.

Ok so where are we at with this? Having read the above I think these are the points of agreement. Does anyone disagree with these? It would be great to get going with agents a bit.

  1. Each agent will have a code.

  2. Each organelle will have a code.

  3. The amount the codes overlap will determine the intensity of the effect on the organelle (basically breaking it / slowing it down temporarily).

  4. The player must work out what the agent does by using it.

  5. The player is offered some mechanism to change the code of the agent.

The points yet to be fixed are.

A. How are the codes assigned, do all mitochondria have the same code? Do all mitochondria of the same species have the same code?

B. How does the player get given information on how to upgrade their agent?

One option is something along the lines of “I want this agent to work 100% against this organelle of this species” So you can pick one time when the agent works perfectly and then all the other times you might get lucky with code overlap.

Another option would actually be to show the player the code of their agent and the overlap with other species organelles. So you can see that your code is 110101 and that had 3/6 overlap with the mitochondria of species A and then you could choose to change your agent code and over time hope to get closer (kind of like the game mastermind, don’t know if you’ve played it).

Do you think this enough to build something to play with? We can always change how the codes are assigned to organelles later (if we find there is a killjuice trap). Maybe it is more difficult to change how the player chooses to change their agent.


A: Every X organelle of Y species has a common code. X organelles of related species would have similar codes simply due to the incremental nature of evolution, but the data itself would be set for each organelle type within a species.

B: I prefer more indirect information, but this is something we could easily fiddle with when prototyping – as it’s largely an interface/gameplay thing and not to do with the underlying model.

Has it been decided how resistances to toxins will be implemented?

every agent and affectable entity will have a special code, which are compared for similarity to determine the potency of the agent’s effect. We haven’t set in stone the exact method of comparing codes for similarity, but that part is very modular so we could easily try different things.

In other words, not completely, but enough so that we can implement it.

So I made an agents prototype today (mostly because I wanted to work on something tractable!) I think it’s pretty good.

So basically what happens is each organelle is given a base_code, for example “CGTAGTTAC” or “GATTACCA”. Each species then gets a code for it’s organelles of that type with 3 of the letters changed.

The the player inputs the following information.

  1. Which species would you like your agent to target? You can give a list.

  2. Which organelles would you like your agent to target? (This info is given as weights, so you can say Mitochondria: 1, Flagella : 4, all others 0 if you really want to target Flagella and you want to target the mitochondria a bit)

The program then spits out the optimal code for your agents to have to attack those species and those organelles. The more focused you make it the more effective it will be (for example if you pick 1 species and 1 organelle then your agent will be 100% effective) and visa versa (so if you make something which is effective against 3 different organelles on 3 different species then it will only slightly affect them (unless you get lucky)).

Of course the code you have may affect other organelles as well as the ones you have targetted.

Anyway I did it by brute force at first and it was slooooooww but then I did it in a more intelligent way and it’s really fast!

This system would mean that

  1. You can explicitly see the genetic code of your agents

  2. You can use an intuitive system to choose what you want to target to generate new codes.

If you guys like this we could work on some more functionality like it (for example what if you have 2+ agents and you want them to overlap as little as possible? Things like that).

What do you think? Code.


I like the idea of choosing what species you want your agents to target, and so far your prototype looks exactly like what we need. Although if we cannot create an intuitive UI for the 2 pieces of information your system needs, I doubt it will work well. How do you incrementally change your agents? What does the system do if you ask to target two organelles that don’t overlap at all? Do you have a dropdown of species that you can choose to target? If you do, what if the player has no idea who to target?

Here’s the kind of thing I was imagining for the UI, basically across the top you choose weights and then there is a scroll able list of species and if you click them they turn green and are targeted, if not targeted they are red.

Then at the bottom it shows you what your current codes are and you can click on them to edit them, when you do an edit it will tell you how much it will cost.

Incrementally changing is difficult. I guess maybe changing a letter costs x mp and so, after an auto evo step where some of the other species have changed their codes, you can recompute what code you would really like to have (using this system) and then it will tell you how many letters you need to change and how many MP that will cost. If you don’t have enough MP then you have to do it in a couple of steps and have a slightly crappy agent in the middle. (Auto-evo would only change your targets codes a little so I guess you could probably follow quite cheaply)

“What does the system do if you ask to target two organelles that don’t overlap at all?” Hmmm yeah ok with input ,“AAAAAAAA” and “GGGGGGGG” it spat out all “AAAAAAAA”. It should probably give half A’s and half G’s. Ok so with the code changed to shuffle things up it not gives “AGAAAGGG” which is a better interpolation, I’ve updated the github.

“what if the player has no idea who to target?” If the UI has pictures I think it will be quite obvious who your enemies / prey are.