Advertisement

Implementing traits system

Started by January 13, 2022 12:40 PM
3 comments, last by AngleWyrm6 2 years, 9 months ago

I'm trying to simulate an ecosystem where each member in the system will have a list of traits that will modify base stats and/or add new ability. The first generation will only have randomly assigned traits. The next generation on will inherit 2 random trait each from both parents, and have 1 randomly assigned trait.

Stat modifiers will add or remove a number or percentage of assigned stats: strength, stamina, etc …

Abilities will add new function such as: - Jump will allow the member to use “Jump” animation, or have the “Jump” function. “Anti-poison” would allow the member to consume food items that are marked “poisonous”
The closest system I can think of is the trait system from Atelier games, a alchemy crafting game where you synthesize item that inherits traits of the recipies.
I'm going to use Unity to make the game, and C# for programming language. May I have a rough sketch of the class diagram or object diagram so I can understand how I should arrange the neccessary classes/scripts?

I smell homework. However, from your description it seems that if you write a simulation with creatures that jump, eat, get poisoned and do many other interesting things adding reproduction with inheritance and mutations would be a minor addition.

Omae Wa Mou Shindeiru

Advertisement

LorenzoGatti said:

I smell homework. However, from your description it seems that if you write a simulation with creatures that jump, eat, get poisoned and do many other interesting things adding reproduction with inheritance and mutations would be a minor addition.

Actually no. I just happened to watch a video on Youtube in which the game developer simulates a simple ecosystem with reproduction, but no traits. The trait idea I got from playing Atelier game series.

This reminds me of the AI in Minecraft. There's a main Think loop that visits each critter, and the critters first respond with a SkipMe() test to see if they actually need some quality face time with the CPU. If yes, then the critters have a dynamic ordered list of AI functions. Things like take cover when it's raining, gaze at player, attack target, change wardrobe when swimming, etc.

Each of these functions perform independently, with no sense of temporal sequence. All they can know is the present and if this particular task can/should act on the observed present. And so the actions of an individual are a collection of things it could presently do. Their only sense of time is consequences of action that result in a new and different present.

This topic is closed to new replies.

Advertisement