Author Topic: Improving Warlat  (Read 51016 times)

Offline aslfkjasfkahfsafahslh

  • Critter
  • *
  • Posts: 2
    • View Profile
Improving Warlat
« on: April 14, 2015, 05:10:35 PM »
Warlat latency is quite slow. In Starcraft there is this program called "LatencyChanger", which allows to use "Singleplayer" latency when playing online (so it is much faster). It has 2 operation modes:

A) Reduce latency to certain number. Latency can be set between 1 and 5. 1 is Singleplayer latency, 2 is LAN latency, 5 is Battle.net.
B) In latency dialog in-game, reduce all options by 1, so Low latency becomes a new "Very low", High becomes Low, etc.

Warlat implements B). So is there some way that A) could be implemented for War2?

What Warlat does is write the following memory:

0x47862E - 0x90, 0x49, 0x90, 0x90
0x478632 - 0x89, 0x90, 0x90, 0x90

Result: It is now allowed to select the lowest possible latency mode that is possible through B).

What LatencyChanger does is write the following memory:

For mode A: 0x4D94EB - 0xB8, (latency value), 0x00, 0x00, 0x00, 0x90, 0x90
For mode B: 0x4859D7 - 0xBE, 0x01, 0x00, 0x00, 0x00, 0x90
« Last Edit: April 14, 2015, 05:14:25 PM by aslfkjasfkahfsafahslh »

Offline Nox

  • Death Knight
  • *********
  • Posts: 4145
    • View Profile
Re: Improving Warlat
« Reply #1 on: April 14, 2015, 05:23:20 PM »
Newb peoples dont understand the importance of latency, but there a certain point where everyone is good and units controls can easily decide who win and who lose.

Same for ressource management when you try to get peon out of gold mines and you cant because latency is too bad.

So latency is a really important probleme we have to fix.

Im glad you bring this probleme on the table.

PS: We also have to close different clients since they corrupt warlatency totally :(

I invited you to take a look at this thread: http://forum.war2.ru/index.php/topic,665.0.html
« Last Edit: April 14, 2015, 05:28:25 PM by Equinox »
Mr.120apm aka U8! Best player of the world losing 4v3 against Phillip5256.

Offline aslfkjasfkahfsafahslh

  • Critter
  • *
  • Posts: 2
    • View Profile
Re: Improving Warlat
« Reply #2 on: April 14, 2015, 05:59:16 PM »
Chat log with author of LatencyChanger

Spoiler
[23:21] <wqerqweqwe> hey
[23:21] <wqerqweqwe> you're the author of LatencyChanger
[23:21] <wqerqweqwe> right?
[23:22] <The-Winner> hi
[23:22] <The-Winner> yes
[23:22] <wqerqweqwe> you know there's a game called warcraft 2 battle.net edition
[23:22] <wqerqweqwe> which is pretty similar to SC
[23:22] <wqerqweqwe> in that game there is a program called "Warlat"
[23:22] <wqerqweqwe> that allows to reduce userlatency by 1 in latency dialog
[23:22] <wqerqweqwe> but this is still slow
[23:22] <wqerqweqwe> would it be possible to apply the "Singleplayer latency"
[23:22] <wqerqweqwe> or LAN Latency
[23:22] <wqerqweqwe> to this game?
[23:22] <wqerqweqwe> i disassembled Warlat and found how it works
[23:23] <The-Winner> Possibly.
[23:23] <The-Winner> In SC there are two values which determine latency
[23:23] <wqerqweqwe> yes, as far as i understand, latencychanger allows to do 2 things:
[23:23] <The-Winner> one is the value from the dialog, which can be reduced one below the values you can choose.
[23:24] <The-Winner> There is some other latency changer for SC that changes this value
[23:24] <The-Winner> the other value determines on which frames commands are executed.
[23:24] <The-Winner> It's computed from the game speed and certain hardcoded milliseconds values
[23:24] <wqerqweqwe> how did you find that value?
[23:25] <The-Winner> comes out as 2 for LAN and 5 for BNET if you have the fastest game speed
[23:25] <wqerqweqwe> so if i start a singleplayer game and search for "1"
[23:25] <wqerqweqwe> a LAN game and i search for "2"
[23:25] <wqerqweqwe> and a BNET game and i search for "5"
[23:25] <wqerqweqwe> i will find the value?
[23:25] <The-Winner> I think I searched for values which is fulfills bnet>lan>singleplayer
[23:26] <The-Winner> takes multiple rounds of searches and some experimentation to narrow it down
[23:26] <The-Winner> Changing that value itself didn't work well, since it got overwritten at an annoying point during the game start and must reliably be the same for all players
[23:27] <The-Winner> so I instead modified the code which reads that value to always return 2
[23:27] <The-Winner> I'm not certain that the values will be 2 and 5 for wc2
[23:28] <The-Winner> they might have tuned them, or perhaps wc2 game speeds are different
[23:28] <wqerqweqwe> so game speed affects the value too?
[23:28] <wqerqweqwe> wc2 has different speed options from sc
[23:30] <The-Winner> yes, it's computed by dividing some millisecond value by the duration of a frame (42ms on fastest)
[23:30] <wqerqweqwe> so on bnet, no matter what latency, that value is always 5?
[23:31] <The-Winner> the value doesn't depend on the latency setting from the dialog
[23:31] <The-Winner> but it depends on the game speed
[23:31] <wqerqweqwe> so for lowest dlay you have to both change the dialog and this value?
[23:31] <The-Winner> yes
[23:32] <The-Winner> but if you go below the latency of the network you'll introduce lag
[23:32] <wqerqweqwe> yeah
[23:33] <wqerqweqwe> so "5" is only when playing at fastest in bnet?
[23:33] <The-Winner> since the network mode dependent value also reduces the variance of the latency and not just the latency, it's better to reduce it
[23:33] <wqerqweqwe> and when playing at slow speed in bnet, the value is different?
[23:33] <The-Winner> yes
[23:33] <The-Winner> at least that's what I remember. It's been a long time since I looked into that stuff.
[23:35] <wqerqweqwe> then it's possible to find it by just going in singleplayer, messing around with speed and just checking for changed values?
[23:35] <wqerqweqwe> i'm trying to find it atm
[23:36] <The-Winner> most memory searchers allow you to search for values which increased/decreased since the last search
[23:36] <wqerqweqwe> so i decrease speed and search for increased value?
[23:36] <The-Winner> if you start a bunch of games in singleplayer/lan/bnet and do searches between each, that should narrow it down
[23:37] <The-Winner> I think I kept the speed at the same value always
[23:37] <The-Winner> but changing it might narrow it down further
[23:37] <wqerqweqwe> but game speed options in singleplayer are different from game speed options in bnet
[23:37] <wqerqweqwe> in war2, "fastest" speed in singleplayer is much slower than "fastest" in bnet
[23:37] <The-Winner> I think on singleplayer the value is always 1, regardless of speed
[23:38] <The-Winner> and even on bnet, changing you probably need to change the speed by several notches to change the value
[23:48] <wqerqweqwe> found a few values which are "1" in singleplayer and "5" in bnet
[23:48] <wqerqweqwe> but changing them seems to do nothing
[23:50] <The-Winner> I had to change the code reading the value for some reason. But I think that wasn't required for the basic working, only to make the game start reliably in multiplayer
[23:51] <The-Winner> But perhaps it's not 5 in WC2
[23:51] <wqerqweqwe> i found 1 value which is always "1" in singleplayer and always "2" in LAN
[23:51] <wqerqweqwe> tried changing it
[23:51] <The-Winner> I'd try a generic bigger/smaller search instead of searching for concrete values
[23:51] <wqerqweqwe> and nothing changed
[23:52] <wqerqweqwe> what is the value type?
[23:52] <wqerqweqwe> it's a byte?
[23:53] <The-Winner> A byte search should work. A bigger size might work as well, since it's quite possible that the following bytes are always 0.
[23:58] <The-Winner> good night
[23:58] <wqerqweqwe> GN

Offline Certified MENSA Genius Brain (smart)

  • "The Architect"
  • Global Moderator
  • Dragon
  • *****
  • Posts: 5384
    • View Profile
Re: Improving Warlat
« Reply #3 on: April 14, 2015, 06:03:38 PM »
What Warlat does is write the following memory:
0x47862E - 0x90, 0x49, 0x90, 0x90
0x478632 - 0x89, 0x90, 0x90, 0x90
can this give you a clue of where to look?
    

Offline Delete mine too

  • Death Knight
  • *********
  • Posts: 2652
  • http://meatspin.com
    • View Profile
    • http://meatspin.com
Re: Improving Warlat
« Reply #4 on: April 14, 2015, 07:07:18 PM »
Are those the values you got when you scanned the memory??

How complex did you get when you where scanning and using war2....

Scan for values in single player then scan when online?? I seen the chat with author. Did you do a unknown search and just scan for changes or no changes??? That would eliminate your problem with knowing which values to scan for...

Offline GaNzTheLegend

  • Best War2 Player Ever
  • Ogre Mage
  • ********
  • Posts: 1745
  • #1 on: Kali, Heat, Zone, Kahn, GameStorm, Bnet, RU
    • View Profile
    • Kali Hall Of Fame
Re: Improving Warlat
« Reply #5 on: April 14, 2015, 07:22:35 PM »
Chat log with author of LatencyChanger

Spoiler
[23:21] <wqerqweqwe> hey
[23:21] <wqerqweqwe> you're the author of LatencyChanger
[23:21] <wqerqweqwe> right?
[23:22] <The-Winner> hi
[23:22] <The-Winner> yes
[23:22] <wqerqweqwe> you know there's a game called warcraft 2 battle.net edition
[23:22] <wqerqweqwe> which is pretty similar to SC
[23:22] <wqerqweqwe> in that game there is a program called "Warlat"
[23:22] <wqerqweqwe> that allows to reduce userlatency by 1 in latency dialog
[23:22] <wqerqweqwe> but this is still slow
[23:22] <wqerqweqwe> would it be possible to apply the "Singleplayer latency"
[23:22] <wqerqweqwe> or LAN Latency
[23:22] <wqerqweqwe> to this game?
[23:22] <wqerqweqwe> i disassembled Warlat and found how it works
[23:23] <The-Winner> Possibly.
[23:23] <The-Winner> In SC there are two values which determine latency
[23:23] <wqerqweqwe> yes, as far as i understand, latencychanger allows to do 2 things:
[23:23] <The-Winner> one is the value from the dialog, which can be reduced one below the values you can choose.
[23:24] <The-Winner> There is some other latency changer for SC that changes this value
[23:24] <The-Winner> the other value determines on which frames commands are executed.
[23:24] <The-Winner> It's computed from the game speed and certain hardcoded milliseconds values
[23:24] <wqerqweqwe> how did you find that value?
[23:25] <The-Winner> comes out as 2 for LAN and 5 for BNET if you have the fastest game speed
[23:25] <wqerqweqwe> so if i start a singleplayer game and search for "1"
[23:25] <wqerqweqwe> a LAN game and i search for "2"
[23:25] <wqerqweqwe> and a BNET game and i search for "5"
[23:25] <wqerqweqwe> i will find the value?
[23:25] <The-Winner> I think I searched for values which is fulfills bnet>lan>singleplayer
[23:26] <The-Winner> takes multiple rounds of searches and some experimentation to narrow it down
[23:26] <The-Winner> Changing that value itself didn't work well, since it got overwritten at an annoying point during the game start and must reliably be the same for all players
[23:27] <The-Winner> so I instead modified the code which reads that value to always return 2
[23:27] <The-Winner> I'm not certain that the values will be 2 and 5 for wc2
[23:28] <The-Winner> they might have tuned them, or perhaps wc2 game speeds are different
[23:28] <wqerqweqwe> so game speed affects the value too?
[23:28] <wqerqweqwe> wc2 has different speed options from sc
[23:30] <The-Winner> yes, it's computed by dividing some millisecond value by the duration of a frame (42ms on fastest)
[23:30] <wqerqweqwe> so on bnet, no matter what latency, that value is always 5?
[23:31] <The-Winner> the value doesn't depend on the latency setting from the dialog
[23:31] <The-Winner> but it depends on the game speed
[23:31] <wqerqweqwe> so for lowest dlay you have to both change the dialog and this value?
[23:31] <The-Winner> yes
[23:32] <The-Winner> but if you go below the latency of the network you'll introduce lag
[23:32] <wqerqweqwe> yeah
[23:33] <wqerqweqwe> so "5" is only when playing at fastest in bnet?
[23:33] <The-Winner> since the network mode dependent value also reduces the variance of the latency and not just the latency, it's better to reduce it
[23:33] <wqerqweqwe> and when playing at slow speed in bnet, the value is different?
[23:33] <The-Winner> yes
[23:33] <The-Winner> at least that's what I remember. It's been a long time since I looked into that stuff.
[23:35] <wqerqweqwe> then it's possible to find it by just going in singleplayer, messing around with speed and just checking for changed values?
[23:35] <wqerqweqwe> i'm trying to find it atm
[23:36] <The-Winner> most memory searchers allow you to search for values which increased/decreased since the last search
[23:36] <wqerqweqwe> so i decrease speed and search for increased value?
[23:36] <The-Winner> if you start a bunch of games in singleplayer/lan/bnet and do searches between each, that should narrow it down
[23:37] <The-Winner> I think I kept the speed at the same value always
[23:37] <The-Winner> but changing it might narrow it down further
[23:37] <wqerqweqwe> but game speed options in singleplayer are different from game speed options in bnet
[23:37] <wqerqweqwe> in war2, "fastest" speed in singleplayer is much slower than "fastest" in bnet
[23:37] <The-Winner> I think on singleplayer the value is always 1, regardless of speed
[23:38] <The-Winner> and even on bnet, changing you probably need to change the speed by several notches to change the value
[23:48] <wqerqweqwe> found a few values which are "1" in singleplayer and "5" in bnet
[23:48] <wqerqweqwe> but changing them seems to do nothing
[23:50] <The-Winner> I had to change the code reading the value for some reason. But I think that wasn't required for the basic working, only to make the game start reliably in multiplayer
[23:51] <The-Winner> But perhaps it's not 5 in WC2
[23:51] <wqerqweqwe> i found 1 value which is always "1" in singleplayer and always "2" in LAN
[23:51] <wqerqweqwe> tried changing it
[23:51] <The-Winner> I'd try a generic bigger/smaller search instead of searching for concrete values
[23:51] <wqerqweqwe> and nothing changed
[23:52] <wqerqweqwe> what is the value type?
[23:52] <wqerqweqwe> it's a byte?
[23:53] <The-Winner> A byte search should work. A bigger size might work as well, since it's quite possible that the following bytes are always 0.
[23:58] <The-Winner> good night
[23:58] <wqerqweqwe> GN

Hey thanks for sharing this, we should be looking to broodwar for useful stuff to make for warcraft 2 since they are built off the same source code.
Kali IGL Stats

Offline iL

  • Administrator
  • Ogre Mage
  • *****
  • Posts: 1653
    • View Profile
Re: Improving Warlat
« Reply #6 on: April 15, 2015, 04:11:40 AM »
Interesting research, need to test that for different values.

Let me make a small console application for that purpose then
Need help to translate War2Combat to German, French, Italian, Polish or another language: http://forum.war2.ru/index.php/topic,4728.0.html
Please, contact me if you are interested in that.

Offline Delete mine too

  • Death Knight
  • *********
  • Posts: 2652
  • http://meatspin.com
    • View Profile
    • http://meatspin.com
Re: Improving Warlat
« Reply #7 on: April 15, 2015, 01:57:28 PM »
I don't think this guy is comming back because of his name.

Offline mousEtopher

  • Administrator
  • Ogre Mage
  • *****
  • Posts: 2065
    • View Profile
    • War2.me
Re: Improving Warlat
« Reply #8 on: April 15, 2015, 05:05:15 PM »
Regardless, I think we can all agree this is something that's worth pursuing.
squeak!

Offline I hate naggers

  • Ogre Mage
  • ********
  • Posts: 2345
    • View Profile
Re: Improving Warlat
« Reply #9 on: April 15, 2015, 05:06:54 PM »
I believe antihack + background hosting bots are more important. This is more of a tweak

Offline Delete mine too

  • Death Knight
  • *********
  • Posts: 2652
  • http://meatspin.com
    • View Profile
    • http://meatspin.com
Re: Improving Warlat
« Reply #10 on: April 15, 2015, 07:22:37 PM »
All he is saying there is lower settings then the lowest one we can choose. He made the point of single player and multiplayer. He was told before by the author that dropping below the network will cause lag. You ever think that's why the developer made it for war2??

If he can scan memory and diassemble the latency program how the fuck can't he set the memory value lower to see if it lags. I'm amazed with his work just puzzled on how he is so stuck on a simple process... right? Or am I reading wrong again LOL

I bet he is the war2injector guy......

Offline xboi209

  • Grunt
  • ***
  • Posts: 80
    • View Profile

Offline rqwlrlpqwl

  • Critter
  • *
  • Posts: 1
    • View Profile
Re: Improving Warlat
« Reply #12 on: November 13, 2019, 04:01:46 AM »
So? Nobody took a look at this? As far as I know the author of this thread tried to find the values for 1 hour, but didn't and then never looked at it again. Not sure whether it's possible or not.

Keep in mind the DOS version of War2 had units respond very fast, however, in the BNE version that people use to play online now in RU it is extremely slow. Even when Warlat is on it's still extremely slow. It was almost instant in Kali with low pkt settings. For example a big problem is when you're trying to pull peons even with Warlat it fails a lot of the time, depending on how close they were to the gold mine... if we modify it it would only rarely fail.

Just go to single player, set the speed setting higher and see how fast units respond.

And microing is a joke. This game could take so much more skill.

BTW, I think in SC1 you can combine both modes A) and B) for even lower latency. Might be able to do the same here. So we already have B) but gotta find A).

One problem with implementing A) I think is that every single player in the match would need to have the patch auto-applied in order not to crash.
Like in SC1, game name could specify latency, for example "gow #L1", and then patch detects that and auto-changes latency to 1, and people know to only join it if you have patch.

Or everyone could be forced to update Combat.

@Lambchops
@iL
@fois
« Last Edit: November 13, 2019, 04:05:47 AM by rqwlrlpqwl »

Offline fois

  • Axe Thrower
  • ****
  • Posts: 250
  • Chicken
    • View Profile
Re: Improving Warlat
« Reply #13 on: November 14, 2019, 12:14:25 AM »
Just been doing some testing, found out that warlat is kinda like a cheat... Anyone who is still playing with an old installation or CD-install etc. without warlat should better update, you can't really have a fair game against anyone using warlat lol

warlat can reduce the delay to just 26 frames, it's not bad. But yeah, LAN is even faster than that with just 12 frames delay.

video version: https://imgur.com/a/ZvfBIbI   ----  gif version: https://imgur.com/a/LF2fYuM


Would be nice to have the LAN settings on bnet too, but that would make the game incompatible so it's a problem and might not be possible without forcing everyone to use the same version.
« Last Edit: November 14, 2019, 12:40:46 AM by fois »

Offline afdkijsdijaisfj

  • Critter
  • *
  • Posts: 1
    • View Profile
Re: Improving Warlat
« Reply #14 on: November 14, 2019, 04:10:58 AM »
We just need to do it like SC1, we need to make it so that the user can choose between latency modes 1-5 (1=Singleplayer, 2=LAN, 5=BNET) and also keep the Warlat "Extra Low" setting on top of that.

@fois

Did you find the memory values? If so, please tell us about them. They cannot be abused to cheat or anything since it would make the game incompatible, it would just make you drop and in that case you could also just terminate the .exe or disconnect your Internet... If you haven't found them, do you plan to try to find them?

Of course, the game will be incompatible if users have different "latency mode" settings. But actually we can solve that in multiple ways.

This means we must do like they did for SC1, we must make a patch that changes latency based on game name. So if game name is "gow noob#L2" it applies LAN latency to that game.

People without the fix would know NOT to join the game because of its name. Therefore there is no problem. In any case it would be easy to auto-announce "Latency patch enabled!" every time someone with the patch joins or something like that. So if an user joins and doesn't say that message people know to kick that user.

And we CAN force updates. It would be highly useful, for example for this latency purpose. Users here have expressed interest in keeping everyone forcibly updated to the latest War2Combat before or having other auto-update mechanisms. Can @iL use PVPGN to distribute the update?

Please tell me your thoughts on all of these ideas @fois.