Create a turn-based multiplayer game in C. Upload your workspace in a ZIP file named <9-digit ID#>_mp2.zip (e.g. 201212345_mp2.zip). The ZIP file will contain the following elements used to implement the system described below
- Client C files
- Server C files
- Common C files (if any)
- Header files (if any)
Specifications are as follows:
- Run the server, indicate the max of players (minimum of 2)
- The server will wait for the specified number of users to connect before the game starts
- Client provides their ID before connecting (alphanumeric string, no spaces)
- Broadcast to all connected players who recently joined
- Start game when all slots have been filled
- Game Mechanics:
- Each round, the player can perform the following:
- a player id = attack specified player
- b = block
- c = charge
- All active players should make their move for the round to end
- Player can only attack after charging
- can store one charge only
- Player can only block one attack
- if multiple players attack while blocking, player gets total damage - 1
- Player can take 3 damages
- Server broadcasts to all player the moves of every player AFTER every round so other players do not know
- Server broadcasts to all player the status of each player (charged, hits left, out of the game)
Hint/Suggestions:
- This is essentially a TCP socket chat system
- start with point to point connection/communication
- then expand to point to multi-point (client to server, server to clients)
- Server will need to broadcast commands/states to clients to indicate that the game has started/ended
- You can implement the system without forking (turn based so send/receive has a fixed sequence)
- forking would be useful if you plan to implement a time-out
- Put all user input validation on the client side to simplify server processing
Grading System:
- 30% - Joining System
- 30% - Broadcast System
- 20% - Move processing
- 10% - Player Status
- 10% - Working Game
- 10% - Bonus features you added