View this PageEdit this PageAttachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide
Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007

M5: Incorporate a Simulation Engine

Our original design for this project, as you have seen, was to have each person in the game remember their schedule and their movements would be based on that. According to their schedule, each person would send events to an event queue, which would handle all movements and interactions. This way, we would really be able to simulate a college environment - people heading off to class, going to get something to eat, etc. all with respect to a clock. This seemed like a great idea when we designed our program during M3.

When it came time to code it, we realized that this was not at all realistic. The problems were endless. How could we make people know the route from one place on campus to another? And how could we make sure it was the best route? And have it efficient enough for a large number of people to move around simultaneously? And what would happen when something or someone else got in their way?

So we scrapped the schedule idea.

Instead, we decided to have the game engine hold a collection of all the people in the game. It would iterate through the collection, and send a simulate message to each person. This called a function that looks to see what a person needs based on his factors, and if there's anything near him that can help. If there is, he may interact with what will help him or might not - but the more he needs something, the more likely he will be to seek it out. Then he will look to move (in a randomly generated direction) or talk with people around him.

Advice:
1. Keep your code integrated as often as possible. We almost always coded sitting next to one another in the labs, and still had trouble meshing our code together at times, because we got lazy about integration.
2. Recognize design problems early. The quicker you make a decision about how you want to approach a problem, the better.

Link to this Page