It is currently Sun Oct 22, 2017 11:21 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Tue Aug 01, 2017 12:28 am 
Offline
User avatar

Joined: Wed Dec 28, 2016 7:16 am
Posts: 40
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.

_________________
Super Tilt Bro.: https://sgadrat.itch.io/super-tilt-bro


Top
 Profile  
 
PostPosted: Tue Aug 01, 2017 1:07 am 
Offline

Joined: Thu Aug 20, 2015 3:09 am
Posts: 284
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.


Top
 Profile  
 
PostPosted: Tue Aug 01, 2017 3:33 am 
Offline
User avatar

Joined: Mon Jan 03, 2005 10:36 am
Posts: 2963
Location: Tampere, Finland
Quick off-topic note:
Quote:
CPU running at 1.5Mhz

It's actually 1.79 MHz (NTSC), or 1.66 MHz (PAL). (https://wiki.nesdev.com/w/index.php/Clock_rate)

_________________
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: kkfos.aspekt.fi


Top
 Profile  
 
PostPosted: Tue Aug 01, 2017 10:58 am 
Offline
User avatar

Joined: Wed Dec 28, 2016 7:16 am
Posts: 40
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.

_________________
Super Tilt Bro.: https://sgadrat.itch.io/super-tilt-bro


Top
 Profile  
 
PostPosted: Tue Aug 01, 2017 8:02 pm 
Offline

Joined: Thu Aug 20, 2015 3:09 am
Posts: 284
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


Top
 Profile  
 
PostPosted: Tue Aug 01, 2017 8:54 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19116
Location: NE Indiana, USA (NTSC)
Image
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: Bing [Bot], Gilbert, tokumaru and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group