Artificial inteligence for soldiers

Get help using Construct 2

Post » Sat Jan 18, 2014 9:14 pm

As a generic response. Good AI is darn difficult to make, even those huge budget AAA games often have quite bad AI characters that quite often do more harm than good. So, any easy/simple answer that would work on all situations ain't likely to be found.

Addendum: For this particular case.

I am not 100% sure what kind of game you are making.. so this my advice may indeed be totally useless to you.

For starters I would consider making the scene grid and turn based, that way it would be easier to be sure that the heros and enemies would not stomp atop of each other and also all players on the field do their movements and attacks in manageable fashion.

If you want them to have pixel (or sub-pixel) positioning, you'll need to define whom the characters want to attack? Perhaps the weakest enemy, or the closest or spice up with some randomness?. Also you'll must be sure that the characters won't get stuck (if movement fails)...

Oh. I got the nasty feeling, there should be at least I more tutorial of this AI. Joannak2014-01-18 21:47:35
Need help? Upload .capx file with your question.
B
16
S
4
G
2
Posts: 233
Reputation: 2,560

Post » Sat Jan 18, 2014 9:34 pm

I agree...
but in my case, should not be so hard to make the instances attack individually. I'm noob...
B
25
S
4
G
2
Posts: 99
Reputation: 2,498

Post » Sat Jan 18, 2014 11:43 pm

One thing I noticed is the twitching the hero makes after closing to enemy. I think it would be better to stop movement when hero is at the good attack range and tries to hit enemy. Only if enemy moves away or dies should the hero move again.

PS: I did expand the previous message quite a lot after testing your code, I hope you noticed.

One issue I think comes with the using Overlapping test alongside System (1.5 sec) delay causes problem. You'll most likely need to rethink that logic.

I added one instance variable for each hero Cooldown and use it to delay the attacks and it seems to work better. Not perfect in any way, but didn't want to hack too much changes.

Unfortunately I cant' copy the code as a text nor don't know how to add a direct picure. Scirra should really fix their system in a way that copy/paste works properly.

Ah well. This forum systems needs tune-up anyhow, and I need to start using Dropbox anyhow..

https://www.dropbox.com/s/8kderyrw5npvtz2/Clipboard02.png






Joannak2014-01-18 23:44:23
Need help? Upload .capx file with your question.
B
16
S
4
G
2
Posts: 233
Reputation: 2,560

Previous

Return to How do I....?

Who is online

Users browsing this forum: VValt and 24 guests