Development > Newbie Coding
Artificial Intelligence
Harkhanam:
Thanks for the reply, I'm compiling the project for the first time and it gave the satisfactory : ||=== Build finished: 0 errors, 24 warnings ===|
First thing is to mess with the cost function of the search, I'll be back for more questions sooner or later. (-:
DarkRain:
Hi,
Good to know you could compile without problems :)
And I must correct myself... typed that reply in a hurry before going out to an appointment, I was bound to make a mistake... anyway, ROUTING_NOT_REACHABLE is returned not when the actor doesn't have enough TUs but when the pathing cost is too high (currently max lenght is 50 TUs IIRC)
Harkhanam:
Ok so I've compiled the maps and launched the compiled .6 version :o)
I have a much more clear view of AI limits now
Basically, it's :
Move to a shooting spot by the shortest path where you can shot at a visible ennemy
Shot as much as you can
Find cover if possible
However, the "find cover" seems very rare and that would be because there's no saving of TU for it : AI select its target & its move, then, a cover if TU's left permit it (if I'm right).
But, AI will more likely try to use every TU available because the score function depend on the damage inflicted.
There's another interrogation :
g_ai.cpp : AI_FighterCalcActionScore(...)
--- Code: ---if (!(AI_IsExposed(hidingTeam, actor)) && !AI_HideNeeded(actor)) {
bestActionScore += SCORE_HIDE + (aia->target ? SCORE_CLOSE_IN + SCORE_REACTION_FEAR_FACTOR : 0);
} else if (aia->target && tu >= TU_MOVE_STRAIGHT) {
--- End code ---
It seems those line are for Aliens to make ambush : They don't want to risk reaction fire so they find a spot out of ennemy sight and gives it value, it lacks a check to see if the alien has reaction fire turned on.
It would require AI_HideNeeded(actor) without the negation ( ! )
I made a change an tested it, aliens start to play more passively once they start suffering losses. (and killed one of my soldier with reaction fire)
I'm wondering, is there a way to print data into the console while the game is playing ?
Sandro:
--- Quote from: Harkhanam on November 25, 2014, 04:48:09 am ---However, the "find cover" seems very rare and that would be because there's no saving of TU for it : AI select its target & its move, then, a cover if TU's left permit it (if I'm right).
But, AI will more likely try to use every TU available because the score function depend on the damage inflicted.
--- End quote ---
IIRC, that is not exactly true -- if AI is NOT in the "brave" mode, it will try to hide at the end of turn, but on most maps it is quite hard to find a safe spot, since they are outdoors. Also, window between "brave" and "panic" modes is quite narrow IIRC. Maybe DarkRain could give a better explanation.
--- Quote from: Harkhanam on November 25, 2014, 04:48:09 am ---It seems those line are for Aliens to make ambush : They don't want to risk reaction fire so they find a spot out of ennemy sight and gives it value, it lacks a check to see if the alien has reaction fire turned on.
--- End quote ---
Aliens always have reaction fire turned on. And yes, there are some attempts to implement ambuses, though not very effective on most maps.
--- Quote from: Harkhanam on November 25, 2014, 04:48:09 am ---I'm wondering, is there a way to print data into the console while the game is playing ?
--- End quote ---
Com_Printf(...), syntax is like classic printf(...)
DarkRain:
Re: AI and cover as Sandro says AI will not always look for cover only if they are not brave or if they see an enemy with a powerful weapon, but the problem you mention with them using all TUs for shooting is also true as expected damage is currently the main part of the AI action scoring.
No aliens don't always have reaction fire enabled ̣— see AI_InitPlayer() is only a 75% chance they do — and it can change during battle (the AI won't their change RF status once spawned by themselves, but losing their weapon, flashbangs and the shaken status)
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version