You have to create Zappy, which is an entirely automatic game where some AIs play amongst themselves. It is about creating families/teams, 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/team reach the highest possible level (8).
- The game consists in managing an entire world and its population. That world, "Minerth" is geographically made of plains, there won't be any obstacles on it.
The place where we are contains many resources that can be used for your survival, what you have to do is just look for them and get them before other players do. Here you will find some stones and food that you will need if you want to survive and evolve.
For the player to know what's around him, the `client` sends the command `SEE` and the server responds the following chain of characters (for level 1):
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.
The `inventory` command allows you to see what objects the player has and how much time he has left. The server will send back, for example, the following line:
A player can kick 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 that square receive the following line:
With K indicating the direction the player is looking to, which is where the other players will be kicked. The kick only works for players, you can't kick food or other recourses.
All the players listen to the broadcasts without knowing who broadcasts them, what they understand from it, is only the direction from which the sound comes and the message.
The number of squares traversed by the sound before reaching the player indicates its direction.
This numbering is done by assigning '1' to the square in front of the player, then counting down the squares around the player in a trigonometric (counterclockwise) direction.
Remember, sound is a wave that moves in a linear manner and the world is round, so we'll choose the shortest path for sound between the transmitter and the player we calculated for.
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.
<!-- TROCAR?? -->
![Example](./sound.png)
If the broadcast is sent from the same box as the receiving player, he will receive the message from square 0.
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].
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.
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 interface must be at least in 2D with the use of icons allowing a representation of the world.
- You need to make sure you can see the in-game items.
- You need to implement the ability to click on a square to see its details, such as how many items of each are inside the square. It should look like a floating window, tooltip or something else.
- You need to make sure that the visualization of sounds is included.
The graphic part can be developed in [Javascript, Python, C, C++, PHP, Perl, etc]. This will communicate within the network with the `server` to retrieve the contents of the `map, teams, inventories, etc`, everything that is needed to see what is happening in the game.
- Create the server using only one process (No THREADS).
- Add a flag to for a log mode when running the server.
- Add a flag for the number of resources and food density (could be different levels for example).
- Implement a seed in the server and client so that specific scenarios could be reproduced.
> Attention: `siege` is a stressing tool, use it ONLY to test your own server. Do **NEVER** use it on any server/website without the owner's permission. If you do so you would have illegally DDoSed a server and could face serious troubles.