-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUGFIX: fix bots not jumping out of water in some cases. #11
Conversation
EA_MoveUp() doing nothing is clearly wrong (nice find). Do you have an example of a map water jump is an issue on or how to cause bot to fail to jump out of water? It's not clear to me if EA_MoveUp() is needed in BotTravel_WaterJump(). (Sorry, I haven't tested this. I'm just guessing/asking from briefly looking at the source code.) BotTravel_WaterJump() sets ideal_viewangles to face toward end of reachability and adds upward and calls EA_MoveForward() which move in direction of view angles (toward end of reachability and also upward). As far as I can tell, BotFinishTravel_WaterJump() is what is suppose to do the actual jump. |
Unfortunately, I can't remember which custom maps show this problem. I know there are a few, but these were of such poor quality that I don't think anyone used them anyway.
Now, apply the PR (to a temporary repository on your HDD, just to compile new vms). Add the patched vms to your existing Spearmint/Mint-Arena installation and start the test map again. Now the bot should be able to get out of the pool to collect the SG. Well, as I said, you can also fix the bug by forcing the bot to JUMP (if he is onground), this is mainly for other projects where the movement code is in the engine. |
Without the patch, the bot just runs in place toward the ledge (doesn't jump out) until it gives up. With the patch, the bot will sometimes jump out (on first or second jump) but other times it runs back and forth along the ledge jumping until it gives up. This doesn't seem like a great solution. I tried changing a couple things but I didn't get anywhere. |
In this case, it seems like it should be a barrier jump as shallow water is not swimable. I'm not sure if the problem is water jump movement or that BSPC thinks it's a water jump instead of a barrier jump. Changing calls in Game VM from Bot[Finish]Travel_WaterJump() to _BarrierJump() fixes getting out to get the shotgun. (It does break getting out of the plasma gun side which is in swimable water depth. Bot gives up eventually.) So it could definitely be fixed in BSPC by using barrier jump reachability. |
That's pretty weird, if patched the bots jumps out of the water without issues, at least for me. |
Yeah, your demo works. The bot failing to get out occurred three times but now it doesn't. After way too much time watching the bot, kicking and reloading map, in my eighth demo I manage to record jumping back and forth but the bot does manage to get out. It at 2 minutes in the demo. It seem to be caused by bot coming at an angle for whatever reason. |
Your demo works as well. |
In some cases bots will not be able to jump out of water. The reason is that inside the bot movement logic (see 'BotTravel_WaterJump') they are are using EA_MoveUp to get out of the water. Unfortunately the actual setting as a bot user command (actionflags) was missing, hence the bot didn't 'know' to move upwards.
NOTE: all idtech3 games using default botai are suffering from this bug. This bug can also be solved by tweaking the 'BotTravel_WaterJump' function (normally this code resides inside the engine, not game code). Fixing this bug inside the mod code seems more accurate, especially because ACTION_MOVEDOWN was also missing. Adding ACTION_MOVEDOWN can help to also fix bots using the 'Flight' powerup.