Savlon already linked a great answer with several links in the comments.
However, for a simple Mario-like (hey!) platformer, I wouldn't worry too much about the AI.
In fact, you don't really need any real AI to create a nice and solid platformer (don't overcomplicate it!):
- To avoid NPCs somehow dieing or wasting their "time" (or the system's processing power) before the player is there, only spawn them with the player being nearby. This way they don't have to determine whether the player is nearby, what they should do, etc.
- Most classic enemy behavior can be realized using some very simple rules:
- Let the enemy walk to the left. If he collides with something, he'll turn to the right.
- If the enemy shouldn't fall off platforms (red turtle in classic Mario games), then check whether there is something walkable in front of them. If there isn't, change direction.
- If the enemy should idle (piranha plants), just check how distant the player is. Don't leave the tube as long as he's closer than x units.
- To decide which direction to shoot (hammer bros), just determine which the direction the player is.
- Boss behavior can be controlled using similar logic combined with (pseudo) random numbers. Keep in mind that a big part of the gameplay for most platformers is the fact you'll have to find and remember patterns (e.g. when a boss jumps or when he shoots) to beat the game and not get hit. If you add AI, this won't necessarily become more challenging or interesting. It's more likely it gets too predictable or players will just aim for some loophole to get the AI into bugging out (not necessarily; but I consider this a great example why you won't need a full AI).
- Classic consoles didn't have the processing power for real time AI decisions, as such this is really uncommon in this genre anyway. I'd say go with fixed/coded behaviors first and concentrate on gameplay. Later on, if you feel like it, you can extend this even more and in the end you'll essentially get an AI like behavior without writing explicit code for it.
Might be interesting to note:
The only AI involvement in a classic Mario-like platformer I know of is the approach to write a "jump and run solver" AI to essentially speed-run such a game (e.g. for Infinite Mario; more information can be found on MarioAi.org). So you're "programming" the player, not the enemies. Keep in mind that I'm not talking about something like the "guide mode" Nintendo introduced with the latest installments of the series. These are - as far as I know - just fixed instructions/scripts solving the levels in a very specific way (path, timing, etc.). Fun fact: With a real enemy AI using random decisions etc. something like that would be a lot more complicated to do (if possible at all, given limited resources and the player not wanting to wait).