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 / Guide: How to make an MMORPG

Author
Message
calcyman
17
Years of Service
User Offline
Joined: 31st Aug 2007
Location: The Uncertainty Principle
Posted: 14th Oct 2007 19:20 Edited at: 14th Oct 2007 19:52
First of all, it is best to break it up into stages:

RPG:

Section 1.1 - Initialising the game
Section 1.2 - The Inventory Array
Section 1.3 - Controlling your character
Section 1.4 - Collision
Section 1.5 - Enemies
Section 1.6 - The massive diversity of items, enemies etc.
Section 1.7 - Triggers

MMO:

Section 2.1 - Building a successful server system
Section 2.2 - Creating a net game
Section 2.3 - The tree approach to MMO's
Section 2.4 - Reducing Latency

I can't be bothered to invent a signature
calcyman
17
Years of Service
User Offline
Joined: 31st Aug 2007
Location: The Uncertainty Principle
Posted: 14th Oct 2007 19:22
Section 1.1 - Initialising the game:

Firstly, we need a world for the game to inhabit:
Advanced Terrain is good for this purpose.

However, if you are aiming for an MMORPG it is best to split the game up into levels.

A way of initialising a level is on this thread:

http://forum.thegamecreators.com/?m=forum_view&t=89100&b=19

That will guide you through the world-building process

I can't be bothered to invent a signature
calcyman
17
Years of Service
User Offline
Joined: 31st Aug 2007
Location: The Uncertainty Principle
Posted: 14th Oct 2007 19:26
Next we need to make arrays for the game:

A user defined type would be good for a monster:

We will include:

Object Number
Monster Name
X Position
Y Position
Z Position
Hitpoints
Strength (Various values such as attack, defence etc.)

Anything else you need specific to a monster



After making a monster type, we need to make an array:

DIM monsters(1000) as monster

I can't be bothered to invent a signature
calcyman
17
Years of Service
User Offline
Joined: 31st Aug 2007
Location: The Uncertainty Principle
Posted: 14th Oct 2007 19:31
Now that we have a monster type and array, it would be good to start on another concept.

Let's choose items. We will need:

X Position
Y Position
Z Position
Object Number
Item ID
Timer
Name$
Quantity - (This is good for coins, as drawing millions of objects would cause latency, not to mention CPU explosion!)

We need 2 arrays:

Inventory(32) as item
Itemsonfloor(1000) as item


By the way this "1000" and "32" are just arbitrary values. For instance, on the game RuneScape, there is a maximum of 28 items in inventory.

Later, when the character collects an item, we will just move the UDT from the itemsonfloor to inventory. We will have to check for aliasing as well.

I can't be bothered to invent a signature
calcyman
17
Years of Service
User Offline
Joined: 31st Aug 2007
Location: The Uncertainty Principle
Posted: 14th Oct 2007 19:35
Section 1.2 - The Inventory Array:

We have already explored part of an inventory, but there may be other items specific to certain slots. For example, you might choose to have a "weapon" slot and "helmet" slot.

That is where the Item ID comes in.

We will need a 2D array storing all the Item ID's that can be equipped in that slot.

Consider having 6 slots:

Armour
Helmet
Weapon
Shield
Magic Spell
Boots

We then need to create an array of something like (100,6)

We will then put the ID's of bronze helmet, Titanium helmet etc. in one column, and the corresponding ID's in the other columns.

I can't be bothered to invent a signature
calcyman
17
Years of Service
User Offline
Joined: 31st Aug 2007
Location: The Uncertainty Principle
Posted: 14th Oct 2007 19:37
We also need a GUI for the Inventory. BlueGUI should suffice, but should you want to get fancy you could use your own images (e.g. a mossy stone-style buttons etc. for a Medieval MMORPG)

You then need to check whether an item being dragged into a slot can actually be equipped there, and we will do so by use of the (100,6) array.

I can't be bothered to invent a signature
calcyman
17
Years of Service
User Offline
Joined: 31st Aug 2007
Location: The Uncertainty Principle
Posted: 14th Oct 2007 19:47
Section 1.3 - Controlling your character:

For this we will be using something called XCollision, together with Advanced Terrain's own system. When we create the AT world we will designate certain areas to have certain 3D models. When you approach that area you will use XCollision for that model. The thread for XCollision is here:

http://forum.thegamecreators.com/?m=forum_view&t=10315&b=6

We will also be using the AT version of the Get Ground Height() command. This, as shown in DBC tutorial #23, allows you to walk over an uneven terrain.

But first, we need to control the character.

The control object using arrowkeys() will suffice.

Next, we need to check to make sure the gradient is not to steep. We will check the heightmap, and find the difference between the heights of the 2 points:



We will need to use this expression on bitmap 1, which we will allocate to the heightmap image.

We then need to check that we are not walking into a substance like lava.

We will use bitmap 2 for a map of substances.

We have 16,777,216 different colours at our disposal. That is the maximum number of different terrain types.

By using a POINT() command on bitmap 2 we can get the terrain type

I can't be bothered to invent a signature
calcyman
17
Years of Service
User Offline
Joined: 31st Aug 2007
Location: The Uncertainty Principle
Posted: 14th Oct 2007 19:52
Section 1.4 - Collision

It was not accidental that I made the collision follow on from Controlling your character. We will integrate the XCollision source code into our own.

But first, we need to make that INTERSECT OBJECT() command change depending on which model we are near. We will allocate a set of 6 coords for each model, so hat we know which model to check for.

But what about collidng into monsters?

We will use Sparky's DLL for this. It is faster than the native DBPro collision commands.

I can't be bothered to invent a signature
calcyman
17
Years of Service
User Offline
Joined: 31st Aug 2007
Location: The Uncertainty Principle
Posted: 14th Oct 2007 19:55
Section 1.5 - Enemies.

We need to make a basic AI system for these monsters.

This will include Raycasting, A* pathfinding and animalistic behaviour. I believe these can all be taken care of using Dark AI.

Next, we need to give each different species of monster a different ID. This ID will be used for detecting which items it should drop.

We already have the array for a monster's properties, as we initilaised near the top of this thread.

I can't be bothered to invent a signature
jasonhtml
20
Years of Service
User Offline
Joined: 20th Mar 2004
Location: OC, California, USA
Posted: 14th Oct 2007 20:21 Edited at: 14th Oct 2007 20:23
um... before you get into this, im curious... how much programming experience do you have? (and networking experience?) judging by your join date, no one will take you seriously

and some of the things you posted are much easier said than done. for example, collision can be problematic, yet you glide over that topic with little less than a paragraph...

calcyman
17
Years of Service
User Offline
Joined: 31st Aug 2007
Location: The Uncertainty Principle
Posted: 14th Oct 2007 21:10
Collision is not problematic if you use the source code form XCollision.

And this tutorial is just to highlight the key points of an MMORPG, and how to go about doing that. It will have to be left open-ended, as there is a wide variety of MMORPG's. The purpose of this tutorial is mainly to help people have a strong starting point on which to expand as they see fit.

I can't be bothered to invent a signature
calcyman
17
Years of Service
User Offline
Joined: 31st Aug 2007
Location: The Uncertainty Principle
Posted: 14th Oct 2007 21:14
Section 1.6 - The massive diversity of monsters, items etc.

There is an annoying loop involved in creating an MMORPG. It begins here:

You need media to create items etc.

The key hint about this section is just to make a few different objects before integrating them into your game, or otherwise your game will just collapse.

Do NOT code these items into your program, instead store them as seperate .dat files containing information about them. These will interact with each other, and so we need a massive table of interactions. This brings us onto our next topic:

I can't be bothered to invent a signature
calcyman
17
Years of Service
User Offline
Joined: 31st Aug 2007
Location: The Uncertainty Principle
Posted: 14th Oct 2007 21:21
Section 1.7 - Triggers and game logic.

First, the player needs to be able to select an item in inventory. This could be implemented with either mousex()/mousey() commands or BlueGUI.

Then, the player will select a target object.
You will need to use a 2D - 3D conversion, namely PICK OBJECT.

After this, look up the source item and target object on a table of interactions, and the result will contain an action ID, together with parameters.

For example:

Source Item - (ID x), Destination Object (ID y)

You will then search the array interactions(x,y) for the result.

This may contain an action ID (use #constants for this) which may mean something like "generate item".

You will then declare a #constant for this action ID.

It will then be followed by a series of action-specific parameters, usually stored in a single string, or in a 3rd dimension of the array. For the "generate item" action it will need 2 parameters:

Item ID, quantity.

I can't be bothered to invent a signature
calcyman
17
Years of Service
User Offline
Joined: 31st Aug 2007
Location: The Uncertainty Principle
Posted: 14th Oct 2007 21:25
You will also need a plethora of game logic. This will need to include:

- Interactions (which we have already looked at)
- Logic for NPC's (these will move a random direction by an amount based on the inverse logarithm of the distance from their starting position.)

I think that covers all logic required in the game. The next section of the tutorial will be the networking section.

I can't be bothered to invent a signature
calcyman
17
Years of Service
User Offline
Joined: 31st Aug 2007
Location: The Uncertainty Principle
Posted: 14th Oct 2007 21:38
Section 2.1 - Building a successful server system:

Because an MMORPG has more than 256 people online, it is necessary that multiple net games are linked up via servers. Each server will simulate a specific area of the world, but can only support 256 players.

Each server needs to be on a network to cyberspatial adjacent ones. On an orthogonal grid, a server needs to be connected to 4 other servers. This brings the total of players down from 256 to 252.

It is best that the client program checks a user's system, and if it has a powerful CPU, to execute the server program.

I can't be bothered to invent a signature
calcyman
17
Years of Service
User Offline
Joined: 31st Aug 2007
Location: The Uncertainty Principle
Posted: 14th Oct 2007 21:42
Section 2.2 - Creating a net game:

This topic is covered in many tutorials, so there is no point replicating the details here. The best place to learn about multiplayer is in the DBPro help file:

Help -> Help Contents -> Technical Documents -> Multiplayer Secrets

If you have any other tutorials, reply to this thread.

I can't be bothered to invent a signature
calcyman
17
Years of Service
User Offline
Joined: 31st Aug 2007
Location: The Uncertainty Principle
Posted: 14th Oct 2007 21:46 Edited at: 14th Oct 2007 21:49
Section 2.3 - The Heirarchal "Tree" approach to MMOPRG's

A simplified example of this is where the main server controls interaction between secondary servers, and these secondary servers control the interaction between players.

A graphical representation will look like a family tree

I believe this is a good way of controlling the massive influx of players.

I can't be bothered to invent a signature
calcyman
17
Years of Service
User Offline
Joined: 31st Aug 2007
Location: The Uncertainty Principle
Posted: 14th Oct 2007 21:53
Section 2.4 - Reducing Latency (lag)

We need to check whether a player has disconnected. If you do not make this check, the game will freeze on that server, and the effect will carry up to the main server, thereby freezing the entire MMORPG.

To check, use the player disconnect() command.

Another way is using a third-party multiplayer command set.

Depending on the way you structure your heirarchy can tremendously alter the latency time.

Either a tree, grid or other server system will work fastest depending on the cicumstances.

I can't be bothered to invent a signature
PresFox
19
Years of Service
User Offline
Joined: 28th Aug 2005
Location:
Posted: 14th Oct 2007 22:10
Really i think you should stop.....

your talking alot of nonsense there (eg, letting client execute the server), and you can just bring people on the COMPLETELY wrong path

Microsoft isnt evil, they just make really crappy operating systems -- Linus torvalds
Xenocythe
19
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 14th Oct 2007 22:14
I agree with PresFox.

Meh. Signatures. Lame :p
izaboo
19
Years of Service
User Offline
Joined: 29th Jan 2005
Location:
Posted: 14th Oct 2007 22:35 Edited at: 14th Oct 2007 22:42
Yeah that would really put a hole in security. You should make all processes server based. Now would i suggest making a server or even a client using dbp built in networking script NO WAY! use a third party DLL or better yet a different script.

I like the idea of a thread like this maybe people will see how hard it is just to make a RPG rather then a MMORPG.... Yet failure is a part of the learning process. You learn from your mistakes.

Edit: and plus home brew game creating should be fun as a hobby. A mmorpg is so demanding that it just takes all the fun out of it. If you want to make a mmorpg so you can be GOD OF ALL because your not on other mmorpgs your going down the wrong path. Yet if you must, gods speed to you my friend. FYI.. Another bit of advice you need to include; Don't post your project on the wip board until you have something presentable. People love to set flame to those posts.
jasonhtml
20
Years of Service
User Offline
Joined: 20th Mar 2004
Location: OC, California, USA
Posted: 14th Oct 2007 22:40
lol, calcyman... i can't believe you seriously think that someone can make an MMO server with DBP's net commands. they are too slow to hold more than 256 players EVEN if you had multiple servers. multisync is practically the only possible way, and even then you can't just give someone "the gist" of a server to get it anywhere near working right.

this thread will probably be locked

calcyman
17
Years of Service
User Offline
Joined: 31st Aug 2007
Location: The Uncertainty Principle
Posted: 14th Oct 2007 22:44
I was merely suggesting how you would go about it. It is a tutorial, not a project, and I haven't posted it on any WIP board. It was mainly in answer to the stream of posts asking for code (mainly from beginners)

I can't be bothered to invent a signature
Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 14th Oct 2007 22:46
and why the heck are you making a new post every paragraph instead of just editing the first?


jasonhtml
20
Years of Service
User Offline
Joined: 20th Mar 2004
Location: OC, California, USA
Posted: 15th Oct 2007 00:22
your post is just going to get beginners overly excited... and how does this tutorial answer beginners' questions of code if you have no more than 5 complete lines and some scattered commands?

also, i don't believe anybody has the right to write a MMO tutorial until they have made one themselves...

TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 15th Oct 2007 00:59 Edited at: 15th Oct 2007 01:00
@calcyman: unlike many others, I commend your effort. I may not necessarily agree with the approach (which I recommend starting with a simple chat prog), but, it is better than all the discouragement I see in this forum.

Most say "No Dont Make an MMORPG!" I find this to be very unfortunate due to the fact that the dream of making a MMO is what draws many to DB in the first place.

Creating an unique FPS game was my dream, and 6 years later I have yet to produce one. However, I have learned a great deal on this path. I've have developed a solid system of programming that has given me confidence. I finally feel that I can be successfully complete an the FPSRPG of my dreams.

After all there is no one way to make MMO. IMHO 256 players is more than enough. Ok maybe its not a MMO by definition, but moreso a LMO Large Multiplayer Game. The wording is only semantics, the concept is the same.

Thus, I encourage to you to keep writing your tutorials. It will get better and it will help others, if they decide to see benefit.
jasonhtml
20
Years of Service
User Offline
Joined: 20th Mar 2004
Location: OC, California, USA
Posted: 15th Oct 2007 01:43
techlord, i dont think you understand... this tutorial is very misleading and doesn't contain enough information.

sure, people can dream. everyone does. but, for beginners to come to this post and attempt an MMO because calcyman said they could, will most likely lead to a lot of disappointed programmers. our forum isn't necessarily trying to shut down all MMO threads, we just discourage it because we see the same thing happen over and over...

wickedly kick it
18
Years of Service
User Offline
Joined: 13th Jul 2006
Location: Fort-worth Texas
Posted: 15th Oct 2007 02:00
This is VERY misleading, and not good for newcomers and has many security holes (even though its just a concept!)

TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 15th Oct 2007 05:09
@jasonhtml: I do understand. However, instead of discrediting the ideas herein, perhaps you can offer additional information. The mere mention of "MMORPG" seems to draw negative feedback, automatically. Why? Its a type of game, just like any other, and making games is what DB is all about.
jasonhtml
20
Years of Service
User Offline
Joined: 20th Mar 2004
Location: OC, California, USA
Posted: 15th Oct 2007 05:26
i already explained why it draws negative attention ^^^

dark coder
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 15th Oct 2007 07:50
Quote: "The mere mention of "MMORPG" seems to draw negative feedback"


And what do you expect? So far there have been probably 50 MMORPGs started that I've seen and as to this date 0 of them have have actually got to a stage where you can say it's any good.

As I've probably said many times on these forums creating a decent MMORPG engine requires either a good team that in total is very knowledgeable in all areas of client and server creation or someone who does.

After reading a few of the points listed above I can see that this isn't the case. i.e. "We need to check whether a player has disconnected. If you do not make this check, the game will freeze on that server, and the effect will carry up to the main server, thereby freezing the entire MMORPG.", "Inventory(32) as item, Itemsonfloor(1000) as item"

So while it's not a bad idea it's not very good to promote this as how to make an MMORPG as it doesn't teach that.

TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 15th Oct 2007 09:43 Edited at: 15th Oct 2007 09:44
Quote: "And what do you expect? So far there have been probably 50 MMORPGs started that I've seen and as to this date 0 of them have have actually got to a stage where you can say it's any good."
Perhaps the reason for this is that there is so much discouragement. A tutorial on how to do it is a start. If one disagree with the author's POV, perhaps one should offer an alternative method.

What positive comes from comments like:
Quote: " no one will take you seriously ..."

Quote: "Really i think you should stop....."

Quote: "This is VERY misleading..."
Cash Curtis II
19
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Corpus Christi Texas
Posted: 15th Oct 2007 11:16 Edited at: 15th Oct 2007 11:17
Discouragement has nothing to do with it. People start MMO games all the time. They don't die for lack of enthusiasm or from the creators following other's negative advice. They all get to about the same place - an advanced terrain with copies of the same Dark Matter 1 knight or Psionic's dwarf and a server test that includes a few bored forum members. Then they tend to realize how hard an RPG really is and lose interest.

This isn't a tutorial at all. It's more like a vague and poorly conceived project outline. No real information is given, and specifics that are given aren't good. Everyone has to start from somewhere, so it's no big deal, but someone without enough experience shouldn't try making a tutorial. You shouldn't make a tutorial about something unless you've actually done it yourself. I've not made an RPG tutorial myself, but I will once my project is finished. The information given about RPGs, if extrapolated into real code, would represent about 2% of what is really needed in such a game.


Come see the WIP!
calcyman
17
Years of Service
User Offline
Joined: 31st Aug 2007
Location: The Uncertainty Principle
Posted: 15th Oct 2007 17:37
I suppose I mistitled this thread. It is just an outline, but when converted into code, it is a good place to begin. Sorry for the controversy that has arisen as a consequence.

I can't be bothered to invent a signature
SimSmall
20
Years of Service
User Offline
Joined: 7th Aug 2004
Location: United Kingdom
Posted: 15th Oct 2007 20:25
It's been mentioned, and I'd agree with people stating: definately don't use the in-built net commands for something like this. These are only really practical for small scale local network games.

For Internet games of any genre you really should be looking into Barnski's winsock plugin, or maybe MultiSync, both are good Internet plugins.
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 17th Oct 2007 21:49
Yes, I agree in concept SimSmall - Get a plugin for DBPro Clients - Or use DarkGDK and link to the Network stack directly - WinSock or a .net equiv should do - however - just go lower level to get the bandwidth.

Alternately, for the Server Side - No Way DB Pro - Yes Way C++, may C# - (don't really need DarkGDK for that but if the routines help some how... I guess ) Personally I'd use FreePascal for the server - Easy Multi-Tasking, Easy Network Protocol Access - PLUS if you use the "Recommended" units that come with it - its 100% portable so you can write network stauf that runs on both linux, mac, and windows - and for MMO whatever - not having to worry about OS is a good thing - Plus I think Linux is better for this type of application... just my opinion. Also - FREE A good selling point!

People hear FreePascal? "My dad used that" thats not Object oriented... is it? OH YES and better than C++ - More equipped to do parallel processing nad easy to use multi-core CPUS to their fullest with pretty easy multitasking.

Anyhoo - only thing faster is assembly/machine code - but FreePascal is EASY to read compared to C++. More "Basic Like" looking syntax. Things are "little" English words mostly versus the more cryptic others.

Anyway - I sensed some hostility in this thread - and my answer to ANYONE wanting to make a MMO - is not to discourage but instead to give them a heads up without crushing their spirit - like - "Cool Man! There is a LOT that has to be done to get an MMO going. Have you ever made one? No? Perhaps you should try getting a level working locally and then maybe add the networking later?"

This might get them hyped and started on making their first animations, moving characters, playing with menus, whatever. The more they learn - the more they'll realize its not as easy as it looks. Hopefully as they realize that - they are already becoming a good artist, a writer, a programmer, and are having fun. That is SO very important.

5867Dude
18
Years of Service
User Offline
Joined: 26th Jun 2006
Location:
Posted: 20th Oct 2007 19:33
Honestly, People who have just begun using DBPro will belive anything-They soak it up like a sponge. And as Jason P Sage said your going to make them belive that they can code anything in a day and then be really irritated when they haven't finished and they find that it is harder to learn

TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 21st Oct 2007 13:45
@calcyman

I'm just curious as to wether or not you will continue with your tutorials? Or expand your current sections.

Eevil Weevil
17
Years of Service
User Offline
Joined: 1st Aug 2007
Location: Wherever you are, I wil follow
Posted: 26th Oct 2007 14:59
Perhaps you could adapt this to 'How to make an RPG' instead of MMORPG.

Your signature has been erased by a forum hacke - I mean, a mod

calcyman
17
Years of Service
User Offline
Joined: 31st Aug 2007
Location: The Uncertainty Principle
Posted: 26th Oct 2007 15:41
@Eevil Weevil - Perhaps the moderators can do this, but I can't change thread titles.

@TechLord - Yes, I have created 2 more tutorials. (functions and #includes)

Your signature has been erased by a hyper-intelligent pan-dimensional being (a mod)
Eevil Weevil
17
Years of Service
User Offline
Joined: 1st Aug 2007
Location: Wherever you are, I wil follow
Posted: 28th Oct 2007 09:49
Quote: "@Eevil Weevil - Perhaps the moderators can do this, but I can't change thread titles."

Yes, that's what I was kinda hinting at

Your signature has been erased by a forum hacke - I mean, a mod

calcyman
17
Years of Service
User Offline
Joined: 31st Aug 2007
Location: The Uncertainty Principle
Posted: 28th Oct 2007 10:14
@Moderators: Then by all means, do so.

Your signature has been erased by a hyper-intelligent pan-dimensional being (a mod)

Login to post a reply

Server time is: 2024-11-25 12:31:02
Your offset time is: 2024-11-25 12:31:02