playMaker

Author Topic: Bloodbath  (Read 6745 times)

Kevron

  • Junior Playmaker
  • **
  • Posts: 51
Bloodbath
« on: October 21, 2013, 06:25:37 PM »
Hi fellow playmakers,

I am scratching my head around a little challenge:

Picture yourself an office. In the middle of the room there is an balloon filled with red paint. Inside the balloon there is also a grenade. Grenade goes boom and the office is looking like a nice red Pollack painting.

How would you solve this for a mobile platform?

I have a few thoughts, please correct me if I am on the wrong path.

Path 1: Shuriken particle system goes of in a burst. All the objects in the office has the "Play Maker Shuriken Proxy" and "Get Next Collision Event". A "quad" is generated at every "collision intersection" and is looking through the normal.

I have it working ok I guess. There are some pitfalls that I am not sure how I would solve yet. (i.e Scale of quad created on the floor vs. scale of quad creating at the coffe cup. The quad created on the floor is a ok size, but the quad created after hitting the coffe cup is to large and covers the cup)

Path 2: Shuriken blast hits objets in the scene and reports back where in the objects UV space the particle hit. A texture is then dynamically changed to red splat at the reported "hitplace". I dont know if this even is possible?

Appreciate all help on this one!

Best,
Tor M

Here is a scene in the current setup:https://www.dropbox.com/s/ybinr9zo99s261b/BloodBath.zip

There are some funky business going on.
« Last Edit: October 21, 2013, 07:45:49 PM by Kevron »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Bloodbath
« Reply #1 on: October 22, 2013, 01:18:22 AM »
Hi,

Tricky... Maybe each object in your room should have its own splat prefab, that would be more like it than trying to have one splat for everything.

Modifying texture is likely possible, but also very likely too much, and you woud require scripting even if it's to build custom actions for PlayMaker,

bye,

 Jean

Kevron

  • Junior Playmaker
  • **
  • Posts: 51
Re: Bloodbath
« Reply #2 on: October 22, 2013, 05:48:27 AM »
Thanks Jean for chiming in, I guess I´ll need a lot of help on this one.

It is a good idea to have a unique prefab splat for each object. Maybe on the small objects, I should position out the "splats" and check for on particle collison. If yes, then activate the prefabs that is already placed out.

Some of my quads that are the results of shuriken particles hitting the floor is not positioned at the "collisionIntersection", but rather at the scene center. Could this just be a hickup in how I have setup the FSM? The FSM is viewable in the file I shared in the first post.

Thanks,

Tor M

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Bloodbath
« Reply #3 on: October 22, 2013, 07:25:23 AM »
Hi,

 You need to experiment as far as prefabs, I am not sure what's best.

As for the hick ups, start with a very simple particle system firing one particle at a time, and then debug properly how your collision is handled, by firing at a specific game object one at a time, if you try to do it all in one go it will be difficult to debug.

Particle collision are absolutly exact, so something is not quite right yet.

bye,

 Jean

Kevron

  • Junior Playmaker
  • **
  • Posts: 51
Re: Bloodbath
« Reply #4 on: October 22, 2013, 08:20:59 AM »
Hi,

Firing one and one particle does not yield any problems, but when firing bursts (60 particles), there are some quads that are misplaced.

I have done some more tests. If the rate is below four, 9 out of 10 times, the quads are placed correctly. If I raise the rate to over 6, then I start to see quads placed in the center of the scene.

It looks like if two particles hits the floor at the same time, it struggles to know where to put the quad. Is this a correct observation, or just gibberish :)

I dont find the "Index" that is described here: https://hutonggames.fogbugz.com/default.asp?W1142

Best,
Tor M

Kevron

  • Junior Playmaker
  • **
  • Posts: 51
Re: Bloodbath
« Reply #5 on: October 22, 2013, 08:58:02 AM »
I managed to work around it with a float compare check.
If Float X and Float Y equals each other (Quad is placed in X=0 and Y=0), then do not create object.

May not be the best solution, but it works now. But I am open for a better solution :)

Best,
Tor M

parallel

  • Full Member
  • ***
  • Posts: 155
Re: Bloodbath
« Reply #6 on: October 22, 2013, 09:38:24 AM »
What are these 'quads' you're talking about?

Kevron

  • Junior Playmaker
  • **
  • Posts: 51
Re: Bloodbath
« Reply #7 on: October 22, 2013, 09:50:39 AM »
Hi,
Sorry for not specifying what quad is, but it is a "primitive" game object that you can create in Unity. You´ll find it under Gameobject - Create Other - Quad

For this initial test, I use quads with splat texture as prefabs.

parallel

  • Full Member
  • ***
  • Posts: 155
Re: Bloodbath
« Reply #8 on: October 22, 2013, 10:04:28 AM »
Oh that kind of a quad, wasn't aware that unity had an inbuilt lowpoly plane.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Bloodbath
« Reply #9 on: October 23, 2013, 02:04:48 AM »
Hi,

 I see, maybe you are hitting the limits of particles handling per collision call back. If you can send me a repro scene, I'll look into this.

bye,

 Jean

Kevron

  • Junior Playmaker
  • **
  • Posts: 51
Re: Bloodbath
« Reply #10 on: October 23, 2013, 04:23:55 AM »
I have sent you a mail with the scene file Jean.


Kevron

  • Junior Playmaker
  • **
  • Posts: 51
Re: Bloodbath
« Reply #11 on: October 23, 2013, 04:26:12 PM »
Bump  :)
Have you been able to take a look at the scene Jean?

Best,
Tor M

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Bloodbath
« Reply #12 on: October 24, 2013, 01:33:57 AM »
Hi,

 It's on my todo's, allow me few days, thanks.

bye,

 Jean

Kevron

  • Junior Playmaker
  • **
  • Posts: 51
Re: Bloodbath
« Reply #13 on: October 29, 2013, 08:21:04 PM »
Hi Jean, any luck figuring this out? If you are also able to get the substances to work under runtime, I'll be a happy man :)

Thanks,
Tor M

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Bloodbath
« Reply #14 on: October 30, 2013, 02:11:23 AM »
Hi,

 On my todos, but haven't had time yet sorry.

bye,

 Jean