Is 'Ignore Main Physics' Flag bugged?

Ok, I know I have mentioned in a few other posts I am having trouble with 'ignore main physics' on my gameobjects and monsters, but I think there may be a deeper problem going on.

After about pulling my hair out trying to figure out what I was doing wrong, I created a new nesmaker project.
Then I made a test asset solid tile and player gameobject so that I could get a clean test.

Then, I checked the 'ignore main physics' flag on the player gameobject. So there are no other influences on the object at all.
If all worked as It should, I expect that the player gameobject would not move at all until I added some movement controls to it.

When I load up the game, the player object moves diagonally down and left until running into something. The same problem that I was having in my game.
So that means I am experiencing this as the default behavior of 'ignore main physics' as there was nothing else to influence the movement of the player gameobject.

Am I really the only person having this issue? Or is there some workaround I have not figured out yet?
 

dale_coop

Moderator
Staff member
In fact, the 'ignore main physics' flag is ment to be use mainly for the monsters projectiles (action step 1...) to shoot Toward the Player. I think this flag has no other real purpose.
So yes could looks quite buggy if you try to use it in another context.
 
Ah, that makes sense.

I was hoping to make use of it because it makes sense for some of my sprites to be affected by physics and some to just be controlled directly.

For example, I want bullets to be able to fire in any direction regardless of gravity, I have flying enemies in my platformer that I want to be able to hover around, etc.
'Ignore gravity' doesn't cut it for those cases because it just disables all vertical movement. And while I can apply a vertical speed to the enemies to get them into the air, it doesn't prevent them from falling back down.

Hope there is some kind of workaround in the future. I tried digging around in the physics code but my limited knowledge of ASM just didn't cut it there.
 

Knietfeld

Member
I came on here looking for an answer to the exact same problem. I have bats in my platformer and I wanted them to fly around in 8 directions but they only flew left and right. I read all these comments and scoured the code to figure out what parts had to be skipped for Ignore Gravity to still allow vertical movement. It turns out, when they modified the Adventure Game Physics code to work for a simple platformer they completely removed the code that checks for vertical movement. I cut and pasted code from Adventure_Physics and optimized it a bunch so it wouldn't be too big but still do everything that both physics routines do.

For any of you guys who are having this same problem, I've attached that ASM file as well as my condensed Adventure Physics routine if anyone wants to save a little space in their adventure game.

I suggest unzipping the file into whateverYouNamedYourNESMakerFolder\Routines\UserScripts, that way it's close to the scripts NESMaker is already using for physics, or you can move them wherever you like from there.

To use either of these physics scripts you'll need to add a couple variables to whateverYouNamedYourNESMakerFolder\Routines\Variables\ObjectsBytesRam.asm. That script has all the variables that have to do with Objects, including vertical and horizontal speed. You can just cut and paste

Object_t_speed_lo .dsb 1 ;; for KN physics
Object_t_speed_hi .dsb 1 ;; for KN physics

to lines 19 and 20. They are temporary variables my code uses for both vertical and horizontal speed (the t stands for temporary), and the variables for each Object's speed are in lines 15-18.

All you need to do after that is open Projects Settings in NESMaker, Click on the "Script Settings" tab and replace the very top line, Physics, with the file you just unpackd in UserScripts.

I hope that helps someone!

Good Luck!
 

Attachments

  • KNPhysics.zip
    8.4 KB · Views: 76
Top Bottom