Topic: Fix "Gravity" for objects

As of right now, its broken. The object being affected never can even stay put when it lands on the ground. It needs to be re-coded.

As it is, it is way too hard to make any sort of feasible object that emulates gravity without a ton of code and a lot of possibility to screw up and glitch straight through the ground. Gravity is a pretty basic need for an object, so it is widely needed.

Re: Fix "Gravity" for objects

yeah, it's a bit annoying sometimes. I worked around by drawing a line on the base of enemies, but that's time consuming and has to be done per-frame and per-enemy hmm

https://image.ibb.co/kuSYrm/SD_sml.pnghttps://image.ibb.co/kHq8P6/SeD_sml.pnghttps://image.ibb.co/cJf8P6/LTot_W_sml.png

Re: Fix "Gravity" for objects

I agree that, when the physics engine for the players got rewritten, the gravity command got broken. At that time I even thought of making the command obsolete. Although I can improve the command, having an accurate physics system for each object would slow things down (as there are too many pixel perfect collision checks in the new engine - the old one used purely trigonometry stuff).

I'm gonna let the community choose:

Option #1: improve the gravity command to a certain degree (a good balance between accuracy and efficiency). This may (will) take some time do be done, and perhaps may not give you the results you want;

Option #2: It's true that you need some scripting to get a good gravity system working right now. Fortunately, you can use a technique to reuse code. It's like this:

1) create a special object called, for example, ".gravity_man". For testing purposes, this could be a little 25x25 circle.
2) .gravity_man will use collision masks to detect collisions with the floors, walls and ceilings. A collision mask is used to detect collision against a given point (x,y) in the map. Read objects/default_startup/tools/collision_mask.inc to see how to use them.
3) say that you want to make "Blue Ninja" and "Yellow Ninja" be affected by gravity. Both of them will spawn ".gravity_man" as a child, and through data communication via global variables, ".gravity_man" will position the ninjas accordingly in the screen. No need to code gravity stuff for each object. Just delegate this task to "gravity_man". Whenever you update gravity_man, both ninjas will be updated automatically!

This option allows you to customize the movements the way you need them to be, but it's slightly more complicated than just issuing a "gravity" command: you need to spawn a child to handle the gravity logic for you, and you need to set_absolute_position of your objects to wherever gravity_man tells you to.

---

So... What is it gonna be?

Re: Fix "Gravity" for objects

The command is broken and needs to be fixed. Otherwise it's useless.

Option 2 can happen regardless of if gravity gets fixed or not. If people don't like the engine's prebuilt gravity, they can make it themselves. Option 1 needs to be done regardless, because if not, then gravity as a command does not have a purpose.

Plus scripted gravity would make your system tank even worse than having special physics for each one and would take more time. So yeah.