Combining Adventure and Platform

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
Posts: 23
Joined: Tue Sep 18, 2018 6:00 pm

Combining Adventure and Platform

Post by Tishero » Fri Oct 05, 2018 5:44 pm

As of right now, is there a way to combine the adventure module and the platform module like how Blaster Master uses both, or like Super Mario Bros. 3 has the map selection screen?
User avatar
Posts: 254
Joined: Wed Aug 08, 2018 9:30 pm
Location: KY, USA

Re: Combining Adventure and Platform

Post by chronosv2 » Fri Oct 05, 2018 6:57 pm

I'm fairly certain there's not enough space in the Static Bank for both sets of code. Fitting two engines into a game might be possible with 4.1.0 but no matter how you cut it it's going to be an extremely difficult thing to achieve.
ASM/C# Coder -- Computer + Coffee = Code
ASM Tutorial Series
My NES development projects have, for the time being, stagnated. I apologize for the inconvenience.
User avatar
Posts: 232
Joined: Wed Aug 08, 2018 7:48 pm
Location: California

Re: Combining Adventure and Platform

Post by jorotroid » Sat Oct 06, 2018 2:12 am

If you asking if there is a way to do it just through NESmaker, no. If your asking if it would be possible to modify the asm to have the functionality of both a platformer and an overhead game, yeah, I think that is doable. The main difference is in the physics script. There is some overlap between the two and for the differences you could have game states that tell it to run as a platformer or as and overhead game. But you will have have to do a decent amount of coding to get it to work. If you are at the level of being able to code it, I think you could also be at the level to cut other aspects of the engine to make room if needed. Also it would probably be prudent to point out that you would have to divide up your graphical resources between the two modes.
Posts: 5
Joined: Fri Oct 05, 2018 1:48 pm

Re: Combining Adventure and Platform

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

I combined the adventure game physics and the platformer game physics. I'll just cut and paste some stuff I said in another post about all of this.

"I have bats in my platformer and I wanted them to fly around in 8 directions but they only flew left and right. 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. It is bigger than the original script still.

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."

With this code, if you want an object to move around like an adventure game, just check the ignore gravity box in the Actions tab in Object Details. I don't know exactly how you'd make one object (especially the player character) move around using both physics, but there's probably a workaround. Hopefully this can help you out a little though.

If I didn't explain that well enough, just ask any questions you have and I'll try to answer.
(8.42 KiB) Downloaded 30 times
User avatar
Posts: 3562
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: Combining Adventure and Platform

Post by dale_coop » Tue Oct 09, 2018 3:02 pm

Very interesting, can’t wait to try your script.
Thanks for sharing
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
Post Reply