project-navigation
Personal tools

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Harkhanam

Pages: [1]
1
Newbie Coding / Re: Artificial Intelligence
« on: November 25, 2014, 08:07:41 pm »
HDD went dead today.

Thanks for the Com_Printf(...), will be priceless to check scoring while skirmishing once I've redownloaded, reinstalled and recompiled all the things needed :p

Another thing that may be clear for you : the visibility of aliens. I've read that "we" believe they see everyone because the way they search for target "move them" to the position before checking visibility. However, if the visibility check is a simple "flag test" that is only set when the correct "move procedure" is done, maybe that flag is not reset when the position of the alien is changed, hence negating the assumption that they can see everyone.

I'll go check ASAP if you can't say without looking at it, and I'll do my first Com_Printf(...) on it to be sure :P



2
Newbie Coding / Re: Artificial Intelligence
« on: November 25, 2014, 04:48:09 am »
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: [Select]
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) {
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 ?

3
Newbie Coding / Re: Artificial Intelligence
« on: November 23, 2014, 10:59:52 pm »
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. (-:

4
Newbie Coding / Re: Artificial Intelligence
« on: November 23, 2014, 05:52:03 pm »
Hello, I'm trying to dig in the AI code. Originally created a new topic but this one is good enough :p

It's been a long time since I coded in C++ and I'm a little bit confused about a function call.

Code: [Select]
g_ai.cpp AI_PrepBestAction(...)
[...]
G_ActorMoveLength(...)
=>  g_move.cpp G_ActorMoveLength(...)
= = > const pos_t length = gi.MoveLength(path, to, crouchingState, stored);

I can't find what is "gi" nor any "MoveLength" function in the source.

I'm trying to figure out which case create the "null or "ROUTING_NOT_REACHABLE" returns.
more specifically, I want to make sure the code doesn't discard the current position of an alien while looking for a best action : I read somewhere they were discarding position already occupied, and I want to check if this include his own position.

I'm using the 2.5 source code provided with the downloaded game from the site.

The general goal is to get familiar enough with the AI code to fix some weird behavior, no revolution yet.


Pages: [1]