Game Randomly Receives Non-Existent Inputs

Ask gaming related questions
Starker
Posts: 22
Joined: 27 Mar 2018, 18:39

Game Randomly Receives Non-Existent Inputs

07 Apr 2024, 17:24

I am observing something completely bizarre. The game, Armored Core 2 on PCSX2, is receiving inputs that do not exist in my script, according to a keyboard event viewer. The attached file only shows the keyboard event log after event 80 due to limitations of the website. The game is behaving as if random single Ss are sent during the random length sequence of Ds. The loop is structured so that only one S is sent and it always happens before the Ds and Space are sent. How is this possible?

I simulated the overall macro myself by hitting S, D a couple times, Space, then repeat in the hopes that this was some weird glitch with the game. The game acts normally and does not receive ghost inputs if a human is sending inputs.

I would send a PDF containing the keyboard event log, but I can't attach PDFs.

Code: Select all

SendMode "Event"
F12::Suspend

;Create random build
F1::{
	setKeyDelay 140, 30
	
	;Select Head
	Send "{space}"
	sleep 900
	rand := Random(1, 12)
	Send "{d " rand "}"
	Send "{space}"

	;Select everything else
	Loop 13 {
		Send "{s}"
		rand := Random(1, 7)
		Send "{d " rand "}"
		Send "{space}"
	}

	;Return to start
	Send "{shift}"
}
Attachments
Keyboard Event Log.png
Keyboard Event Log.png (371.01 KiB) Viewed 348 times
User avatar
boiler
Posts: 17120
Joined: 21 Dec 2014, 02:44

Re: Game Randomly Receives Non-Existent Inputs

07 Apr 2024, 20:33

Starker wrote:
07 Apr 2024, 17:24
I am observing something completely bizarre. The game, Armored Core 2 on PCSX2, is receiving inputs that do not exist in my script, according to a keyboard event viewer.
Nothing bizarre at all about it. What the key event viewer is showing is exactly what your script tells it to do. I don’t see why you think it’s doing anything different.

Starker wrote:
07 Apr 2024, 17:24
The loop is structured so that only one S is sent and it always happens before the Ds and Space are sent.
No, it is not structured to send only one S. It sends it 13 times — once each time through the loop, before each set of random number of Ds and a space. That’s exactly what the output is showing (although it’s not showing all 13 iterations of the loop). You see that your script sends the S as part of the loop, right? It’s not sending it once before the loop as you are saying it does.
Starker
Posts: 22
Joined: 27 Mar 2018, 18:39

Re: Game Randomly Receives Non-Existent Inputs

07 Apr 2024, 21:55

I have since abandoned the loop in favor of a function because there were too many exceptions required by the game's menus. This script is navigating a menu system. The script will use SelectPart function many times, but only one example is active. That one example is still behaving abnormally.

Code: Select all

SendMode "Event"
F12::Suspend

;Create random build
SelectPart(x) {
	rand := Random(1, x)
	Send "{d " rand "}"
	Send "{space}"
}
F1::{
	setKeyDelay 60, 30
	
	;Select Head
	SelectPart(12)
Output of script:
image.png
image.png (65.6 KiB) Viewed 325 times
The 112 (F1) release is not important and adding a sleep at the beginning of the script has no effect.

Game Behavior (emulated by human):
image.png
image.png (45.15 KiB) Viewed 325 times
The game sometimes acts as if the inputs are similar to the above log. It appears like D is received a random number of times, which is correct, but Space is often not received.
Last edited by Starker on 07 Apr 2024, 22:49, edited 1 time in total.
User avatar
boiler
Posts: 17120
Joined: 21 Dec 2014, 02:44

Re: Game Randomly Receives Non-Existent Inputs

07 Apr 2024, 22:00

I don’t see what your point is. Your first script was actually not behaving incorrectly, and when that is pointed out, you show different output and no script. A different script will have different output. Without posting your new script, the output cannot be evaluated.
Starker
Posts: 22
Joined: 27 Mar 2018, 18:39

Re: Game Randomly Receives Non-Existent Inputs

07 Apr 2024, 22:51

boiler wrote:
07 Apr 2024, 22:00
I don’t see what your point is. Your first script was actually not behaving incorrectly, and when that is pointed out, you show different output and no script. A different script will have different output. Without posting your new script, the output cannot be evaluated.
Check my last reply again. I don't know what happened to the code block.
User avatar
boiler
Posts: 17120
Joined: 21 Dec 2014, 02:44

Re: Game Randomly Receives Non-Existent Inputs

07 Apr 2024, 23:55

Maybe it needs a longer delay. You could try adding a longer delay with a Sleep before sending the space, especially since you significantly the delay in SetKeyDelay.
Starker
Posts: 22
Joined: 27 Mar 2018, 18:39

Re: Game Randomly Receives Non-Existent Inputs

19 Apr 2024, 21:09

I ramped the delay up to 1000 ms with no effect. The ghost inputs are obeying the input delay, which is interesting.

What is even more interesting is that this is happening again with a much more modern game, Darktide, without an emulator. However, the inputs are occurring consistently after the same line, every time. I checked the serial output and the inputs were not there. I believe that AutoHotKey is bugging out the game on a deeper level beyond my understanding.

I edited the script to rapidly undo the regular ghost inputs. This is not possible with the Armored Core 2 script, due to the randomness of the ghost inputs. I can post the original version of my Darktide script if others want to try it.
User avatar
WarlordAkamu67
Posts: 223
Joined: 21 Mar 2023, 06:52

Re: Game Randomly Receives Non-Existent Inputs

19 Apr 2024, 21:32

I did not read the previous posts, but maybe Menu Mask Key?
Starker
Posts: 22
Joined: 27 Mar 2018, 18:39

Re: Game Randomly Receives Non-Existent Inputs

21 Apr 2024, 14:28

WarlordAkamu67 wrote:
19 Apr 2024, 21:32
I did not read the previous posts, but maybe Menu Mask Key?
I don't see how this applies. Win and Alt have no effect in the game's menus and are not being sent by the script.

Code: Select all

F12::Pause
SendMode "Event"
SetKeyDelay 30, 30
SetDefaultMouseSpeed 2
menuWait(){
	Sleep 600
}

F1::{
	selectRandom() {
		randY := Random(501, 855)
		MouseClickDrag "Left", 730, 516, 730, randY
		randY := Random(185, 845)
		Click 416, randY
		Send "{Enter}"

		;Undo ghost "V" input
		menuWait
		Send "{Escape}"
	}

	;Select melee weapon
	CLick 472, 330
	menuWait
	selectRandom
	Send "Escape"

	;Select ranged weapon
	menuWait
	Click 476, 544
	menuWait
	selectRandom
}
Attachments
Menu Of Ghost Input.png
(1.25 MiB) Downloaded 27 times

Return to “Gaming”

Who is online

Users browsing this forum: No registered users and 10 guests