Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Break - In Heist Multiplayer Game Blog (Week 2)

Week 2 – Planning Player Registration, Login with MySQL and PHP

This week, I began outlining the next major step in my game's development: implementing a secure player authentication and data-saving system. The goal is to allow players to register and log in to the game, while also tracking and storing their scores in a persistent online database. The scores will be implemented in the later part, I mainly focused on Registration and Login and also having a secure password using Hash and Salt so that even if a Hacker looks at our database he won't be able to see our password.

To achieve this, I will be using:

  • MySQL as the database management system to store player information (e.g., usernames, passwords [hashed & salted] .
  • MAMP (Mac Apache MySQL PHP) as the local development environment, which allows me to run a full web server stack on my machine.
  • PHP scripts to handle server-side logic for registration, login, and score updating.

Key Features I’m Aiming to Implement:

1. Registration System:

Players can create a new account which takes a username and password both have to be minimum of 8 characters via a form.

PHP script will validate and sanitize input data.

Passwords will be hashed before storing in the database for security.

Main Menu Scene

The first scene the player sees after the Loading Scene ( the Play Game button function is still under works it has no meaning for now might be removed in the later update).

Register Scene
Here you enter the credentials which will be later used in the Login Scene

2. Login System:

Players can log in using their existing credentials.

PHP will authenticate input against stored hashed passwords.

A session/token system may be used to manage login state.

Login Scene
Here you enter the credentials that you used to register your account and then click "Login" (I know the UI needs more work but i am just building basic prototype for now )

3. Score Saving and Retrieval: 

Once logged in, player scores will be stored and updated in the MySQL database.

This ensures player progress is persistent even after quitting the game.

4. Secure Communication:

I plan to implement measures such as SQL injection prevention, password hashing  and salting using password_hash() and password_salt() using the sha-256 encryption method to encrypt the password ( I have kept it to 5000 rounds , the more rounds you enter the more secure and encrypted your password becomes , but it may affect the loading time)

While everything is currently being tested in a local environment via MAMP, the long-term plan is to migrate the database and PHP files to an online hosting server, making the system accessible across the internet.

MAMP

To access your host and database

What's Next

In next week's blog, I aim to show working screenshots and breakdowns of the PHP scripts, database schema (mySQL), and Unity integration (likely using UnityWebRequest for server communication, a bridge between Unity and the mySQL Database on a server).

References

  1. https://www.mamp.info/en/downloads/(MAMP Download)

Support this post

Did you like this post? Tell us

Leave a comment

Log in with your itch.io account to leave a comment.