Zappy is an automatic video Game where AIs play with each other, The Game is about building a world and managing its population; we are going to call this world Trantor.
- The "Trantorions" lives in harmony and peace with everyone, They only eat food so they Can stay alive, look for stones, pick them up to create totems, and have a ritual to get to the next level of the game, it will be all explained later.
- Each level has different requirements for a ritual, making the adventure more and more difficult for the AI players, who play independently without help from their creator.
### Players
- If a player (or you call it a client ) Join the game, it does not Join as one character in the game, but as six characters or players play in the form of one team, the game does support Multiplayers, but players cannot share data between them outside the game in any way.
- Teams play the game.
- The game is over once six members of one family reach the highest possible level (8).
- 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 ritual that allows increasing the Trantorian physical and mental capacities must be accomplished according to a particular rite. He needs to bring together the same field unit:
- A combination of stones
- A certain number of players of the same level
- The player will start the incantation, and the elevation will start.
- Not all the players need to be on the same team.
- Only their collective levels matter.
- All players within the incantation group will reach a higher level.
- Passed on from generation to generation, the secret to the elevation goes as such:
| Level | Number of Players | linemate | deraumere | sibur | mediane | phiras | thystame |
- For multiple reasons, the player's vision 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 three levels, the first two elevations, the following vision (our player is on 0):
```console
---- ---- ----
| 1 | 2 | 3 |
---- ---- ----
| 0 |
----
Level 1
---- ---- ---- ---- ----
| 4 | 5 | 6 | 7 | 8 |
---- ---- ---- ---- ----
| 1 | 2 | 3 |
---- ---- ----
| 0 |
----
Level 2
----- ----- ----- ----- ----- ----- -----
| 9 | 10 | 11 | 12 | 13 | 14 | 15 |
----- ----- ----- ----- ----- ----- -----
| 4 | 5 | 6 | 7 | 8 |
----- ----- ----- ----- -----
| 1 | 2 | 3 |
---- ---- ----
| 0 |
----
Level 3
```
For the player to know his surroundings, the `client` sends the command `SEE,` and the server responds with the following chain of characters (for level 1):
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.
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.
When the egg hatches a new player pops. He is oriented randomly. This operation authorizes the connection of a new client. The `connect_nbr` command returns the number of authorized and unauthorized connections for this team.
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.
### Teams
In the beginning, a team is made of n players and only n. A client controls each player. The clients cannot communicate or exchange each other data outside of the game in any way.
In the beginning, the client has ten life units; he can survive 1260 time units, 1260/t seconds.
### 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 at 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 communication between client and server will happen via sockets and TCP. The port used will be indicated in the program's parameters.
The client will send its requests without waiting for their execution, the server sends back a message confirming the successful execution of the requests.
The connection client to server will happen as such:
> The client can send successively up to 10 requests without a response from the server. Beyond 10 the server will no longer take them into account.
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.
The project will have 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 will integrate at least a 2D visualization through icons allowing a representation of the world. You also 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.