Mirage Source http://web.miragesource.net/forums/ |
|
Packet Enum - Completed http://web.miragesource.net/forums/viewtopic.php?f=210&t=2764 |
Page 2 of 2 |
Author: | Coke [ Thu Sep 27, 2007 12:26 pm ] |
Post subject: | Re: Packet Enum - Completed |
Guys what i dont understand is we obsess over bits, and bytes so much; if you look at mainstream online games they spam the hell out of the server and client, they have 32897423987432 more packets sending constantly than MS does; yet we still get some little lags on MS. Why is this? Simply because its vb6.0? |
Author: | William [ Thu Sep 27, 2007 12:33 pm ] |
Post subject: | Re: Packet Enum - Completed |
Well, it's obviously cause vb aint so good. But never the less, the largest part is how it's programmed. I don't encounter any lag in my game now. And nor do the players. Of course it highly depends on how many players you got, but a MS game can for sure carry tons of players as long as you've spent a lot time fixing the source up. |
Author: | Matt [ Thu Sep 27, 2007 12:39 pm ] |
Post subject: | Re: Packet Enum - Completed |
Winsock plays a part in it too. These mainstream games have custom socket handlers and shit like that. |
Author: | Lea [ Thu Sep 27, 2007 1:11 pm ] |
Post subject: | Re: Packet Enum - Completed |
These commercial game servers also run on 100 different computers with a fiber connection to the internet |
Author: | Aranshada [ Thu Sep 27, 2007 6:06 pm ] |
Post subject: | Re: Packet Enum - Completed |
I'd just like to add a little note about this tutorial, if I may. Any variable declared of a custom Enum type will be 4 bytes. I even made a quick test program to confirm this. I had one form, and one module. In the module, I had this code: Code: Public Enum PacketName First = 1 Second Third Fourth Fifth Sixth Seventh Eighth Ninth Tenth End Enum In the form, I had this code: Code: Private Sub Form_Load() Dim myEnumVar As PacketName myEnumVar = Fifth MsgBox "myEnumVar: " & Str$(myEnumVar) & vbNewLine & "LenB: " & LenB(myEnumVar) End End Sub When I ran the program, I got a message box containing this: MessageBox wrote: myEnumVar: 5 LenB: 4 I felt I needed to bring that to light since it was mentioned in the tutorial that it would make the packet ID be 1-2 bytes, but it will indeed be a full four bytes. Of course, the way to make them 1 or 2 bytes is to have a bunch of constants set as bytes or integers. But by nature, all Enums are of data type Long. P.S. I believe I may still have a copy of Verrigan's "binary packet" MSE where he tweaked all of the stuff. Granted, I can't check until I can get back to my computer at home. |
Author: | Robin [ Thu Sep 27, 2007 6:13 pm ] |
Post subject: | Re: Packet Enum - Completed |
Convert it to byte. |
Author: | Aranshada [ Fri Sep 28, 2007 3:14 am ] |
Post subject: | Re: Packet Enum - Completed |
You mean a bunch of byte constants? Or: Code: Public Enum Packets As Byte Blah = 1 MoreBlah BlahBlah FourthBlah End Enum Note: No clue if that'd even compile, I don't feel like pulling up VB6 right now. =x I'm assuming you mean byte constants... which would be the best way to do it. |
Author: | Robin [ Fri Sep 28, 2007 3:10 pm ] |
Post subject: | Re: Packet Enum - Completed |
cByte I think it's called. |
Author: | Aranshada [ Fri Sep 28, 2007 6:01 pm ] |
Post subject: | Re: Packet Enum - Completed |
Oh, wrap all of the Enum variables with CByte(packetID) before you stick it on the packet. I get it. =x |
Page 2 of 2 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |