hoshi10 / OpenSkyscraper

Open source tower simulation game inspired by SimTower, based on SDL, OpenGL and OpenAL. #opentower on freenode.net
https://github.com/fabianschuiki/OpenSkyscraper/wiki
1 stars 0 forks source link

Cinema patrons should enter from the top floor and exit from the bottom floor #3

Closed hoshi10 closed 11 years ago

hoshi10 commented 11 years ago

Currently cinema patrons enter and exit the cinema from its bottom floor. In the actual game, there is an additional mechanic where patrons enter from the top floor instead.

fabianschuiki commented 11 years ago

I think this is in the TODO list as well somewhere. I thought about introducing an integer in the ItemPrototype that holds the offset of the entrance from the bottom floor, defaulting to 0.

hoshi10 commented 11 years ago

Indeed, it was already in the TODO list. I missed it as I was looking under Item::Cinema. Thanks!

An entrance variable specifying the floor offset would do the job nicely. But the path-finding algorithm needs to be modified as well, since it currently defaults to the bottom floor for buildings. I haven't thought through how best to implement this yet.

hoshi10 commented 11 years ago

Ok, so I've been looking through the path-finding code, and there's actually very little modification needed to be done. In its simplest terms, it just finds a path from point A to point B. The issue arises in choosing the floor for point A & B to feed into the algorithm.

Now, an entrance offset will work for the cinema (I've done some preliminary testing to confirm this). But I went to observe the behaviour of Metro passengers in SimTower and it seems there's a different mechanic to it. Metro passengers enter/exit from the top floor to go to other buildings in the tower. However, if they want to visit other buildings on the middle floor of the Metro, they simply walk in/out through the middle floor landing of the Metro. But only for the middle floor, i.e. they don't exit from the middle floor and take the elevator up elsewhere.

Since there seems to be only 2 buildings in the whole tower that will have such special behaviour, we could just code to handle these 2 cases for now. But in the future if there are other building types which can have multiple entrances/exits, this will not be an elegant solution. Perhaps then, we have to think how the people will pick their entrance/exit and design a new mechanic.

fabianschuiki commented 11 years ago

That sounds good, I agree with you that we should keep it as clean as possible for the future :). Sometimes I get the impression that quite a few gameplay quirks in SimTower were actually due to the programmer's laziness or some other technical limitation. E.g. the fact that Security offices are indestructible.

Might it be possible to modify the path finding such that for routes interacting with the Metro the pathfinder checks for two routes, one from the top and one from the middle floor of the station? The shorter route could be chosen eventually, making people leave for the tower from the top level, but customers for retail shops on the middle level would simply leave the station through that floor.