‚Ork Commander‘ was a recreational project where the player had to build a base and equip his units with the appropriate equipment. Whether the army of the player was effective against the attackers or not depended on the provided equipment. The goal of the game was to destroy the enemy base. The project was realised in the Unity3D engine.
My tasks were the implementation of a rasterized construction system associated with an user interface as well as a direction-controlled road system. We decided that the construction area of the player should be predetermined to a limited area. That’s why I decided to initialize every point in the grid of the construction area as a gameobject. In addition to this object a sprite was created which was then used to visualize collisions with other objects.
In case of a collision between a point in the grid and an object in the world, the associated sprite was marked as non-buildable and a corresponding entry was placed in the logic of the building area. Building a structure was controlled via raycasts. The raycast was used to determine at which point of the grid the placement was attempted.
In an area around this point was then checked whether the placement of the building was possible or not. The size of the area depended on the size of the building.
The directional road system was a much heavier task compared to the construction system. In addition to the requirement of the directional control it was also necessary to move the units correctly on the roads, that the units were routed into buildings and that streets were adapted to neighboring streets.
I implemented the direction control in a way that a road was marked with a special type in each direction. This type was either a wall, an entrance or an exit. The adjacent streets were then adapted to the newly placed street depending on its types.
The correct routing of the units was controlled by the road system. Each unit polled the system for information about the next road. The unit moved forwards after the system returned a positive message.Proper forwarding to buildings was controlled by triggers. If a unit moves into the trigger of a building the building checks for available capacities. If capacities were available the unit was directed into the building.
Working on this project was one of the most difficult and nerve-wracking experiences I had in my studies. Nevertheless, the result motivated me a lot. In retrospect, I would research for more information about systems and not develop them „from the gut“.