SUGGESTION? - Physics Type & Sensor Type for a Fire Beam Explotion

Hi dear members of the forum. I’m re doing a project I have about a BOMBERMAN game like. Last day a member already helped me a lot with a question, but now I want to do another one…

The FIRE used in Bomberman, what kind of pshysic or sensors must have? I ask this cause: there are objects like “power-up items”, “bombs”, “destructible blocks”, “no destructible blocks”, and “players”.

I though I can make almost all objects as Statics (except for the players (use dynamics)), but the Fire & Item objects need to interact between then… I explain:

  • When an Item or Destructable Block is touched by Fire, it will dissapear, and at same time, the Fire need to dissapear when touch it.
  • When a Player is touched by Fire, it will die (lets say dissapear), BUT the fire need to go through the player, wouldn’t stop.

(See Image)

So what I need to do?

  • Can use Static physic and put Collision sensor, but the objects won’t detect collision between each other.

  • Can use Static physics and put a Near sensor, but the sensor won’t detect exact same time when both object are same distance, so one will dissapear before the other (need dissapear (end object) simultaneously).

  • Could set the fire into Dynamic physics, but cause the game is based in lot explotions, won’t become too heavy for the overall performance of the game?

  • Last… even I set in Dynamics physics (that stand alone works) I need each direction of the fire (are individual objects that move along axis) to be parented to a center object (so after a time will dissapear with all parented fire direction objects)… But I just noticed ONCE AN OBJECT IS PARENTED TO OTHER ONE, CAN’T COLLIDE? (even if set as dynamic physics).

(See test.blend)

Help me please… :frowning:

Attachments


test.blend (538 KB)

I think that you do not need physics or that kind of detection for this kind of game at all.

Create a simple model of your game mechanics in Python e.g. a two dimensional list. Then you do all operations on that list, which should be pretty simple. Either a cell is filled or not.

To get the fancy 3D look synchronize the game model (cells of the list) with the 3D objects. This means when you create an object in your cell, you add an object to the 3D scene. When you remove it from the cell, you remove it (don’t forget the fancy animation) from your 3D scene.

The 3D scene acts as user input … e.g. the user can click on 3D objects, press keys etc… The game mechanics takes the input and processes it into the game model (not the 3D model). From the model you can update the 3D scene. Indeed there should be a relation between game model objects and 3D objects.

In other words: If you want to know what objects to remove when burning a row, you look into the according row of the two dimensional list, rather than to fiddle with collisions and meshes. You can even run this game with console in/output ;).

If you think this all is to complicated enable actor and sense with rays.

Hi monster. Actually what gets burned is not all in a row, the fire is needed to stop at certain point (example, collide a wall). Sadly, is taking me time learning Python and the Blender API… so what you mentioned for me is too hard/complicated due to my weak actual knowledge.

** Any idea how to make both static objects to dissapear when “close/collide/near or etc” with the ray sensors?

I can put in moving object “FIRE” a Ray Sensor, so when distance to Actor object “ITEM” is the indicated will end object.
But to make the “ITEM” dissapear same time use a Ray Sensor too… should need 4 (-x, +x, -y, +y axis) cause FIRE can come from those directions… Then should use a Near Sensor with “ITEM” objects?

** PD: can you share a link that maybe explain what you mentioned about in Python in Blender and make a bidimentional list, calling for objects?

Sorry for the trouble :frowning: Thanks :slight_smile:

If you have no experience with programming I think this will be to hard for you.

How about that:

killer.py:


def endHitObject(currentController):
   for sensor in currentController.sensors:
      if sensor.hitObject:
         sensor.hitObject.endObject()

Let an empty “Killer” fly along the row to burn. Add an ray sensor (or any other sensor) to detect your targets.

<your> sensor -> Python Module: killer.endHitObject

(untested)

Maybe it helps

This might help a bit, if you forget about flames passing through certain objects but stopped by others…

It uses rays to detect objects with a certain property, and then will scale a child object of the bomb exploding to fit the gap (it also adds an explosion ‘ball’ at the contact point of the hit object). The flame object could then delete (or trigger animation etc) on the object hit if it is a player.

With additions the blast can be changed so that small explosions do not reach as far.

The script is primitive (the four bits of code per flame could be condensed into a list comprehension) but its a start.

Attachments

BomberMan.blend (550 KB)

Thanks again Monster, that worked somehow, but cause need add various other conditions, gets complicated for me… :frowning:

Rubbernuke, thanks you, the script was totally understandable for me. It works fine, but well, guess will play with it changing or adding some stuff until fits what I need exactly. :smiley:

One last question about all of this… between “Logic Bricks” and “Python Scripts”:

Use a script or do the same in simple logic bricks way have any relevant difference into the game performance?

Thanks again, think can give the topic Solved. Greetings.

Python v logic: from memory, lots of rigged characters, shaders, complex maths and always logic bricks eat into game engine performance, irrespective if its in logic or Python.

Got it, thanks again. Time to join the pieces. :yes: