"Now, I understand why so few companies have attempted to develop a life simulation game"
Echo Dot
link
fedilink
English
1921d

I’ve read from a few people who’ve done similar sorts of things that the solution to this problem is to just have everything track everything to begin with. Hunger level, heart rate, mood, everything you can possibly think of to track, and then just have everything else inherit from that global class. A lot of the values will be zero for some objects, but that’s okay, after all a storage crate doesn’t need a mood, both at some point in the future maybe you want to add an emotional box, and your code will definitely handle it now. Otherwise you have to go back in and alter everything every time you make a slight change.

@[email protected]
link
fedilink
English
1221d

A more complicated but ultimately faster approach is using a structure like an Entity Component System. You build an entity (deer, person, plant) out of components that are just data (health, hunger, mood), and then each type of component has a corresponding system that updates all the components at once based on other values. It’s somewhat similar, but you save space on unnecessary components not being added, and it packs the data together in way that is faster for the computer to iterate through.

@[email protected]
link
fedilink
English
221d

An emotional box? Enough about my wife!

OH!

@[email protected]
link
fedilink
English
121d

LOL, forgot about that tacky bastard.

@[email protected]
link
fedilink
English
521d

He sucks, but it was such a good set-up for a shitty Dice Man style joke, I couldn’t resist.

Create a post

Welcome to the largest gaming community on Lemmy! Discussion for all kinds of games. Video games, tabletop games, card games etc.

Weekly Threads:

What Are You Playing?

The Weekly Discussion Topic

Rules:

  1. Submissions have to be related to games

  2. No bigotry or harassment, be civil

  3. No excessive self-promotion

  4. Stay on-topic; no memes, funny videos, giveaways, reposts, or low-effort posts

  5. Mark Spoilers and NSFW

  6. No linking to piracy

More information about the community rules can be found here and here.

  • 1 user online
  • 292 users / day
  • 771 users / week
  • 2K users / month
  • 6.14K users / 6 months
  • 1 subscriber
  • 5.63K Posts
  • 112K Comments
  • Modlog