Gamestudio Links
Zorro Links
Newest Posts
zorro license, IB connection
by AndrewAMD. 12/06/23 17:16
Newbie Questions
by fairtrader. 12/06/23 11:29
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
5 registered members (AndrewAMD, miwok, TipmyPip, 3run, 1 invisible), 631 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 3 1 2 3
Re: AI implementation [Re: ] #267073
05/21/09 18:11
05/21/09 18:11
Joined: May 2009
Posts: 1,816
at my pc (duh)
darkinferno Offline OP
Serious User
darkinferno  Offline OP
Serious User

Joined: May 2009
Posts: 1,816
at my pc (duh)
ok thanks smile... thats awesome

Re: AI implementation [Re: darkinferno] #268054
05/27/09 11:04
05/27/09 11:04

F
Fear411
Unregistered
Fear411
Unregistered
F



alright here is the level:

IntensePathfinding Test Level

Move the red cross with the cursors.
Run the level with -d make_graph to build the graph.
In the ix_Interface.c is the ki_go_to function and the modified npc function. If you dont get it to work with your own project, you can send me you files and i will implement it for you.

Re: AI implementation [Re: ] #268098
05/27/09 13:04
05/27/09 13:04
Joined: May 2009
Posts: 1,816
at my pc (duh)
darkinferno Offline OP
Serious User
darkinferno  Offline OP
Serious User

Joined: May 2009
Posts: 1,816
at my pc (duh)
thanks, it looks awesome, i have a question though, since i ONLY want pathfinding from intenseX, is it smart to develop other aspects of my AI (such as how it will behave in combat) first, then implement the pathfinding when thats done or would it cause major problems?

Re: AI implementation [Re: darkinferno] #268124
05/27/09 14:21
05/27/09 14:21
Joined: Nov 2008
Posts: 946
T
the_clown Offline
User
the_clown  Offline
User
T

Joined: Nov 2008
Posts: 946
Should not cause any problems. Most AIs have two functions running, one for the whole decision making (combat behaviour), one for the navigation. Say, you use a state machine; You'll have functions to control the states. In one state you call the pathfinding. You could use a skill that stores the handle of a specified target entity, call the pathfinding everytime the handle skill is not zero, with the pointer from the handle as parameter.

Re: AI implementation [Re: the_clown] #268157
05/27/09 17:44
05/27/09 17:44

F
Fear411
Unregistered
Fear411
Unregistered
F



yeah i should no cause any problems. But you must have some things in you npc action like in the example. Just copy it from there.

Re: AI implementation [Re: ] #268165
05/27/09 18:43
05/27/09 18:43
Joined: May 2009
Posts: 1,816
at my pc (duh)
darkinferno Offline OP
Serious User
darkinferno  Offline OP
Serious User

Joined: May 2009
Posts: 1,816
at my pc (duh)
okok... another noob question, lol, so i know i can handle coding this, just that i dont have much of a base knowledge with it.. so could anyone show me jus a QUICK sample of a state machine and decision making... if they arent the same thing, lol...

Re: AI implementation [Re: darkinferno] #268169
05/27/09 19:28
05/27/09 19:28

F
Fear411
Unregistered
Fear411
Unregistered
F



There are different methods. The Finite State Machine and the Goal Oriented Descision Making like in IntenseX

Finite State Machine.

Code:
if(see_enemy)
{
  my.state = attack;
}
if(see_atombomb)
{
  my.state = run_away;
}

if(my.state == attack)
{
  do something...
}
if(my.state == run_away)
{
  do something...
}


Goal Oriented Descision Making
Code:
my.guard_value = 20;
my.attack_value = 0;
my.run_away_value = 0;
if(see_enemy)
{
  my.attack_value += 60;
}
if(enemy.health > my.health)
{
  my.attack_value -= 20;
  my.run_away_value += 20;
}
if(enemy.type == atom_bomb)
{
  my.attack_value -= 50;
  my.run_away_value += 80;
}
my.goal = guard_goal;
if(my.attack_value > my.guard_value || my.attack_value > my.run_away_value)
{
  my.goal = attack_goal;
}
if(my.run_away_value > my.guard_value || my.run_away_value > my.attack_value)
{
  my.goal = run_away_goal;
} 

if(my.goal = guad_goal)
{
  ...
}
....and so on


The second one is better, more human, cause as you can see the values are influenced by many things and so there could be more different action that the npc is going to do. With Finite State Machine the npc is always doing the same, but with GOAP the npc could react in another way then before in the same situation. I hope you understood the examples. The code is not optimized smile. For example the finding of the highest value could be in a loop or something like this!

Re: AI implementation [Re: ] #268193
05/28/09 01:09
05/28/09 01:09
Joined: May 2009
Posts: 1,816
at my pc (duh)
darkinferno Offline OP
Serious User
darkinferno  Offline OP
Serious User

Joined: May 2009
Posts: 1,816
at my pc (duh)
ok.. umm, thanks fear i got it implemented ok... i'll use your above post as a guideline too, how would i get two seperate entities to go to their own targets... currently they all go to the player...

Re: AI implementation [Re: darkinferno] #268317
05/28/09 16:22
05/28/09 16:22

F
Fear411
Unregistered
Fear411
Unregistered
F



set the target for each npc in the action like:

my.target_x = ...;
my.target_y = ...;
my.target_z = ...;

and in the ki_go_to function write insead player.x... my.target_x....

Re: AI implementation [Re: ] #268390
05/28/09 23:18
05/28/09 23:18
Joined: May 2009
Posts: 1,816
at my pc (duh)
darkinferno Offline OP
Serious User
darkinferno  Offline OP
Serious User

Joined: May 2009
Posts: 1,816
at my pc (duh)
but wouldnt changing the targets in this way affect all npc's since they all have the same action applied? i havent tried it yet but just wondering...

Page 2 of 3 1 2 3

Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1