🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

MMORPG how do you keep the data?

Started by
7 comments, last by Azrael 23 years, 11 months ago
Im doing a little 2d MMORPG for learning purposes, everything is going neat im using winsock2 udp and tcp/ip combo so lag is not a problem a friend is helping me. However I was wondering how can I actually save the data of my characters (right now, we start all over again every time you get in) how can games like ultima save thousands of characters and read the data for each so fast? what do they use? SQL with precompiled queries or something? and how do you do it from visual c? I know how to do it in ASP but I have no idea on how to do it in C++... I''d really apreciate any help on this, thanks!
Advertisement
a really simple way: save the character''s data to the player''s harddrive...but encrypt it with your own special code that nobody will be able to decipher.

ultima online saves the character''s request query to a file and when the character logs out. when the character logs back in, it contacts the server with that data and the server sends back all of the data.
==============================
whats a signature?
htm[s]l[/s]
I think you should save that data on the server, either in a database using SQL (don''t know how to do it in C++) or just write it down to a file (or several files, on for each user or something). That way the user can play from any computer he chooses and does not have to worry about losing his character if his harddrive crashes. It also allows you to easily run statistics on the characters, check for cheating and make adjustments to stats etc. if the characters are stored on the server (something that might be especially important to do while the game is in development).

Experience also shows that you should not underestimate users when it comes to breaking or tampering with home-made encryption codes. Storing the data on the client would also increase the amount of data sent over the connection, something that I think one should try to minimize.

QUESTION? Anyone know how they represent the maps of 3d games like EverQuest and Asheron''s Call on the server? In EverQuest I suspect they use some kind of 2d representation along with some precalculated (or even hand made) path-finding information for the NPCs, but how do they handle places with many different levels where the map really uses the 3rd dimension (like towers, caves, bridges, multileveled parts of cities etc.)?

Henry
A rather simple player-data storage method used by MUDs uses text files.

You create a "player" directory beneath the home directory of the server process. All player data is stored in a file in the "player" directory using their player name. When the player logs in, you take their name and load their data from the "player" directory.

The actual data stored in the file is formatted with a different value-name and value per line of text. For instance:

NAME ''DavidRM''
DOLLARS 828963
CHOICES 51
SHOTS_EVER 43364
SPLATS_EVER 12039
BONUS_EVER 10049000
...

While not the most space efficient storage mechanism, it allows for an incredible amount of flexibility--and even the option to "tweak" player data using a text editor. Both of which can be very handy for the game still in development.

If you isolate the player data load routines appropriately, you can easily change the storage and retrieval mechanism to something more "modern" (like a client-server database) at a later point in development.


DavidRM
Samu Games
If you build it........they WILL crack it.
NOTHING you put on the user hard drive is invunerable to being cracked. You save the character on the user drive and there will be hacking/cracking/cheating. You need to save on the server side (and hope noone hacks your server which can be done as well).


"Now go away or I shall taunt you a second time"
- Monty Python and the Holy Grail
themGames Productions

I believe AC and EQ use height maps for terrain. That''s the standard method. For actual leveled areas like buildings, they may use layered height maps, so there''s one for the main level/outside, and smaller ones for each level of a structure.


Pax
p
Ok, thanks Pax, height maps was my guess too. It would seem that those would be bad for complex buildings but I guess the games cheat by using the actual 3d levels that are stored in the clients to do part of the work (it would be hard to determine the thickness of a floor or the height of a window just by looking at the height maps but the games probably use client side collision detection on the 3d models of the buildings to deal with those cases).

Could layered height maps be used effectively to model really complex buildings (skyscrapers and other buildings with lots and lots of levels) or does anyone know of any technique that could be combined with height maps to handle such structures in a better way? Also, does anyone know if there are any problems with using height maps to model dynamic worlds where buildings are built and destroyed and terrain changes over time?

Henry
They could. There may be better ways. Height maps are useful for large areas of uneven terrain, particularly outdoors. When you get into buildings, the floor is flat except for obstacles (chairs, desks, etc.) and ramps or stairs. This would be a good place for a constant height with exceptions (obstacles). In this case, you just have an area defined as the floor and objects defined for all obstacles. Walls, ramps and stairs are different. Traditionally, BSP trees are used in these cases (Quake, etc.).


Pax
p
Ok, so heightmaps are good for ground and floors in buildings but how do you effectively combine them with walls? In a MMRPG you can not do all the collision detection with walls in the client. If you do, hackers will be able to run through walls by tampering with the client. Using BSP-trees and other kind of 3d collision detection is really out of the question when you need to do it on the server.

I guess one would need to combine the height maps with server-side 2d ''wall maps'' that define the walls and keep players from walking through them. Fine-scale collision detection can be done against the 3d models on the client (such as forcing a player to jump through a window rather than just walk through it). It really would not matter if a hacker tampered with the client so that he could just walk through the window since he would be able to get through it anyway by jumping. The problem with the wall map approach arises when you want to have dynamic worlds. It might be tricky to get the computer to create wall maps that correspond to the structures that the players build and destroy in their 3d clients.

Henry

This topic is closed to new replies.

Advertisement