Level Editor

Are you new to 6502, NES, or even programming in general? Post any of your questions here. Remember - the only dumb question is the question that remains unasked.

Moderator: Moderators

User avatar
tokumaru
Posts: 12106
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Post by tokumaru »

tepples wrote:Checking 960 tiles through a binary search might be difficult, as it would require turning parts of the nametable on and off quickly
This would not be a problem. The first screen should be all black to make sure the gun is not pointed to a constant bright light. This one is easy, as it can be done without any tile writing, turning the screen off and setting color 0 to black will do it. Since the screen is off, you can use the time to draw the next screen, half white, half black (which wouldn't be possible just with vblank time). The next sections (1/4 of a screen and less) will fit in vblank, as you can just store the same value over and over, it's just a fill, so it's quick.

You could even use palette tricks, and do a lot of black and white switching by just changing the palette, and that'd give you some more time to update sections of the screen. Not complicated really. Also, maybe you don't need to address individual tiles, and checking for hits to 16x16-pixel blocks could make it all faster.
and the gun/mouse would have to stay still for those frames.
That may be a problem... let's say you can detect which 16x16-pixel block was hit in 8 frames. That's a somewhat small fraction of a second, if after a click you don't move the mouse right away, you'll be fine.
Nestopia claims to emulate a mouse, but I don't know whether it's the same mouse as the Super NES mouse that was bundled with each copy of Mario Paint.
I think that is a mouse used on those pirate educational NES-based PC's. If there is any documentation of that, it could still be useful.
albailey
Posts: 177
Joined: Thu Jul 13, 2006 3:15 pm

Post by albailey »

Since I'm almost done my Sudoku game for NES (which I need to have completely done for a game show in April), in May I am planning on starting writing a level editor. (to go with a side scroller NES game I'll be starting this summer. )

My last utility was a nametable editor (and palette, and pattern table editor and numerous other stuff I found useful) so I'd likely wire them all in together.

If anyone has suggestions/wish-list for features, or a list of things they wish they had done differently when they wrote theirs, let me know.

If I actually get anything done, I'll make it available. Assuming it doesnt suck. It''ll be in Java.


Al
Celius
Posts: 2159
Joined: Sun Jun 05, 2005 2:04 pm
Location: Minneapolis, Minnesota, United States
Contact:

Post by Celius »

It's funny that you say that, because a while ago, I was working on a sudoku game myself. And I made a level editor for it that used the idea being discussed. It was really cool, because it used the exact same engine as the game does, and you could alternate in between permanent and non-permanent numbers, and you'd just lay the puzzle out, and it'd be saved in the proper form into SRAM. By permanent, I mean the numbers that are layed out that you can't change. It's basic, it just made me proud because it was one of the first editors like that that I made. It didn't use the light gun, though.
mattmatteh
Posts: 345
Joined: Fri Jul 29, 2005 3:40 pm
Location: near chicago

Post by mattmatteh »

i have never used a level editor. but might interested in helping. i wouldnt mind coding it in qt, gtk, or sdl. i mostly code in C. C++ and OO is weak.

matt
Bananmos
Posts: 551
Joined: Wed Mar 09, 2005 9:08 am
Contact:

Post by Bananmos »

I think this has something to do with placement of NPCs, monsters, and such. Does tUME support that?

...

It seems to only support placement of objects/enemies on grids. Since it is wasteful to store them like this (because of a bunch of blank "tiles" with nothing), you'd have to convert from this grid format into coordinates, to make a more compact list of objects. That's what I understood from their demo. Yeah, they have this nice demo that shows what the program can do.
Actually, I was more talking about using a small number of sprites to add graphical detail to your levels. Since the NES has such limited palettes, you might want to use sprites to make your level more colorful. (though overusing them will give you flicker of course)

For example, imagine you're making a platformer and your player arrives at the big guardian tree of eternal life or whatever. You might want to have some apples hanging from the branches, and it won't look very good if they can only be placed on a 16x16 grid.

And since you mentioned NPCs and monsters as well: you might want to have some nasty vultures sitting on branches, which will sweep down to attack a player who walks past the tree.

I don't see how such levels could be built with tUME, so only being able to place stuff using grid coordinates is a big drawback IMO.
Bananmos
Posts: 551
Joined: Wed Mar 09, 2005 9:08 am
Contact:

Post by Bananmos »

Ok, here are my personal thoughts on a level/graphics editor for tile-based systems:
So, there is no way for "the ultimate level editor" to be prepared for the designs of every game programmer. I don't see any other way for this to work, other than the editor saving everything using a format that's easy to understand and work with, so that the programmer himself can code converters to the desired format.
Yep, this is exactly how I think it should be done. Do not limit yourself to using a fixed format implemented for a single system. Instead, just handle maps with any possible configuration, and have your program save everything it in an easy understandable text-based format. (XML comes to mind) Then provide well-commented and documented source libraries for reading the files and examplifying conversion programs that will convert the data to binary formats suitable for different systems and/or game engines. No need to put any hardware restrictions in the program itself as the conversions tools can handle those.

The editor itself would have most of tUME's editing features, but be able to handle layers with transparency where each layer can different grid setting. For example, your main editing area (for levels or graphics) might have a room with 16x16 grid setting. To organize your tiles, you would have one with an 8x8 grid setting where you build composite 16x16 tiles from 8x8 tiles. You might also have another kind where you'd build structures of 16x16 similar to Metroid.

If I were to use the editor for making sprite object frames made of small 8x8-sprites, I would simply use a grid setting of 1x1 which would allow me to place my 8x8 tiles at any pixel position. Of course, in this case the editor would need some intuitive scheme for priorities since a tile could overlap another. (even if most NES designers made sure tiles wouldn't overlap, check out Megaman's face for example) A flag to specify if two tiles can occupy the same coordinate might also come in handy, since you might want to place two 8x8 sprites at the same coordinate when making sprite object frames, but probably want a placement to overwrite another when editing grid-based levels.

And if I would like to make some fancy cut-scenes, I might use one grid-based layer with either an 8x8 or a 16x16 grid setting and another one with a 1x1 grid setting. This way I could use BG for the main parts of a full-screen image and then fill in details with sprites. A method very often used in high-quality NES games, which most graphics programs and level editors lack any intuitive support for.

Of course, there should also be good support for animating inside inside the editor. Animation should not be limited to a fixed number of frames per single tile. For example, if I want to animate my sprite objects, I want to be able to specify a sequence of sprite object frames to reference for each animated frame, along with a time length. Nowadays, I use a bitmap program for animating my sprites, but that treats every frame as a pixel image, and for storage and flicker considerations, it'd be nice to be able to arrange a set of 8x8-sprites directly instead.

In the ideal case, animation should also include scrolling different layers. Maybe even scripted with some easily addable script language?

Last of all, it would be neat if there were some typical image editing tools avialable to edit the graphics data itself inside the editor. But that's kind of overkill and shouldn't be bothered with until the more important features are implemented.

I advise everyone to take a look at the tUME demos. (which are actually preferable to watch in DOSbox, since they run awfully slow in Windows for some reason) Especially if you have any plans on rolling your own editor.
tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

Bananmos wrote:Actually, I was more talking about using a small number of sprites to add graphical detail to your levels. Since the NES has such limited palettes, you might want to use sprites to make your level more colorful. (though overusing them will give you flicker of course)

For example, imagine you're making a platformer and your player arrives at the big guardian tree of eternal life or whatever. You might want to have some apples hanging from the branches, and it won't look very good if they can only be placed on a 16x16 grid.
In Super Mario World for Super NES, the first thing Mario sees is the big guardian tree. The game actually stores this as one object, where the decompression handler for the tree adds several apples to the level.
User avatar
Memblers
Site Admin
Posts: 3902
Joined: Mon Sep 20, 2004 6:04 am
Location: Indianapolis
Contact:

Post by Memblers »

OK, you guys have inspired me to do what I'd been wanting to do for a really long time. Which is to write my level editor for a simple game I'd been wanting to make for a while. I need the coding practice.

It's very low-budget though. I'm not sure if it'll be useful for anyone else (maybe). I might keep it built it into the game, though it'd have to run on Squeedo to worthwhile on a cart (WRAM + 4-screen + FlashROM + XMODEM = my NES is my computer :)).

So far I'm only planning on supporting horizontal scrolling, and having the editor lay out metatiles + 2 attribute bits. I'll see how it turns out, I just started on it the other day.
tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

Memblers wrote:(WRAM + 4-screen + FlashROM + XMODEM = my NES is my computer :)).
Add a keyboard, a hacked Super NES Mouse, and an ATA controller for a CompactFlash slot, and something like Doctor PC Jr. might actually be doable.
mattmatteh
Posts: 345
Joined: Fri Jul 29, 2005 3:40 pm
Location: near chicago

Post by mattmatteh »

are you coding it yourself or is this a group project ? what are you coding it in? what is the intended operating system?

matt
User avatar
Memblers
Site Admin
Posts: 3902
Joined: Mon Sep 20, 2004 6:04 am
Location: Indianapolis
Contact:

Post by Memblers »

Here's a demo of what I have so far. It's not much to see, but I just fixed a horribly annoying bug (in some code I wrote years ago, even!), so I'm proud and have to show it off to someone who understands what it's for. :)

There's no saving or loading yet, but the editing works.

select = change mode
a = place tile / select tile
b = change attribute (selection mode only)

http://www.parodius.com/~memblers/nes/e ... n-demo.nes
Image
Image

Source is up in that folder too, but it's nothing pretty.
albailey
Posts: 177
Joined: Thu Jul 13, 2006 3:15 pm

Post by albailey »

I like it.

My wife told me that she remembered playing a game called pinball factory when she was younger. I can see something like what you've done being readily applied to a game like that.

Al
Bananmos
Posts: 551
Joined: Wed Mar 09, 2005 9:08 am
Contact:

Post by Bananmos »

I should admit that there's one category of games where making the level editor run on the NES is indeed a good idea: Puzzle games with a built-in level editor are great for this. When you have the game engine working and the tiles drawn, a built-in level editor would be great for designing new levels and being able to try them out immediately.

Not to mention that once the game is done, you have a cool level constructor for the gamers to enjoy.
User avatar
beneficii
Posts: 127
Joined: Tue Jul 12, 2005 4:37 pm

Post by beneficii »

For a while, I've considered making a generic Mario level editor which assumes that levels are composed of object and enemy data and that lets you define the objects and specify their sizes, etc. You would be able to store stages to their own file or even convert them to code. It doesn't seem like it would be technically difficult, just a lot of work. :)
Post Reply