playMaker

Author Topic: Multiple FSMs and character controllers  (Read 4612 times)

3dmaven

  • Playmaker Newbie
  • *
  • Posts: 4
Multiple FSMs and character controllers
« on: January 16, 2014, 01:17:52 AM »
As far as I can tell, this hasn't been covered in the tutorial videos and I'm fairly new here so my search of the forums hasn't been that deep, but what is the general theory on building character controllers? Let's assume a 3rd person camera with a character that needs to move, jump, and do several different attacks. Do you keep all your states in one FSM? Do you have one main listener for each button that fires off to its respective state? Multiple FSMs, one for movement, one for attacks? Do different FSMs run simultaneously?

The videos on Playmaker's YouTube channel are great, and the concepts make sense, but they all just use Unity's character controller (plus, their only video dedicated to the topic is far too simple for most needs).

Thanks for any explanations--I'm more on the artistic side of gamemaking, so this kind of logic escapes me.

redikann

  • Full Member
  • ***
  • Posts: 174
Re: Multiple FSMs and character controllers
« Reply #1 on: January 16, 2014, 01:36:47 AM »
I have a set up that I like a lot and I based it off of the Darksiders 2 Camera.
I basically have a camera controller and a player controller.
I have gotten my camera controller down to a very simple set up but a good character controller can get deep very fast with FSMs .

3dmaven

  • Playmaker Newbie
  • *
  • Posts: 4
Re: Multiple FSMs and character controllers
« Reply #2 on: January 16, 2014, 01:45:31 AM »
What does the character controller look like? You don't have to go into detail, I'm just looking for something more than what the tutorials show.

redikann

  • Full Member
  • ***
  • Posts: 174
Re: Multiple FSMs and character controllers
« Reply #3 on: January 16, 2014, 01:52:21 AM »
Well like the tutorial the player controller gets input and stores it in a vector 3 relative to the camera. But the camera is controlled by the mouse or joystick.
the player controller is just an empty game object the has a child mesh/armature mesh. The controller can then tell the child when to play animations like walk or attack.

colpolstudios

  • Sr. Member
  • ****
  • Posts: 370
Re: Multiple FSMs and character controllers
« Reply #4 on: January 16, 2014, 08:23:49 AM »
I have a set up that I like a lot and I based it off of the Darksiders 2 Camera.
I basically have a camera controller and a player controller.
I have gotten my camera controller down to a very simple set up but a good character controller can get deep very fast with FSMs .

Would it be possible for you to share your knowlage in regard to creating a good character controller with FSMs?

One important thing I do not use Mecanim.

A new sprite management system is being used with the call method to play the animations.

I currently have eight direction movment that does play, but having trouble adding a shooting.

I can not get back to walking again without pressing a key again.

more info can be found here: http://hutonggames.com/playmakerforum/index.php?topic=6008.0


Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Multiple FSMs and character controllers
« Reply #5 on: January 16, 2014, 08:43:20 AM »
Separate your FSMs. For instance if you have controls doing movement in a state and you need to leave that state to fire a weapon then you simply need another FSM.

You can only create multipurpose FSMs to the extent of practicality. Once you start overlapping functions then you will need to begin segregating things to maintain smooth gameplay. There isn't really a solution for every character controller, just principles that should drive the creation of your controller.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

3dmaven

  • Playmaker Newbie
  • *
  • Posts: 4
Re: Multiple FSMs and character controllers
« Reply #6 on: January 16, 2014, 09:03:32 AM »
Great replies everyone. It's a great help just discussing!

So dividing FSMs into their general usage is the way to go? If I had a 'walk' FSM, and a 'jump' FSM, they would work simultaneously--e.g. I could jump and move at the same time?

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Multiple FSMs and character controllers
« Reply #7 on: January 16, 2014, 09:04:38 AM »
Sure, it just depends on how you want Jumping to work in your game. Every game is different.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

3dmaven

  • Playmaker Newbie
  • *
  • Posts: 4
Re: Multiple FSMs and character controllers
« Reply #8 on: January 16, 2014, 09:15:26 AM »
Sure, it just depends on how you want Jumping to work in your game. Every game is different.

Of course, but generally speaking. I'm excited to try and get this working, thanks for the replies.

redikann

  • Full Member
  • ***
  • Posts: 174
Re: Multiple FSMs and character controllers
« Reply #9 on: January 17, 2014, 10:24:34 AM »
I find jumping to be generally more difficult to fine tune than you would first believe. You might want to allow the player to jump while standing and maybe also ledge grab. But you wouldn't want the player to drift left or right from controller input. But if the player is moving then you would want to vary the jump power and still not add exaggerated movement from controller input. But then you also want the landing animation and forward momentum to look natural but also feel tight control wise or your player will hate jumping.