Jump to content


Photo

mplay speed improvement using strings


  • This topic is locked This topic is locked
6 replies to this topic

#1 tomster1996

tomster1996

    GMC Member

  • New Member
  • 312 posts

Posted 09 September 2010 - 08:28 PM

I'm sending and recieving 15 values using mplay functions and i think it might be slowing down my game. Would compressing all the values into one string, sending the string, and then extracting the values from that string thats recieved on the other application run quicker?
  • 0

#2 ragarnak

ragarnak

    GMC Member

  • Retired Staff
  • 19468 posts
  • Version:GM8

Posted 09 September 2010 - 08:35 PM

Would compressing all the values into one string, sending the string, and then extracting the values from that string thats recieved on the other application run quicker?

Why don't you try ? :whistle:
  • 0

#3 tomster1996

tomster1996

    GMC Member

  • New Member
  • 312 posts

Posted 09 September 2010 - 08:40 PM

Would compressing all the values into one string, sending the string, and then extracting the values from that string thats recieved on the other application run quicker?

Why don't you try ? :whistle:


To put it bluntly, i cant be bothered.
I'd have to recode my game, or create a new test game and some scripts just for to see it it runs quicker.
I was hoping someone just knew the to save me the time. If not though, i will try it out myself.
  • 0

#4 tie372

tie372

    Bassist of Death

  • New Member
  • 1038 posts
  • Version:Unknown

Posted 09 September 2010 - 10:11 PM


Would compressing all the values into one string, sending the string, and then extracting the values from that string thats recieved on the other application run quicker?

Why don't you try ? :whistle:


To put it bluntly, i cant be bothered.
I'd have to recode my game, or create a new test game and some scripts just for to see it it runs quicker.
I was hoping someone just knew the to save me the time. If not though, i will try it out myself.


No this probably won't be faster. Each character of a string is one byte. So if you send 3642 as a short, this is two bytes. If you send "3642" that is four bytes. This already doubles the data size. After you multiply this by the 15 values you have, plus any delimiting or formatting you would need to add in, it becomes apparent that sending numbers is a lot slower than sending strings.

PS: I just saw you were using MPlay. The above advice is from my experience with 39dll. I'm not sure if MPlay uses a different system, but I'm almost positive that strings will still be slower.

Edited by tie372, 09 September 2010 - 10:13 PM.

  • 0

#5 brett14

brett14

    GMC Member

  • GMC Member
  • 1150 posts
  • Version:GM8

Posted 10 September 2010 - 04:25 AM

You should use 39dll. Much faster, much more efficient, much less lag, more control over what data gets sent.
And MPlay has a bad reputation of being HORRIBLY SLOW.

Edited by brett14, 10 September 2010 - 04:26 AM.

  • 0

#6 Medusar

Medusar

    GMC Member

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

Posted 10 September 2010 - 12:54 PM

MPlay is said to have a massive overhead when it comes to using bandwith, so if you're worried about that you've got to use 39DLL.

Either way, it will not make the game faster, because there is no magic synchronisation system. When a message is sent, the game simply continues execution. It doesn't wait for the message to arrive at the other side. An MPlay function hardly takes any time to execute, so if you experience lag, it's mostly due to some other part of the game.

Putting all messages into one gigantic string might cause less bandwith usage - that of course only if it only consisted strings in the first place - but will certainly make your game slower because you have to pack everything into a single string and explode it again when the message arrives.

Edited by Medusar, 10 September 2010 - 12:54 PM.

  • 0

#7 tomster1996

tomster1996

    GMC Member

  • New Member
  • 312 posts

Posted 11 September 2010 - 11:40 AM

MPlay is said to have a massive overhead when it comes to using bandwith, so if you're worried about that you've got to use 39DLL.

Either way, it will not make the game faster, because there is no magic synchronisation system. When a message is sent, the game simply continues execution. It doesn't wait for the message to arrive at the other side. An MPlay function hardly takes any time to execute, so if you experience lag, it's mostly due to some other part of the game.

Putting all messages into one gigantic string might cause less bandwith usage - that of course only if it only consisted strings in the first place - but will certainly make your game slower because you have to pack everything into a single string and explode it again when the message arrives.


Thank you for the detailed explanation. I think it's the 3D graphics thats slowing it down.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users