Author Topic: Ideas to improve performance  (Read 2994 times)

Jessyn

  • Hydlaa Citizen
  • *
  • Posts: 249
    • View Profile
Ideas to improve performance
« on: December 17, 2002, 08:37:41 pm »
I had an idea to reduce lag, and figured that some(if not all) of you might have ideas to improve performance, so if we come up with enough crazy ideas, maybe the devs will like a few, and we get a better game, so....

1) Store characters locally - hacking the char could be prevented by transmitting a \"hash\" to the server to verify that the char hasn\'t been changed.  the server would only have to store a single number per character, and verify it when appropriate.  It would still have to be updated whenever the char changed, but it might reduce lag times.

btw, for those who don\'t have backgrounds in programming/cryptography, a hash is a number derived from any one way mathematical procedure.  any set of stats would have a unique hash, which wouldn\'t match the char stats if they were changed by anything other than the server(ie - hacked)

Just a thought,

Jessyn
Most things in life operate, not on reality, but the perception of reality.  

Link

  • Hydlaa Notable
  • *
  • Posts: 895
    • View Profile
(No subject)
« Reply #1 on: December 17, 2002, 09:45:27 pm »
There is still to big of a risk storing them locally, which is why most MMORPGs don\'t, storing them server side only adds a second or two to loading time and guarantees safety.
The Great Linksunius

Vengeance

  • Veteran
  • *
  • Posts: 1452
    • View Profile
(No subject)
« Reply #2 on: December 17, 2002, 11:54:52 pm »
For those who don\'t have backgrounds writing MMORPGs, ;-) the lag is not, repeat not, caused by network bandwidth.  The lag in the demo and whatever lag you experience in MB are caused by graphics overload and the 3d engine, not by the network.

Our engine keeps getting faster but our world keeps getting bigger and more complex.

- Vengeance

Tomaseth

  • Hydlaa Resident
  • *
  • Posts: 151
    • View Profile
(No subject)
« Reply #3 on: December 18, 2002, 12:26:28 am »
I\'m not experienced in writting online games or anything, so I guess I\'m not really sure how it all works. So when the world keeps getting bigger how do you deal with lag problems?

Jessyn

  • Hydlaa Citizen
  • *
  • Posts: 249
    • View Profile
(No subject)
« Reply #4 on: December 18, 2002, 12:31:13 am »
ok venge, didn\'t know that, thanks

tomaseth, they will may have to do what everquest(shudder) did, and break the world into \"zones\"

Jessyn
Most things in life operate, not on reality, but the perception of reality.  

kinshadow

  • Hydlaa Citizen
  • *
  • Posts: 218
    • View Profile
(No subject)
« Reply #5 on: December 18, 2002, 12:37:59 am »
Quote
Originally posted by Tomaseth
I\'m not experienced in writting online games or anything, so I guess I\'m not really sure how it all works. So when the world keeps getting bigger how do you deal with lag problems?


Zones are the usual solution (first seen in UO & EQ).  You only load the area (city, forest, etc) you are in and only get world data about that area.  More advanced systems stream the data, but I don\'t see that happening unless someone hacks a more dynamic mapping system into crystal space.  UO did zone change overs real well (you didn\'t know it was happening), but it was 2D and took a lot less to load.  In EQ you have to sit in an inter-zone limbo waiting for the next to load.  Zones have the benefit of being distributed....you can have a seperate server or seperate process for each zone.  Allows scalability as the game grows.

The bandwidth becomes more of a problem the more players you have and the more dynamic objects the server has to tell the client about (MOBs, equipment, treasure, etc).

Vengeance

  • Veteran
  • *
  • Posts: 1452
    • View Profile
(No subject)
« Reply #6 on: December 18, 2002, 03:34:12 am »
kinshadow is right about both issues.

Tomaseth

  • Hydlaa Resident
  • *
  • Posts: 151
    • View Profile
(No subject)
« Reply #7 on: December 18, 2002, 01:39:25 pm »
Okay, thanks.  :]

Voldengrath

  • Hydlaa Citizen
  • *
  • Posts: 227
    • View Profile
(No subject)
« Reply #8 on: December 18, 2002, 09:40:26 pm »
Also, that locally thing

Knowing computers, even if you are clean might send out a bad hash or whatever and cause your character to be concidered Corrupted =(
Voldengrath Blake

Jessyn

  • Hydlaa Citizen
  • *
  • Posts: 249
    • View Profile
(No subject)
« Reply #9 on: December 20, 2002, 02:40:44 am »
once again, i bow to those with superior knowledge... :P    However, i notice no one else has come up with any ideas..... :rolleyes: oh well...

Jessyn
Most things in life operate, not on reality, but the perception of reality.  

Snodgrass

  • Traveller
  • *
  • Posts: 28
    • View Profile
(No subject)
« Reply #10 on: December 20, 2002, 05:16:06 am »
My guess is that most of this information is in the forum for coders which we don\'t have access to.  However, it would seem the biggest performance increases would come from compressing the data stream from the server.  When I have had to do this it took quite a bit of knowledge about the data set that you are trying to transmit.  Usually the best approach was to turn it from a text format to binary.  I got further mialege by taking standard flag information and making it parts of a byte.

The problem is premature optimization is the root of most evil in most projects.  Since this is a pre-alpha release I wouldn\'t expect that it is a hot topic right now.  However, I\'m often wrong.  

Vengeance

  • Veteran
  • *
  • Posts: 1452
    • View Profile
(No subject)
« Reply #11 on: December 20, 2002, 07:13:21 am »
Quote
For those who don\'t have backgrounds writing MMORPGs, ;-) the lag is not, repeat not, caused by network bandwidth. The lag in the demo and whatever lag you experience in MB are caused by graphics overload and the 3d engine, not by the network.


See above.

- Venge

Snodgrass

  • Traveller
  • *
  • Posts: 28
    • View Profile
(No subject)
« Reply #12 on: December 22, 2002, 04:26:56 pm »
At this time with say 20 or so characters in a single area, with nothing really going on, I would totally agree.

However, let\'s take an example that was talked about previously and expand on it.  It was stated that if you want a hoard of monsters to come charging down the hill you could use a flat polygon per monster with an animated image on it.  In the problem statement it must also be able to be piped through a 56 K modem.  The server speed and band width are not an issue.  

On a hot day I never saw my modem ftp something in better than 3 kbytes per second.  This might be due to a less than desirable phone line but let\'s go with it.  

X,y, and z are 4 byte floats.

Pitch, roll and yaw are 4 byte floats.  

We can get rid of z, pitch and roll because the monsters are standing on the ground.  Total 12 bytes.  

You might want to add another byte to determine what texture set to place on the poly so they don\'t all look the same or 13 bytes to determine the object.  The last 2, the yaw and the poly set, determine what picture is on the polygon.  

There is an issue of update rate.  Assuming you\'re using interpolation to make the screen run smoothly the update rate is just viewed like lag.  I\'m going to use 5 updates per second.  I\"m kind of pulling it out of my hat but it the ping in some sites is about 200 milliseconds roundtrip, going any faster than that would be a waste.  

13 * 5 = 65
3000 / 65 = 46

46 is hardly a hoard.  If you forced everyone to use a cable modem or better there might be a lot more.  
But if we looked at it differently.  Since we know a lot about this data set maybe there\'s a way to compress it that is fast and easy to code.  Instead of looking at it at individual monsters we look at it in a group.  Let\'s use a group of 16 because it is a computer friendly number.  And isn\'t unwieldily as groups go.  
Some other constraints to make life easier is that the collision border is group sized not individualized (ie. Groups don\'t mix except within themselves) and go around objects, never split, and we will say each member is killable and everyone in the group faces the same direction.  We create a group grid of one by one byte and all members are within that.  

X,y, yaw, Group position and direction.
Since yah does not have to actually be a float it can be one byte, another shortcut.  X,y and yah = 9 bytes.  Plus, type byte = 10.  Then each group member sub(x + y) = 2 bytes.
  So,
members * 2 + 10 = 42 bytes.

That\'s 42 bytes as opposed to 192 bytes for 16 monsters.  42 X 5 = 210
3000 / 210 = 15    15 X 16 = 224

224 monsters is not bad but I want a real hoard.  Fortunately we can do better.  Let\'s try another approach at the problem statement and constraints.  Say that instead of having 2 halves, each element independent, we have an orbital pattern or each monster in the group is assigned to a position via a look up table.  To make it interesting we will have 64 K entries in the look up table/ or up to 64 K, since ram is cheap.  Then we will have 2 kill status bytes for our 16 monsters.  

X,y, yah, kill status, group position, and type = 14 bytes.
14 bytes for 16 monsters not bad.

14 X 5 = 70.

3000 / 70 = 42

42 X 16 = 672 monsters

So that\'s 672 independent monsters all moving around.  That might work for a small battle but wouldn\'t it be cool to compress in some serious carnage.  We\'re going to need some more tricks.  There is always culling based on distance but it would be better to have it all on screen to give the gamer a scene of true panic and mayhem.  We don\'t want them to be stationary.   A group of monsters just standing there looks stupid.  So the obvious solution is large groups that can be broken up (ie formation).  Formations can then be broken up into groups or individuals for combat against characters.  Let\'s show an example for a formation of 256 monsters.  

256 = 32 Kill bytes for individual monster killing
X,y, yaw + kill bytes + formation position = 43 bytes.
16 X 5 = 215
3000 / 80 = 13
13 X 256 = 3,328

3,328, now that\'s a hoard of monsters.  So you can have individual groups and divisions  mixed and have enough bandwidth left over to do the other required communications on a 56 K bod modem.  Okay, so we can\'t use 3328 monsters but if you want two armies fighting each other with 1,000 monsters apiece, where there are different levels of interactions required, this approach might work.  

Some of the numbers I used here, for instance update rate, I just had to pick something to show a comparison.  However, in concept whatever system you used, compressing by using grouping, would probably get more monsters on a field for the same bandwidth.  It\'s possible that this is the way it\'s really done anyway or something similar.  This is something I just came up with as an example of data compression concepts.  

I hope this clears up my point.
 

Severed Hope

  • Traveller
  • *
  • Posts: 35
    • View Profile
(No subject)
« Reply #13 on: December 22, 2002, 09:08:53 pm »
Well, would using \"flat\" animated pixie-characters (ALA Final Fantasy Tactics ALA Jet Set Radio) -- which would also give any artists we have here a chance to flex their creativity, would that help in processing speed for them?

I mean -- if you take the 3-D out of the characters and monsters, leaving only 2-D animations, aside from flags and stuff, or maybe even just removing the 3-D out of every non-static picture... first of all if its done right it can look wicked, if dated -- but this is a free game and we can\'t expect people to need a huge high end super computer to play it anyway -- so if the graphics aren\'t the best on earth, no one can really complain.  But like I said if its done right it can look wicked.

Im just not sure of that would actually help.

And if I sound like a moron, feel free to tell me all about it.

Bigfoot

  • Hydlaa Citizen
  • *
  • Posts: 268
    • View Profile
(No subject)
« Reply #14 on: December 22, 2002, 11:20:43 pm »
Nothing realy to do with Network lag, but...

Clipping plane clipping plane clipping plane... there has to be a clipping plane. Im shocked one hasnt been put in already.

also people have to stop refering to low FPS (frames per second) as graphical lag. lag, latency and ping have nothing to do with graphics ^^. Low FPS has nothing to do with network speed or codeing but has every thing to do with the rig thats running the game, and slightly less so but still with the polycounts of the games models

On teh network side Daoc used a bubble system, where the player client asked for all relavant information within a defined radius. the result was that you had no zone loading, expect where they wanted it, such as the capital cities and entering dungeons I was playing on european servers and had very comfortable gameplay (network wise) sept for the odd ping spike.