Author Topic: Improving Warlat  (Read 50688 times)

Offline jaiaeiararhe

  • Peon
  • **
  • Posts: 18
    • View Profile
Re: Improving Warlat
« Reply #30 on: November 15, 2019, 11:11:05 AM »
Probably yeah, the players need to check the connections between each other anyways and report the highest ping to the host (the host can't know what setting to choose otherwise).

Actually my "automatize the check" comment was regarding the situation we didn't do the ping thing and we relied on my other idea.
And how to communicate? Embed as game message?

The game has a ping command (the Note bot that checks if your port is forwarded is using the ping command too), so maybe you can use that without any external ip list. Maybe lambchops knows if there is a list with all pings somewhere?

Ok so how do we make a program that runs within each player's machine ping everyone else? Simulate game packets and then read the results? How do we know what IP to send the packet to?

Just made a auto warlat plugin, didn't test it much yet but seems to work fine on both of my pcs

If only one player in the game has it installed will it enable Warlat for everyone?
No compatibility problems with only one player having it in a game?
« Last Edit: November 15, 2019, 11:15:19 AM by jaiaeiararhe »

Offline jaiaeiararhe

  • Peon
  • **
  • Posts: 18
    • View Profile
Re: Improving Warlat
« Reply #31 on: November 15, 2019, 12:48:37 PM »
Ok what do you people think about this: If player joins game "gow #L1" with latency hack on, the patch spoofs your own name so you have a symbol at the end of it that indicates you have the patch on, then host kicks everyone without it and starts. Would cause any problems? Seems like a clean solution, no chat messages dirtying up stuff, no need to scroll up to check everyone's messages etc.

Offline jaiaeiararhe

  • Peon
  • **
  • Posts: 18
    • View Profile
Re: Improving Warlat
« Reply #32 on: November 16, 2019, 07:57:04 AM »
@Lambchops
You said my plugin idea was hard to develop but guess what.
I just found how to get ping from all players in the game, the game already has the ping for all players in some memory addresses.
I also found how to send a chat message to other players.
And I found how to read chat message log.
These are all the elements we need, the coding job is simple now.
So actually, let's dump the game name idea.

Let's just make a plugin which, before game start, calculates a latency to use based on worst case ping to any player, reports it to chat as "warlat5" for example right before game starts (for plugin compatibility in case a different version calculates based on ping value differently since we always trust worst case latency), then if every player sent a latency message then people use the worst case latency specified, but if one player didn't report a latency value, it means he doesn't have our patch so game just uses normal War2 latency.

Because War2 is P2P is required to do it like that.

That way we don't need game names, it's 100% compatible, it picks the most optimal latency possible for a game, and it's all automatic, transparent and requires zero effort from the user.

Here's some info
4D157C --> Ping in milliseconds for 2nd player in lobby screen for Top vs. Bottom game type (maybe only this address if you're host/player 1?) (does exact address depends on other settings like team size, resources setting, etc. or just game type TVB? In any case if you change the settings the ping ms value's address just moves by a little)
1E80084 --> Specify message to be sent as string here, then if you press "Enter" game will send that message (so just have to find function which triggers it)
Only one problem -- found the address for chat log but it's changing every game, have to track down a pointer to it.

You in or out @Lambchops? All this information proves the plugin now turns out to be 100x easier to develop than you expected, and not only that but will work optimally removing the drawbacks out of all previously suggested ideas and yet having even more advantages.

@fois helped find these addresses BTW.

P.S. If we found another way to communicate, like not game chat messages before game starts, then it would be 100% transparent and perfect.
« Last Edit: November 16, 2019, 08:09:55 AM by jaiaeiararhe »

Offline jaiaeiararhe

  • Peon
  • **
  • Posts: 18
    • View Profile
Re: Improving Warlat
« Reply #33 on: November 16, 2019, 10:26:12 AM »
Only one problem -- found the address for chat log but it's changing every game, have to track down a pointer to it.

Problem solved. Inject code at 00407E67, ESI will point to string of chat message being sent.

Offline Lambchops

  • Ogre Mage
  • ********
  • Posts: 1541
    • View Profile
Re: Improving Warlat
« Reply #34 on: November 16, 2019, 08:45:49 PM »
Glad you're having fun.

Server ping times are irrellevent. It's a p2p game, so in an 8 player game you have 56 different ping times to consider (yes they can be different from either end of the same connection). Also you need to be testing with UDP packets, ICMP is handled seperately by many servers.

You can find the address for the current chat text by following a couple of pointers, there is no need to inject code. I found that for tupac a while back when he made his color chat text thing.

If you want help making plugins I can advise you on how to adapt things to use the plugin framework.

its gooder to hax hard and NEVER get caught!

Offline jaiaeiararhe

  • Peon
  • **
  • Posts: 18
    • View Profile
Re: Improving Warlat
« Reply #35 on: November 17, 2019, 02:24:52 AM »
Glad you're having fun.

Thank you, Lambchops.

Server ping times are irrellevent. It's a p2p game, so in an 8 player game you have 56 different ping times to consider (yes they can be different from either end of the same connection). Also you need to be testing with UDP packets, ICMP is handled seperately by many servers.

You misunderstood what I said. I'm not talking about ping times to war2.ru. I'm talking about ping time between player to player. The game stores it in memory, so there's no need for us to send custom packets to calculate it. And also, if you read carefully, I explained how I would get it to consider the 56 ping times. That's the point of auto-sending chat messages -- to exchange info on that.

If you want help making plugins I can advise you on how to adapt things to use the plugin framework.

Like what?

Offline Lambchops

  • Ogre Mage
  • ********
  • Posts: 1541
    • View Profile
Re: Improving Warlat
« Reply #36 on: November 19, 2019, 01:04:06 AM »

Like how about you stop making up a million smurf names and PMing me asking for help. If you use a bit of common courtesy and use real handle I may help, but until then stop wasing my time.

its gooder to hax hard and NEVER get caught!

Offline RipE[Eur0]

  • Berserker
  • *****
  • Posts: 715
  • LAWL! LICK MY RIPESTICKZ0R H0M0 :D
    • View Profile
Re: Improving Warlat
« Reply #37 on: November 20, 2019, 12:37:37 PM »
tell me how to get the automatic warlat on??

Offline fois

  • Grunt
  • ***
  • Posts: 248
  • Chicken
    • View Profile
Re: Improving Warlat
« Reply #38 on: November 20, 2019, 01:08:39 PM »
tell me how to get the automatic warlat on??


Download this and extract it into your plugin folder: http://forum.war2.ru/index.php?action=dlattach;topic=883.0;attach=3429

If you don't have a plugin folder then install combat 45: http://en.war2.ru/downloads/
« Last Edit: November 21, 2019, 03:21:21 PM by fois »

Offline jaiaeiararhe

  • Peon
  • **
  • Posts: 18
    • View Profile
Re: Improving Warlat
« Reply #39 on: November 20, 2019, 01:33:38 PM »
@fois Overlay is now ready and has everything necessary for its purpose, if you want to review the code before it starts being used it for tests go Discord

Offline Buttercraft

  • Grunt
  • ***
  • Posts: 57
    • View Profile
Re: Improving Warlat
« Reply #40 on: April 01, 2023, 04:02:51 PM »
Here is a pretty simple solution I think, respecting that lower latency is desired but smooth gameplay is basically the gold standard.

Keep a performance counter on rolling basis (20 seconds), if there is lag detected (>3%) in any period it bumps the latency up one (no reporting necessary, it's automatic)

After first increase the rolling timer gathers next samples over 30 seconds instead of 20 (for greater confidence).

After that 45 seconds (20, 30, 45 seconds), after three bumps it's "settled" the antilag feature won't attempt any more measures.

Offline Charlie

  • Critter
  • *
  • Posts: 1
    • View Profile
Re: Improving Warlat
« Reply #41 on: May 22, 2023, 05:59:13 PM »
So is there currently a way to play with lan latency over a PVPGN server like you can with Brood War 1.16.1?

Offline Buttercraft

  • Grunt
  • ***
  • Posts: 57
    • View Profile
Re: Improving Warlat
« Reply #42 on: May 23, 2023, 02:52:36 PM »
Yes it's an option in the default installer (standard or full version only, not lite)

War2 2.0.2.0 Lambchops > select "Auto War Lat"