Is 'Ignore Main Physics' Flag bugged?

Having trouble compiling code? Getting an unexpected error? Player not appearing on screen? Seeking answers on how to do a particular thing? This is the forum you're looking for, to ask other NESmaker users for assistance.
Post Reply
User avatar
chronicleroflegends
Posts: 37
Joined: Thu Sep 06, 2018 3:51 am

Is 'Ignore Main Physics' Flag bugged?

Post by chronicleroflegends » Mon Sep 17, 2018 8:27 pm

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?
~Do you believe in legends? ~
User avatar
Convoy_Avenger
Posts: 61
Joined: Tue Aug 14, 2018 1:42 am

Re: Is 'Ignore Main Physics' Flag bugged?

Post by Convoy_Avenger » Mon Sep 17, 2018 11:06 pm

I think it's definitely bugged. I get similar "floating to the left" behaviour. I've just avoided using it.
User avatar
dale_coop
Posts: 1269
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: Is 'Ignore Main Physics' Flag bugged?

Post by dale_coop » Tue Sep 18, 2018 7:27 am

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.
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE
User avatar
chronicleroflegends
Posts: 37
Joined: Thu Sep 06, 2018 3:51 am

Re: Is 'Ignore Main Physics' Flag bugged?

Post by chronicleroflegends » Tue Sep 18, 2018 4:06 pm

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.
~Do you believe in legends? ~
Knietfeld
Posts: 4
Joined: Fri Oct 05, 2018 1:48 pm

Re: Is 'Ignore Main Physics' Flag bugged?

Post by Knietfeld » Tue Oct 09, 2018 12:04 pm

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.42 KiB) Not downloaded yet
User avatar
Convoy_Avenger
Posts: 61
Joined: Tue Aug 14, 2018 1:42 am

Re: Is 'Ignore Main Physics' Flag bugged?

Post by Convoy_Avenger » Wed Oct 10, 2018 11:54 am

This is great. I recommend making a separate post about it in the Code forums so more people are likely to see it.
Post Reply