Hey Guys,
We thought it was high time to show you a few tricks we use during game development that might give you some answers on some facts and concerns about the behavior and cause of different things in Train Station Simulator.

1. An isometric world:
Most of you know that TSS is an isometric game that is the illusion of 3D of a two dimensional world. Basically we can say that the game takes place on a checked paper with open (GREEN) and forbidden (RED) squares the whole time in 2D. You as a player of the game only sees everything happening in a different projection in isometric 3D.
Corridors and tiled areas are open spaces but objects, trains and walls are forbidden (partially) places. As an example let's see how an area of a toilette and some tiled areas look like in the 2D Train Station Simulator engine and in the game:

Enabling another layer will show passengers as blue boxes actively moving around. The white less-than // greater than sign indicates the direction the object is moving towards. Some other numbers indicates certain objects as well in your station like 115 for an interactive monitor or 117 for ticketing machines:
2. Code: "Dead" Backgrounds, "Zombie" mixed elements and "Alive" objects
Most elements in Train Station Simulator are background or active object elements or many elements are both.
As an example flooring are completely background elements, benches are mixed, background and object elements and passengers are objects only. Let me explain this a little more deeply.
During game development we always pay attention to the speed of FPS (Frames the game runs Per Second) a game can run on maximum. Lots of factor has a huge effect on this (code itself, engine used for development, graphical elements at once on the screen and/or in memory, quality of coding and lots of other factors...).
We use some easy techniques to reduce memory and CPU usage. The biggest advantage is the 2D vs. isometric trick I talked in the first point. The other major possibility is using different elements for different purposes as "dead" background elements will not eat up much memory or CPU but "alive" object will:
A. Background only elements: (Dead)
Most flooring, walls, doors, tracks, platforms are "static" elements and are not moving or changing very often. I call them "dead" as these are not moving but sometimes other elements can interact with them (eg.: passengers damage more likely cheap floor and less likely expensive floor).
B. Mixed, Background and Object elements (Zombie)
Most of the interiors to be placed (eg.: benches, machines etc.) are mixed elements. These one have their own rules and functions (eg.: a ticket machine can give a ticket to the passenger or a passenger can use the toilette) so basically we can say that these elements have their own interaction with active objects. These elements cannot interact with each other only with "alive" objects.
C. Object elements (Alive)
Passengers, vandals, staff members, vehicles and trains are active objects in Train Station Simulator. These pieces can interact with A and B types and they can interact with each other as well. For example a passenger can blemish the flooring background only elements, also passengers can sit on a mixed bench element but they feel pretty angry when seeing a vandal passenger destroying machines or missing their train as it leaves the station.
So by understanding the main elements of TSS now you can have a much cleaner picture why there is a limit in the number of passengers (250 right now) or why the map is not much larger. There are other great tricks used in other games where object elements (C) are only active in the view of the game but in TSS it would not be possible as in real world simulation games even if you do not see your passengers they have to continue their behaviors (they are getting more and more tired or hungry and have to catch their trains).
3. The underpass problem: why not possible to move the underpass entrance/exits away from platforms each side or only one side

So past week there were some discussions on the new underpass feature. We planned on request to move the entrance/exit of the underpasses off the platforms but as you might now understand more deeply the mechanism of Train Station Simulator it will easy to understand the cause.
To understand the problem let me introduce a few issues. Train Station Simulator was not designed to be a multi-floored game scene. The "open" // "forbidden" cell system enable "alive objects" to explore around open cells and avoid forbidden cells. The problem is with crossings and the fact that there are no multiple layer levels of that system so it would be difficult to define being on ground level or underground level (Actually we have tried that too but did not work as expected).
So the next image will show how the underpass works: actually if you place an underpass between tracks it will open a corridor for "forbidden" cells so passengers can cross. The illusion that they "disappear" is only a graphical effect to make it more real and train tracks are forbidden cells as trains use different paths for their movements than passengers.

The image shows that it is possible to reach from A-B-C-D each point to each other. But moving the underpass entrance/exit each side one cell off the platform would have resulted situation that may caused series blockage that can be seen on the next image:

In this case "B" would have never been accessed from position "A" as the underpass invisible corridor would block the ground access on the platform.
Well yeah... We know we could have come up with a solution for that but there were no easy solution for this. We could have created another floor database of coordinates but that would have limited the expanding of passenger number so we had to decide which direction to follow.
Well this example clearly shows that adding new features needs lots of attention and enormous time to develop!

Hope you guys enjoyed this short insight of the mechanism of Train Station Simulator. We may create posts like this in the future as well and please continue posting comments and feel free asking questions in the future as well.
Thank you guys!
[ 2018-07-20 16:28:00 CET ] [ Original post ]