Bullet behavior (Similar to Construct 3)


#1

I would like to possibly suggest that there be a new bullet behavior added to the engine, similar to Construct 3’s bullet behavior.
The bullet behavior could possibly have the following customizable properties:

  • Velocity: Adjusts the initial speed of the bullet, but can be edited with events. This way, forces can now be reserved for other objects.

  • Acceleration: Causes the bullet to gradually accelerate over time until it reaches max speed. Putting in a negative value will DECELERATE it instead, causing it to eventually come to a stop.

  • Gravity: Self explanatory.

  • Set Angle: This will point the bullet in the direction it’s moving, and automatically update the angle if it changes.

  • Step: Moves the bullet in small steps for making additional collision tests. Can be paired with an “On step” condition.

  • Bounce of solids: Bullets will ricochet off of solid objects. To compensate, the object properties panel could have a checkbox to mark the object as a solid, or there can be a solid behavior perhaps?

Personally, a bullet behavior would give quite a lot more flexibility and convenience to us developers. I’m aware that there are many workarounds to this, but using this simple behavior will probably cut down on events to improve performance, as well as being much more beginner friendly. After all, GDevelop 5 IS the ultimate beginner engine.

Of course, if a bullet behavior is not the priority, perhaps somebody can upload a custom behavior of this bullet behavior if possible? It would still be nice to have in the main engine, but if a custom behavior would be better, then I’d like to suggest that instead.

What do you guys think? Feedback is appreciated ^^


#2

So there are already both bounce and fire bullet behaviors, and both are user made.

You (or another user) could very well take the existing ones and add some of the items you’re asking for, however most of these are already covered.

Velocity/acceleration: Use a variable as the velocity and lerp it’s value.

Gravity: This one doesn’t make sense to me, as bullets for top down won’t work with gravity anyway.

Step: This one also doesn’t make sense to me, as as far as I know in the engine, movement is going to be movement, adding steps will be visible, there’s no way to do “intermediary” movement steps outside of the actual movement.

Bounce: I would leave the bounce behavior completely separate, IMO.

Also, Just to clarify behaviors are going to have the same number of events/performance as doing them separately.


#3

Ah, understood. I could look more into how to use bullets.
Also, for gravity, I’m not talking about top-down perspectives, but rather platformers in which bullets (Or any other object) should fall to the ground.
I’m currently struggling with the acceleration thing, and I’m wondering how I can use the lerp to cause bullets to start fast, but then slow down