In revision 3750, I removed a bug in the combat code that made ships head for a different direction than planned when flying a way from a target. The sign of the the calculated roll that was needed to get on course, when flying away from a target, was wrong. This bug has always been in the code but nobody noticed because ships flew in a random direction anyhow I was very reluctant to fix this bug as it would change known behaviour, but I needed the fix to make other, new code in the flee mode, work properly.
The old code tried to send a retreating ship in a direct line, away from the target, when within 500 meter. This never happened as we all know from experience, but with the fix the retreating ships did fly that path. This was also what I remembered from Elite: when flying close behind an other ship you just could kill him because it kept just flying in a straight line. It felt wrong to me, so I changed a bit at the jink code to also work at close range to keep the old evading behaviour at close range.
After doing many dogfights this weekend, I have the feeling that no player will notice a big difference with the old situation. And that is good, as I never had the intention to make things more difficult during dogfight. But, every ship reacts different. e.g. with a hydra you still can kill him easy when you manage to get behind him. And the much more agile Basilisk is still hard to hit from behind because it kept moving away from my fire. I would appreciate if other trunk users also watch dogfights a bit more closely than usual and report if I changed behaviour somewhere to much. (It are really only the behaviour_fly_from_target and behaviour_flee that have changed a bit. Any other change you might see is just illusion)
What I did intended to change, is giving 75% of the fleeing ships a much higher jink-factor. That change of fleeing is now clearly visible and would not have worked without the previous bug-fix.
EDIT: And I added a FRUSTRATION message to the perform_flee that fires after accumulating 15 seconds of not being able to increase the distance to its opponent. Internally it is now used to generate a new jink value, but a custom AI might use this FRUSTRATION message to evaluate if it should switch tactics.
Please test dogfighting in Trunk rev 3750+
Moderators: winston, another_commander, Getafix
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
Please test dogfighting in Trunk rev 3750+
Last edited by Eric Walch on Mon Sep 13, 2010 7:31 am, edited 2 times in total.
UPS-Courier & DeepSpacePirates & others at the box and some older versions
- Griff
- Oolite 2 Art Director
- Posts: 2479
- Joined: Fri Jul 14, 2006 12:29 pm
- Location: Probably hugging his Air Fryer
great stuff Eric edit: and Giles! , i picked a fight with a griff_python far out near the witchpoint beacon and chased after it for a few minutes occasionally jabbing it with a few shots from my beam laser, it tried hard to get away the whole time, rolling and adjusting it's course, ditching cargo etc, in fact, i let it get away before quitting the game since it had tried so hard to escape
edit: edit to give credit!!
edit: edit to give credit!!
Last edited by Griff on Wed Sep 15, 2010 2:36 pm, edited 1 time in total.
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
Yes, but actually most of it was code written down by Giles, long ago in the dark ages. Just because of one bug, that evasive code never worked properly. For Giles, testing of ship behaviour was much more complicated than now with the console, so he probably put his attention to other parts of the code as it visually worked.Griff wrote:great stuff Eric!,
Thanks to the console it becomes now much easier to change parameters during game and query data from ships. And specially for ship AI and combat testing is the target inspector a must. Its just a pity that this inspector only available for the Mac side.
Probably a good challenge for window programmers that want to contribute: Its a separate program from Oolite so you don't have to familiarise with the big chunk of code. Its only representing data that is already available through the console in a graphic form. Having such a tool is a very good help for other oxp developers. And than particularly AI coders.
UPS-Courier & DeepSpacePirates & others at the box and some older versions