Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

879290 Posts in 32974 Topics- by 24362 Members - Latest Member: Zokk

May 23, 2013, 05:58:03 PM
TIGSource ForumsDeveloperTechnical (Moderators: Glaiel-Gamer, ThemsAllTook)Fighting Game Logic Questions
Pages: 1 [2]
Print
Author Topic: Fighting Game Logic Questions  (Read 1600 times)
alltom
Level 0
**



View Profile WWW
« Reply #15 on: November 20, 2010, 09:47:58 PM »

I remember the (C++) object-based state machine examples in the book "Programming Game AI By Example" being very good, although I lent my copy and I can't remember the structure well enough to copy it here. But I'd check out the table of contents in case it looks useful enough for you to find a copy.
Logged

deactivating lurk mode
Trevor Dunbar
Level 10
*****


Working on unannouned fighting game.


View Profile Email
« Reply #16 on: November 20, 2010, 10:36:30 PM »

Try looking inside this book on amazon and see if they give away that part for free..
Logged

Toucantastic.
ross
Level 0
**



View Profile
« Reply #17 on: November 21, 2010, 12:57:31 AM »

I own the book. It recommends a couple things, but eventually seems to settle on entities having a state object by composition, which has its own behavior and can affect state switches. ie: instead of checking a state enum in a big if-statement, move the logic from each of those if-blocks into its own class and give your character an instance of one of those state classes.
Logged
DragonSix
Level 0
**



View Profile
« Reply #18 on: November 21, 2010, 05:24:32 PM »

I'd stick to boolean states for most of the cases, because multiple states can often be triggered at once and you need to have clear control over what happens.
For example if an ennemy is hit AND in the air, or hit AND doing a move that makes him immune to interruption. You'd need to be able to trigger multiple conditions in your logic (without having to make a shit ton of enum fields for every possible combination).
Logged

Jay_PC
Level 1
*


It, Happens...


View Profile Email
« Reply #19 on: November 21, 2010, 07:35:37 PM »

Although boolean flags and enums work for simple state machines, they can quickly become hard to manage. Your approach is definitely the simplest and it works when you don't have many states to deal with, but you might want to look into more robust state machine implementations if things get out of hand.

As far as open source fighting games go there are a variety of open source MUGEN clones that might be worth investigating. Even if they don't necessarily produce very good fighters there are probably some good ideas to be had on how to build a fighting game engine.  If you want to look at open source beat 'em ups Beats of Rage is an open source game that is actually pretty good.

I looked into Beats of rage before, Back when I was into the Dreamcast Mod Scene. Ill definitely look into MUGEN though, I figure a Fighting game and a beat-em up contain lots of similar elements, but fighting games have more advanced combo and block systems.

I'd stick to boolean states for most of the cases, because multiple states can often be triggered at once and you need to have clear control over what happens.
For example if an ennemy is hit AND in the air, or hit AND doing a move that makes him immune to interruption. You'd need to be able to trigger multiple conditions in your logic (without having to make a shit ton of enum fields for every possible combination).

this makes sense, but I feel like the enum still works for this, if the enemy is in the air, it cant be stunned or knocked down, but can be hit, and in the case of the un-interruptable move, this would be a enum state, even if the enemy has 3 moves that cant be interrupted all 3 moves call the same state.

this being said Im still more comfortable with the boolean machine, I just understand how this could be beneficial.
Logged

Pages: 1 [2]
Print
Jump to:  

Theme orange-lt created by panic