Ecosystem entity reproduction

The game I’m working on features a ecosystem (not as the main game), the two major parts here (apart from the climate) is plants and animals.

The plant system is already done and it’s reproduction is done asexually (meaning an entity can just make a baby with out a partner), that works wonderfully and is not that far off from reality so bonus points.

The animal system is what I’m currently working on and I have some doubts as to what exactly to do here, the obvious way to do it is have a male and a female have a baby,Ramble

this can be extended to have that dual gender thing like snails or whatever do in real life, I sort did that with the herbivor/carnivor/omnivor relationship like so

    bool herbivor;
    bool carnivor;
    bool omnivor { get { return herbivor && carnivor; } }

so a similar thing can be done to reproduction fairly easily I recon

but my concerns here is

  1. that it’s an unneeded level of complexity, the game is not about the ecosystem, it’s there to help sell the world as alive (well, it’s actually alive, or at least as alive digital stuff can be so I’m not just “selling it as”)
  2. that’s another layer of instability to the system and will take time to balance, meaning it’s not just how much of a species exists, but also the relationship between male-female and the whole age thing (currently they only starve/dehydrate/killed by another entity) that can get outta hand real fast.

I can just do asexual reproduction here too, but it feels out of place to me… what do you think?

One thing I plan doing is creating a “nest” of sorts for each animal that they build once a certain number of entities in an area is reached, like a wolf den(for wolves) or a tunnel entrance for small rodents
I’m going to do this thing for some animals regardless or this reproduction dilemma, so what I thought about is to make the nest create new entities instead of entities creating other entities directly, it’ll make keeping population in check fairly simple (I think, haven’t planned it out enough yet), but it can get a little awkward with stuff like camels, they don’t have a place they keep going back to afaik, they just kinda wander around wherever, (not saying stuff has to be true to real life, but a lot of the game relies on real life understanding of nature so here it’s kind of expected to have some adhesion to reality).

Any thought about this?, what do you think of asexual reproduction for animals in this case? if I go with the nest thing - what should I do with animals that don’t have “nests”?
Any other stuff I neglect to mention?

also I’m not a great artist so i’m modelling most of my stuff from real life, I started creating some made up plants, but doing it for animals is gonna be a lot harder.

I was investigating this problem whila ago, for my project.
I decided to do asexually, as it is easier to model behaviour.
In my case, there are additional species mutations, which adds another dimension to complexity.

However, if you would ignore gender aspect, think a bit of minecraft, you could easily have more realistic reproduction behaviour, without additional complexity. Age is simply threshold, to allow reproduce, so that is rather easy part. Finding mate, is simply by looking for nearest same specie animal, of suitable age and trying to get close enough.

With plants however, I would rather do reproduction asexually.

1 Like

Yeah that’s basically what I had in mind, I don’t have any problem implementing this.
The complexity I was talking about is how hard it is for the system to reach a stable equilibrium, if we throw age and gender into the equation it gets significantly harder.
The point* is not to create a flourishing ecosystem, it’s to co-exist within a given ecosystem in a city builder fashioned around medieval times and I don’t want species to go extinct easily, one thing I thought about doing is just checking how much suitable living area is there for a given species and if there is good area and no animals just spawn a few in, this can also be a part of the game difficulty, like a “hardcore” mode thing

*although designing a map and simulating a climate and all the stuff I talked about in the other thread is a ton of fun on its own it’s gonna be a part of the map editor, not the main game

when you did asexual reproduction did you let entities duplicate themselves or did you required two entities but with no genders? I’m sure how it’s called.

edit: also thanks for reading and replying :wink:

At the current state, even single entity can reproduce. No need for a mate. Besides genetic traits for reproduction, I do however age, energy and space factors, which influences chances for giving ofsprings.

1 Like

In the plant system they have a density modifier that effects both how fast they age and how likely they are to reproduce(that is also effected by how old they are), but in my case they don’t move.

how hard do you find it to reach a state where the population doesn’t explode but also doesn’t die off?, what kind of thing does the entities do to regain energy?, my animals have hunger and thirst, if I recall correct you had some more “basic” stuff like photosynthesis to get energy, did you do more “complex” organisms that eat each other?(wolf and sheep, sheep and grass, grass and nutrients, etc)

You would need to have quite number members of give specie, to be sustainable.
But if your species are more representative, rather than making eco simulations, this may be indeed harder to achieve, as would be easy to destabilise ecosystem.

What you would need, is to build system in such way, so it can be self sufficient, with certain margin of ecological fluctuation. So killing few trees, or few animals, won’t make specie extinct.
But again, if your species are just representative, i.e. you spawn them, when number is low, not sure if mating system would be required.

Alternatively, you can have new species approaching from outside of the map border, to fill defiecency of certain species. Or take them away in more natural way, when they overpopulating.

You could also introduce this way, new specie in mid game, which could be game goal, to prevent it from expanding and breeding. Kind of hostile alien, or cancer if you like.

1 Like

In my project, plants gain food during daytime and concert into energy, which allow for growth and reproduction. Reproduction cost energy.

To keep balance of plants ecosystem and prevent overpopulation into infinity, I have implemented greenhouse effect, or atmosphere saying otherwise. Like CO2 / O2 ratio.
Basically how it works, an atmosphere is a storage of global energy, which can be used by species. Only that, only photosynthesis species can “grab” from that energy storage. Think about CO2 level.
Now, as the CO2 is consumed, it drops. This makes plants growth and breeding harder, preventing overpopulation.

Any new born specie takes equivalent energy of its parent. So there is energy transition, rather than just use of energy. So more complex offspring, will cost more energy of the parent. Also size of new born offspring, affects the cost proportionally. That exact energy is given to offspring.

Any life form which dies by natural causes, it returns equivalent energy level back to atmosphere. Like emmiting CO2.

Herbivores gain food from plants and convert into energy.
Similar way for carnivores.

The only difference for animals is, that they require lower level of CO2, for better efficiency.

This way I control equilibrium, and I can control both difficulty and number of global species to be allowed. Think about graphic settings, for slower devices.

1 Like

I’m still not sure how it’s gonna go down, I’m yet to stress test the entity system I’m building.
the plant system I built can simulate a few million plants with relative ease so there i went full on simulation, I let it run for a full day on my machine on high speed and it sustains itself really well, i’m guessing now with the addition of animals i’ll need to bump up the plant reproduction rate a bit and also be able to simulate a little less plants, but a huge map only really needs like 500-700 thousand plants to fill it up unless it’s all a jungle.

Very good I love this!, I always have such troubles with the map borders so most of the maps I designed so far are islands

I could keep track of how much livable area is there for every animal like i said before, keep another “global”(as in out side of the map area) value for this and make each species migrate into or out of the map according to the ratio of these values.

and playing with these values during the game can have some really cool effects like you mention adding new animals or making an existing animal leave.

very very exellent, thank you my friend! (;

1 Like