Mafia Online Game - Dev Report #1
by Kiyaku · 09/11/2008 (1:57 pm) · 4 comments
Hi everybody,
i'm currently working on a mafia online game. Goal is to play with some people (~100-200 planned) in the 1930s. You can form gangs, fight against other gangs, doing a few quests, driving around or just chill in a bar and have a good chat.
The Status
I still don't know the power of the network engine but everything i got so far works just fine. Hopefully it can handle this amount of people but i'm very optimistic about that.
In my current version you can connect to a dedicated server which is runnin gon a root server online, run around with a mafia guy, shooting other guys or just chat with them (local, world and whisper working yet).
Might not be much but i just started last week and i get mor and more working lately.

The updater
Beside the game itself, Thomas Bang, also a member of the GarageGames Community, programmed a updater to get the newest version of the game on the fly.
It's not written in torque but delphi. You can download the ~1MB client, install it, start it and it will automatically start downloading the necessary game files. You have a progress bar, you see which file is currently loaded, it creates a error.log file and so on. When all files are downloaded, a "Start" button will be enabled and you can start the game.
The updater - internals
We would like to talk a bit about how the updater works and maybe some of you could give some comments about this idea, or even suggest a better way to do that.
1) All necessary game files have to be uploaded to a server
2) I wrote a php file that reads the last modification date of every file in the game editor and write that date and the path to the files into a SQL database.
3) The updater itself reads out a file named "options.kdf" which includes several informations.
First, the name of the checkfile. When the updater downloads files successfully, it writes its last changed date into this encrypted file. The next time the updater starts, it checks if any of the downloaded files are older than the one on the server. We decided to write it into a file so nobody can just change their systemclock and manipulate the "last changed" date.
Second, the IP to the update files so the updater knows where it can get the files from.
Third, The IP of the MySQL file so you could seperate the update files and the sql database on different servers
Fourth and Fifth Username and Password to connect to the database
Sixth, the database name
Seventh, Port to the mysql server
Eighth, the select command to choose the name of the table itself.
The options.kdf is encrypted too so no user can change it by itself. Thomas Bang wrote a special OptionsApp to read and write the data from the options.kdf.
4) If there is any new update, i have to upload the changed files to the server and re-execute the php file to get the new dates of the files. I'm not quite statisfied with this method but i got no better idea yet.

So this is all i want to talk about for today. I'm gonna write some updates soon and report about the games status.
Thanks for reading and i hope i didn't make too many gramma mistakes :)
i'm currently working on a mafia online game. Goal is to play with some people (~100-200 planned) in the 1930s. You can form gangs, fight against other gangs, doing a few quests, driving around or just chill in a bar and have a good chat.
The Status
I still don't know the power of the network engine but everything i got so far works just fine. Hopefully it can handle this amount of people but i'm very optimistic about that.
In my current version you can connect to a dedicated server which is runnin gon a root server online, run around with a mafia guy, shooting other guys or just chat with them (local, world and whisper working yet).
Might not be much but i just started last week and i get mor and more working lately.

The updater
Beside the game itself, Thomas Bang, also a member of the GarageGames Community, programmed a updater to get the newest version of the game on the fly.
It's not written in torque but delphi. You can download the ~1MB client, install it, start it and it will automatically start downloading the necessary game files. You have a progress bar, you see which file is currently loaded, it creates a error.log file and so on. When all files are downloaded, a "Start" button will be enabled and you can start the game.
The updater - internals
We would like to talk a bit about how the updater works and maybe some of you could give some comments about this idea, or even suggest a better way to do that.
1) All necessary game files have to be uploaded to a server
2) I wrote a php file that reads the last modification date of every file in the game editor and write that date and the path to the files into a SQL database.
3) The updater itself reads out a file named "options.kdf" which includes several informations.
First, the name of the checkfile. When the updater downloads files successfully, it writes its last changed date into this encrypted file. The next time the updater starts, it checks if any of the downloaded files are older than the one on the server. We decided to write it into a file so nobody can just change their systemclock and manipulate the "last changed" date.
Second, the IP to the update files so the updater knows where it can get the files from.
Third, The IP of the MySQL file so you could seperate the update files and the sql database on different servers
Fourth and Fifth Username and Password to connect to the database
Sixth, the database name
Seventh, Port to the mysql server
Eighth, the select command to choose the name of the table itself.
The options.kdf is encrypted too so no user can change it by itself. Thomas Bang wrote a special OptionsApp to read and write the data from the options.kdf.
4) If there is any new update, i have to upload the changed files to the server and re-execute the php file to get the new dates of the files. I'm not quite statisfied with this method but i got no better idea yet.

So this is all i want to talk about for today. I'm gonna write some updates soon and report about the games status.
Thanks for reading and i hope i didn't make too many gramma mistakes :)
#2
these pointers should improve both your security and reliablility, as well a lowering the needed bandwith of your patcher server.
09/12/2008 (12:23 am)
I wouldn't include the login information with the patcher. But rather have the patcher contact a webserver script that retrives the information for the updater. This way you don't risk anyone extracting the login information. And I would probably look at some sort of bitTorrent tech to handle the download, the Torrent tech is opensource and shouldn't be too hard to implement in to the patcher itself. And I wouldn't rely on reading the cration date on the files since this information is not always accurate (i have seen several occations where this information have been corrupted and/or lost. I would rather have a version number and then patch depending on what version nummer the client have. Use a checksum system to check that all files are accurate to that version number.these pointers should improve both your security and reliablility, as well a lowering the needed bandwith of your patcher server.
#3
09/12/2008 (1:03 am)
Sounds awesome. I'm your biggest fan already :) Sign me up for the newsletter please.
#4
@ Mikael, thanks for your ideas. It sounds good to me and i know it's kinda risky to implement the MySQLs Password and Username on the clients computer.
Right now this system is still good for me, as the game is not public yet and i doubt it will reach such a huge community. If i see that many people will play it and i have lot of connections, i will consider to let the php file get the necessary data.
Actually we did that before we implemented the SQL database into the updater itself. We just had lot of problems with spaces in file names like "Arial (20) bold.*" or something. They are standard files from the torque project i used and i will get rid of such space-filled filenames oneday. Maybe then we could switch back to the php solution.
I'm not that familiar with checksums actually. I know it can check if the file is completely downloaded or corrupt. But not sure about how to check version numbers. I'm gonna read more about it.
Thanks again for your tips, they will help a lot in future updates!
09/16/2008 (12:38 am)
Thanks guys for your nice words! I appreciate that.@ Mikael, thanks for your ideas. It sounds good to me and i know it's kinda risky to implement the MySQLs Password and Username on the clients computer.
Right now this system is still good for me, as the game is not public yet and i doubt it will reach such a huge community. If i see that many people will play it and i have lot of connections, i will consider to let the php file get the necessary data.
Actually we did that before we implemented the SQL database into the updater itself. We just had lot of problems with spaces in file names like "Arial (20) bold.*" or something. They are standard files from the torque project i used and i will get rid of such space-filled filenames oneday. Maybe then we could switch back to the php solution.
I'm not that familiar with checksums actually. I know it can check if the file is completely downloaded or corrupt. But not sure about how to check version numbers. I'm gonna read more about it.
Thanks again for your tips, they will help a lot in future updates!

Torque Owner Ben "Djaggernaut" Chavigner