The Daily Click ::. Forums ::. Klik Coding Help ::. I'm having some trouble with enemy AI
 

Post Reply  Post Oekaki 
 

Posted By Message

JetpackLover



Registered
  01/03/2007
Points
  212
24th April, 2009 at 00:16:44 -

I have the enemies all set up and working mostly. All of the values they use are in alterable values or alterable strings. The enemy records what distance you are and changes state. The way my AI works is by using counters counting down from either a static number like "1" or using random(?)and when it reaches a set number the state will change. For example if the state is "idle" then the state timer is set to 100 and if the state timer is greater than 11 and "state" equals "idle" it will subtract 1 from the timer. When the timer is lower than 11 or equal to, it will set state timer to random(10) only one action when event loops)(which is 0-9 I believe) Anyway so when it is lower than 10 but greater than 4 it will change the state to walk, or if it is lower or equal to 4 it will change the state to jump. Basically it works like that.

Now my problem has to do with the timer not subtracting when it should. The stupid thing is it won't happen unless there is at least 5 enemies on the field(could be lower but maybe the lower it is the harder it is to break)

I have an example all set up very simple to understand with counters on screen for ID, State timer, and a string set to what state the enemies are at.(the enemies also jump without entering a state by colliding with a background)

So anyway what I'm hoping is that people will try my example and figure out exactly what is going wrong. The way to find the glitch is by running around activating the enemies attack1,attack2,attack3 states and then running away from them and if you get a certain distance away they will go to "idle" Now what is supposed to happen when they hit "idle" is the timer is supposed to set to 50 and then count down but for some reason the timer gets stuck on 11.

Trust me it is a lot easier by viewing the example. Which is right here,

http://www.mediafire.com/download.php?djh4wdbmtho

I don't think I can figure out what is wrong by myself so if you take a look know that I really need and appreciate help from the community.

 
http://www.invincibletime.com/

Devlog for HD MMF Game Omulus. Check it out because it's gonna be awesome. http://omulus.tumblr.com/

Follow me on the twitters https://twitter.com/JetpackLover


Trooper_959

The Stupid Rebel

Registered
  02/11/2007
Points
  213
28th April, 2009 at 01:12:34 -

lol im like making a metal slug game right now and i have had some glitches in the ai but i will try and see what i can do.

 
Is it really worth it to go onto the battlefield? I GOT A CUSTOM RATING SEE???

http://www.freewebs.com/tiredfreakedoutproductions/

http://www.weirdogamez.com



Trooper_959

The Stupid Rebel

Registered
  02/11/2007
Points
  213
28th April, 2009 at 01:14:01 -

actually sorry i cant, i only have tgf2 and i dont think i can get much custom movements except the install packs off of clickteam sorry

 
Is it really worth it to go onto the battlefield? I GOT A CUSTOM RATING SEE???

http://www.freewebs.com/tiredfreakedoutproductions/

http://www.weirdogamez.com



JetpackLover



Registered
  01/03/2007
Points
  212
28th April, 2009 at 01:35:14 -

Were you not able to open it because of the Platform Movement object?

It didn't really need PMO so I took it out and replaced it with 8 directional movement. The ai is a custom movement and requires no other extensions.

http://www.mediafire.com/download.php?omqqqg4whzj (no extensions)

 
http://www.invincibletime.com/

Devlog for HD MMF Game Omulus. Check it out because it's gonna be awesome. http://omulus.tumblr.com/

Follow me on the twitters https://twitter.com/JetpackLover


Trooper_959

The Stupid Rebel

Registered
  02/11/2007
Points
  213
28th April, 2009 at 01:53:13 -

hey im looking at it and it could it be because you said that it has to be greater than 11 or am i wrong

 
Is it really worth it to go onto the battlefield? I GOT A CUSTOM RATING SEE???

http://www.freewebs.com/tiredfreakedoutproductions/

http://www.weirdogamez.com



Trooper_959

The Stupid Rebel

Registered
  02/11/2007
Points
  213
28th April, 2009 at 01:55:21 -

hmm odd some of them like go into the negatives for me. some others also go into like 11 and then repeat is it supposed to be doing this because the ai looks like its normal to me. Im just tired tonight ill check it out more tommorow and maybe we can figure it out

 
Is it really worth it to go onto the battlefield? I GOT A CUSTOM RATING SEE???

http://www.freewebs.com/tiredfreakedoutproductions/

http://www.weirdogamez.com



JetpackLover



Registered
  01/03/2007
Points
  212
28th April, 2009 at 02:10:07 -

Yeah when it's State is equal to "idle" and the state timer is greater than 11 then subtract 1 from the timer. It works sorta...

Oh I just changed it so instead of saying greater than 10 but lower than 12 I instead changed it so it says "State timer equals 10 then set state timer to random(10)(0-9) but alas it's still being a jerk. I think it may have something to do with only one action when event loops. I'm thinking that if the condition is already true and it needs to count down it will get to the number it needs to count down to and then do nothing(something like that I'm not really sure)

 
http://www.invincibletime.com/

Devlog for HD MMF Game Omulus. Check it out because it's gonna be awesome. http://omulus.tumblr.com/

Follow me on the twitters https://twitter.com/JetpackLover


JetpackLover



Registered
  01/03/2007
Points
  212
28th April, 2009 at 02:11:13 -


Originally Posted by Trooper_959
hmm odd some of them like go into the negatives for me. some others also go into like 11 and then repeat is it supposed to be doing this because the ai looks like its normal to me. Im just tired tonight ill check it out more tommorow and maybe we can figure it out



Cool no prob! See you then!

 
http://www.invincibletime.com/

Devlog for HD MMF Game Omulus. Check it out because it's gonna be awesome. http://omulus.tumblr.com/

Follow me on the twitters https://twitter.com/JetpackLover


Chloe Sagal

under the influence of FUN

Registered
  19/02/2009
Points
  607

Orange
28th April, 2009 at 07:55:22 -

im confused on the overall goal of this. you want it so the enemies bug you when you get within a cerain distance (which also changes their attacks), but when you arent they either stand around or walk in random directions? and the issue is the countdown part and the fact that after the first idle, they keep walking when they should be idle?

lol, yeah there definatly was a big problem with the greater that 11 part, it was always getting stuck around there. im not too sure but i think you might be overcomplicating things a bit. and youre right it might be a problem with the run this event once. sorry im not able to arrive at any other conclusions that the ones already concluded.

 
Patreon: http://www.patreon.com/chloesagal
Twitter: https://twitter.com/ChloeSagal

Trooper_959

The Stupid Rebel

Registered
  02/11/2007
Points
  213
1st May, 2009 at 23:36:03 -

sorry i havent had like time to check it but like i said ill try to help when i get to it but still i dont notice anything odd with the ai but who knows

 
Is it really worth it to go onto the battlefield? I GOT A CUSTOM RATING SEE???

http://www.freewebs.com/tiredfreakedoutproductions/

http://www.weirdogamez.com


   

Post Reply



 



Advertisement

Worth A Click