Welcome to the LnLP Forums and Resource Area

We have updated our forums to the latest version. If you had an account you should be able to log in and use it as before. If not please create an account and we look forward to having you as a member.

PGE2v1 - Development Status

MarkShot

Member
Joined
Jun 3, 2015
Messages
293
Points
28
Age
79
Location
NYC+13,000mi
PGE = Panther Games Enhancer

What is it?

In many RTS games you can assign hot keys to units. PGE allows you to assign hot keys to [map location + zoom level]. It allows for up to 12 hot keys. It has the option to remember these hot keys between gaming sessions (stored and reloaded from an INI file).

PGEv3 supported the following games (GAMES not DLC modules): HTTR, COTA, and BFTB.

PGE2v1 will support CO2 (only).

Today, I began my initial research and discovered this interesting fact.

The CO2 Strat Map in the CONTROL Window is +15 pixels wider and +17 pixels taller than the above three mentioned games.

The Strat Map is important since PGE is NOT a mod. It makes no changes to anything. It is utility that runs alongside the game. (Think of it more as a programmable joystick or keyboard.) PGE works by capturing the user specified Strat Map location/zoom and replaying it bound to a key.

PGEv3 is currently about 1600 lines of AutoHotKey code.

Well, I just wanted to let those who had previously used PGE with BFTB (that's when I wrote it) that I have begun thinking about how to make it work for CO2.

(more to follow)
 

MarkShot

Member
Joined
Jun 3, 2015
Messages
293
Points
28
Age
79
Location
NYC+13,000mi
I think I am done for today.

* Ripped out old HTTR/COTA/BFTB compatibility code.

* Confirmed that I will be able to support a floating Control Window and multiple monitors.

* Capture of Strat Pixel location click now works, but replay does not as I need to support multiple independent Windows.

* Reported a bug to Dave in 5.1.22; SHFT-1 does not work to bring up the Control Window.

It's a start! :)

PS: The original PGE was written 5 years ago! Amazing.
 

MarkShot

Member
Joined
Jun 3, 2015
Messages
293
Points
28
Age
79
Location
NYC+13,000mi
That is not a bug Mark. We now have a specific Cntl button on the toolbar that toggles the Control dialog. This activates code that manages the dialogs. It's important that happens.

I see. The mouse over still says SHFT-1. Is there any key stroke to open the Control Window other than me programmatically generating a mouse click event? (Maybe I don't even need to, since PGE will do nothing if one tries to set a hot spot without the Control Window having focus.)

One more question while I am at it. That window is named "Control". I am having trouble finding out what is the name of main map window is? (as I need to switch focus from "Control" to whatever the map is)

Thanks.
 

MarkShot

Member
Joined
Jun 3, 2015
Messages
293
Points
28
Age
79
Location
NYC+13,000mi
control1.jpg
 

MarkShot

Member
Joined
Jun 3, 2015
Messages
293
Points
28
Age
79
Location
NYC+13,000mi
Today's update very exciting. It is by no means close, but it is a proof concept that this is going to work. (Multiple Displays, and floating Control Window)

* Succeeded in capturing the map location (setting hot spot) and playing back (relocating the map). Previously, I was only able to capture. I knew that was working from looking at the INI values created. But today, the game map jumped for the first time.

Old code: PGE1v3:

MouseClick, left, 10, 10 ; Reset Strat Map
Sleep, DelayMap

If FKeyId=1
MouseClick, left, F01X, F01Y
Else If FKeyId=2
MouseClick, left, F02X, F02Y
Else If FKeyId=3
MouseClick, left, F03X, F03Y

New code: PGE2v1:

WinActivate, Controls,
Sleep, DelayMap

If FKeyId=1
{
MouseClick, right, , , 1, 2, U
MouseClick, left, F01X, F01Y
}
Else If FKeyId=2
{
MouseClick, right, , , 1, 2, U
MouseClick, left, F02X, F02Y
}
Else If FKeyId=3
{
MouseClick, right, , , 1, 2, U
MouseClick, left, F03X, F03Y
}
 

MarkShot

Member
Joined
Jun 3, 2015
Messages
293
Points
28
Age
79
Location
NYC+13,000mi
Much was working and new code was being written to address issues like the zoom level is no longer controlled by ALT-LCLICK and ALT-RCLICK.

And then, it hit me that everything was broken. Somehow the new runtimes which Dave has introduced as made the scripting of AutoHotKey behave completely erratic with the new release. All types of buttons and controls are getting mysteriously triggered. I have no idea why.

Also, remember this utility is not supported by Panther. I have to admit that for the moment I am at an impasse, since things are seriously broken.
 

MarkShot

Member
Joined
Jun 3, 2015
Messages
293
Points
28
Age
79
Location
NYC+13,000mi
Okay, I have upgraded to:

AutoHotkey112209_Install.exe

That seemed to do it. Now, working:

* Store hot spot.

* Relocate map to hot spot

* Set default hot spot zoom level

* Set individual hot spot zoom level

Not working yet:

* Nudging hot spots with the arrow keys for fine positioning.

* Various programs checks:

** Particular functions can only be invoked while the map has focus

** Storing of hot spot it taking place only within the valid portion of the Control Window

** The Control Window is open when attempting to execute any PGE function

*** Remember ***

* Coding needs to be done to recognize that there is now more than a single window. Previously, the game had a fixed interface.

* The size and location of the strat map within the Control Window has changed.

---

Probably anywhere from 5-10 hours of additional coding/testing is required.

PGE2v1 makes little difference on the tutorial toy map. But it makes a substantial difference on some of the huge maps. And remember, that hot spots for 14 day battles can be reloaded between gaming sessions.
 

MarkShot

Member
Joined
Jun 3, 2015
Messages
293
Points
28
Age
79
Location
NYC+13,000mi
BTW, I had a choice of 3 different version of AutoHotKey with which to distribute the executable. For greatest compatibility, I will be choosing ANSI 32 bit.

See below for details of what it will actually do. This functionality is already available for HTTR/COTA/BFTB.

2am here - good night!
 
Last edited:

MarkShot

Member
Joined
Jun 3, 2015
Messages
293
Points
28
Age
79
Location
NYC+13,000mi
I have been coding for a day and half, it is time to admit that I am abandoning this project.

Why?

Okay, I upgraded to the latest runtime version of AutoHotKey and did resolve much of the weirdness which crept in after Dave's upgrade of the Microsoft Libraries.

I thought I was getting close to the finish line. As usual, I was testing and coding/testing in a prototyping style. I finally noticed a subtle, but truly devastating problem.

With PGE1v3 for HTTR/COTA/BFTB, I could recover exactly the hot spot which had been set by the user. I mean exactly down to the pixel.

But I noticed with PGE2v1 for CO2, my hot spots were drifting over time. Meaning the more you returned to one, the more it tended to drift.

What was going on?

Previously, I was able to position the mouse to any X/Y pair for the Airborne Assault or Command Ops engine with perfect fidelity. Since I could just put the mouse cursor down where it needed it to be. (Almost as if the cursor was being lifted from the screen and placed back down.)

However, with CO2, Dave's new Microsoft libraries are seeing change of cursor location as drag events. Thus, my scripting is generating side effects (dragging of the mouse). Over time, this builds up and means that any kind of precision by PGE has been lost.

Finally, why am I sure that it is CO2's new Microsoft runtimes? I have used interpreted (not compiled versions) with the same AutoHotKey runtime which I am coding with for CO2. With BFTB, my former code is able to position the mouse cursor to any location without it being seen as mouse movement (a drag event).

Guys, these drag events are really a drag. It completely breaks how PGE works. I will check the AutoHotKey documentation one final time, but I am ready to throw in the towel. I cannot reproduce PGE for CO2. Sorry.
 

MarkShot

Member
Joined
Jun 3, 2015
Messages
293
Points
28
Age
79
Location
NYC+13,000mi
Good news! There will be a PGE2v1. I am almost there with all the previous functionality. The only thing besides HTTR/COTA/BFTB support which I decided to drop (since you can just run the old PGE) is I will only support 3 zoom levels as opposed to the full 6 in the game. I decided this due to performance issues. I was especially concerned as my new PC is just six months old and was cutting edge and over clocked. I want PGE2v1 to work on everyone's PC not just mine.

Here is the key insights that occurred today (or should I say tonight; no one programs computers during the day. It goes against the culture).

I figured out how to fix the drift in my hot spot code.

It was drifting due to the user having the mouse in hand with buttons pressed; required to enable various functions.

There is in AutoHotKey:

Block, On
Block, Off

This basically blocks any user input which occurs during execution between these two markers. Thus, I was able to prevent drift of hot spots. They now recover exactly to the pixel.

I also found out that unlike Dave's older games the mini-map was no longer responding to each pixel click, but implementing a landing area strategy (means the map does not jump until the mouse clicks outside the current landing area; map context). This can be defeated by clicking outside and then clicking back; effectively causing a reset of the landing area. Thus, making it possible to nudge hot spots once set.

I can see the completion of this utility now. It will be very useful for my own play on new maps. I am looking forward to starting to play.


I am happy to share this with the community. I have made it robust that it contains plenty error checking to prevent user error. I am currently waiting to work out the details of hosting with LnL. I have probably about one more days worth of work on nudging and to update the old documentation.
 
Last edited:

MarkShot

Member
Joined
Jun 3, 2015
Messages
293
Points
28
Age
79
Location
NYC+13,000mi
I must say PGE is completely integrated into the game when you combine with a programmable keyboard and mouse:

CO2p1.jpg


CO2p2.jpg
 
Top