Ideas to decrease server load.

Thoughts on the further development of Haven & Hearth? Feel free to opine!

Re: Ideas to decrease server load.

Postby BWithey » Sat Oct 09, 2010 9:13 pm

Thurrok wrote:Maybe I'm wrong here but wouldn't continuous keystroke movement actually "emulate" hundreds of clicks per second the way it works now? Since that wouldn't save bandwidth, just cause an epic spike.


I'm not sure how it works, but that's kinda what I was thinking.
BWithey
 
Posts: 274
Joined: Sun Aug 01, 2010 3:16 pm

Re: Ideas to decrease server load.

Postby BlueFire » Sun Oct 10, 2010 1:15 pm

Implementing a collision detection that is in the client as well would help. Or basically all checks that are preformed by the server should also be preformed by the client. This will eliminate all the "stupid user clicks" before the server ever has to process them. The server must check so the game is not being abused, but the client should also as well. By "stupid user clicks" I mean all those times someone tries to walk through the edge of a boat over and over when it's not going to work cause it has an invisible wall... stuff like that.

Arrow keys are not constant clicks, they are usually received and sent as press up and press down events. More then likely they will neither reduce nor increase server load.

You can allow the client to handle moving things around in your inventory. The server only needs to be involved when something is added and removed from the inventory or when the things inside are used, and then when a user closes a box to save the configuration of only those things that were moved.
User avatar
BlueFire
 
Posts: 80
Joined: Thu Sep 30, 2010 1:44 am

Re: Ideas to decrease server load.

Postby mvgulik » Sun Oct 10, 2010 1:56 pm

BlueFire wrote:You can allow the client to handle moving things around in your inventory. The server only needs to be involved when something is added and removed from the inventory or when the things inside are used, and then when a user closes a box to save the configuration of only those things that were moved.

... macro'ers wet dream I'm sure. ...
mvgulik
 
Posts: 3786
Joined: Fri May 21, 2010 2:29 am

Re: Ideas to decrease server load.

Postby BlueFire » Sun Oct 10, 2010 3:53 pm

mvgulik wrote:
BlueFire wrote:You can allow the client to handle moving things around in your inventory. The server only needs to be involved when something is added and removed from the inventory or when the things inside are used, and then when a user closes a box to save the configuration of only those things that were moved.

... macro'ers wet dream I'm sure. ...


oh no people are going to move their stuff around more efficiently they're really going to have the advantage there...
User avatar
BlueFire
 
Posts: 80
Joined: Thu Sep 30, 2010 1:44 am

Re: Ideas to decrease server load.

Postby genusis » Sun Oct 10, 2010 4:31 pm

To reduce Bandwidth by using a byte array system. May cause the server to use a little more CPU like .2 per every 300 players but it would drastically reduce bandwidth so then you would not need to worry about stuff being sent back and forth XD.

this is an example in vb6 but can be written over to java just would have to change a few variables.
Private Buffer() As Byte ' Our byte array to hold all data

this is for writing a single -255 to 255 data variable into the byte array.
Code: Select all
Public Sub WriteByte(ByVal nByte As Byte)

    Select Case WriteHead > BufferSize
    Case True
        Allocate 1
    End Select

    Buffer(WriteHead) = nByte
    WriteHead = WriteHead + 1
End Sub


this is fr writing a preallocated amount to the byte array.

Code: Select all
Public Sub WriteBytes(ByRef nByte() As Byte)
    Dim nLength As Long

    nLength = (UBound(nByte) - LBound(nByte)) + 1

    Select Case WriteHead + nLength - 1 > BufferSize
    Case True
        Allo



this is used to read the Data from the byte.
Code: Select all
Public Function ReadByte(Optional MoveReadHead As Boolean = True) As Long

    Select Case ReadHead > BufferSize
    Case True
        Exit Function
    End Select

    ReadByte = Buffer(ReadHead)

    Select Case MoveReadHead
    Case True
        ReadHead = ReadHead + 1
    End Select

End Function


this is to read the prelocated data from the byte array.

Code: Select all
Public Function ReadBytes(ByVal nLength As Long, Optional MoveReadHead As Boolean = True) As Byte()
    Dim Data() As Byte

    Select Case ReadHead + nLength - 1 > BufferSize
    Case True
        Exit Function
    End Select

    ReDim Data(nLength) As Byte

    CopyMemory Data(0), Buffer(ReadHead), nLength

    Select Case MoveReadHead
    Case True
        ReadHead = ReadHead + nLength
    End Select

    ReadBytes = Data
End Function
genusis
 
Posts: 56
Joined: Tue Aug 31, 2010 5:20 am

Re: Ideas to decrease server load.

Postby JustasJ » Sun Oct 10, 2010 5:32 pm

Thurrok wrote:Maybe I'm wrong here but wouldn't continuous keystroke movement actually "emulate" hundreds of clicks per second the way it works now? Since that wouldn't save bandwidth, just cause an epic spike.


Nooo. You press a key, and you keep moving until something blocks your path, and not a click for each meter you walk.
Throughout the centuries there were men who took first steps, down new roads, armed with nothing but their own vision.
- Ayn Rand
User avatar
JustasJ
 
Posts: 205
Joined: Wed Feb 03, 2010 1:48 pm

Re: Ideas to decrease server load.

Postby Jackard » Mon Oct 11, 2010 4:02 am

Thurrok wrote:Maybe I'm wrong here
User avatar
Jackard
 
Posts: 8849
Joined: Sun Jul 12, 2009 6:07 am
Location: fucking curios how do they work

Re: Ideas to decrease server load.

Postby genusis » Fri Oct 15, 2010 2:56 am

well there are several ways to do it but the push key one is the same as holding it down and sending every step your player makes to the server to update your position to the other players online. what the server does is you click sends where you want to go server calculates it and sends each movement to the next block then when server detects that there something in your way it send a signal to stop your player or sends a signal to stop your player when he reach's the destination. the way it should be done is Client side for there characters movement then just send where there character is on the map to the server then the server can double check to make sure there's nothing in the path <hack protection> if no the server just sends the data to the other players but the one who sent the information.same for all the other things, the server is the reason why people get massive lag in the game especially when the server gets an error or heavy load. this way will lighten the load on the server. since then all the server has to do is check the data then send it to the other clients.

Clients should do most of the work and Server should just be there to double check things and send information and save information of players and maps and stuff.
genusis
 
Posts: 56
Joined: Tue Aug 31, 2010 5:20 am

Re: Ideas to decrease server load.

Postby notacunt » Fri Oct 15, 2010 3:14 am

Client side map generation might help for bandwidth.
User avatar
notacunt
 
Posts: 31
Joined: Mon Jul 05, 2010 1:33 pm

Re: Ideas to decrease server load.

Postby DatOneGuy » Fri Oct 15, 2010 5:06 am

Question is can arrow key movement be done through an edited client?

If so, do want.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . .Hi. . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
User avatar
DatOneGuy
 
Posts: 5553
Joined: Sun Apr 18, 2010 7:50 am
Location: I'm in Miami, trick.

PreviousNext

Return to Critique & Ideas

Who is online

Users browsing this forum: Claude [Bot] and 1 guest