• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
Sky Warden

Simple MORPG project planning

24 posts in this topic

Hi everyone! My name is Herwin, and I'm new to the community. I'm not very sure about which forum I should post this topic in, so the "For Beginner" it is.

 

I'm sorry if the title is too annoying to see. I understand that an MMORPG project is a dangerous topic, but it's not a real MMORPG project, seriously. Just like the title says, it's just a simple MORPG (without 'massive') project. Recently my friends and I decided to make a project to practice. We're looking for some experiences in working as a team, and because we have various interests and skills, we decided to make a small MORPG project. We already have the network guy, programmer, sprite artist, and we can just use a humble *bip* *bub* *bub* *bab* which is generated randomly for the music since none of us is a musician. I'm one of the programmers, and I got the server-side part.

 

We're aware that an MMORPG is kinda insane to make, especially for a group of students. We're just planning to make a 2D RPG with three maps, simple hunting and leveling system, chat, database, and can be played via Internet with a server that only runs when we're going to play the game. We took MORPG because working on one may give some interesting experiences. For me, it's the network programming. I'm pretty new at it.

 

For an unknown reason they voted me to be the project leader, so I need to make the planning and assign the jobs for the team. The thing is, I've never done this before. Here's the summary of my current plan :

  • I code the server. It will handle the math (counting damages, etc), sharing information about world objects to the players, handle the connection between players, do things with the database, and other server thingy like encryption. I will write the code for accessing the database, count damages, etc.
  • While I'm coding the server, the other programmers work with the client. They will handle physics, player input, loading sprites, sending player input to the server, receiving information from the server. The client only acts as an input device, while the serious game process is done in the server.
  • The sprite artist works with the the client-side programmers and make sure that the client can load sprites perfectly.
  • After the client software is finished, we connect the server and the client.

That's just the summary of my to-do list. Of course there's more, but that's my whole plan in a nutshell. Do you think I miss something? I have no exact idea if my steps is correct. If you have some suggestions or tips for me, please share it.

 

By the way, I'm planning to have a login server which handles user login and gives a kind of 'ticket' after the player login successfuly. Without this 'ticket' the player won't be permitted to access the world server (announces the world objects) and the server which handles counting like damage, etc (I don't even know what is this called). Is it correct?

 

Also, what's the best way to handle NPC dialogue? At the moment, I store it in the database.

 

A bonus question. Do you think 42 tables in the database for such small game is too many? I was just trying to do that normalization thingy, but I have no idea if I either overdone it or underdone it.

 

I use Python and MySQL. Oh, is it necessary to write the client and server with the same language?
 

Thank you, and nice to meet you all guys. smile.png

Edited by Sky Warden
0

Share this post


Link to post
Share on other sites

2 small things:

 

All NPC dialog should be stored fully within the client and referenced with an ID or something along those lines.

Unless you are planning on having constantly changing server controlled NPC dialog, even then you could just update the client with a server message containing the replaced dialog.

 

Figure out your packet structures etc before hand, having seperate teams working on client and server can be a huge nightmare if you are not working on the same concrete information.

0

Share this post


Link to post
Share on other sites

Yes, you definitely want to work closely with your client/network programmer(s) on that. If the clients input/physics/animation is not coded with the networking in mind, you're going to have bad times down the road. Building the client and the server each in a vacuum and then "Connecting" them after they're done is... Well, that's probably not the safest approach, we'll say.

 

Having a log in server to supply an auth ticket is not a problem, but be mindful of how many distinct "Servers" you have. For something small, as you are proposing you probably shouldn't need more than one server application.

 

I don't see a problem with having the dialogs in the database, but you'll definitely want to keep that stuff cached on the client in some sort of data files so you don't need to stream it constantly.

 

Your client and server do not need to be written in the same programming language. What's important is that they speak the same "language" over the network. What I mean mostly is your packet structures and protocols (TCP, UDP, HTTP[Probably don't do that], etc...).

 

Without knowing what sort of data you're storing in your DB, we can make no judgments on it's structure or table counts. So long as it's intelligently designed, and your queries don't have performance issues, you're probably going to be fine. 

1

Share this post


Link to post
Share on other sites

First I want to say that I have done something similar and it was great, I learned a lot with it.

 

On topic:

 

1) Language:

 

Python is a slow language, so, unless you are using an engine that provides you with binds and code written in c/c++, the project won't scale really well. You can use an optimizer to improve your performance (cython and pypy are good places to look at).

Python network layer to send variables that are not string is pretty annoying, so you probably want to take some time to read a little about it. I would recommend you take a look at this: http://docs.python.org/2/library/struct.html

 

2) World representation:

 

Assuming your game is a top view world (like Secret of mana or chrono trigger), you should probably use a tile map to represent it, using a grid to store the data. This will make some operations easier, such as rendering and path finding.

 

3) Client/Server:

 

In my implementation, both server and client used the same classes, the client had an HumanInterface class that would translate the actions into messages and send it to the server, that would have nearly the same objects (for instance, servers wouldn't load graphics or animations) and call the objects methods.

or instance, if the client clicked the "w" key, the HumanInterface would translate it into a start moving message the server would call the move method of the player and reply to the client with its new position.

 

4) Authentication:

 

This is probably a good approach, maybe you should use a ready solution, such as radius? Also, you should be careful how you are sending the information by the network and how you store it. I used pycrypto for my authentication needs.

 

5) Dialog:

 

Saving it on a database is probably the best approach, this way you can easily implement multiple language into your game. Python comes with sqlite by default, you could take a look at it.

Edited by KnolanCross
0

Share this post


Link to post
Share on other sites

Your client and server do not need to be written in the same programming language. What's important is that they speak the same "language" over the network. What I mean mostly is your packet structures and protocols (TCP, UDP, HTTP[Probably don't do that], etc...).

 

I see, thank you. I did feel like I have to work directly with them for writing the client. That means the client sends the data like user_id, the server receives it and then uses to do tasks like getting the user information based on the user_id. Is that correct?

 

1) Language:



Python is a slow language, so, unless you are using an engine that provides you with binds and code written in c/c++, the project won't scale really well. You can use an optimizer to improve your performance (cython and pypy are good places to look at).

Python network layer to send variables that are not string is pretty annoying, so you probably want to take some time to read a little about it. I would recommend you take a look at this: http://docs.python.org/2/library/struct.html

 

The client programmer decided to use C# to code the program. The Python is used only in the server. Therefore, I think the performance issue won't be so big right? Or it will? I heard it will be fine as long as I run it in its realm. Sorry, I don't really understand why Python is a slow language. Is there a way to optimize it? I know it's something about the compiler and the way Python runs.

 

Obviously the fun part is making classes, spells, enemies, designing the game. But Soon when you want your game to have a good amount of gameplay and reatures. There are a lot of subsystems you need to implement in an RPG. I'm going to blast a ton of questions relating to these subsystems so you can start thinking now.

Oh thank you. They're really important indeed. I will keep them in a list. The client-side programmers want to work with Unity 3D along with the spriters.

 

By the way, I'm not very sure about the way I handle things like buff. At the moment, I handle it like this :

  1. There are some tables in the databases which store information like "Thing A has effects X, Y, Z, etc."
  2. The program looks for the effects the triggered thing (just say magic or buff) has with the database. Maybe it has damage reduction by X percent.
  3. The result will be a list of effects. I have functions which represent every effects. The function name is the same name which is stored in the database. Like a function to count the damage reduction, etc.
  4. From that list of effects, I will do a loop to call the effect function one by one according to the effect name, and then count the total damage.

Is it good? Maybe you have a better way? :)

 

Thanks for the reply guys.

0

Share this post


Link to post
Share on other sites

Python is a slow language, so, unless you are using an engine that provides you with binds and code written in c/c++, the project won't scale really well. You can use an optimizer to improve your performance (cython and pypy are good places to look at).
Python network layer to send variables that are not string is pretty annoying, so you probably want to take some time to read a little about it. I would recommend you take a look at this: http://docs.python.org/2/library/struct.html

 

Say that Python is 'slow' a broad generalization which is not useful. Scalability of a system is not simply a matter of language choice; it's more often a matter of design. It also depends on what your definition of "scale" is.

 

The client programmer decided to use C# to code the program. The Python is used only in the server. Therefore, I think the performance issue won't be so big right? Or it will? I heard it will be fine as long as I run it in its realm. Sorry, I don't really understand why Python is a slow language. Is there a way to optimize it? I know it's something about the compiler and the way Python runs.

 

Python should be just fine for your server. Python is technically slower than a compiled language because there is additional execution overhead in the Python interpreter. But don't worry about that. It's fast enough for many things.

 

Also, don't worry about optimization until you have _actually_ profiled your code and have identified _real_ bottlenecks. Read that last sentence again. Resist the temptation to guess about where bottlenecks exist in the present or future, and instead learn to use a profiler. See http://docs.python.org/2/library/profile.html. Often bottlenecks you find are caused by redundant computation or a poor choice of data structures or algorithms; these issues have nothing to do with your language choice. As a last resort, if you *really* need blazing speed for number crunching, etc. (_after_ you've profiled your code), you can always write C extensions to optimize those keys pieces.

 

If you're dealing with a database, you may find that some bottlenecks are caused by the database (inefficient queries, latency, etc.). These sort of issues also have nothing to do with your language choice.

 

So if you're already familiar with Python, stick with it. It's a fine choice. =)

2

Share this post


Link to post
Share on other sites

So if you're already familiar with Python, stick with it. It's a fine choice. =)

Whoa. Thanks! That reliefs me. I've asked some seniors and they say the same. "You should pick a programming language based on your own skill set and the needs of the project." Also, that's a very useful link you gave me there. I will have it a read soon. I'm writing the database class at the moment.

 

Yes. I choose Python because it's easier to develop and therefore, will make it easier for the team if a new programmer comes to the team.

 

As for the client-server play, I later decide to separate the client-side team into two parts. One part handles the resources along with the spiters, while the another one handles the sent data with the network guy and server-side programmer (me).

 

About database, I'm concerning about the normalization. It's good for some reasons, but it slows down the reading process a bit. I think I need to denormalize some of them, but not sure about the best way to do it. I can decrease the writing performance if I do it wrong. Some ideas or links will be very appreciated.

 

Thank you everyone! :)

0

Share this post


Link to post
Share on other sites

Love getting voted down for telling the truth on python.

 

Python is slow comparing with other programming languages. It is slow because it is an hybrid language model (instead of purely compiled) and it uses dynamic typing (this is a perform killer). PERIOD.

This doesn't mean that it won't be fast enough to run your project, but you should know that this may become a problem and that you have optimizers. This is a simple example on how it can be a problem:

 

Let's say you want to calculate the distance from one point to another. This is a very simple problem and it will be used thousands of times every second on your game, specially because it is used for collision tests. The algorithm is really simple, just this formula:

sqrt((x2 - x1) ^ 2 + (y2 - y1) ^ 2)

 

So I wrote this code and run it in a 10000 times loop, here are the results (I run the program 10 times, got the lowest result):

Python: 0m0.031s

C: 0m0.002s

 

That is a simple algorithm, that depends a lot on the python sqrt implementation, still it was 15.5 times slower than a C version. If you take more complex algorithms, specially the math based ones (see the example on Cython site) you can end up with 1000 times slower code.

Also, I never said to blindlessly optimize your code, instead I posted a reference, cython. If you had lost 15 minutes of your time to take a look at the cython site (and maybe learn something), you will find a profiller section that will show you how to indentify bottlenecks and how to optimize it.

 

So, you may negativate me all you want, but that won't change the fact that python is slower than most other languages and that you may need to optimize some parts of your code by exporting C code or using cython.

 

Sorry if this may seen aggressive, but I post all my references and I get really pissed when you post references and people don't read it.

 

On the communication, as I said in my first post, it is possible, but you need to take some precautions. Sending binary data via a socket with python means that you will need to use the structs module, where you passa a formatted string and pack variables into a buffer. Your variables must have the same size on both sides of the network, otherwise you will have problems.

In the link I posted there is the description of size of each variable, you should look for the size of variables of C# and create a simple communiaction example between them. Also it would be wise to test on both 64 and 32 systems.

Edited by KnolanCross
-1

Share this post


Link to post
Share on other sites

KnolanCross, I think you are confusing Python the language with cPython, _one_ implementation of the Python language.

0

Share this post


Link to post
Share on other sites


So if you're already familiar with Python, stick with it. It's a fine choice. =)

Whoa. Thanks! That reliefs me. I've asked some seniors and they say the same. "You should pick a programming language based on your own skill set and the needs of the project." Also, that's a very useful link you gave me there. I will have it a read soon. I'm writing the database class at the moment.

Yes. I choose Python because it's easier to develop and therefore, will make it easier for the team if a new programmer comes to the team.

As for the client-server play, I later decide to separate the client-side team into two parts. One part handles the resources along with the spiters, while the another one handles the sent data with the network guy and server-side programmer (me).

About database, I'm concerning about the normalization. It's good for some reasons, but it slows down the reading process a bit. I think I need to denormalize some of them, but not sure about the best way to do it. I can decrease the writing performance if I do it wrong. Some ideas or links will be very appreciated.

Thank you everyone! :)

About the database, and this database class you're working on:

First, if you already have 42 tables, but haven't started coding yet, you're doing it wrong, in my opinion. You're also likely to run into surprises once you start using the database. Perhaps for the moment the best approach is to use your schema as a design guideline, but build the actual db from scratch, adding what you need as you go along. It's good to look ahead and try to anticipate, but don't try to look too far. :)

Second, are you using an ORM? If not, do it, especially if you're dealing with 40+ tables. If you don't use one, you're going to end up basically writing one yourself--and it's going to suck. That's not a criticism of your programming skill, it's just that these things already exist. Use them. Sqlalchemy is nice, and you can also use Django. Django includes a bunch of other stuff you won't need, but the ORM is quite good. This will make your life easier, especially when you find yourself writing generic insert, update, and delete code. There is a learning curve, but please, for the love of god, use an ORM.

Finally, about normalization. My favorite quote about this is, "Normalize until it hurts; denormalize until it works." This goes back to my previous point: try to build what you need, as you go. Change when necessary. Iterate.

Hope that helps.
0

Share this post


Link to post
Share on other sites
Oh, slightly off topic. Learn to use a version control system, if you haven't already. This is necessary even for solo projects, in my opinion, and absolutely critical for a team.

If you already are, great! And sorry for the assumption. If not, git and svn are good choices. I prefer git for several reasons, but I will stop now before initiating a tool choice holy war.
1

Share this post


Link to post
Share on other sites


Oh thank you. They're really important indeed. I will keep them in a list. The client-side programmers want to work with Unity 3D along with the spriters.

 

By the way, I'm not very sure about the way I handle things like buff. At the moment, I handle it like this :

  1. There are some tables in the databases which store information like "Thing A has effects X, Y, Z, etc."
  2. The program looks for the effects the triggered thing (just say magic or buff) has with the database. Maybe it has damage reduction by X percent.
  3. The result will be a list of effects. I have functions which represent every effects. The function name is the same name which is stored in the database. Like a function to count the damage reduction, etc.
  4. From that list of effects, I will do a loop to call the effect function one by one according to the effect name, and then count the total damage.

Is it good? Maybe you have a better way? smile.png

 

Thanks for the reply guys.

 

I'll Show you my Buff table I used in my Database.  I actually grouped spells as buffs so they had a type.  (note statement is for a SQLITE3 database)

 

 
CREATE TABLE Spells (
 spell_id INTEGER PRIMARY KEY AUTOINCREMENT,
 school_id INTEGER,
 school TEXT,
 class_id INTEGER,
 name TEXT,
 desc TEXT,
 attack_value NUMBER,
 range  NUMBER,
 cost  NUMBER,
 cast_time  NUMBER,
 recast_time  NUMBER,
 spelltype INTEGER,
 duration INTEGER,
 stuns INTEGER DEFAULT  0,
 mezs INTEGER DEFAULT  0,
 tick INTEGER DEFAULT  0,
 forever INTEGER DEFAULT  0,
 passive INTEGER DEFAULT 0
);
 
Notice this is kinda denormalized because I only have 36 spells in my game so I lumped things into one table, for easy querying at the start of the game. I ended up have 3 types of spells.
 
1. Target is Hostile
2. Target is Ally (friendly) for heal spells
3. No Target.
 
So obviously any Damaging spell needs to be type 1 because those spells require the user to be targeting an enemy.  Can be damage, or a stun, etc..  If I want a spell that heals or a buff that you must click on people i set that type to 2 in the database.  I also made a rule about type 2 spells.  If targeting noone or an enemy, the spell will still cast but the allied target will be yourself.  So you can self heal without having to click on your avatar/player etc...  Type3 is where any group spells came in to play.  No target is required, and it uses the range value in the database.  Again, another rule in my game was all type3 spells casted work on yourself.  So If I wanted a self buff I would make it range = -1.  
 
THen I had various flags for all the buffs I wanted:
 
Tick- calls the buff to do something every tick amount.  Lets say I have a power song that my Bard class can give to the group.  But i want it to chant every 5 sec so they have to stay near him.  This tick value is set to 5.  I set the type to 3, and the range to 20.  Now this is a group pulsing buff that will pulse every 5 sec, and i set the duration to 30, so if they leave the presence of the bard the buff will fall off in 30 sec.  Notice the bard spams the buff everytime because I will set the Forever flag to true (see below).
 
Amount - If type 1 spell this is used as a base number for damage.  If type2 I use this for healing amount.  If type3, depends on buff but could be stat increasing, torns amount, an HP/MP regen rate, etc....
 
Stun/Mez - Will this spell stun or mez the enemy.  Use Duration (in some formula of the game) to figure out how long.
 
Forever - This tells the buff to RECAST itself to the owner.  I used this for my bladeturn ability.  If bladeturn buff is on, then the next time you get hurt from an enemy, the attacks damage is reduced to 0. The buff comes off, but the Bard's bladeturn will reapply itself every (duration) secs.  That way you have to BE near a bard to get the benifits of the buff.  The buff will last until you logout, but it won't get reapplied unless you are near him.
 
Passive - This flag tells the game to ignore duration.  The buff will stay on forever.  I used this for buffs that increased stats.
 
cast_time - How long does it take to cast the spell.  Can be zero for instant cast spells
 
recast_time - How long till you can recast this spell. Can be Zero (but you shouldn't have cast time and recast time = zero or someone can cast a lot of spells in 1 sec!)
 
Things like amount and duration are actually base values that get thrown into a formula so the spell scales with INT and Level etc.....    Maybe this can help you out, but at least it shows one approach to spells.  Also, having all the datapoints in a database made it easy for me to give the game to my friends to play, and I can make quick database changes while attempting to balance, without having them redownload the game, or recompile it, etc.  So remember to try and avoid any hardcoded values in your source code. 
0

Share this post


Link to post
Share on other sites

KnolanCross, I think you are confusing Python the language with cPython, _one_ implementation of the Python language.

 

Why? I do know the difference between the multiple implementations.

 

Can anyone point me where I am wrong? I just would like to know why people are giving me negative posts, I am not saying anything wrong in my posts, If I am, I want to know it.

0

Share this post


Link to post
Share on other sites

KnolanCross, I think you are confusing Python the language with cPython, _one_ implementation of the Python language.

So... it's fine to use Python for the server?

 

First, if you already have 42 tables, but haven't started coding yet, you're doing it wrong, in my opinion. You're also likely to run into surprises once you start using the database. Perhaps for the moment the best approach is to use your schema as a design guideline, but build the actual db from scratch, adding what you need as you go along. It's good to look ahead and try to anticipate, but don't try to look too far. smile.png

 

Actually I've designed it on my papers (a poorly-drawn schema with lines, squares, and pieces of script here and there). What I meant with writing the database class is putting those script pieces on that papers into text editor in files. I hope I can merge it right. Hmm... maybe I do it wrong indeed. XD

 

Second, are you using an ORM?

Yes, SQLAlchemy, but I'm still learning about it.

 

My favorite quote about this is, "Normalize until it hurts; denormalize until it works."

I like this. By the way, this sounds promising to me :

 

"Keep the logical design normalized, but allow the DBMS to store additional redundant information on disk to optimise query response."

 

But I don't know how to implement it with Python.

 

Learn to use a version control system, if you haven't already.

Oh I will! Please list the things I need to learn and throw it to me, sir. I really am eager to learn as much as possible. :)

 

I'll Show you my Buff table I used in my Database. I actually grouped spells as buffs so they had a type. (note statement is for a SQLITE3 database)

That's interesting. I will keep them in mind.

 

By the way, what do you think about the way I handle buff? I store the spell information in one table (name, description, mana_cost, etc) and store the effect in another table (contains the spell_id and the value for particular effects). The effect table stores the function name in string. The program will look for the effects the casted spell has (select bla from effect where spell_id=bla), then save it and the value for each effect. Then from that list of effects, I do a for loop and call the functions dynamically (about the function math) and insert the value as the argument.

 

Like spell with id = 1 has effect A with value a and effect C with value c. Then from that list with A and C in it, I do a for loop. For each loop I call the function using the string name, and use the value. In this case, the first loop will call A(a). Then in the next loop, C(c) will be called.

 

Am I doing it wrong? I love this kind of discussions. :)

0

Share this post


Link to post
Share on other sites

@skywarden

 

Yes it is possible to have a server using python, I use it on mine!

But I use binds for physics/collision so the math is made with C++ and I profile my code and improve performance using cython (an optimizer).

1

Share this post


Link to post
Share on other sites



Yes it is possible to have a server using python, I use it on mine!

But I use binds for physics/collision so the math is made with C++ and I profile my code and improve performance using cython (an optimizer).

Thanks for clearing that up. By the way, the collision detection is done by server right? Or the client?

0

Share this post


Link to post
Share on other sites

I execute the algorithm on both sides.

The client uses the information to be more responsive and results on better gameplay, still the server has the final decision (to avoid hacks).

0

Share this post


Link to post
Share on other sites

@skywarden

 

That sounds like the buffs might work.  You might want to have 3 tables.

 

-Spell table

-Effect Table

-SpellEffectJunction Table.

 

 

 

So you can customize your spells with different effects.  I'm not sure if yoru effects are what the spell does (like damage, heal) or the graphic elements of the spell (what particle system to use).  But I guess this would work for either way.  If you have three tables, you can define your spells, define your effects, and then the junction table is a simple 2 column table with a spell_id and an effect_id (forgive me if this is what you had in mind).  Then you can add as many effects to a spell by inserting them in this table.  A query will return all effects related to the spell in the query.

 

Also, is this a client side database or on the server?  Because the client will need to load all of this from the server before they start the game (i'm guessing).  But you want the values to be controlled on the server so you can easily apply server side patches to balance the game.

0

Share this post


Link to post
Share on other sites

You might want to have 3 tables.

 

Aye. That's how I do it. I have a table to store the effects, then magic table to store basic information about magics, and magic_effect to store the effects of magics and its value. That way, I can use the effect table for other tables like buff, items, etc and make a pivot table to relate them. For magic, I have these three :

 

-effects

-magics

-magic_effect

 

Magic elements, etc are stored in other tables. Like you said, if I want to add a new kind of effect I can easily insert it in the effects table and relate them in the magic_effect. I do it this way because I think not all magic has stun effect, and filling it will null doesn't feel just right. smile.png

 

The database is on the server. I think it's more secure. I mean, if it's a client-side database, the client can hack it right? To make sure that everything is secured, I make the client to act more like an input and display device, and the server do the game. I don't need to patch the client engine frequently that way, right?

 

What I put in the client are just the physic (I don't care about physic hack), sprites and models (who wants to hack them anyway?), and things to handle user input. My plan is to make the client engine detect input like 'move forward' then send the vector to the server. Then the server read that vector and see if it will make collision or not. The server later announce the result to the world.

 

I'm still rather confused with this actually. From what KnolanCross said, I assume that this kind of math is slower to do in Python, and the colission detection will be faster if it's done in the client. Do I get it wrong? Maybe you guys have an alternative? I really want to know the best way to do everything. biggrin.png

Edited by Sky Warden
0

Share this post


Link to post
Share on other sites

Well I voted you up KnolanCross, simply because I don't think you deserve negative points.

I too think Python isn't the right choice for a project like this. I'm not saying it cannot be done, but I simply think there are better alternatives.

Although I would not advice him to use C++ either. Why not using C# for both server and cient? Its easy to learn and it makes interaction with the C# client easier too.

 

I think it will increase productivity and performance in the end. Just download Visual studio 2012 express and play around with the language. I think on a project of this scale it really doesn't hurt to spend some extra time figuring out the alternatives, you can easily learn the basics of C# within a couple of hours. If you really mastered the Python language it might be a different issue, but my intuition tells me its not like you're using it for years too. It never hurts to learn and use a new language in my opinion, and if it doesn't work out you can always drop it and go back to Python.

0

Share this post


Link to post
Share on other sites

Your first step should be to learn programming. This isn't something that you can just learn by looking up C tutorials (although I definitely recommend looking up as many tutorials as possible). Once you learn the language, the real job is applying it to accomplishing your goals. Try to define, on paper, each one of your systems as specifically as possible. Then read more books and articles and update your system accordingly. I would say the most difficult thing to do would be to find enough money to buy some servers, an office/warehouse with a commercial-grade internet connection, an incorporated business, a domain, and all of the other things you need to run even a small server-based game.

0

Share this post


Link to post
Share on other sites

What I put in the client are just the physic (I don't care about physic hack), sprites and models (who wants to hack them anyway?), and things to handle user input. My plan is to make the client engine detect input like 'move forward' then send the vector to the server. Then the server read that vector and see if it will make collision or not. The server later announce the result to the world.

 

I'm still rather confused with this actually. From what KnolanCross said, I assume that this kind of math is slower to do in Python, and the colission detection will be faster if it's done in the client. Do I get it wrong? Maybe you guys have an alternative? I really want to know the best way to do everything. biggrin.png

 

I don't know the most optimal way of doing movement/collision detection in a multiplayer game over the internet, so maybe someone can chime in.  Movement wasn't as big of a deal for me, because my game is LAN only, and 4 players maximum.   Players tell the server when they "start walking", "stop walking", "start Turning", "stop Turning".  That way the client updates themselves and there is a lot less packets being sent just for movement.  Most of the time, users will envoke auto-run, or be standing still in combat.  But I also send absolute coordnates (from the server) where peoples positions are.  I do this at a realitivly fast rate so if things get out of sync, there is a ruberbanding effect.  But this usually doesn't happen very much at all.

 

I'm sure there is a better way to do this.  Since my game has no "server" (one of the players hosts a session), My Collision detection was done on the client, and told the server about running into a building or a tree, etc.

0

Share this post


Link to post
Share on other sites

Just to elaborate a little bit on KnolanCross' confusion about Python, here is a comment that came up yesterday on the comp.lang.python mailing list from Terry Jan Reedy:

Python is an "interpreted" language.
I consider this a useless or even deceptive statement. Python is an object-based algorithm language. The CPython implementation (currently) *compiles* Python code to a virtual machine bytecode, similar to Java bytecode. This could change. Jython translates to Java, which is then compiled to Java bytecode. Do you call Java an 'interpreted' language? There are compilers that compile Python to the same 'object code' that C is compiled to.

I guess this explains my small objection to KnolanCross' explanation of Python better than I could with my own words.

Just my 2 Cents, please continue with your regular discussion.

1

Share this post


Link to post
Share on other sites

About Python, I asked someone (a tech admin in a forum) who uses Python very much, and is familiar with game programming. Here's his reply :

 

Python is a slow language? For what? Server-side or game engines? Both are completely incorrect.
 
For game engines, all Python does is wrap into lower-level languages written in C and C++, so the claim of Python being "slow" is false for game engines. In this way, your game loop is going to mostly be executing in low-level code that is remarkably fast. Python's overhead is small. If you have an AI routine or something processor intensive with Python, then you can simply rewrite that specific function into C or C++ and call it from Python. This is what Python excels at, providing powerful high level interfaces to low level code.
 
Now, for Python being slow for a game server, that is completely false as well. In fact, this is even worse. Here's the thing. What do game servers do? They write to a database, yes? That is an IO itensive task, so your IO is actually going to be the bottleneck here. You can resolve this IO bottleneck with greenlets, events, or some other massively concurrent approach, then your code flies. How many requests per second are they looking to do? Low level languages are only useful when you need to push into the 100,000s of requests per second. I'm sorry, but... This is not a level that most games can get to. Even then, Python could handle that load just fine - add hardware.
 
Finally... Link this list the next time you see a debate like that:
 
 
Please, scroll down to see the games that use Python. Of particular note is Eve Online, which uses stackless python to power it's massively multiplayer online servers.
 
For C++ check this guide out: http://www.cprogramming.com/
 
With that I decide to use Python. I'm more familiar with it after all. biggrin.png
 

 

I don't know the most optimal way of doing movement/collision detection in a multiplayer game over the internet, so maybe someone can chime in.  Movement wasn't as big of a deal for me, because my game is LAN only, and 4 players maximum.   Players tell the server when they "start walking", "stop walking", "start Turning", "stop Turning".  That way the client updates themselves and there is a lot less packets being sent just for movement.  Most of the time, users will envoke auto-run, or be standing still in combat.  But I also send absolute coordnates (from the server) where peoples positions are.  I do this at a realitivly fast rate so if things get out of sync, there is a ruberbanding effect.  But this usually doesn't happen very much at all.

 

I'm sure there is a better way to do this.  Since my game has no "server" (one of the players hosts a session), My Collision detection was done on the client, and told the server about running into a building or a tree, etc.

 

That sounds good actually. If the collision detection is done in the server, there will be weird glitches due to lag right? I think the only risk of this is physic hack, which I don't really care about since it's just a personal project. Or am I wrong? I think that's the only disadvantage.

Edited by Sky Warden
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0