It is currently Wed Nov 22, 2017 12:37 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Fri Dec 20, 2013 7:20 pm 
Offline
User avatar

Joined: Sun Dec 08, 2013 9:53 pm
Posts: 54
Location: Canada
Hello, this is my first attempt at a platformer engine for the NES. I used the sound engine from the Nerdy Nights tutorials. The source is included along with a ROM, please feel free to mention anything I may be doing wrong or poorly :)

Attachment:
NES Platformer.zip


Last edited by Light-Dark on Sun Aug 10, 2014 10:04 pm, edited 2 times in total.

Top
 Profile  
 
PostPosted: Fri Dec 20, 2013 8:48 pm 
Offline
User avatar

Joined: Mon Sep 27, 2004 8:33 am
Posts: 3715
Location: Central Texas, USA
Code:
DEX
CPX #$00
BNE ReadController1Loop

The CPX is redundant here.

Also, you sould be able to use lowercase for instructions. Less activity on the shift key.


Top
 Profile  
 
PostPosted: Sat Dec 21, 2013 6:32 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19239
Location: NE Indiana, USA (NTSC)
It was hard to get past the first room until I realized I could go left then right to skip the room with the pit under the low ceiling.

Are you intending for jumping to use jetpack-style physics or actual jumping?


Top
 Profile  
 
PostPosted: Sat Dec 21, 2013 10:33 am 
Offline
User avatar

Joined: Sun Dec 08, 2013 9:53 pm
Posts: 54
Location: Canada
tepples wrote:
It was hard to get past the first room until I realized I could go left then right to skip the room with the pit under the low ceiling.

You could also fall down the pit and end up at the top of the screen as well :P. I intend on implementing some sort of Room coordinate system ala-Battlekid. My idea is that depending on what side of the screen you exit on it will increment or decrement the room x,y values and then calculate the room index using index = room_x + (room_y*Max_x).

tepples wrote:
Are you intending for jumping to use jetpack-style physics or actual jumping?

At some point actual jumping will be implemented, it's jetpack-style for now.


Top
 Profile  
 
PostPosted: Sat Dec 21, 2013 3:58 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5825
Location: Canada
I'm noting a short grey glitch mid-screen when dying. Are you trying to set the palette while rendering is off? (It should only be written during vblank to avoid this.)


Top
 Profile  
 
PostPosted: Sat Dec 21, 2013 6:58 pm 
Offline
User avatar

Joined: Sun Dec 08, 2013 9:53 pm
Posts: 54
Location: Canada
rainwarrior wrote:
I'm noting a short grey glitch mid-screen when dying. Are you trying to set the palette while rendering is off? (It should only be written during vblank to avoid this.)


Thanks! the palette is now set during VBlank.


Top
 Profile  
 
PostPosted: Sun Aug 10, 2014 10:29 pm 
Offline
User avatar

Joined: Sun Dec 08, 2013 9:53 pm
Posts: 54
Location: Canada
Okay so over the past 6 months or so I've completely rewritten this engine from the ground up.
Attachment:
File comment: Updated ROM
Main.nes [128.02 KiB]
Downloaded 202 times


Some new features to the new and improved engine are:
- AI
- Status Bar
- Better jumping physics
- Better background collision detection and resolution
- Different background collision properties ( An example of this is in the water area of the demo wher the water makes you fall slower and some of it moves you to the right as if there is a current).

If anyone wants to pop open an emulator hex editor mess around with things like background collision and AI during run time here are some memory locations and info:

$0700-$071A = AI Memory
Each AI is 9 bytes in size: y,x,sprattributes,sprite#,Health,xVel,yVel,Action,Frame
The action byte, for those who are wondering, basically controls which action "script" is jumped too in the global AI action jump table.
(0 = do nothing, 1 = move left and right, 2 = move up and down, 3 = move in a Zig zag wave, 4 = move in a sine wave)
$0600-$06FF = Background Collision table
Setting bit 7 makes a tile solid, setting bit 0 makes the tile water-like (more resistance to movement than air), bit 1 makes the tile move the player to the right, bit 2 to the left.

When you load the ROM the screen will start black, just press start to begin ( it's in the "menu" state and I haven't really implemented a basic menu/title screen yet). Controls are pretty much like any other platformer on the NES d-pad to move left and right and a to jump. Pressing start and select currently modify the action byte of one of the AI's because I was doing some tests. Lastly when you go to the screens right of the starting area, which ultimately go nowhere, you'll notice the graphics are all messed up. That is intentional and not a glitch as I was testing to see if my tileset swapping between different screens functions correctly.

So yeah enjoy I guess!


Top
 Profile  
 
PostPosted: Sun Aug 10, 2014 10:54 pm 
Offline
User avatar

Joined: Wed Apr 02, 2008 2:09 pm
Posts: 1035
Hmm... I dunno, are you looking for feedback?

I'd like to know what kind jump physics you're going for. Currently it seems you're after a jetpack type movement, because it's reversed from a typical jump.

Edit: HAH! I read the rest of the topic. Jetpack style it is. Still, I might slow it down a tad for a more jetpack feel. Possibly take a look at the Yoshi's Island flutter mechanics. I've also managed to kind of hover by mashing A, which supports that the player has a jetpack, but it's very difficult to do this, if this is meant to be a mechanic and not a glitch.

If you hold A button while pressing start, you can just kinda chill in the air.
Edit: Oh, I maybe found out why. $0434 seems to be in charge of how much time is left to hover. At reset it decrements from 0 and wraps through $FF. So you can't float indefinitely as I first thought. Just for a very long time.

Similarly, holding left against walls while a new screen loads allows you to jump off walls. (Jump off the pit in the start while holding left+A. The screen you should fall on allows you to go back up to the first screen, but then you fall to the second screen etc.) Holding down while landing allows you to hover a pixel off the ground. I assume you've begun a crouching state that causes this, since it also prevents you from jumping.

Not bad progress, though.

_________________
https://kasumi.itch.io/indivisible


Top
 Profile  
 
PostPosted: Sun Aug 10, 2014 11:31 pm 
Offline
User avatar

Joined: Sun Dec 08, 2013 9:53 pm
Posts: 54
Location: Canada
Thank you for the feedback! Yeah I've kind of moved away from the jetpack style as I have learned more about 6502 programming over the months. I fixed the bug where you can jump off walls and woops I accidentally left some old code in my d-pad down routine (it isn't supposed to do anything) :oops:. I haven't been able to replicate the floating via holding start and A yet.


Top
 Profile  
 
PostPosted: Sun Aug 10, 2014 11:35 pm 
Offline
User avatar

Joined: Wed Apr 02, 2008 2:09 pm
Posts: 1035
Being more specific, I mean start the rom. (black screen, game is in menu mode.) Hold A. Don't let go. Press start.

Not holding A+start after the game has begun.

_________________
https://kasumi.itch.io/indivisible


Top
 Profile  
 
PostPosted: Sun Aug 10, 2014 11:43 pm 
Offline
User avatar

Joined: Sun Dec 08, 2013 9:53 pm
Posts: 54
Location: Canada
Kasumi wrote:
Being more specific, I mean start the rom. (black screen, game is in menu mode.) Hold A. Don't let go. Press start.

Not holding A+start after the game has begun.


Weird. I'm doing just that in FCEUX,Jnes and Nestopia and everything is functioning as intended; no hovering. Just to be on the safe side though I'll make sure when the game changes state that it clears the controller input byte and resets all the jumping related bytes.


Top
 Profile  
 
PostPosted: Sun Aug 10, 2014 11:59 pm 
Offline
User avatar

Joined: Wed Apr 02, 2008 2:09 pm
Posts: 1035
Just so you know I'm not crazy: http://i.imgur.com/3kbQ2pA.gif

_________________
https://kasumi.itch.io/indivisible


Top
 Profile  
 
PostPosted: Mon Aug 11, 2014 12:16 am 
Offline
User avatar

Joined: Sun Dec 08, 2013 9:53 pm
Posts: 54
Location: Canada
Kasumi wrote:
Just so you know I'm not crazy: http://i.imgur.com/3kbQ2pA.gif



Hmmmm, I notice your emulator is in PAL mode ( you're not supposed to see the sprites in the upper left). Have you tried setting it to NTSC? Here try this:
Attachment:
Main.nes [128.02 KiB]
Downloaded 155 times


Top
 Profile  
 
PostPosted: Mon Aug 11, 2014 5:32 am 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10117
Location: Rio de Janeiro - Brazil
Light-Dark wrote:
I notice your emulator is in PAL mode

"PAL mode" is a setting that affects timing, not resolution. Both PAL and NTSC consoles generate 240 lines of picture, emulators that crop scanlines in NTSC mode are just (poorly) attempting to simulate the clipping that commonly happens in NTSC TVs, but the amount of picture that's cut varies from TV to TV and you shouldn't rely on that happening. Also, all emulators I know of that crop scanlines allow you to configure how much is cropped.

Quote:
( you're not supposed to see the sprites in the upper left)

There should be no sprites in the upper left! =) The correct place to hide unused sprites is after scanline 239, past the end of the picture. A Y coordinate of anything between 239 and 255 will completely hide a sprite. The X coordinate doesn't matter.


Top
 Profile  
 
PostPosted: Mon Aug 11, 2014 7:51 am 
Offline
User avatar

Joined: Sun Dec 08, 2013 9:53 pm
Posts: 54
Location: Canada
tokumaru wrote:
Light-Dark wrote:
I notice your emulator is in PAL mode

"PAL mode" is a setting that affects timing, not resolution. Both PAL and NTSC consoles generate 240 lines of picture, emulators that crop scanlines in NTSC mode are just (poorly) attempting to simulate the clipping that commonly happens in NTSC TVs, but the amount of picture that's cut varies from TV to TV and you shouldn't rely on that happening. Also, all emulators I know of that crop scanlines allow you to configure how much is cropped.


Okay I see, my bad.

tokumaru wrote:
Quote:
( you're not supposed to see the sprites in the upper left)

There should be no sprites in the upper left! =) The correct place to hide unused sprites is after scanline 239, past the end of the picture. A Y coordinate of anything between 239 and 255 will completely hide a sprite. The X coordinate doesn't matter.


Thank you! That issue has been fixed, sprites that aren't supposed to be displayed are no longer displayed.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group