It is currently Thu Sep 21, 2017 7:04 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 12 posts ] 
Author Message
PostPosted: Sat Apr 01, 2017 9:54 am 
Offline

Joined: Mon Jan 30, 2017 5:20 pm
Posts: 280
Location: Colorado USA
So, I want a tool that would allow me to put tiles on a screen that lets me see what my level looks like so I can type in the data for the game. I need one that lets me see multiple nametables.


Top
 Profile  
 
PostPosted: Sat Apr 01, 2017 10:11 am 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6162
Location: Seattle
Would the tiled map editor be usable? It's not an exact match, but ...


Top
 Profile  
 
PostPosted: Sat Apr 01, 2017 10:14 am 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10010
Location: Rio de Janeiro - Brazil
NES Screen Tool is the most popular software for designing Name Tables, but you do it all graphically, not typing values, and when you're done you can export the data to include in your project.

Most people don't build levels out of raw name tables though, because these take a lot of space. Keep in mind that an NROM cartridge has only 32Kb of PRG-ROM, and each raw name table (plus it's attribute table) is 1Kb, so you'll hardly be able to hold over a dozen or so screens along with the code, music, and other things a game needs.

Most programmers come up with more compact formats to represent level maps, otherwise SMB could never fit in 32Kb!


Top
 Profile  
 
PostPosted: Sat Apr 01, 2017 10:40 am 
Offline

Joined: Mon Jan 30, 2017 5:20 pm
Posts: 280
Location: Colorado USA
How did SMB do it?


Top
 Profile  
 
PostPosted: Sat Apr 01, 2017 10:51 am 
Offline
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 1730
Location: DIGDUG
Do you mean...

"How did they design the levels?"

Or

"How did they program the levels?"

The first question = they drew them out on graph paper.

The second question = very complicated compressed metatile system.

_________________
nesdoug.com -- blog/tutorial on programming for the NES


Top
 Profile  
 
PostPosted: Sat Apr 01, 2017 11:11 am 
Offline
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 1730
Location: DIGDUG
So, at the start of each level, it will find a pointer to some level data. It has separate sets of data for enemies and for BG.

The first few bytes of data will tell it what kind of world it is, and it uses that to switch palettes and switch music.

The next byte will set a master design... something like, 2 blocks of floor, and blank sky. (Filled with scenery appropriate for that world...like clouds)

The next bytes it gets will give it directions for how to draw a room...starting at X=2,Y=3, draw left to right 5 bricks.

Then it has an automated routine draw the tiles for a brick metatile (4 tiles)....and it will repeat 5 times, shifting right each time.

And, even more complicated, it buffers writes to occur only during v-blank. So you can scroll smoothly without having to turn rendering off.

You don't have to do any of this like the SMB programmers do, but this is one of many ways to compress a level.

Edit - it can also use 1 byte to say...draw a flagpole here. Or, draw an end of level castle here.

Those are represented as 'objects', and there is a separate set of data to represent the tiles of that object. Like an array of tile numbers.

_________________
nesdoug.com -- blog/tutorial on programming for the NES


Top
 Profile  
 
PostPosted: Sat Apr 01, 2017 12:10 pm 
Offline

Joined: Mon Jan 30, 2017 5:20 pm
Posts: 280
Location: Colorado USA
Thanks, Doug! you've really saved me a whole lot of time! Imagine how long it would have took me if I did each nametable individually!


Top
 Profile  
 
PostPosted: Sat Apr 01, 2017 3:15 pm 
Offline
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 1730
Location: DIGDUG
I'm guessing you are being sarcastic.

Mario Bros used a complex system, because they were trying to cram 32 levels into 32000 bytes.

Use a simpler system. Use the NES screen tool. Make a nametable with it. Either compress it with the RLE system that comes with it, or some other compression method.

You can uncompress into expansion RAM at $6000-7fff.

And then load to the PPU as you scroll, a little at a time.

_________________
nesdoug.com -- blog/tutorial on programming for the NES


Top
 Profile  
 
PostPosted: Sat Apr 01, 2017 3:50 pm 
Offline

Joined: Mon Jan 30, 2017 5:20 pm
Posts: 280
Location: Colorado USA
I actually wasn't being sarcastic, because my levels use a lot of looping tiles, I came up with a method that would use the Y register for the high byte, the X register for the low byte, and the accumulator for the tile number. To write a nametable, all you would have to do is load X with the low byte of where your starting to write, the A register with whatever tile number you wanted to use, and then store the low byte of the memory address you want to end on. every loop, it will increase the low byte and check if it's equal to the low byte you want to end on. If they aren't equal, it repeats. It would look like this.
Code:
GetRegistersReady:
LDA #$03 ;Prepares A register
LDY #$20 ;Prepares Y register
LDX #$FF
STX NametableEndByte ;Sets at what address to stop
LDX #0 ;Prepares X register
JSR NametableLoop
; You can prepare other tiles here
NametableLoop:
STY $2006 ;Stores high byte
STX $2006 ;Stores low byte
STA $2007 ;Stores tile number
INX ;Increases low byte
CPX NametableEndByte ;Checks if safe to end loop
BNE NametableLoop ;If not, repeat
RTS ;When done, check for more tiles.


Top
 Profile  
 
PostPosted: Sat Apr 01, 2017 3:52 pm 
Offline
User avatar

Joined: Wed Sep 07, 2005 9:55 am
Posts: 296
Location: Phoenix, AZ
Here's my tilemap tool, MapEd Pro

It uses metatiles of different sizes, not raw name tables. You would need to setup palettes and chr mapping before you could build a map.


Top
 Profile  
 
PostPosted: Sat Apr 01, 2017 5:11 pm 
Offline
User avatar

Joined: Wed Mar 29, 2017 3:11 pm
Posts: 19
Tile Layer pro works
http://www.romhacking.net/utilities/108/


Top
 Profile  
 
PostPosted: Sat Apr 01, 2017 6:23 pm 
Offline
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 1730
Location: DIGDUG
Quote:


That's a tile editor, though. Not a map editor.

It can't output a nametable.

_________________
nesdoug.com -- blog/tutorial on programming for the NES


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 8 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