You have to create Zappy, which is an entirely automatic game where some AI's play amongst themselves. It is about creating families, surviving by eating food and collecting stones in order to level up. Each level has different requirements for a ritual, which makes the adventure more and more difficult for the AI players, which play on their own, without any help form their creator. The game is over once six members of one family reach the highest possible level (8).
- The game consists in managing an entire world and its population. That world, "Trantor" is geographically made of plains that have no height, no crater, no valley or mountains.
The location where we are is quite rich in resources, mining and food. All you need to do is to walk around and discover this wonderful food and many stones of various nature on the ground.
- The goal for everyone is to reach the top of the Trantorian hierarchy.
- The ritual that allows to increase the Trantorian physical and mental capacities must be accomplished according to a particular rite. He needs to bring together on the same field unit (square):
- A combination of stones
- A certain number of players of the same level
- The player will start the incantation and the elevation will start. It is not necessary that all the players are on the same team. Only their collective levels matter. All players within the incantation group will reach the higher level.
- For multiple reasons, the vision that the player has of the field is limited. With each elevation their vision goes up one unit of measure ahead and one on each side of a new row. Thus we obtain, for example, for the first 3 levels, the first two elevations, the following vision (our player is on 0):
Only the classification of an object can be identifiable. It is therefore impossible to distinguish two objects of the same class. For example, two `siburs` will have the same denomination since they belong to the same class.
At the beginning a team is made of n player and only n. Each player is controlled by a client. The clients cannot communicate or exchange amongst each other data outside of the game, in any way.
At the beginning the client has 10 life units, he can therefore survive 1260 time units, 1260/t seconds.
A player can reproduce with the `fork` command. The execution of this command results in the production of an egg.
Once the egg is laid, the player that laid the egg can go around until it hatches. Once the egg has hatched, a new player comes out, and is given a random direction.
This operation authorizes the connection of a new client.
The command `inventory` allows you to see what objects the player has and how long it has to live. The server will send back for example the following line:
```
{food 345, sibur 3, phiras 5, ..., deraumere 0}
```
### Kick
A player can expulse all the players sharing the same square. It pushes them in the direction he is looking at. When a client sends the `kick` command to the server, all the clients in this square receive the following line:
```
moving <K>\n
```
With K indicating the direction of the square where the player comes from. Basically saying that you are getting out of that square.
### The commands
Each player responds to the following actions and only with the following syntax:
All the players hear the broadcasts without knowing who emits them. They perceive only the direction the sound comes from and the message. The number of squares crossed by the sound before it arrives to the player indicates the direction. This numbering is done through the attribution of `1` to the square in front of the player, then a count down of the squares surrounding the player in the trigonometric direction (counter-clock wise). The world is round, therefore we will choose the shortest trajectory for the sound between the transmitter to the player for which we calculate.
The following example indicates the sound trajectory that we must choose, as well as the numbers of the squares around the player. The player receives the broadcast through square 3.
The server is the main engine that will interfere between the AI and the GUI. It will exchange all data with the AI and execute these instructions. At the same time, it send the information to the GUI. It can be written in one of these languages [C - C++ - Rust - Go].
The client will send its requests without waiting for their execution, the server sends back a "welcome" message confirming the successful execution of the requests.
The `nb-client` indicates the number of clients that can still be accepted by the server for the team `team-name`. If that number is greater than 1 a new client connects. X and Y indicate the world’s dimensions.
There is no chat room or sharing of data between players. Still, the Player can broadcast a message through a command-line sent to the server, which will be broadcasted to all players; All details are in the sound transmission part.
The server executes the client requests in the order that they are received. The requests are buffered and the execution time of the command will only block the player concerned. `x` and `y` indicates the dimensions of the world.
To have a better vision of the game, which is simple, clear and ergonomic, the project will need to have a graphic visualization client. That client will propose a real-time representation of the world as it is on the server.
The Graphic part must be done with one of these languages:
- The interface will integrate at least a 2D visualization through icons allowing a representation of the world.
- You need to make sure that it is possible to visualize the items in the game.
- You need to implement the the possibility of clicking on a square to see the details of it, like how many of each items it has inside. It should look like a floating window, tooltip, or something else.
- You need to include the visualization of the sounds.
This can be developed in C, PHP, Perl, Python, etc. And will communicate within the network with the `server` to retrieve the content of the `map, teams, inventories, etc`. For example, everything needed to see what is going on in the game.