Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411507 Posts in 69374 Topics- by 58429 Members - Latest Member: Alternalo

April 26, 2024, 03:46:58 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperDesignFighting Games - What to think about for combat?
Pages: [1]
Print
Author Topic: Fighting Games - What to think about for combat?  (Read 3463 times)
EmmerichSpiel
Level 0
*


View Profile
« on: January 03, 2021, 05:07:00 PM »

Hey fellow developers,

I was wondering what kind of AI would you guys recommend for creating an enemy in a fighting game, like Mortal Kombat?

For example, I was thinking that the enemy could have a raycast vector to detect where the player is, then use RNG to decide the enemy's next move.

Do you all think that this type of AI is effective?
Logged
droqen
Level 10
*****


View Profile WWW
« Reply #1 on: January 05, 2021, 09:31:50 AM »

Raycasting makes sense in a first-person shooter, but not in a fighting game - in a 1v1 fighting game, the spaces are generally very simple (often they are a featureless rectangular space) and you can always see exactly where your opponent/s is/are.

Randomly selecting moves will probably create an interesting and unpredictable opponent for a beginner to start out with, as long as the AI can understand spacing correctly (i.e. you can start with making sure it does not use short-range moves when at long range), and from there you can hopefully continue developing solutions to easy tactics that exploit the ai's edge cases.
Logged

raigan
Level 5
*****


View Profile
« Reply #2 on: January 17, 2021, 10:26:01 AM »

You could also consider researching how similar games have tackled this -- for example, here's an overview of how SF2's AI works, which ought to be perfect for you: https://sf2platinum.wordpress.com/2017/01/20/the-ai-engine/

This looks to be very data-heavy, ie they authored little scripts for every possible combination of fighters, and annotated every attack of character with a "yoke" which instructs the AI which counter-attack to throw, but the general idea (a small state machine or even just a set of if/else rules) seems workable: "can any attacks hit the opponent? Y: throw one of them; N: move closer".
« Last Edit: January 17, 2021, 10:40:38 AM by raigan » Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic