Posted by inktrebuchet
in Is there a more recent AI coding tutorial/document? (Started by Nocturnis September 02, 2022, 03:03:34 am
Board: M.U.G.E.N Development Help
Board: M.U.G.E.N Development Help
Moves canceling into or switching states when they shouldn’t be, is definitely a coding error on your end. That can only happen if you triggers/conditions aren’t strict enough.
I recommend using the ailevel trigger for AI detection if you are coding for 1.0, 1.1 or Ikemen. It’s completely reliable where the older var method can have some unwanted results. Ailevel trigger should be on EVERY changestate in statedef -1, so either trigger1 = ailevel or trigger1 = !ailevel for example.
Also, it’s best to copy all of the changestates that aren’t for AI and paste them to convert them to AI changestates in statedef-1, that’s what we mean by separating AI. This also makes it easy to keep the conditions the same for AI as they are for a user. *Charge moves, would need a variable, if you want it to be more like a user.
More advanced stuff would involve preventing the default AI from jumping and walking randomly and writing your own logic for that. That can be tough coming up with when to walk and jump though. Cutting out jumping alone makes even kfm a harder character to fight.
I have some snippets you can find in my signature for AI detecting projectiles, if you are interested in that kind of thing.