Menu

ASync Multiplayer Project

Home / portfolio / ASync Multiplayer Project

ASync Multiplayer Project

I followed a course at school where I would learn how to make servers and databases and how to connect them to Unity so we could use them in our games. The final result I got was a asynchronized multiplayer game where you could make an account and battle other players! You can make an account, generate resources, build an army, battle other players in this simple yet complex game.


For this project we learned how to use php and json to transfer data from the live game to the server and then to a sql database on the server. We wrote our own php server code so send the data to the database and send some data back to unity from the database to prevent cheating from the player side. It may not be super efficient yet it does work and for my first time using this is is really nice.


img-Image


Every functionon the php side gets started with this functionality that will check if the token is correct that the player has. The player has made a token the moment that you log in and when you log out the token gets deleted. Without the token you cannot do anything and it works against hacker that try and hack the game.



img-Image


This is the api call that alls the server and gives some data and retrieve some data from the server. In this case you gain resources every couple of seconds so at the top you pass some data like the token and last tick. At the bottom you recieve some data like the gold, lumber and mana.


If you enjoyed this read or have questions feel free to contact me!


Made with:

Download/View project

Share