project-navigation
Personal tools

Author Topic: New Artificial Intelligent (powerful I guess :) )  (Read 4340 times)

Greenz

  • Guest
New Artificial Intelligent (powerful I guess :) )
« on: April 30, 2007, 10:06:06 am »
Hi everybody! Right now I am working at new AI for this game. It
is something about 60% what I'm had done for this moment. But I have
some questions and I will very thankful if you help me :)
Here are the questions:
About inventory and weapons. Can I'm take a specific weapon for
the inventory of agent? (for example, I am need to take a knife for
atacking nearly opponent or grenade to atack group of opponents and etc.)
About Patch Plannig. How there work pathfinding? Here is using navgraph or
something else?

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
New Artificial Intelligent (powerful I guess :) )
« Reply #1 on: April 30, 2007, 01:24:29 pm »
i'm sorry, i don't have the time yet - but i will answer all of your questions later - a new ai? can we see the codechanges you've made? join the irc channel and talk to me or zenerka there. best regards
martin

Greenz

  • Guest
New Artificial Intelligent (powerful I guess :) )
« Reply #2 on: April 30, 2007, 02:09:15 pm »
Mattn
Quote
can we see the codechanges you've made?

Of course (and I guess this new AI will take the place of standart AI :), if you will decide to do this, of course =) ), but when I'm when done it, ok?

 
Quote
join the irc channel

sorry, but I'm too don't have a time to do this :(

Some words about new feature of new AI:
First of all, it is based on Goal-Driven Agent Behavior. Agent have a set of predefined high-level goals, or strategies (for example explore, attack and etc.) and when AI logic update - there is calculate the desirability of each high-level goal, and that of them, that have maximum desirability, The agent will then attempt to follow by decomposing it into any constituent subgoals, satisfying each one in turn. It will continue doing this until the goal is either satisfied or has failed, or until the game state necessitates a change of strategy.
Second, new AI consist 4 systems: memory, targeting, weapon, goal.

right now I'm working on weapon system - on weapon selection, and on goal system - on explore goal (there is why I had asking about pathfinding)

I guess, I'm clarify it clear :)
so, I am waiting for your help.
Thanks

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: New Artificial Intelligent (powerful I guess :) )
« Reply #3 on: April 30, 2007, 02:59:43 pm »
Quote
About inventory and weapons. Can I'm take a specific weapon for
the inventory of agent? (for example, I am need to take a knife for
atacking nearly opponent or grenade to atack group of opponents and etc.)


this is currently all done in g_ai.c AI_FighterCalcGuete - we are cycling over all weapons an ai has in its inventory and calculate the best probability - then we use the weapon with the highest probability to hit or kill the target.

Quote
About Patch Plannig. How there work pathfinding? Here is using navgraph or
something else?


again g_ai.c AI_PrepBestAction we check all reachable targets in this function  (see the for loop)


you should be able to use that code and modify for your needs

Greenz

  • Guest
New Artificial Intelligent (powerful I guess :) )
« Reply #4 on: April 30, 2007, 04:00:34 pm »
Mattn
Quote
his is currently all done in g_ai.c AI_FighterCalcGuete - we are cycling over all weapons an ai has in its inventory and calculate the best probability - then we use the weapon with the highest probability to hit or kill the target.

You talk about this:
Code: [Select]
if (IS_SHOT_RIGHT(fm) && RIGHT(ent)
&& RIGHT(ent)->item.m != NONE
&& gi.csi->ods[RIGHT(ent)->item.t].weapon
&& (!gi.csi->ods[RIGHT(ent)->item.t].reload
|| RIGHT(ent)->item.a > 0)) {
od = &gi.csi->ods[RIGHT(ent)->item.m];
weap_idx = RIGHT(ent)->item.t;
} else if (IS_SHOT_LEFT(fm) && LEFT(ent)
&& (LEFT(ent)->item.m != NONE)
&& gi.csi->ods[LEFT(ent)->item.t].weapon
&& (!gi.csi->ods[LEFT(ent)->item.t].reload
|| LEFT(ent)->item.a > 0)) {
od = &gi.csi->ods[LEFT(ent)->item.m];
weap_idx = LEFT(ent)->item.t;
} else {
Com_DPrintf("AI_FighterCalcGuete: TODO: grenade/knife toss from inventory using empty hand\n");
/* TODO: grenade/knife toss from inventory using empty hand */
/* TODO: evaluate possible items to retrieve and pick one, then evaluate an action against the nearby enemies or allies */
}

if so, no, it isn't. If I'm right understand, there we only find weapon index and ammo pointer for weapon that in right or left slot (or hand? ). Then there is a cycle for selecting best firemode.

And I'm asked, how to take in inventory SPECIFIC weapon, for example, knife?

Greenz

  • Guest
New Artificial Intelligent (powerful I guess :) )
« Reply #5 on: June 07, 2007, 08:33:26 am »
I'am need some help. I'am add some variables in edict_s structure in file g_local.h, so, where I can initialize that variables? (and in what file initialize all variables in that structure?)

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
New Artificial Intelligent (powerful I guess :) )
« Reply #6 on: June 07, 2007, 10:27:45 am »
see g_spawn.c SpawnEntities line 294:
Code: [Select]
memset(g_edicts, 0, game.maxentities * sizeof(edict_t));

If the new variables are ai only - you can initialize them in G_ActorSpawn