Game AI: Implementing a behavior tree in C2. Thoughts?

Discussion and feedback on Construct 2

Post » Thu Jun 05, 2014 11:46 pm

Uh, I mean that why you need picking in you AI struct? Is it something special? Sorry for the mistake.
B
109
S
27
G
277
Posts: 4,482
Reputation: 154,924

Post » Fri Jun 06, 2014 1:58 am

@rexrainbow Oh, heh. I was wondering how you wrote a plug-in without understanding picking. :-) My AI blocks have to work with am entire family of mobs, with multiple instances of each family member who may be in totally different situations.
Thus the need to pick particular instances based on the instances circumstances; they won't all be doing the same thing. Not sure if I am answering your question or not.
If I was to try to use behavior tree arch, it seems to me that I would have to separate the condition portion, which contains the picking, from the action. But maybe that's just me not seeing how to make it work. Anyway, that's why the initial question.
B
11
S
4
G
1
Posts: 159
Reputation: 1,803

Post » Fri Jun 06, 2014 7:32 am

@Yttermayn

You are right.
My fsm behavior maintains a state variable for each instance, and one instance could have more then 1 fsm behavior, they work individually.
Just see the sample capx in the document.
B
109
S
27
G
277
Posts: 4,482
Reputation: 154,924

Post » Mon Jun 09, 2014 1:38 pm

@rexrainbow Ok, I am intrigued by your plugin. It may be too late to use it for this particular project because my AI as it is is nearly done as far as the overall structure is concerned, just need to polish the states. However, there is another project I might try to use it for. So I ask, since I hope to release and sell my games someday, are there any strings attached to the use of your plugin? If so, what are they?
B
11
S
4
G
1
Posts: 159
Reputation: 1,803

Post » Mon Jun 09, 2014 3:48 pm

Nothing need. Just tell me the link of your game, heh.
I had made another fuzzy plugin for game AI, but I still could not use it well.
B
109
S
27
G
277
Posts: 4,482
Reputation: 154,924

Post » Wed Feb 01, 2017 9:26 pm

Message: rafaelsorgato can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
jobel wrote:
Yttermayn wrote: http://intrinsicalgorithm.com/IAonAI/2012/11/ai-architectures-a-culinary-guide-gdmag-article/
.


good article thanks! I'm making a rogue-like as well! or at least modified roguelike...


you know how to make enemy for roguelike?
B
4
S
1
Posts: 6
Reputation: 376

Post » Thu Feb 02, 2017 12:34 am

My ai logic typically uses variables to determine the state of the AI and then logic is in an if-else if type of structure.

For example:
I have an AI Monster called Slime. The slime has 3 behavior states.
Peaceful: 0
Aggressive: 1
Attacking: 2

The slime has Instance variables:
Level
Behavior

the game then compares the slime level and player level
if(slime.Level > Player.Level)
if(Player is near Slime) Behavior = 2
else Behavior = 1
else Behavior = 0


Then the game can choose which AI to implement based off of this.
For each slime
if(behavior = 0) Implement peaceful AI
else if(behavior =1) implement an aggressive AI
else is in combat, do combat AI.

Something like that can be taken further and broken down as much or little as needed, looking at things such as health, items, environment anything.


the very important aspect of this is being able to differentiate one slime from another and properly pick the slime based on the behaviors etc. For this, I find instance variables to be invaluable in dynamic/diverse AI's
B
28
S
8
G
1
Posts: 226
Reputation: 2,865

Previous

Return to Construct 2 General

Who is online

Users browsing this forum: Yahoo [Bot] and 9 guests