This is one of our project for Artificial Intelligence subject at the Jaume I University, in January 2019.
This a video game about a Jewish man who is imprisoned in a concentration camp from which he will have to escape. In order to do so, he must avoid being seen by the guards as he goes through the different labyrinths in search of his mates and the switches that open the doors to his freedom.
The game should contain:
This project was made with a group of 5 students from Jaume I University.
The visual design of the game is based on the use of 3D low poly models, among which we count the two figures of the Guards and the Prisoners, as well as the different scenarios in the form of labyrinths. All characters have various animations, so the guards can run, patrol and attack with different weapons (gun and bludgeon), and confined Jews can run, evade attacks and operate the buttons that enable the different actions that the game proposes.
As far as the conceptual design is concerned, every level will have a final door that the player will have to cross to pass the level. To open the door there will be several switches along the labyrinth. We can also find other types of switches that will turn off the light in the area, implementing a new mechanics that will help the player / prisoner to pass near a guard without being seen or alerted. In the same way, some levels have a trap for the player in form of a "plate" located at ground level, which will emit a noise alerting the guards of the area to come to that point, whenever the player passes over it, which is quite probable because it is mixed up with the ground and only a very slight brightness reveals its situation to the player.
The limitations that the player has as a Jewish prisoner are linked to his narrative "situation", that is to say, the character that controls the player cannot attack, because he doesn't have any weapon or enough physical force to do any damage to the guards vigilant; this is justified by aspect of truthfulness that we wanted to breathe into the game. Nor does it have more than one life, so if it receives a shot or a couple of direct blows, the prisoner dies ... and the level is reset.
Finally, it is worth mentioning the fellow prisoners that the player must rescue in the last level; without them, the final door will not open, forcing the player to look for them, guide and protect them until the last exit. These companions will be in position of "followers", reason why they will not be able to avoid any attack, and if in some moment they stop seeing the character player, they will go to the last point where they saw him and they will remain waiting for him until he comes back for them; said this, once they see him again, they will follow him again.
In this game, pathfinding is the most important part since we control all the behaviors with it. For that, we implemented A* (A star) algorithm.
Pathfinding is the plotting of the shortest route between two points. The best path possibly is not the shortest way. A* combines the pieces of information that Dijkstra’s Algorithm uses (favoring nodes that are close to the starting point) and information that Greedy Best-First-Search uses (favoring nodes that are close to the goal) A* assigns a weight to each open node equal to the weight of the edge to that node plus the approximate distance between that node and the finish. This approximate distance is found by the heuristic. In other words, the heuristic decides which is the best way. There are many different heuristics that can be possible in one problem, but we used euclidean heuristic. To calculate the path we need this information in each node:
To calculate the euclidean distance of our heuristics, we use the following function:
D and d is a scale that matches our cost function: d is the minimum cost for moving from one space to an adjacent space and D in the cost of moving from one space to a diagonal space (octile distance).For the implementation of A* we need two sets of nodes: Open and Closed. The open set contains those nodes that are candidates for examining. Initially, the open set contains only one element, the starting node. The close set contains those nodes that have already been examined. Initially, the closed set is empty. Because we required a path at the end of the search, we keep with each node a reference to that node’s parent. At the end of the search these references can be used to recover the optimal path.
Our grid of nodes is a square grid. We decided the size of the grid and the size of each node. Then, we create the grid of nodes taking into account the size of the nodes and the size of the grid. Also, there are unwalkable objects that we avoid when we calculate the path.
The enemies have got “walkies” to send warnings between them, we have represented this with a range in which the enemies detect the playero chen another enemy has detected him, they try to go through different paths to overthrow the player.