Jump to content


Photo

Sabriath Multiplayer Engine


  • Please log in to reply
21 replies to this topic

#1 sabriath

sabriath

    12013

  • GMC Member
  • 3197 posts

Posted 24 June 2010 - 09:56 AM

I have been working hard for a few months on different projects, but I really pushed through this past few days to get this engine started. This will double as not only a base line engine for WOW style gaming (complete with registration, login authentication, server selection, character creation, world loading, dead reckoning, p2p patch networking), but also a tutorial in how to make your own game as well to accompany my already written tutorials (in my signature).

At this point, I am tired and the program is not in running condition (actually I'm not sure if it's runnable, some parts have been tested individually)...but I am really excited to show you guys what I have so far. I would also like to open this up to possible public creation as well (allowing you guys to add in your own codes to help form the engine). Full credit to those who get their codes added, even if I have to recode it for the current format.

The file can be found here:
http://host-a.net/sabriath/EngineClient.gmk
http://host-a.net/sabriath/EngineServer.gmk
http://host-a.net/sabriath/EngineC.gmk
http://host-a.net/sabriath/EngineS.gmk

I have also been keeping track of a date/time stamp of when I finished/modified the code, I'm trying to be a better record keeper (my project list is so full, I have to prioritize). I am now keeping my logs in a separate file for better handling, but here is the updates:
I have not been keeping track of this new format, I busted it out this past week, again I went too fast for my own good. The registration system is theoretically done. I am no longer going to have a timestamp for every little thing I do, but will still keep updating this with color normally and bumping.

Although this file is, at this stage, unrunnable,Please report anything you might be able to see wrong with it. Feel free to speak your mind as well (following forum rules of course) about the project.

At the moment, the changelog cannot be colored because I'm using a CODE block for format reasons, if KCLC/another mod fixes the PRE tag, I will swap it over to that instead and colorize the newer entries. If someone has a better idea, let me know. Thanks!

Update 06/27/2010: I started to think about "how am I going to secure a registration connection?" It took me some time, but I think I have it down, let me know what you think:

Client creates a 16 byte 50/50 cipher and this will be KeyA
Client creates another 16 byte 50/50 cipher and this will be KeyB
Client will choose a symmetric method of encrypting (right now I have XOR and ADD/SUB, but I plan to implement rotation and possibly multiples of such)
Client creates a 16 byte packet by Encrypt(KeyA, KeyB) and sends it to server

Server then creates a 16 byte 50/50 cipher and this will be KeyC
Server will use the xor method (saves on processing of server)
Server creates a 16 byte packet by Xor(KeyC, Encrypt(KeyA, KeyB)) and sends it to client

Client reverses the encryption scheme that it used by Decrypt(Xor(KeyC, Encrypt(KeyA, KeyB)), KeyB)
This will result in an answer of Xor(KeyC, KeyA), and sends this to server

Server uses the symmetry rule to arrive at KeyA
Both of which will do an md5 on KeyA to become the MasterKey
The Client then can XOR encrypt the md5(password) with MasterKey and send it to server along with name chosen (plain text is fine), the MasterKey is then discarded

As for an eavesdropper, all they will know is:
Encrypt(KeyA, KeyB)
Xor(KeyC, Encrypt(KeyA, KeyB))
Xor(KeyC, KeyA)

Even if you were to Xor the last 2, you end up with Xor(KeyA, Encrypt(KeyA, KeyB)), and without knowing the method the client used, you can't reverse it any further (although you can have multiple "guesses" to try brute force, but by then IP can be logged along with other methods).

This security has a fault in it on simple eavesdropping tactics. Plus the symmetric keys do not work properly. See below for addition.

Anonymous security is extremely difficult to overcome, but this seems to be "ok" enough for my current needs. The hash will act as a private key in a public key situation once registered, so logging in will be much more secure (as long as the key wasn't stolen during registration).

Update 07/07/2010: Above links have been changed to suit the new format. Since anonymous key creation is extremely difficult (to the point where there's practically a million-dollar reward for finding an uncrackable scheme that no one has yet to claim), I have decided on a much simpler approach (one similar to SSL). It goes as follows:

Client sends 16 byte random string during a SEC code
Server sends 16 byte random string during its SEC code for acknowledgement
Both server and client create a 16 byte string from the md5 hash of both combined keys
Client sends the XOR encrypt of the md5 hash of his password with this 16 byte string
Server XOR decrypts using the same master key to get the md5 of password (which is stored in player's database)

This is NOT secure, but it's better than plain text and doesn't take up too much processing/bandwidth. I will leave it up to the programmer on how he secures the comms in getting the player's password-hash, but for now, this will do. The login method will be much more secured because I can use asynchronous key swapping (the server will already have the player's password as the key)....more on this later as I develop this project.

As you may notice, I stripped almost everything of the previous engine, for simplicity. It's hard to use the KISS method with network programming.



Note to Mods: BlaXun currently has his online engine in this same category, so I hope you guys don't delete/move this, it would be much appreciated. I just need a little bit more time and I'll have this finished.

Edited by sabriath, 07 July 2010 - 10:51 PM.

  • 2

Tutorials of Interest:
* Multiplayer: mine or True Valhalla's

Projects:
* Net39
* My 39dll scripts
* My 39dll lib
* Multiplayer Engine
* Artificial Chemistry

Posted Image

#2 2DLuis

2DLuis

    Graphic Designer

  • GMC Member
  • 2527 posts
  • Version:GM8

Posted 24 June 2010 - 07:43 PM

Looks like BlaXun has competition ^.^
Great work Sabriath, great work indeed!
  • 0

#3 sabriath

sabriath

    12013

  • GMC Member
  • 3197 posts

Posted 25 June 2010 - 09:35 AM

TV:

Thank you for the positive feedback, I do take pride in my coding style (although the DB save/load scripts are horrendous right now, I will look to fixing up that mess in a few). I know that it needs more commenting, however I am trying to push for a completion at the moment (the comments I did put is for my own benefit to remind me what arguments the functions take), however the new stuff has a tiny-bit more definitions in those headers.

As for data encryption, I'll be using the same authentication scheme I worked up in my old scripts, but with much faster turnout. As for the data itself, encrypting every piece will be extremely cumbersome, and I think it would be best to just run a game plain-text -- only using encryption on things that need it (password changes, and possibly a minute timer pulse to check if the person is still who it's suppose to be).

2DLuis:

Thanks very much! I don't want to bring BlaXun down or throw him out of the ring...but I think his engine has reached a point of complication that beginners are having trouble understanding, and he has stated several times that he is too busy to rewrite the entire thing. I'm hoping that I can relieve him of his stress a bit and he can go back to making games again -- let someone else take the reigns lol :)
  • 0

Tutorials of Interest:
* Multiplayer: mine or True Valhalla's

Projects:
* Net39
* My 39dll scripts
* My 39dll lib
* Multiplayer Engine
* Artificial Chemistry

Posted Image

#4 2DLuis

2DLuis

    Graphic Designer

  • GMC Member
  • 2527 posts
  • Version:GM8

Posted 25 June 2010 - 06:05 PM

Thanks very much! I don't want to bring BlaXun down or throw him out of the ring...but I think his engine has reached a point of complication that beginners are having trouble understanding, and he has stated several times that he is too busy to rewrite the entire thing. I'm hoping that I can relieve him of his stress a bit and he can go back to making games again -- let someone else take the reigns lol :)


I agree, while BlaXun's engine is good with regards to some aspects, you cannot really use one sole part without getting errors and offsetting the rest of the engine :/

Your coding style is also much better than most people here on the forums as well :)
Overall, this is just a real valuable asset to the community and to any programmer who wants to make a truly efficient online game. Say, I know the engine is still early in development, but any word on how many players this could support without lagging too much? Assuming you have a good internet connection and fast computer?

Edited by 2DLuis, 25 June 2010 - 07:43 PM.

  • 0

#5 sabriath

sabriath

    12013

  • GMC Member
  • 3197 posts

Posted 26 June 2010 - 07:41 PM

Say, I know the engine is still early in development, but any word on how many players this could support without lagging too much? Assuming you have a good internet connection and fast computer?

Considering that I will eventually have dead-reckoning, bandwidth/room speed throttling, and possibly even a p2p set up, it could theoretically run 32,000 connections. The only reason I don't say more is because I believe there is a network card limit to connections (along with router clutter), so I tend to not do more than that.


In reality the most I suspect my server to support online at once (and this would be an absolute maximum) is 200. But I'm not so worried about the network lag, more the performance lag of all those players, their actions and NPC's, which as I've learnt you're more likely to encounter troubles with first.

Your server lags for others reasons and not just the actions performed, but rather that you combined the models in with your server itself. I think if you split the files into relay (server) and a client (talker) then you can reduce the lag from your players and support more connections. These are only a few of the points I will hit with this engine series, so maybe keep this on watch? :)


Whenever I make an update, I will try to answer people's posts to sorta double as a bump as well. Keep up the chatter and I'll be able to keep working on the project (if I don't have interest, I'll be more inclined to put it down for other projects). Thanks guys!
  • 0

Tutorials of Interest:
* Multiplayer: mine or True Valhalla's

Projects:
* Net39
* My 39dll scripts
* My 39dll lib
* Multiplayer Engine
* Artificial Chemistry

Posted Image

#6 2DLuis

2DLuis

    Graphic Designer

  • GMC Member
  • 2527 posts
  • Version:GM8

Posted 26 June 2010 - 08:31 PM

Say, I know the engine is still early in development, but any word on how many players this could support without lagging too much? Assuming you have a good internet connection and fast computer?

Considering that I will eventually have dead-reckoning, bandwidth/room speed throttling, and possibly even a p2p set up, it could theoretically run 32,000 connections. The only reason I don't say more is because I believe there is a network card limit to connections (along with router clutter), so I tend to not do more than that.


That right there is flat out amazing. Yet, having 32,000 client objects running on the server, would that not yank CPU values drastically?

I do hope you perservere through with this, because if your server really gets to the point where it can support 32,000 connections, then there is no need for c++ servers around here anymore. Heck, if your connection could get 500 players playing online simultaneously, I'd still consider that a huge accomplishment.


Thanks and keep up the phenomenal work man,
~Luis

Edited by 2DLuis, 26 June 2010 - 08:32 PM.

  • 0

#7 sabriath

sabriath

    12013

  • GMC Member
  • 3197 posts

Posted 27 June 2010 - 10:03 AM

would that not yank CPU values drastically?

It possibly could, but then all I would have to do is limit connection bandwidth and decrease room_speed to match CPU lag. I set up the obj_client spawning into a module design, if I wanted to, I could make it create a position in a list rather than a whole instance...then run through the list instead of having the game bog down on each object in a room.

Heck, if your connection could get 500 players playing online simultaneously, I'd still consider that a huge accomplishment.

lol...really? If I can't hit that number, I might as well quit programming altogether! :D

Thanks for the good words though, let me know if you have any more ideas, love to hear...err...read them!
  • 0

Tutorials of Interest:
* Multiplayer: mine or True Valhalla's

Projects:
* Net39
* My 39dll scripts
* My 39dll lib
* Multiplayer Engine
* Artificial Chemistry

Posted Image

#8 2DLuis

2DLuis

    Graphic Designer

  • GMC Member
  • 2527 posts
  • Version:GM8

Posted 27 June 2010 - 09:52 PM

I am really looking forward to a Dead Reckoning system so I may use it. I assume you'll calculate latency and compensate accordingly on the server?

I don't think there is an open source dead reckoning example on the GMC, is there?
  • 0

#9 sabriath

sabriath

    12013

  • GMC Member
  • 3197 posts

Posted 28 June 2010 - 06:35 AM

I think this is an important distinction =)

Except that all you have been taught is to run your server as a hub of information...instead of what it's meant for...relay information. A server should not do anything "harsh" in code at all, even warp-testing is calculated off-server, and dead-reckoning is handled by the clients. A server should simply:

1. read a message
2. figure out if they were even allowed to send the message (you can't send x/y updates at the character select menu)
3. send that message to people who need to "hear" it

That's it. You might think "well what about NPC? Questing? Mobs?" Imagine the matrix, remember the "programs"? Each 'program' connects to the matrix externally and has control over their aspects of the matrix world. Sooo... you have a client program that connects to the server just like any normal person can connect. This program is special in that ALL of its bitfields are on (meaning he is allowed to send ANY message at ANY time) because he is a "mod" program. This client will listen for people's updates and do all the harsh coding like "did that player just warp cheat", or "send that player an NPC quest box." This relieves the main server from game mechanics.

You can even go further by having multiple client connections listening to different areas....or programs to handle different mechanics. Since you can have theoretically 32k connections, a half dozen or so connections to mod clients won't hurt anything.

I unfortunately do not have an update tonight because I just got off work....and I had a really bad day. I'm going to let my brain simmer for a bit before I get back to it.
  • 0

Tutorials of Interest:
* Multiplayer: mine or True Valhalla's

Projects:
* Net39
* My 39dll scripts
* My 39dll lib
* Multiplayer Engine
* Artificial Chemistry

Posted Image

#10 e_barroga

e_barroga

    ES Studios Leader

  • GMC Member
  • 2475 posts

Posted 02 July 2010 - 02:19 PM

That right there is flat out amazing. Yet, having 32,000 client objects running on the server, would that not yank CPU values drastically?

You might have the value of the two commodities confused. You hardly worry about cpu cycle as much as worrying about saving bandwidth.

I do hope you perservere through with this, because if your server really gets to the point where it can support 32,000 connections, then there is no need for c++ servers around here anymore. Heck, if your connection could get 500 players playing online simultaneously, I'd still consider that a huge accomplishment.

I doubt anyone at home can get that kind of accomplishment for practical MMO's.

I don't think there is an open source dead reckoning example on the GMC, is there?

I'm sure there are many. In practicality, there is no such thing as a multiplayer game without dead-reckoning that involves real-time movement. An extremely simple dead reckoning technique is sending key strokes. Dead reckoning is more of a requirement, not a feature.

sabriath, secured registration connection is an interesting touch.


edit:

Except that all you have been taught is to run your server as a hub of information...instead of what it's meant for...relay information.

I do not see how the two are different. As you said, a server needs to read/send messages. 100 players sending and receiving data to one location, constantly..... it adds up. Not only that, the server needs to cache all the maps into memory all at once. In fact, you might want to cache more than just maps to lessen disk i/o.

Edited by e_barroga, 02 July 2010 - 02:30 PM.

  • 0

rsa_gmc_sig.png

 

logoGIF1.gif EXTENSION. PM TO PURCHASE LICENSE.


#11 sabriath

sabriath

    12013

  • GMC Member
  • 3197 posts

Posted 02 July 2010 - 04:44 PM

Not to be picky, but a few notes:

An extremely simple dead reckoning technique is sending key strokes. Dead reckoning is more of a requirement, not a feature.

Dead reckoning is actually the ability to calculate a person's determinate path using only partial data. Sending keystrokes only tells the "partial data" part of the equation, the rest is to figure out how to "make the character walk and hit the spots on all machines at the same time the player is hitting them on his computer." This technique is done by increasing the players speed before a point-reach, and then slowing his speed down afterward (slightly) and splining his path the best that can be done. And there's a lot more into it then even that....frustrating to say the least.

sabriath, secured registration connection is an interesting touch.

Thanks, but I have come up with a block and realized a breach in my previous assumption. Although I can secure communications with public-key knowledge assigned ahead of time....creating a key anonymously is extremely difficult (and the diffie-hellman approach is CPU exhaustive). This is the reason it has taken me a bit of time from my last update, working different angles right now and trying to find the best way to make this engine "easily changeable" as well.

I do not see how the two are different.

The difference is that a server that relays information is as simple as this:

size = receivemessage();
if (size)
{
    with obj_players
        sendmessage(socket);
    clearbuffer();
}
Although this is extremely brutal on the system, it is the basics behind relaying. The server is a metaphorical 'monkey', it doesn't know what the world looks like, it doesn't know what quests there are, it doesn't even know what items there are in the world. It only knows there are connections, and those connections have a status/grouping, and based on those, their data is redirected toward other common connections....that's it.

As I stated, ANOTHER client is programmed (so you end up with 3 programs, the server, and 2 clients). This client will log in to the server like normal, but has special status "properties" that allow it to be omnipresent (it receives data from anyone, and when it tells the server to tell 1 person or multiple people something, it can as if the server itself sent it). This client CAN see the world, it does know where the npc's are, what items are in the world, etc. etc. It "watches" what people are doing, and reacts to it.

So when a player walks into town, his location is sent to the common "group" he is in (and in that group is the mod client as well). The mod tells the server to say "npc:john is at XY" to the player...and the server does. The player receives this info and shows the NPC standing at XY. The player walks up to John and clicks him to talk (and since the client knows John as an ID of the game, the client simply opens up the information panel on what he says), no bandwidth is used up. When the player clicks "accept quest 'get the axe' from John" which happens to have a questID, he sends a message to the server. Since this message is part of the "quest grouping" information, the only person who "hears it" is the mod....the mod checks "is he next to john?" (the person assigned to the questID), "is the player the right level, is the quest accessible to him," etc -- then the mod sends an "ok" or a boot through the server.

The server is unaffected by these massive checks, since it is only relaying the information. ALSO.. (as I may have mentioned).. as more people connect to the server and overload the mod program, another mod program can be loaded and the groupings split up. This allows the players to not have to "reconnect" to another subserver during a group change, the mod simply pushes off any group data to the newly opened mod program (and the player remains connected to the primary relay server). The only thing the player sees is possible "lag" in the NPC database to appear in his area during a change (this can be seen even in big games like WOW where you fly into town at 300% movement and the server took some time switching your group info over -- could be up to 10 seconds even).



@TV:

I assume the 'mod' client programs wouldn't be running on the same machine as the server

You could run them on the same computer, but it takes up 2 spots on the network card if you do that (for each mod program you have running). The best is to have a computer with 2 network cards, 1 is connected to the internet where people connect into it, and the other is connected to a switch of computers that run only mod clients and other database stuff. This secures your internal mods from being 'hacked' for their authentications (although with internal cards, you don't even really have to have ANY authentication stuff since there's no way outside people can get to it). Being on a switch allows for extremely quick information exchange (and if you have a good cisco anti-collision switch it's even better).

Network engineering is fun, but expensive. This really is not needed for a simple GM game with less than a few dozen connections, but if your game is good, it can be quickly expanded with the techniques I will cover.

Edited by sabriath, 02 July 2010 - 04:58 PM.

  • 0

Tutorials of Interest:
* Multiplayer: mine or True Valhalla's

Projects:
* Net39
* My 39dll scripts
* My 39dll lib
* Multiplayer Engine
* Artificial Chemistry

Posted Image

#12 e_barroga

e_barroga

    ES Studios Leader

  • GMC Member
  • 2475 posts

Posted 02 July 2010 - 08:35 PM

The system is the same, the only difference is that you are spreading out cpu consumption (which is clever), but you didn't save any bandwidth. In fact, the additional client is an addition (although not as scarce) to the original bandwidth consumption.

Dead reckoning is actually the ability to calculate a person's determinate path using only partial data. Sending keystrokes only tells the "partial data" part of the equation, the rest is to figure out how to "make the character walk and hit the spots on all machines at the same time the player is hitting them on his computer." This technique is done by increasing the players speed before a point-reach, and then slowing his speed down afterward (slightly) and splining his path the best that can be done. And there's a lot more into it then even that....frustrating to say the least.

Partial data, extrapolation and interpolation... really all there is to it.
  • 0

rsa_gmc_sig.png

 

logoGIF1.gif EXTENSION. PM TO PURCHASE LICENSE.


#13 sabriath

sabriath

    12013

  • GMC Member
  • 3197 posts

Posted 03 July 2010 - 06:37 AM

The system is the same, the only difference is that you are spreading out cpu consumption (which is clever), but you didn't save any bandwidth. In fact, the additional client is an addition (although not as scarce) to the original bandwidth consumption.

I never said it saved bandwidth....I said that it cuts down on server lag due to forcing the server to "think" about what players are doing. When a player sends a "I want to do this quest" to server, TV (and others on these forums) have been locking up the GM server by doing all the checks for quest stuff. Even something as low as 1ms 'lag' in cpu usage on the server for each code message can have catastrophic effects on a >20 player MOG (1ms * 20 players * 30 code messages * 30 steps/sec = 18 seconds). Sometimes it's best to waste 0.5ms sending data between mods and clients then wasting 1ms making the server do all the work.

Partial data, extrapolation and interpolation... really all there is to it.

*blinks*

YEeeeeahhh... that's all. Nothing to it! lol

I appreciate your interest though, so don't take my sarcastic overtones too personal (of course you know how I am :) ).
  • 0

Tutorials of Interest:
* Multiplayer: mine or True Valhalla's

Projects:
* Net39
* My 39dll scripts
* My 39dll lib
* Multiplayer Engine
* Artificial Chemistry

Posted Image

#14 sabriath

sabriath

    12013

  • GMC Member
  • 3197 posts

Posted 05 July 2010 - 05:54 AM

Though, I don't understand the advantage if you're running the mod client on the same PC as the server.

There isn't much advantage because of the wasted bandwidth doubling on the same computer (writing to a port just to read it back). If there was a way to use a virtual connection (maybe a shared memory block), then this could easily get rid of that problem. The main advantage of running both mod and server on the same system is threading....GM uses only about 15% at most of my CPU, and I have 2 dual cores, so that's 85% "free" space somewhat.


I'm sorry it is taking me a long time putting out an update...I've had to switch my sleep cycle and I'm not use to it yet.
  • 0

Tutorials of Interest:
* Multiplayer: mine or True Valhalla's

Projects:
* Net39
* My 39dll scripts
* My 39dll lib
* Multiplayer Engine
* Artificial Chemistry

Posted Image

#15 sabriath

sabriath

    12013

  • GMC Member
  • 3197 posts

Posted 07 July 2010 - 10:53 PM

I have off today and tomorrow, my wife works....so guess what I get to do! Yep, another update to the engine, enjoy! And please let me know if there are any problems, or if you have any additions to make.

Main post was edited, blue is new.
  • 0

Tutorials of Interest:
* Multiplayer: mine or True Valhalla's

Projects:
* Net39
* My 39dll scripts
* My 39dll lib
* Multiplayer Engine
* Artificial Chemistry

Posted Image

#16 Ace

Ace

    GMC Member

  • GMC Member
  • 372 posts

Posted 09 July 2010 - 06:29 AM

Just curious, but is there UDP and file downloading/uploading support between clients in this version? If not, are these two things planned?

I cant seem to get the hang of file downloading/sending and need a good engine that supports UDP sending of simple data such as button presses and whatnot. As far as I know, no engine exists that supports these features natively.
  • 0
Posted Image Posted Image Online Fighting & Roleplay Game

ZERO ENGINE
Posted Image

#17 sabriath

sabriath

    12013

  • GMC Member
  • 3197 posts

Posted 22 July 2010 - 01:12 AM

Now where are those updates? =)

My apologies....to everyone really. Last week was my wife's birthday and I spent my days off with her. Then I had a 6 day workweek and today was my only day off (and I screwed around a bit). I'm having a hard time getting back into this lately because of my hectic schedule...along with the fact that I've had a few people state this is more complicated than they can handle. Maybe I should reduce this even more for the KISS method.
  • 0

Tutorials of Interest:
* Multiplayer: mine or True Valhalla's

Projects:
* Net39
* My 39dll scripts
* My 39dll lib
* Multiplayer Engine
* Artificial Chemistry

Posted Image

#18 BlaXun

BlaXun

    Slime Online Creator

  • GMC Member
  • 2750 posts
  • Version:GM:Studio

Posted 12 November 2010 - 09:47 AM

TV:

Thank you for the positive feedback, I do take pride in my coding style (although the DB save/load scripts are horrendous right now, I will look to fixing up that mess in a few). I know that it needs more commenting, however I am trying to push for a completion at the moment (the comments I did put is for my own benefit to remind me what arguments the functions take), however the new stuff has a tiny-bit more definitions in those headers.

As for data encryption, I'll be using the same authentication scheme I worked up in my old scripts, but with much faster turnout. As for the data itself, encrypting every piece will be extremely cumbersome, and I think it would be best to just run a game plain-text -- only using encryption on things that need it (password changes, and possibly a minute timer pulse to check if the person is still who it's suppose to be).

2DLuis:

Thanks very much! I don't want to bring BlaXun down or throw him out of the ring...but I think his engine has reached a point of complication that beginners are having trouble understanding, and he has stated several times that he is too busy to rewrite the entire thing. I'm hoping that I can relieve him of his stress a bit and he can go back to making games again -- let someone else take the reigns lol :)


Damn, and I thoguht I made it rly simple ;_;

Well, now that I'm back I can take a look again.
And I dont think we have to compete whith each other at all :)
We can propably learn from each other (at least I can learn from u, and I am willing to do so)
Wish u best of luck with everything =)
  • 0

iBNKRoX.png


#19 e_barroga

e_barroga

    ES Studios Leader

  • GMC Member
  • 2475 posts

Posted 16 November 2010 - 01:31 AM

Spreading out CPU usage is the important part. From my experience with Realm One Online, bandwidth did not become an issue. Even with 15 players online, bandwidth was not a problem at all. The usage was absolutely minimal. On the other hand, my unrefined coding practices at the time and poor initial server design led to large CPU usage, and in the end I decided that this level of usage was not sustainable.

So, I decided to discontinue my game and work on a new design which took into account the flaws of the game design I'd chosen. Everything about my new game's design revolves around lessening the burden on the CPU -- this model Sabriath has suggested intrigues me a lot, because it can potentially allow me to save on CPU usage further. Though, I don't understand the advantage if you're running the mod client on the same PC as the server.

With my new project I'm being even less frugal with bandwidth usage now that I have an even more efficient server infrastructure, but CPU is still my biggest worry.

You probably have horrible design. I can use up all the bandwidth with only 20pct CPU usage. Trust me CPU isn't as important as bandwidth, unless you're doing something wrong.
  • 0

rsa_gmc_sig.png

 

logoGIF1.gif EXTENSION. PM TO PURCHASE LICENSE.


#20 sabriath

sabriath

    12013

  • GMC Member
  • 3197 posts

Posted 16 November 2010 - 10:00 AM

Well, now that I'm back I can take a look again.
And I don't think we have to compete with each other at all :)
We can probably learn from each other (at least I can learn from u, and I am willing to do so)
Wish u best of luck with everything =)

Thanks and you too. Seems lately I don't have much time for anything, still working on Net39 whenever I have a chance (finally got the UDP connection finished, yay).

You probably have horrible design. I can use up all the bandwidth with only 20pct CPU usage. Trust me CPU isn't as important as bandwidth, unless you're doing something wrong.

In a normal situation of a good mmorpg setup, you will have no less than 10 "mobs" (mobile objects) that must be calculated for _each_ person online at any given time. Running these calculations through a GM server is terrible and would take up far more CPU than bandwidth as a block...but with the technique described, GM could do it fine (not the best language to use, but I'm only comparing the technique itself).
  • 0

Tutorials of Interest:
* Multiplayer: mine or True Valhalla's

Projects:
* Net39
* My 39dll scripts
* My 39dll lib
* Multiplayer Engine
* Artificial Chemistry

Posted Image

#21 spicydeath82

spicydeath82

    Awesomesauce

  • New Member
  • 138 posts
  • Version:GM8

Posted 10 January 2011 - 10:19 PM

looking good sabriath. looking forward to it. it would make some of the games i have planned easier to implement.
  • 0
Life is incapable of of springing from nothing. Science has proven that. So if life here didn't spring up outta the primordial muck then who's responsible? Life has to come from life.

Posted Image

#22 KurtBlissZ

KurtBlissZ

    GMC noob

  • GMC Member
  • 752 posts
  • Version:GM:Studio

Posted 21 August 2012 - 04:04 PM

Hey you get this error for your download, running the server then client

___________________________________________
FATAL ERROR in
action number 1
of Trigger Event: Registering
for object obj_register:

COMPILATION ERROR in code action
Error in code at line 61:
keyb = readchars(16);
^
at position 21: Unknown function or script: readchars


Though I did easily fix it change line 61 to keyb = dll_readchars(16); looks like you renamed some stuff and forgot to save or test it :P lol, anyways not sure this is for me, I only followed the 39ster's tutorial for 39dll I'm still learning.

Though I never know you could make constants, gues I did before I just long forgot about them, I did just start using triggers a while ago. Not that there needed but very useful.
  • 0