How do I set my game up to run server side?

Get help using Construct 2

Post » Sat Jan 24, 2015 8:18 am

Hi guys,

As someone with no knowledge and understanding on programming and networking, I am grateful to scirra and the community here for helping and giving me the opportunity step into the world of something I have always loved. I would like to increase my knowledge and understanding on the various approaches to games out there. I do hope that some of you with knowledge in this will be able to help shed some light on this. This is what I would like to create.

1: I want my to store all my game events and variables on a server.

2: The player can't play the game offline, as all the code is on the server.

3: At the start of the game, it will ask the player to enter a name. After that, every time the player achieves a new high score, it will will save the score onto the server next to the name so that it can be easily accessed.

What are the things that I will need to look into and learn to be able to implement this into my game?

Thanks you for any insight and advice on this.
B
42
S
20
G
31
Posts: 685
Reputation: 20,221

Post » Sat Jan 24, 2015 11:02 am

1. You can't store ALL your game events nor variables on the server, there must be some interaction on the client side which involves variables and events, Even a server side game would contain no more than 5% of the game code running on the server i would guess...
2. Yes, you can check the internet connection, to prevent the user playing by cache or downloading the game locally. Technically everything is on the server, but it must be send to the client and therefore become clientside.
3. This is a basic task and i suggest you start here, don't focus on your game running on server side until you have a better understanding what that really means. To get started here, you'll need to setup a way for your game to contact the server and send the player's name and high score. Once the score is received i suggest you save it into a file that is plain text, csv, json or xml (don't bother with a database for this). Also if you don't already know a server side language such as php, that is probably the best place to start.
B
32
S
6
G
2
Posts: 317
Reputation: 2,801

Post » Sat Jan 24, 2015 1:23 pm

@IndieKiwi, thank you for that info.

For 1 and 2, the main reason is because I would seem to be the most secure in terms of not allowing players to hack or manipulate the results. So I would store all the variables in the server making it harder to manipulate, but leave the game codes on the client side because even if they can read all the code, they won't be able to manipulate the results since the variables are on the server?

Does that mean that to implement server side games, I will need to learn a programming language, such as the php that you mentioned? Is this something very complex, or perhaps there are templates out there and we can study the basic to modify and implement the templates to work for our game?
B
42
S
20
G
31
Posts: 685
Reputation: 20,221

Post » Sun Jan 25, 2015 2:17 am

You should be able to get away with using templates with highscores. But doing the other stuff with templates can make you vulnerable if you don't know what is going on.

Serverside doesn't mean it is not hackable. I remember hearing this notion in the days of Runescape; because it is server sided, it can't be hacked. But this is not true at all..
B
32
S
6
G
2
Posts: 317
Reputation: 2,801

Post » Sun Jan 25, 2015 6:23 am

@IndieKiwi, thank you. I see, so it is important to get a good basic understanding of php to be able to implement and understand how it can be exploited.

Does how hard it is to hack serverside games, depend more on the security used by the server company, or more on how we code and implement the games on the server?
B
42
S
20
G
31
Posts: 685
Reputation: 20,221

Post » Sun Jan 25, 2015 6:01 pm

The server host should use the latest stable versions of software and have security features enabled, so if you choose a reliable host, there isn't too much else you can do with shared hosting.

Your implementation would be the most important part, but NOTHING is unhackable and a focus on being unhackable for indie game development without a very good reason would be a blackhole for time, especially with limited resources.

For example if you pick up 10 gold coins and store this on the server by sending a packet. The user could 1. keep sending the packet over and over. 2. modify the gold coin value to be 1000000000 and send it.

Also hosting a game on the server with a reasonable audience won't be cheap.

good luck :)
B
32
S
6
G
2
Posts: 317
Reputation: 2,801

Post » Mon Jan 26, 2015 1:36 am

@IndieKiwi, thanks! That's really informative. Haha it's a plan for a game down the road, but it is nice to start learning and understand. It might help me avoid many mistakes, like maybe implementing this if it really isn't that feasible. Again, thanks for sharing! Appreciate it!
B
42
S
20
G
31
Posts: 685
Reputation: 20,221


Return to How do I....?

Who is online

Users browsing this forum: alextro, tarek2, wenwen11212016 and 7 guests