Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Online RPG Databases in DarkBASIC Professional?

Author
Message
vampire2948
14
Years of Service
User Offline
Joined: 16th Jul 2010
Location:
Posted: 18th Jul 2010 00:38
Hey,

Sorry to post again so soon. But... hey, this is a newcomers area. And that is what I presently am.

I'm trying to work out the best way to create a server that will work for a small online RPG type game. Recieving data such as location, items in inventory, and all the other things that go into ORPGs.

What's the best way to go about this? Do I have my client send the server a packet involving, say, a change in vector, or aquiring an item, everytime it happens?

I'm fairly new to servers. I have the DarkNET addon aswell as DarkBASIC Professional.

Anyway - Shortened and more clear form of my question:

What's the best way to go about coding a server/client for DarkBASIC Professional+DarkNET? Can anyone point me toward a book/website/similar that might be helpful?

*goes back to googlin'*

Thanks!
Vampire2948,
KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 18th Jul 2010 04:49 Edited at: 18th Jul 2010 04:51
http://www.kistech.com/page.php?15

Is a link to a plugin I made called DBConn. It lets you connect your DBPro program to any ODBC data source. I currently use it to access the Microsoft SQL Server 2000 database that drives the MMORPG that I'm currently working on.

As for how to write it, that's something that you'll have to design based on your integral knowledge of the game you are making.

In general however, if you are going to do any kind of online game, you have to have the clients tell the server everything. Player movements, inventory transactions, battle attacks, everything. Then the server needs to determine if the data is within acceptable limits for that particular type of data packet, to help prevent cheating, and then the server needs to send that data to all the other players that it's relevant to. For example, you wouldn't send information about a battle to a player that's in the next town. There wouldn't be any point, because they can't see it anyway. You would however send it to the players that are within 50 feet of the battle, so they can watch or join in.

Even for a small Online RPG, there is a lot to consider. You are on the right track with DarkNet though. It's an excellent networking plugin.

vampire2948
14
Years of Service
User Offline
Joined: 16th Jul 2010
Location:
Posted: 18th Jul 2010 14:19
Thank you. I hadn't considered checking packet size. And thank you for the link.

Vampire2948,
vampire2948
14
Years of Service
User Offline
Joined: 16th Jul 2010
Location:
Posted: 18th Jul 2010 16:00
So, I'm trying to work out how to get information sent to the server.

If I am using an array method of storing data, and my item array looks like this:
(This exists on the server.)



Now, if the player finds an item in-game. Say, s/he buys it from a vendor. What would be the best way to code this?



So, if that code is correct... [which I doubt. /newbie coder] then the Client that requested the packet will now have the packet.

Now the client can take the packet and use the data for things.



Then I somehow make the packet fill up those arrays with the data that was put into them from the previous arrays.

Can I just load an entire array into a packet without doing all the fiddling about with individual elements? I don't see a command for that in the DarkNET documentation.



Once again, I've made a fairly vague question. Basically, I'm trying to work out the best way to make a client query a server for an array (or the contents of the array), and have it sent and recieved.

A code snippet of a system that does this would be appreciated.
Or else a pointer as to whether using arrays is the best way to do this... or if I should be doing it differently.
I'm waiting for my Dark Data purchase to be approved - at which point I might be able to use the databases in that for this, rather than arrays?

Thanks,
Vampire2948,
GIDustin
16
Years of Service
User Offline
Joined: 30th May 2008
Location:
Posted: 23rd Jul 2010 02:17 Edited at: 23rd Jul 2010 02:57
Quote: "Is a link to a plugin I made called DBConn. It lets you connect your DBPro program to any ODBC data source. I currently use it to access the Microsoft SQL Server 2000 database that drives the MMORPG that I'm currently working on."


I too am working on an MMO type game. I currently use CR's plugin to connect to MySQL but I am having some problems with it. I am talking to him via email, but not sure what all he can do. You got me thinking of switching to an access DB instead of MySQL because it looks alot easier to backup that one file than an entire MySQL Database...

Edit: The following command fails to run on Access but works on MySQL: SELECT UNIX_TIMESTAMP(NOW())

@vampire2948
An MMO is a massive undertaking, and the server has to be top notch or you end up with a non-massive game. Are the items in your MMO fairly well decided or can they be created in game? Instead of the server sending all that information about the item, you might have the client already know about the items existence by having the same "item database" in the client code as the server. Then there is less information for the server to send each client.

When you send information between the server and clients, before you tell the other end all the information you need to tell them what information it is. You can add that at the beginning of your code:



That is the format I use for most of my packets. But again, I think your Client should know as much about the game as possible to avoid sending too much data across the net.

bitJericho
22
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 31st Jul 2010 14:06 Edited at: 31st Jul 2010 14:08
But then your players can easily cheat.

Also, access would not be a good alternative, as access cannot handle the load a mysql server can.

Also, your game server can backup your database easily with a couple commands. Or you can connect remotely, or locally, and pull the data with a few commands. It's only marginally more difficult to backup a mysql db vs an access db.

Login to post a reply

Server time is: 2024-11-16 16:07:56
Your offset time is: 2024-11-16 16:07:56