Hey, sorry for the necro, but I was wondering if you ever solved the problem or figured out the cause? I didn't wanna make a new topic, because I'm currently experiencing the exact same issue.
I did manage to isolate the cause though, but I have no idea how (if even possible) to fix it myself. The cause is Avast antivirus and
gamepad_axis_value.
So, when Avast encounters a new application, it runs it inside a "CyberCapture" which is some kind of a safe environment Avast uses before it figures out if an app is malicious or not. This most often happens with new and small games, since they aren't well known to Avast's database.
For some reason, if a game uses the gamepad_axis_value
anywhere in it's code, launching it for the first time after a build will result in the aforementioned "The memory could not be read."-error instead of Avast's CyberCapture. I suspect the reason why this happens only once after a fresh build is because after that Avast marks the game as safe and doesn't need to check it anymore on further launches. This error (or CyberCapture) does not happen if Avast is closed.
To find out what piece of code was causing this, I manually stripped my game down of all of it's code and assets one at a time, till only gamepad_axis_value remained. If you're using avast, you can replicate this yourself by making an empty game with one single object, and put an empty gamepad_axis_value if-statement in any event and this error will happen. I also managed to replicate this on three different PCs which all use Avast.
Now, I don't know if there's anything I can do to "fix" this, since it seems to be caused by Avast, but I'm still going to submit this as a bug to see if there's anything the GM team can do about it. This error does not hinder gameplay, but it's still alarming and can cause people to think there's something wrong with your game, even when there's not. This is very frustrating, because I'm close to releasing my game on Steam, and I don't want people who use Avast to encounter this weird error message on their first startup of my game.
This has been a problem on multiple games of mine for the past couple of years or so. I always ignored it, but now that I'm actually about to sell a game I would like to fix it. I can't be sure, but I don't think this was happening before GM 2.3.0.
Any info, thoughts or ideas would be appreciated. Has anyone else who uses Avast encountered this? Thank you.