| Mirage Source http://miragesource.net/forums/ |
|
| Walking issues http://miragesource.net/forums/viewtopic.php?f=201&t=750 |
Page 1 of 1 |
| Author: | Spodi [ Mon Nov 20, 2006 12:38 am ] |
| Post subject: | Walking issues |
A friend is having problems logging in, so I am making this post for him: Hello everyone at Mirage Source. I would like to bring to your attention a bug I am currently having that I have been unable to fix. I have asked many different programmers good and bad for some help with this and this problem has found to be so far unfixable. Whenever someone logs into the server with their character and runs around everything is fine and perfect and they are no flaws or problems. But when someone else logs in and starts to run/walk around and the other character watches they see a form of lag, Almost like if the person's character is running/walking and is missing blocks. An example of this would be like starting as 1 being the top frame and 10 being the bottom one 1 2 3 5 7 10 This problem happens on all types of PC's fast and slow and all types of lines. We have tried many different settings and ways of fixing this. The only way left would be a flaw in the programming. Could anyone help me with this flaw? Thanks, Damien MSN - mailto:[email protected] |
|
| Author: | Misunderstood [ Mon Nov 20, 2006 1:08 am ] |
| Post subject: | |
Is it a problem with the client sending the wrong info, the server reading or setting the wrong info, the server sending the wrong info, or the client is setitng/bltting the wrong info? I would use Debug.print to print the values at those 4 instances to see where the problem happens. I know thats probably common sense stuff...but I don't know what else to say. |
|
| Author: | Reece [ Mon Nov 20, 2006 4:29 pm ] |
| Post subject: | |
I always thought it was natural part of the MS engine. Check Elysium source im sure they fixed it. |
|
| Author: | Verrigan [ Mon Nov 20, 2006 10:08 pm ] |
| Post subject: | |
I think this has a lot to do with the nagling, Spodi's friend.. Lookup setsockopt on the internet.. (You won't find many VB references for it, but it is fairly easy to convert..) The function will look something like this, when you're done.. Code: Call setsockopt(frmMirage.Socket.SocketHandle, TCP_NODELAY, 1, 4) I believe the declaration for setsockopt() is something like this: Code: Public Declare Function setsockopt Lib "ws2_32.dll" (ByVal sHandle As Long, ByVal sFlag As Long, OptVal As Any, OptValLen As Long) As Long There are some other things that you'll need declared, but not sure what they are atm.. Lookup SOCKET_ERROR and TCP_NODELAY on google, and I'm sure you'll find what you're looking for.Basically, that turns off the buffer that is used by default in the winsock control.. (Which has some good points, but also has bad points if your packets are very small.. Spodi did an article on this somewhere...) This can be done on the server, too.. and might help with this issue... ...Though I think you will also need to make sure that the server sends all movement messages to the client, and make sure that the client buffers those movements, so that it doesn't skip over any... Since the client pretty much handles the movement code as soon as it is received, it will pop the other players into their 'new' x/y positions while they're walking/running, and make it look like they're skipping tiles.. (OMG U R Uzng Sped! U HAKER!) Warning.. Theory stuff mentioned above, as I am not at home where my beloved VB and Visia are, so I cannot perform a test and give you 100% accurate information. :) Also, if you are using SOX or the JetByte IOCP ComSocketServer library, then the top section of this post shouldn't apply. :P [edit] Originally forgot the lib in the declaration.. silly me. :P After looking over my code that I converted from the Platform SDK documentation, I am back with the correct declaration. :P Code: Public Const TCP_NODELAY = &H1& Public Const SOL_SOCKET = &HFFFF& Public Declare Function setsockopt Lib "ws2_32.dll" (ByVal s As Long, ByVal level As SocketOptions, ByVal optname As SocketOptions, optval As Any, ByVal optlen As Long) As Long So the call to setsockopt() would look more like: Code: Dim OptVal As Long
OptVal = 1 Call setsockopt(frmMirage.Socket.SocketHandle, SOL_SOCKET, TCP_NODELAY, OptVal, Len(OptVal)) |
|
| Page 1 of 1 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|