Home » PLAYER'S HQ 1.13 » v1.13 General Gameplay Talk » Enemies Moronic Ai iQ, why?
|
|
|
|
|
|
|
|
|
|
|
Re: Enemies Moronic Ai iQ, why?[message #312258]
|
Mon, 19 November 2012 19:25
|
|
Zelekendel |
|
Messages:20
Registered:November 2012 |
|
|
I also found my experiences to be similar with the OP. I tested several times on 2085, and this behaviour didn't happen. It seems like some kind of AI decision making code is causing weird the weird behaviour of running out and back into cover turn after turn, and I think there's some sort of code that causes the enemy to evaluate the situation (being out of range, seeing many enemies), that makes him run back to cover, where he starts the loop again and runs out, then back etc.
This happens regardless of NCTH and new tac AI, and theory is that the new decision making code was added in with the HAM 2.8 merge. So, someone who knows the code could maybe take a look at tactical_ai.cpp and perhaps disable this behaviour?
I'll take a stab at it myself, but I'm no coder unfortunately.
Report message to a moderator
|
Private 1st Class
|
|
|
|
|
|
|
Re: Enemies Moronic Ai iQ, why?[message #312524]
|
Tue, 27 November 2012 00:16
|
|
Zelekendel |
|
Messages:20
Registered:November 2012 |
|
|
Flugente, the problem is that only a part of the enemy force are engaged with you currently, even if all of them are aware of you. Those "close enough" to start engaging, do so, but those who are currently too far and intimidated by you fiddle around in cover while their mates die. I'm of the belief that for this reason, running and gunning worked better for the AI in the earlier versions.
If all of the enemy behaved the same way, staying back in cover, it'd be different. Another problem, however, is that the enemy don't just stay in cover - they walk back and forth from and to cover, thus triggering multiple reactions and getting shot anyway.
So, in either case the current behaviour fails in comparison to running and gunning, and that is easily seen by playing pre-HAM and after HAM (I think it's the 100 AP system that brought all this along)
NCTH is a non-issue in my case at least, as I play with it off.
But, sounds like there is hope at the end of the tunnel - maybe I'll just have to hold off on my return to Arulco until the certain someone (Warmsteel?) is able to do his magic.
There's plenty of games in the backlog anyway, and I've just started old UFO as a "replacement".
Report message to a moderator
|
Private 1st Class
|
|
|
Re: Enemies Moronic Ai iQ, why?[message #312616]
|
Thu, 29 November 2012 15:15
|
|
Jcd000 |
|
Messages:19
Registered:July 2011 |
|
|
While i know almost nothing about ja2 modding, and i have only some familiarity with c++ programming, i have worked a bit on ai projects, and i find them interesting.
I also want to learn c++, so maybe i can do something to help..
only thing i want is pointers on how to get started...
eg. where to find the latest 1.13 source code, any documented knowledge on current ai, ideas on how to improve the ai... I'm thinking of completely changing the way ai works, writing it from scratch.
Since i have mostly worked with python, and much less with c, c#, this will take much time, but in this period, it will give me something to do. At the least i can promise to try..
Report message to a moderator
|
Private
|
|
|
|
|
|
|
Re: Enemies Moronic Ai iQ, why?[message #312669]
|
Sat, 01 December 2012 15:11
|
|
Zelekendel |
|
Messages:20
Registered:November 2012 |
|
|
It's not just about not seeing you, it's in fact seeing you massed together that scares some enemies into running in circles, especially so if they're so far out of range that the code calculates it doesn't have a good shot.
So basically it's something like:
"Do I have LOS at enemy? If no, try to get into LOS"
"Do i have a good enough shot from where I am?"
If yes, shoot.
If not, decide between getting into the best available cover or into range for a shot.
And in that decision, number of enemies seen is a factor, so actually them seeing you causes them to run in circles! I'm sure there's other factors in there, too.
When they're back in cover, the loop starts again. As a result, the enemy shuffles from cover to your LOS (triggering reactions) and is totally ineffective at either helping their mates or staying in cover themeselves!
Whatever the preference for enemies to stay in cover would be, I think the highest priority would be to help their mates, so they can do at least some teamwork.
Report message to a moderator
|
Private 1st Class
|
|
|
Re: Enemies Moronic Ai iQ, why?[message #312671]
|
Sat, 01 December 2012 15:46
|
|
Jcd000 |
|
Messages:19
Registered:July 2011 |
|
|
i think that at first (after understanding, at least superficially what the ai does) i have to understand what the ai knows, and how it uses that knowledge (there is a separate file handling the ai knowledge).
Maybe i can expand that a bit, in order to add short term memory if it is not in already.
After that, a new (or modified) decision making system is in order.
I actually dislike -if- trees.
I much prefer to make a tree with all possible actions (or a simplified one, if that's too big), and then evaluate those found action-sequences, maybe with a fuzzy logic system where the action-sequence with the highest rating prevails, thus choosing a "best course" of action.
So in your example, the enemy soldier will have to decide if
1. It is better for him to shoot as is, despite the bad shot %
2. Try to close in despite the danger of massed enemies (he has to take into account existing friendly support, enemy cover and snipers)
3. Take cover and fall back, maybe hiding inside buildings or on rooftops, so that you will have to flush them out the hard way...
also, the enemy soldiers have to follow an almost uniform reaction each time, since each one doing his thing is a recipe for disaster..
seems too ambitious, but i can clearly see how that can help...
anyway, don't expect fast results on that project.. i work slowly at best
Report message to a moderator
|
Private
|
|
|
Re: Enemies Moronic Ai iQ, why?[message #312677]
|
Sun, 02 December 2012 01:13
|
|
Zelekendel |
|
Messages:20
Registered:November 2012 |
|
|
Sounds good. How about the end of next year as the target? I find it helps a lot to have targets.
[Updated on: Sun, 02 December 2012 01:14] by Moderator Report message to a moderator
|
Private 1st Class
|
|
|
|
|
|
|
|
Re: Enemies Moronic Ai iQ, why?[message #312855]
|
Fri, 07 December 2012 14:26
|
|
Gazz |
|
Messages:32
Registered:October 2010 Location: Bavaria |
|
|
It was something that hadn't been tried before in X3, either.
The entire AI in that game is pretty much built in long chains of If-Then-Else. The hardcode as well as all the higher level AI scripts for pilots or turrets.
At least most custom scripts, too. AEGIS and all it's offspring like MEFOS or younameit.
It's no concidence that the AI in that game is considered smart as a rock. Because it is. It flies towards the nearest enemy and from then on, all behaviour is purely reactive. There is no trying to create a tactical advantage. There are no formations. Every ship acts individually. Ship gets shot, ship starts evading. Otherwise it closes with and if possible shoots at the closest enemy. Repeat.
With writing a smarter AI for JA2, the problem is not the principal approach - it's all the moving parts.
Weapons alone end up with a huge array of stats (some of which are irrelevant in a stand up fight, of course) which need to be tested for their "value" when deciding what weapon to use or what to shoot.
I spent a lot of my time watching, logging, tweaking, and re-evaluating conditions. You can still turn that display on in the game now. Shows the ships' relative "yumminess" in the ship name and how it fluctuates. =)
Report message to a moderator
|
Private 1st Class
|
|
|
Re: Enemies Moronic Ai iQ, why?[message #312955]
|
Tue, 11 December 2012 16:15
|
|
Jcd000 |
|
Messages:19
Registered:July 2011 |
|
|
For me, an added problem is my lack of knowledge of c++, and lack of experience in manipulating so big programs.
So it gets somewhat hard for me to grasp everything i need to know.
So, while i can do something, i think it is unfeasible for me to "rewrite" most of the ai.
On some occasions though (meaning some elementary situations where the ai is doing poorly) i think i can create such a system inside the if tree, where the approach will be based on evaluation.
Namely, when i understand that the if-then solution can be faulty, a small evaluation will run to modify the previously determined reaction.
Since i think i'm not ready to really overhaul the whole system using that idea (that would be the ultimate goal) i will try keep it small scale for now..
the basic idea though would be simple enough:
when the if-result is proven to be often wrong,
we generate solutions (or use a pre-defined list of them), then choose one of them through a fuzzy system.
The bad thing in generating solutions, is that they can be too many for any cpu to handle, so one has to discard many of them through assumptions, complicating the code.
And as Gazz mentioned, the evaluating idea is not very hard to grasp or code, but the fuzzy system needs much tweaking to work successfully, and the more things we factor in, the hardest the tweaking can get..
This is patchwork, i know, but one has to start somewhere...
Report message to a moderator
|
Private
|
|
|
|
|
Goto Forum:
Current Time: Sat Apr 20 00:23:34 GMT+3 2024
Total time taken to generate the page: 0.01780 seconds
|