playMaker

Author Topic: Timing of States: Sometimes "Finished" is a bit greedy.  (Read 2338 times)

Red

  • Hero Member
  • *****
  • Posts: 563
Timing of States: Sometimes "Finished" is a bit greedy.
« on: September 12, 2013, 08:39:01 AM »
So, it's something I've been noticing lately which has caused some issues with the timing of the various FSMs i've got built.

Some actions seem to take up a bit more "time" than others and using the "FINISHED" transition sometimes leaves those actions either unused or is cutting them off at the knee before they can truly finish.

some actions I've noticed this happening with (in a standard "when finished, go 'FINISHED'" kind of set-up.)

Animator Set values actions (and some "Get" values as well.)
Get/Set FSM actions

I'm sure there are others... but having the finished transition being a bit too greedy/premature is throwing off a lot of my code (this leads me to have to use Wait and Next Frame Event far more often than I'd like and for some FSMs it renders them too slow... not to mention that the Next Frame Event could cause some issues if the games i'm making are being run on a slower computer which could result in a poor end-user experience which is not good.)

EDIT: I think this is a great opportunity to discuss the "under the hood" mechanics that surround timing issues such as this... things such as knowing how Playmaker does it's thing in this regard can help as I haven't found much out there that explains this other than "some actions are really big."
« Last Edit: September 12, 2013, 08:45:28 AM by Red »

Red

  • Hero Member
  • *****
  • Posts: 563
Re: Timing of States: Sometimes "Finished" is a bit greedy.
« Reply #1 on: September 12, 2013, 01:35:04 PM »
Sure, I accept that this isn't a very big "Game breaker" kinda deal... and with the effective application of waits and next frames and other forms of holding you can avoid it... but still, if it's truncating some actions before giving them the time to complete their tasks that's kinda a bit of a bug.

All that said, I am aware that it could be something on my own machine that's causing it to happen... so, for that I'd like to ask if anyone else has seen this kind of thing happen in your own games?

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: Timing of States: Sometimes "Finished" is a bit greedy.
« Reply #2 on: September 12, 2013, 01:45:33 PM »
Lets work through one example where the behavior is not what you expect, maybe a Get/Set Fsm action example. This will help us figure out if it's a bug or something else... and what we should do about it...

The best way to do this is to submit a bug report with a specific example. Then we can work through it...

Red

  • Hero Member
  • *****
  • Posts: 563
Re: Timing of States: Sometimes "Finished" is a bit greedy.
« Reply #3 on: September 25, 2013, 10:35:02 AM »
allrighty... I'll see about sending a ticket for the machine gun system I have... since I have had to rely on many next-frame-events and waits for the system to perform the tasks that I need it to (and without them it just fails to complete them) that might be a good example because the holds are starting to make it fire slower than a simple handgun system. (I'm trying to make it have a fire-rate of at least 5 shots per second and the holds are slowing it down... with just it and an enemy to shoot (and a basic box for the play area it's fine but when there are more than about 10 enemies on screen and some art assets, it gets bogged down.)

Red

  • Hero Member
  • *****
  • Posts: 563
Re: Timing of States: Sometimes "Finished" is a bit greedy.
« Reply #4 on: September 25, 2013, 10:44:31 AM »
I'm going to put a list of actions that seem to be a bit too greedy here... as I test, i'm sure i'll find them... however, the "Why" as to why they're being greedy or causing issues I'm not sure but i'll do by best to try and discern what's going on (not being a programmer i'm a bit out of my depth as to the deeper intricacies of how they work.)

I'll update this list as I go.

- Raycast (needs a "next-frame-event" to get it to exit.)