🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Implementing traits system

Started by
3 comments, last by AngleWyrm6 2 years, 3 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?

Advertisement

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

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