Simple MORPG project planning

Started by
23 comments, last by Sky Warden 10 years, 12 months ago

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.

Advertisement

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.

C dominates the world of linear procedural computing, which won't advance. The future lies in MASSIVE parallelism.

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.

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.

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.

This topic is closed to new replies.

Advertisement