playMaker

Author Topic: State with 520 events  (Read 2037 times)

Tonda

  • Playmaker Newbie
  • *
  • Posts: 31
State with 520 events
« on: February 13, 2016, 03:48:12 AM »
I am contemplating setting up 3 states each with 520 events of which only 3 will fire...

Before I spend the hours setting this up, are there any issues (other than inefficiency) that I could run into that could effect performance etc. (or an event limit I am unaware of?)

Reef

  • Playmaker Newbie
  • *
  • Posts: 3
Re: State with 520 events
« Reply #1 on: February 13, 2016, 04:56:08 AM »
Hi, Just a curious noob here, with no answer to your question- just one of my own.

As I understand it:
You are making a state with 520 transition events below it, but only 3 of the events have arrows to other states?

Maybe I misunderstood your post. As Im just wondering why would having events that do not transition to other states be useful to you (or generally in playmaker)?

I am a noob but so far I do not understand them being used in such a way and was wondering if you could enlighten me.

Thank you and I hope an expert comes along soon, who knows all about optimization and has a good answer to your issue.

Tonda

  • Playmaker Newbie
  • *
  • Posts: 31
Re: State with 520 events
« Reply #2 on: February 13, 2016, 06:42:53 AM »
Im new too, so i may have worried it wrong. 3 states have 520 events leading to 520 different states, but I only meant that the FSM would only be running 3 of the 1560 possible states from these.

mdotstrange

  • Hero Member
  • *****
  • Posts: 555
    • Can't code? Who cares! Make games anyway!
Re: State with 520 events
« Reply #3 on: February 13, 2016, 07:34:12 AM »
I've never seen any performance hits because of the number of events- but before you spend hours setting up 500+ events you might want to research to find a different way to do it-

What are you trying to do wherein you need 500+ events? There must be a smarter way to do it-
Indie game dev and instructor at the Strange School. Learn Playmaker at the Strange School!

Tonda

  • Playmaker Newbie
  • *
  • Posts: 31
Re: State with 520 events
« Reply #4 on: February 13, 2016, 04:10:27 PM »
Thanks for the advice, I have really tried to wrap my head around the issue , and looked in arraymaker etc. But haven't figured out a better way to accomplish my goals.

In short I have a system of 45 tiles, and after determining which tile the player is standing on, I have to determine which direction they are facing when I mouse pick,
or rather which of 4 box colliders they are clicking on (as they might actually be facing perpendicular on the side of the tile.)

After determining the positioning there is a list of tiles they can place in front of them, which differs depending on their positioning on the board (rank and file.)

I've been wrapping my head around the issue for a week or so, but  I did figure out a way to bruteforce it, (im using 45 collider events to record entering tiles and updating rank and file) and on of each of these I have 4 additional colliders to identify direction.)

Here's the set up to determine whether or not a tile is already placed in that direction.



Additional states to determine, exactly what category of tile will be selected.


Now each of those 32 states will be randomizing 3 variables out of a group of 60 tiles (out of 520 total).

I was originally going to have them just come up with numbers and then have a separate state machine sort it out (hence a 520 event state).

But now I think I am planning on having those 32 states send FSM event to 32 different state machines, that are each dealing with 3 states with an average of 40 events each...

Here's a test example of that with 3 states with 21 events each.




Not sure which method is less complicated...

I am new at this, and I'm sure there are much more simple solutions, but it's been a good learning experience.