views:

176

answers:

5

After seeing the 13th Floor back in the day I have been obsessed to a degree with writing a simulator like that.

I have written several simulations with a human base class that have a male and female subclass. They have a routine called runYear and they interact. They date, work, die, have kids, get sad, commit suicide, divorce, etc.

It will run for thousands of "years" and depending on seed parameters grow very large or die off.

My question is: I have really maxed out what I can do with this and I am looking to rewrite this from the ground up, but I want to have a foundation going forward. Are there any good books or articles anyone can point me to that would help me better understand how I need to design this or what key foundations I should include?

On a technical point:

  1. should I look at using a Object Oriented database to store this information?
  2. I was planning on writing this in C#(For comfort reasons), would learning LISP be better?
  3. Are there any other opensource simulators anyone has run across like this I can maybe get some ideas from

Any other ideas/suggestions would be be awesome.

Erik

+1  A: 

Swarm

Doug Currie
+1  A: 

First, you need to start off with creating a World class. Your World class would encompass everything that a world can do. You will want to incorporate Gravity, Air, Ground, Walls, etc.. You will probably want to start off by giving the sky a limit, as you wouldn't want someone to just leave your world and go do his own thing in memory somewhere.

Once you got your World setup, create yourself an Abstract Human class. This class will have basic human abilities. You can specify stuff like height, weight, age, etc...

From there, you inherit the Human class, and create Woman and Man classes, each with their specialized attributes. Woman class can have BreastSize, CookingSkill, SexualPrownessLevel, Etc... The Man class will be mostly for keeping track of who is bald.

From there, you can go even further and split into ethnic classes, such as Asian, Indian, etc.. Each ethnic class would have its own traits as well.

Once you got all that out of the way, you can start working on the fun stuff. You can create objects to wreck havoc into their lives, such as Diseases, Religion, Money, Crime, Poverty, Starvation, Floods, Tornadoes etc..

Jon
And don't forget to take a vacation on the seventh day. ;)
Actually, he forgot to first let there be light. Second, he might want to have "public class Meek : Earth { ... }" even though that might break realistic inheritance.
Erich Mirabal
Ok, I realize this is a completely silly response, but man I got a kick out of it!
Ogre Psalm33
+1  A: 

I think the first step is to first be able to describe your problem in a descriptive way.

I like to think of it as a System-of-Systems problem. For that, take a look at SysML. That way, you can start at a high level, and then add more and more fidelity as your system evolves.

Erich Mirabal
+2  A: 

Most complex thing about this kind of simulators is not how to implement it, but how you model your creatures, and their interactions with each other and environment.

Just use those tools that you are most comfortable with. I wouldn't most likely use any kind of database in the beginning, I would use datastructures that my programming language uses and maybe write and read the datastructures to plain files when persistance is needed.

Here are few links about this kind of simulations. Most of them are not human level, instead they work on a bit "lower" level, think of insects, bacteria and DNA.

A couple of examples about existing systems:

Juha Syrjälä
A: 

You should look at discrete event simulation frameworks (there's link to the list at the end). I only know SimPy for Python, but there are others, open source and commercial. Basic framework is also pretty simple, so it should be easy "programming exercise".

Harriv