I was getting pretty sick of staring at a static screen in Startup Freak. Sure, the movements and interactions of the employees with their environment in the game are purely cosmetic (their actual output and behavior is dictated by underlying statistics). But after all this is a game, and looking at numbers and UI gets old fast. Here is how the movement of employees works, at least in this first incarnation:
- Sporadically, each employee will choose some object in the environment they want to interact with. This might be a fridge, a coffee machine, a game console, or maybe even other employees.
- He or she will then walk to the object. I have implemented a basic path finding algorithm. The most interesting thing was dealing with stairs. I create “anchor points” in the level in Tiled marking the bottom and top of each set of stairs. If the target object is located on the floor above or below, these anchor points are used to setup intermediate way-points for the employee.
- Once the employee reaches the target, the “interaction” for that object is played. The interaction is essentially an animation sequence that will happen both on the object itself, and the employee. So for example if the item is a fridge and the interaction is “open”. Then the fridge will play an opening animation, and the employee will play a pulling animation. Each interaction also has a notion of number of loops it plays.
- After the interaction is complete, the employee will similarly target his or her workstation, and once there they’ll activate a “work” interaction with the computer.
I don’t have any animations or interesting objects in place right now, but here you can see the various employees approaching a target (painting), interacting with it (currently just watching), and then heading back to their desk.
It would be interesting to add support for multiple interactions for some items, allow multiple people interacting certain items, add support for elevators (for fancier offices), and also support employees interacting with each other.