• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
Silgen

FSMs in Platformers

3 posts in this topic

I have got my platformer working in a very basic fashion: entity/tile management system, collision, movement, collectible/dangerous items, camera etc.

I have a long list of things that I would like to start adding/improving - and I think a state system for the entities would be a good place to start. My thinking was that this would simplify handling different kinds of behaviour - but also that I could link animations in with states.

However I am unsure of exactly how to structure this. I was considering states like grounded, jumping, underwater, dead - and then having nested states (moving left, moving right, stationary.)

How have you guys handled this in the past/would you handle this?
2

Share this post


Link to post
Share on other sites
Hello
I am not an expert on this, but I'd like to share and maybe discuss.
For my game objects, I have two fsm right now; one for input and one for motion.

In the input FSM, I have the following states: KEYBOARD (input comes from keyboard), INERT (object doesn't think), WANDER (walks around the area), HUNT (find things to kill), FLEE (run in opposite direction of danger). Theses states does not do much, they mostly change the states of the motion FSM.

In the motion FSM, I have the following states: IDLE (not moving), WALK (move), RUN (move faster).

I don't use nested states because I feel it's too complicated. I think I will add one more FSM for animation later on, but this is what I have right now.
What do you think? ;o
1

Share this post


Link to post
Share on other sites
Are you working on a platformer? Or maybe a 2D RPG type of game?

If you are working on a platformer, do you not need states for jumping and being on the ground? Or could you just represent them using a boolean variable? I like the idea of using a state machine for the animations - what I was actually going to do was just set the animations in the walk state, or in the run state etc. - but this seems like a better solution.
0

Share this post


Link to post
Share on other sites
[quote name='Silgen' timestamp='1352025024' post='4997129']
Are you working on a platformer? Or maybe a 2D RPG type of game?

If you are working on a platformer, do you not need states for jumping and being on the ground? Or could you just represent them using a boolean variable?
[/quote]

Right, It's a 2d rpg. If it was a platformer though, I would use a boolean value to represent grounded or not. That way, I don't have a seperate state just for one particular direction, and that's consistent with the way I lay them out in my 2d rpg.

Or maybe make it more general have 4 boolean values to represent touching south, touching east, touching north, and touching west. Most of the time touching south can be interpreted as grounded, but the other directions can be interpreted as grounded too if you decide to implement gravity scew. Just a thought ;o

[quote name='Silgen' timestamp='1352025024' post='4997129']
I like the idea of using a state machine for the animations - what I was actually going to do was just set the animations in the walk state, or in the run state etc. - but this seems like a better solution.
[/quote]

Animation is low priority for me right now, so I don't know how well that idea is because I don't have a working implementation of it. Still worth a try though.
1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0