Artificial intelligence's architecture
Page 1 of 1

Author:  RogerBidon [ Tue Aug 01, 2017 12:28 am ]
Post subject:  Artificial intelligence's architecture

How do you handle non-trivial artificial intelligence in your homebrews?

I just re-implemented a new AI for the Smashbros-like that entered the nesdev compo 2016. Since I love to solve problems by myself, I came with my own solution. At any time, the bot has a current action, which is a simple technical move, like "double jump". When the current action is complete, a new one is selected by running a series of subroutines, each trying to solve a specific task, for example a subroutine can try to hit the opponent, another can try to move to a safe area, ... It leads to an easy to write AI, each subroutine focusing on a specific goal. As a bonus, the bot's behavior can be adapted at run time by modifying the list of subroutines used during the selection phase.

Being pretty proud of the thought process and the result, I also wrote an article about the subject. And now that everything is clear in my head, I would be glad to compare with how you guys fix the same problem.

Author:  Rahsennor [ Tue Aug 01, 2017 1:07 am ]
Post subject:  Re: Artificial intelligence's architecture

That sounds very similar to the gambit system used (by players!) in Final Fantasy XII, which also happens to be my favourite simple AI: it's just a priority-sorted list of condition-action pairs. The first condition that returns true triggers the action it's paired with. Since FF12 is an RPG all the conditions are actually targets, such as "enemy: HP > 1000" or "ally: poisoned", and the 'condition' is simply that a target matching the criteria exists. The actions are identical to the ones on the player's control menu, using the target provided.

Author:  thefox [ Tue Aug 01, 2017 3:33 am ]
Post subject:  Re: Artificial intelligence's architecture

Quick off-topic note:
CPU running at 1.5Mhz

It's actually 1.79 MHz (NTSC), or 1.66 MHz (PAL). (

Author:  RogerBidon [ Tue Aug 01, 2017 10:58 am ]
Post subject:  Re: Artificial intelligence's architecture

The gambit system is awesome, it shines by its simplicity. Also, it is particularly adapted for an RPG as the game can naturally unlock it progressively to let the player experiment with a limited version before getting access to the full stuff. FF XII being turn based also helps for accessibility, the player/designer immediately understand when the logic is run. It may be less intuitive on a real-time game as the player must think in ticks while experimenting continuous gameplay, but it would be no problem for a developer/designer.

Oh, and thefox, you are perfectly right and on-point. When writing I didn't even though of using the precise frequency. I may have stick with the rounded 1.5Mhz value, but it would have been better doing it consciously. Lesson to learn: ask proofreading from someone knowledgeable about the subject.

Author:  Rahsennor [ Tue Aug 01, 2017 8:02 pm ]
Post subject:  Re: Artificial intelligence's architecture

FF XII is realtime, with cooldowns/casting times. The gambit engine will interrupt a spell or action if its target is lost or a higher-priority one becomes available in the meantime, under certain hardcoded conditions. That's actually one of the reasons the gambit system is so useful - it lets you control your whole party without pausing. I like to play entirely by the gambit menu. :P

Author:  tepples [ Tue Aug 01, 2017 8:54 pm ]
Post subject:  Re: Artificial intelligence's architecture

Hello class. I'm Mr. LeBeau
, and today we'll learn to code by programming this PlayStation 2 to play Final Fantasy XII for us. Now let me get out some cards so I can spin up this generator, and we'll be set.

Page 1 of 1 All times are UTC - 7 hours
Powered by phpBB® Forum Software © phpBB Group