LongBeardedLion Expert Cheater
Reputation: 0
Joined: 10 Apr 2020 Posts: 173
|
Posted: Sat Sep 14, 2024 12:39 pm Post subject: Complex RTS tactical system keeps failing, video: |
|
|
https://www.youtube.com/watch?v=VhJ3atIbT1M&ab_channel=LastIberianLynxGameDev
https://www.youtube.com/watch?v=hybqhZV_nKc&ab_channel=LastIberianLynxGameDev
In these videos you can see what im trying to do.
Thats correct, im trying to make a Parthian tactics formation by changing the code from within.
The system relies on functions reversed using x32dbg, ida pro, cheat engine.
Then i make a dll injection, and call these functions to make the units behave in the intended way.
For that i call the stance function and the patrol function.
Check when and if units should retreat or shoot, or what to do, similar to how AI behavior systems are done, with a loop ticking with checks for unit location and stance.
At first i simply used a new thread, and this would be running separately.
But this is not reliable because very rarely but often enough, the game crashes because somewhere in the code there would be a racing condition (this is just my suspicion).
Though when it worked it worked amazingly well. Sometimes for 30 minutes straight without crash. But it crashes at some point almost every game.
So to solve this problem I decided to look for a function in the game that runs on tick.
So that instead of having a separate thread ticking with checks. I run it directly inside a game function thats also ticking. Makes sense right?
It completely solved the problem. The game never crashed again.
But now instead of crashing if the game has more than 3 players it starts lagging like crazy.
I dont know what else to do, I ran out of ideas to solve this. Its a shame because its one of the best things i made in game hacking / modding.
|
|