playMaker

Author Topic: Multi Collision/Multi-trigger event  (Read 10385 times)

wheretheidivides

  • Sr. Member
  • ****
  • Posts: 496
Multi Collision/Multi-trigger event
« on: January 17, 2015, 03:28:41 PM »
In 'collision event' action and 'trigger event' action, it only looks for a single collision/trigger tag.  It'd be really cool to be able to set up more than one.  This would avoid making a bunch of FSM states checking for every single collision tag. 

So let's say you have a 4 player game and there is an area that only 2 of the 4 players can go, then you can use the player1 and player2 tags to let pass but not player3 or player4 tags.

Would be very useful to a lot of people.
« Last Edit: January 17, 2015, 06:54:04 PM by wheretheidivides »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15537
  • Official Playmaker Support
Re: Multi Collision/Multi-trigger event
« Reply #1 on: January 19, 2015, 02:46:55 AM »
Hi,

 Simply have 4 of these actions on the same state. Have you tried that?

 Bye,

 Jean

wheretheidivides

  • Sr. Member
  • ****
  • Posts: 496
Re: Multi Collision/Multi-trigger event
« Reply #2 on: January 21, 2015, 03:02:50 AM »
So if I have 4 different on collision events on 1 state, how does that work?  Does the state look at the first one, then 2nd, then 3rd, then 4th?  When it finds a match, then goes to the 'send event'?

So this gets me to another question.  on a state like this, does playmaker go though all of the actions all of the time (unless told to exit)?

Also, do you see my confusion.  Scripting 'oncollisionenter' just waits but what you are saying I can have 4 of these in 1 state and all 4 get run unless 1 is met and tells it to goto next state.
« Last Edit: January 21, 2015, 03:06:36 AM by wheretheidivides »

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Multi Collision/Multi-trigger event
« Reply #3 on: January 21, 2015, 07:11:29 AM »
Using multiple Collision Event action's in a single state is standard. I agree it would be nice it the layer dropdown allowed multiple selection.

Action stacks are executed from top to bottom and you generally don't want to mix update types in the same state if you need to rely on this flow. OnEnter is called for all actions in the state, then OnUpdate is called, etc..

To be specific, 4 Collision Events would be evaluated top to bottom and as soon as one of them fires then of course the transition is made to the appropriate state and any actions below it would not be given the opportunity to run their OnUpdate cycle for that frame. The likelyhood of two different collisions of different layers occurring on the same object in the same frame and resulting in an uncaptured collision because of this stacking practice is not significant enough to avoid the practice altogether.

A more valid concern would be the fact that we're running 1 action for each layer and there is a potential performance impact. But, in reality this is likely insignificant as well but really depends on the game and the volume of these states you would have running at any given time.
« Last Edit: January 21, 2015, 07:15:54 AM by Lane »
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

wheretheidivides

  • Sr. Member
  • ****
  • Posts: 496
Re: Multi Collision/Multi-trigger event
« Reply #4 on: January 21, 2015, 11:20:35 AM »
I had these set up as separate FSMs but switched over.  Now I have several collision events tested in 1 state and then multiple events to exit it depending on the collision event.  Thanks for the tip.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7623
    • jinxtergames
Re: Multi Collision/Multi-trigger event
« Reply #5 on: January 25, 2015, 08:52:41 PM »
maybe an interesting idea is to be able to add multiple tags to a collision action?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7623
    • jinxtergames
Re: Multi Collision/Multi-trigger event
« Reply #6 on: October 08, 2019, 05:51:50 PM »
Hi.
I made a action for multiple tags, but its is not yet performance tested.

If someone can test them so i can add them to the ecosystem :)

i made one for 2D and 3D.

Natecurt

  • Playmaker Newbie
  • *
  • Posts: 8
Re: Multi Collision/Multi-trigger event
« Reply #7 on: October 11, 2019, 02:03:05 PM »
If someone can test them so i can add them to the ecosystem :)

The 3D version seems to be working perfectly in my project. It's much more compact this way, thank you!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15537
  • Official Playmaker Support
Re: Multi Collision/Multi-trigger event
« Reply #8 on: October 14, 2019, 02:32:21 AM »
Hi Kurt,

 Can you put them on the Ecosystem? thanks!

Bye,

 Jean

Christoph

  • Beta Group
  • Sr. Member
  • *
  • Posts: 254
Re: Multi Collision/Multi-trigger event
« Reply #9 on: March 10, 2023, 02:53:22 PM »
Old thread, I know, sorry. BUT, is it possible to have this not only for trigger events but also for collision events? Just what I would need right now. :)