Game Development Community

Persistent Characters and MMORPG Network Architectures

by BrokeAss Games · in Torque Game Engine · 12/02/2005 (6:32 am) · 137 replies

It seems there are quite a few flavors of database and network architectures here on GG for creating MMO games (be warned, making MMOs creates hair loss).
Dreamer, Kyle Cook and others have inspired me to create this thread.
I personally have been running a MySQL variant for about a year on a cluster at my server farm.
As far at the base mechanics go, the system works great and we haven't found any bugs during testing.
It could still use some work and new features but so far so good.
Lately I have been pressed for time (invite only beta opens Jan1-06) so I haven't had time to seperate my persistent character code and post it (yet).
I know alot of people are working on this type of feature and I would like to open a discussion about it and hopefully share/blend up some features/ideas/code.

My current setup:
A MySQL database w/ offsite backup (All game and cluster servers talk to this, currently clients are not allowed).
2 Master Servers w/ clients/servers using both for failover.
Chat Server (for between server communication).
Cluster Controller (game server that reads MySQL data and says you need to be on this other server and has you connect to it *still under construction).
4 Zone Servers (dedicated game servers)

Currently we have health, energy, special, experience, inventory, position and orientation loading and saving.
Ours is a hack of Armor::onAdd and Armor::onRemove, it's sounds bad, but it works REALLY well.
When our team logs into the game they are right where they left off.

I'm pretty tired (no caffine yet) so I'm out for a bit.
When I get some time and energy I'll started posting what I have running (w/ code).
Just wanted to start this thread so some of us could share ways to do peristent characters.

@Dreamer, Kyle Cook and others.
I hope to see you here.

Ari
Page «Previous 1 2 3 4 5 6 7 Last »
#1
12/02/2005 (6:35 am)
Currently I'm using the MySQL for TGE code for my database interface.
#2
12/02/2005 (6:36 am)
Kewl man thanks
#3
12/02/2005 (6:41 am)
@Dreamer
Woah, damn you're fast!
Got them links to the SQLite code and maybe post links to your tuts?
I'm hoping this thread will have a little for all of us.

Ari
#5
12/02/2005 (8:28 am)
Greetings!

I've added this thread to my Massively Multiplayer Game Resource. That reminds me that I need to turn this resource into a page on TDN so we can all add to it.

Thanks for sharing, guys!

- LightWave Dave
#6
12/02/2005 (9:03 am)
Hey Ari, the MMORPG tutorial series is currently being revamped.
For now, the series 1 and the Advanced won't work at all under 1.4

As soon as TGE 1.4 can compile under linux (who the heck would want to run an MMO (at least the server portion) under windows anyways), there will be a wiki site launching that will contain my deffinitive MMORPG tutorial series.
Launching shortly thereafter will be a complete MMORPG, truly MMO this time (I now have the bandwidth to handle it, and enough servers at my disposal to pull it off pretty easily).
This will be the final iteration until I can get TSE to compile under Linux, which will probably take a year or two.
The wiki site would be a much, much better thing to point to.
I will get you a link as soon as I know for certain the domain name I registered is properly pointed.
#7
12/02/2005 (11:39 am)
I'm strongly leaning towards using an XML/RPC style interface to talk to a server running PHP, and letting that access the database. JSON is also an idea for communication (its aimed at web 2.0 Ajax style applications atm). JSON is a very lightweight communication protocol, as opposed to the fairly bloaty XML/RPC, but could be a pain to implement.

My basic idea is to have the users client hashing the users CD-Key with a unique session key the server gives out, using this to authenticate themselves with any servers in the system, they being able to check with the master that its a valid key.

I dont see the need to randomly access the server lots of times from the client, so this shouldnt be a drain on resources.

This also open the possibility to check for duplicate CD-Keys, and dynamically ban them etc.

I was hoping to get the Dynamic Gui resource, but it seems to be gone, that would allow a greater level of customisation.
#8
12/03/2005 (5:45 am)
Hi Ari,

just started a MMO as a newbie (with TGE - but not with database programing)

So at first I would like to say thank you for all your help and resources you post here!
#9
12/04/2005 (12:03 pm)
@ Dreamer: Is your Wiki site available yet? And will it work with 1.4?
#10
12/04/2005 (12:40 pm)
This is great folks!

Our project is currently battling this too, so I am looking forward to sneaking around here. And who knows maybe at some point even share some usable info.

Thumbs up!
#11
12/04/2005 (12:56 pm)
Would be nice for some of you guys to get together and put resources into an original MMOG made with Torque. Something other than D&D style (hack & slash).
#12
12/04/2005 (1:30 pm)
"Something other than D&D style (hack & slash)."
I cant agree more, and maybe that is why 'we' are doing just that ;o)

(hard to explain -without loosing the originality) -but we are working
#13
12/04/2005 (4:08 pm)
Quote:Would be nice for some of you guys to get together and put resources into an original MMOG made with Torque. Something other than D&D style (hack & slash).
I think alot of people feel the same way. :)
We are working on one called Ruin.

I'm hoping to post our persistent character code here soon.
It is based off of the RTS, Dreamer's Logins R US and Pick a Char Any Char! code but has been modified to work with MySQL, save and load position, inventory, stats, experience and a few other things.
I have also noticed that the MySQL for TGE code seems to support SSL for Game Server to Database communications.
I'm thinking that this would allow for us to create some code based off of Dreamer's Datablock to Database theory, create some GUIs for admin use in game that talk to the MySQL server securely.
The end result would be GUIs w/ 3D views, sliders, etc. that allow to edit and create items that would appear/change after server reset.
I'm still very new to C and working on my TGE.
Can DataBlocks be created during runtime or is a server reset required?
It seems to me that it can be done during runtime as-is if serverCmds were called to call the functions that created/updated the various DataBlocks.

Ari
#14
12/04/2005 (4:14 pm)
I totally scrapped the whole PHP/HTML 3 tier approach for SSL and direct communication to the server.
Can some one more experienced explain why this is bad?
I think I'll be ok, but I'm hoping to hear the cons of doing this so I can switch or be prepared.

Ari
#15
01/12/2006 (4:51 pm)
I've currently got a WAMP server communicating with Torque via the "Persistant Character Server" resource posted here ages ago. The only thing I'm confused about is how the server knows it's the game server accessing the pages and not someone typing them into his/her browser.

For example,
http://www.blah.com/game/givecredits.php?userid=1&credamount=1010232


being the site where people can add all sorts of money credits to their player.

How do I run checks and do I have to every time? Maybe a cookie? I dunno. I'm lost there.
#16
01/15/2006 (9:19 pm)
IMHO, PHP, while functional, is not exactly the best way to go. It requires a lot of additional services (namely a webserver) and is not the quickest solution under high load... If it takes 3 seconds for a web page to load you don't mind... but 3 seconds in-game is a lifetime. Running a webserver exposed to the internet creates an entirely new category of maintenance and security concerns.

I would highly recommend an alternative... Such as coding a custom server.

In our early stages, PERL was excellent for this due to the fact that it is multiplatform and includes a slew of ODBC libraries. The project had a PERL script operating as a query server. This script would listen for connections on a particular port and then process queries from clients. It would then directly interface w/ the MySQL server and return responses. Infinately faster than PHP.

We've now moved to a .NET application that operates as a query server. The database is MSSQL2005 (just upgraded from 2000).

Our next step is to move to Oracle 10 on a linux system, but keep the query server in .NET.

OMG! Not commercial software!!

Yup... Sorry.

There's a few reasons we decided that it's worth spending money and using common-market commercial software.

#1 - It's a HELL of a lot easier to find .NET, MSSQL and Oracle developers than PERL and MySQL developers... especially ones that will work in their spare time or on the cheap. .NET developers are $12/hr. PERL developers are $20/hr.

#2 - We want to sell our idea to a commerical publisher if we cannot raise the funds to complete the project ourselves. We feel that our project will be more marketable to a publishing house if we use technologies that run Fortune 1000 companies. Basically, our version of "No one ever got fired for buying IBM."

#3 - MSDN Premium Subscription = $1,200. All the software you will EVER need for developing a commercial product. Given the price of Visual Studio by itself, taking that extra step and buying a MSDN Premium Subscription in the beginning saves you worlds of time later in the development of your project.

PERL, PHP and MySQL are WONDERFUL, PERFECT products if you are on a budget.

But I STRONGLY recommend that if you are out to create a professional product, you start with professional tools.
#17
01/15/2006 (10:28 pm)
A well configured PHP/MySQL setup can be just as effective. Its pretty simple to setup permissions to only allow access from certian IPs. Also, if you install PHP-Accelerator it precompiles your scripts and your performance will be top notch. If you doubt that all you need to look at is Yahoo:

news.com.com/2100-1023-963937.html

Never doubt the power of open source.
#18
01/16/2006 (5:45 am)
Greetings all :)

Personally, I think it is what are you trying to accomplish.

If your trying to build a real indie MMORPG then you will obviously be fighting the budgets and cost constraints to accomplish the project and as such, the "opensource" solutions will probably be best, and lets face it, they are not shabby these days, in fact many are excellent.

If, like me, and I suspect Bryce, above, you are actually aiming for sponsorship and named label release, then what I am doing is prototyping the game in Torque to get together a sufficient flavour to allow the "suits" to see the potential of the ideas, and to ensure that the "team" is capable of providing the goods, if the money is present.

As such, for a demo, all we are using is SQLite, because we know hat as soon as we get funding, everything gets binned and we start from scratch.. like Bryce above using full commercial software and home grown development code so that a) we have support when things do go wrong, b) we can find specialist coders more easily and c) we can not have any worries about licence and release in any form.

I guess its just horses for courses, but I guess the answer from me is.. Purely operating on SQLite, but not expecting that to be a commercial solution in any way, shape or form :)

Regards

Graham
#19
01/16/2006 (10:51 am)
To slide between Cogburn and Peter:

A much easier solution that is easily upgradeable to a "commercial" solution is to implement ODBC within Torque, and then use whatever db backend you like. That way, you can easily upgrade your backend db without having to change much (if any) source level code.
#20
01/16/2006 (11:10 am)
Another option I have not seen here at GG is using either BerkeleyDB for GNU dbm.

For my project I was considering using BerkeleyDB instead of a standalone DB. So the DB routines become part of your application code, in this case Torque. It's not in the same league as Oracle or other RDBMS but it warrants a look in my opinion. Of course you will need to purchase a license once you ship code and I'm not exactly sure of the cost of that. If price is an object then you may look at gdbm which is similar and under the GPL.

Steve

[ After posted comment ]

I realize that this option wouldn't work too well for a full-blown MMO game, however, for a small multiplayer game where you want some persistence I don't see why it wouldn't work. Heck BerkeleyDB even has transaction support.

Another option is to use the PostgreSQL database. Nobody ever mentions that free open-source database and its just as good or better than MySQL. Plus you don't need to purchase a license since its under the BSD license. I'm thinking a lot of people probably don't realize they need to purchase a license for MySQL for their commerical projects.
Page «Previous 1 2 3 4 5 6 7 Last »