War2.ru Slogan
News: Don't forget to join Channel: Trivia for trivia!


Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
Welcome to the forums! We're glad to have you here! :) You can register your account here, then feel free to introduce yourself in the Server.War2.ru board & let us know who you are on the server.

Improving Warlat 2234  39

Peon Posts: 18 Karma: +0/-0 **

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?
Peon Posts: 18 Karma: +0/-0 **

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.
Peon Posts: 18 Karma: +0/-0 **

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.
Peon Posts: 18 Karma: +0/-0 **

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.
Ogre Mage Posts: 1504 Karma: +82/-1 ********

Lambchops

  • Ogre Mage
  • ********
  • *
  • Posts: 1504
    • 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.

Peon Posts: 18 Karma: +0/-0 **

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?
Ogre Mage Posts: 1504 Karma: +82/-1 ********

Lambchops

  • Ogre Mage
  • ********
  • *
  • Posts: 1504
    • 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.

Axe Thrower Posts: 431 Karma: +25/-2 LAWL! LICK MY RIPESTICKZ0R H0M0 :D ****

RipE[Eur0]

  • Axe Thrower
  • ****
  • *
  • Posts: 431
  • LAWL! LICK MY RIPESTICKZ0R H0M0 :D
    • View Profile
    • fuk the leftist scum.
Re: Improving Warlat
« Reply #37 on: November 20, 2019, 12:37:37 PM »
tell me how to get the automatic warlat on??
Grunt Posts: 77 Karma: +15/-0 Chicken ***

fois

  • Grunt
  • ***
  • *
  • Posts: 77
  • 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/
Peon Posts: 18 Karma: +0/-0 **

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