Open-source online game techniques
Posted: Mon Dec 21, 2009 8:06 pm
I've been thinking about very simple morpg like game (like mmorpg, but not as much players, can't host powerful enough servers ). Löve games are open-source, but after reading this interesting thread there seems to be some ways to prevent players from reading straight from .love file (luac). It probably solves these problems for most of little online games, but I'm still interested in the idea of open-source morpg.
I'd like to have ideas and examples (from games that does this, not actual code) in this thread about techniques for writing open-source online game, with server and number of clients playing on it. There's too big temptation to modify the code a bit to i.e. run faster than others in the world. But it would be great to share the code for server and I'll start with some ideas:
md5sum: After game is started and loaded needed .lua files, it compares client files with server's own files and if they're same, then lets the client to connect. I'm not too good löve+lua coder, so problems that comes to my mind are, that you can't read the .lua files on the run for comparison. Or you can modify the files on the run (would pretty much make the comparison at the start useless). Tried to find md5 things for lua+löve on forums, but didn't find anything useful, so that could be problem too. Some people said it was impossible to do it in Löve, but I'm not sure about that.
Calculating everything on the server: One idea that came to my mind (and was suggested in the thread I linked) is to do all the important calculations on the server and send data needed for displaying the game right to the client. This is of course very power consuming for the server to do calculations for i.e. 50-100 players at the same time, and very lagging without proper net lines.
Correcting the client: One idea, which is similar to above, is to calculate i.e. players movement on the server (which is again, power consuming) and on the client itself. Server just sends correction x and y values from time to time to the client and it corrects it's position. It would be very annoying for player to modify it's character faster than it should be, but then it gets corrected every 3 seconds.
Can't think clearly for anything more now, but there should be more ideas like this to prevent cheating even if it's open-source game. Shoot ideas!
I'd like to have ideas and examples (from games that does this, not actual code) in this thread about techniques for writing open-source online game, with server and number of clients playing on it. There's too big temptation to modify the code a bit to i.e. run faster than others in the world. But it would be great to share the code for server and I'll start with some ideas:
md5sum: After game is started and loaded needed .lua files, it compares client files with server's own files and if they're same, then lets the client to connect. I'm not too good löve+lua coder, so problems that comes to my mind are, that you can't read the .lua files on the run for comparison. Or you can modify the files on the run (would pretty much make the comparison at the start useless). Tried to find md5 things for lua+löve on forums, but didn't find anything useful, so that could be problem too. Some people said it was impossible to do it in Löve, but I'm not sure about that.
Calculating everything on the server: One idea that came to my mind (and was suggested in the thread I linked) is to do all the important calculations on the server and send data needed for displaying the game right to the client. This is of course very power consuming for the server to do calculations for i.e. 50-100 players at the same time, and very lagging without proper net lines.
Correcting the client: One idea, which is similar to above, is to calculate i.e. players movement on the server (which is again, power consuming) and on the client itself. Server just sends correction x and y values from time to time to the client and it corrects it's position. It would be very annoying for player to modify it's character faster than it should be, but then it gets corrected every 3 seconds.
Can't think clearly for anything more now, but there should be more ideas like this to prevent cheating even if it's open-source game. Shoot ideas!