AuthorTopic: [wip] Mr. Cuddles  (Read 5665 times)

Offline lilwing

  • 0001
  • *
  • Posts: 95
  • Karma: +0/-0
    • View Profile

[wip] Mr. Cuddles

on: May 21, 2011, 01:53:47 pm
This all started out as an idea for a NES homebrew. I recently decided to toss out the NES limitations to create a more unified palette. Perhaps I will go back later and reapply the limitations. Lately, I've been focusing on the enemy sprites. I still need to go back and make a new Mr. Cuddles sprite and I need to start with bg/fg tiles.

The idea for this mock chibi style, especially the bovine, was inspired by Yondemasuyo, Azazel-san.

The idea of the game is that you're a corn snake who collects candy corn. Most of the "bad guys" are capsular robots as pictured below.

Most recent work (these are all incomplete, some more than others):



Rough draft walking animation:


Older:



Oldest:

« Last Edit: June 11, 2011, 12:12:29 am by lilwing »

Offline Kasumi

  • 0010
  • *
  • Posts: 275
  • Karma: +1/-0
    • View Profile

Re: [wip] NES Snake platform mockup

Reply #1 on: May 21, 2011, 03:48:26 pm
The other problem is that I need four-color sprite palettes, but the NES only allows 3+transparent. Not sure how I am going to go around that issue.



Then go megaman style.

Here are your hardware sprites and sprite palettes.


There's not really a problem here. Your snakes are pretty well optimized for NES. Since the bodies are the same for both snakes, they don't take up extra space in CHR-ROM/RAM depending on your setup. They'd just be displayed with different palettes.

The places where you need white on the snakes don't need to have sprites on the same horizontal line, so you don't have to worry about flicker having to be as bad.

I optimized for CHR-ROM/RAM space and anti flicker, but if you want more palette colors, you could use two 8x8 sprites for the mouse's tail instead of one. (One with white, one with pink using different palettes), and then also have extra sprites for every other time the mouse needs white on it. This would free pink from the fourth palette that's used for all the overlays, and then you'd have two extra colors for whatever instead of one.

This would make the mouse take up 8 sprites alone when he's being displayed, 6 of which are on the bottom line. If it were me programming the game, I'd rather have one less palette color.

Edit: I actually realized there's a another way to get an extra color. Only pink needs to be in the "overlay palette", since the snakes can use the white from the mouse palette. This would mean only the tail would need one more sprite than what's used in the current setup. Also, other stuff:

Right now 16x24px is fine, but the mouse does not fit into those dimensions.

Don't think in dimensions. Think in hardware sprites. The mouse uses 5(or 6 depending on the setup), the snakes use 6. The hardware sprites are going to have to be arranged with offsets regardless, because they're different entities. Appealing to different dimensions that use the same number (or less) of sprites is not a big deal. I have an NES worm animation, and when the worm is compressed to move forward, the hardware sprites are arranged in a box, but when he's extended getting ready to compress again, they're in a line. Not a problem.

As for whether or not the mouse reads immediately as a powerup depends, I would say no. But to make him look like one to me, you'd probably have to make him look immobile or "icony" which would take away the fun of eating him. I think your players would figure it out pretty quickly, so I wouldn't worry about it.
« Last Edit: May 21, 2011, 04:22:44 pm by Kasumi »
I make actual NES games. Thus, I'm the unofficial forum dealer of too much information about the NES

Offline lilwing

  • 0001
  • *
  • Posts: 95
  • Karma: +0/-0
    • View Profile

Re: [wip] NES Snake platform mockup

Reply #2 on: May 21, 2011, 08:43:37 pm
Thanks, that was really insightful! Today I am going to make some more enemy sprites, but now I'm not sure what my limitations are. What I understand from Bob Rost's lecture notes is that you can set 4 sprite sub palettes (per name table?). So, there is a maximum of 25 colors on the screen at once, and since only one player sprite (snake) is drawn during gameplay, I can swap out the two palettes, and treat them as one? In which case, it is obvious that the palettes are not static, and I have an additional palette to work with, correct?

Offline Kasumi

  • 0010
  • *
  • Posts: 275
  • Karma: +1/-0
    • View Profile

Re: [wip] NES Snake platform mockup

Reply #3 on: May 22, 2011, 01:47:01 am
Correct, except sprite palettes have nothing do with the name tables.

I may have misled you a tad in the first post. Only worry about what'll be on screen at once. You can use as many different palettes for different levels or even different parts of the same level as you want, as long as no more than 4 will be on screen at once.

25 colors on screen at once comes from this:

4 sprite palettes with 3 usable colors each = 12 colors.

4 background palettes with 3 usable colors each = 12 colors.

+ 1 "universal" background color that that can be used by each background palette in addition to that palette's 3 colors. (This rule can be broken, but not really in a game)

In which case, it is obvious that the palettes are not static, and I have an additional palette to work with, correct?
Indeed, the palettes are not static. So if for example palette 0 is your snake palette, you could write Mr. Cuddles' colors there when he is being played as, and Mrs. Cuddles there when she is being played as. At least one color in palette 1 needs to be the same for the snake's chests, leaving two colors in that palette, and palettes 2 and 3 free for enemies/powerups. Using palette 0 this way of course means no enemy can use it, unless you don't care that it changes colors depending on who's playing. (This is why Megaman lives icons change when he changes weapons)
« Last Edit: May 22, 2011, 01:49:04 am by Kasumi »
I make actual NES games. Thus, I'm the unofficial forum dealer of too much information about the NES

Offline lilwing

  • 0001
  • *
  • Posts: 95
  • Karma: +0/-0
    • View Profile

Re: [wip] NES Snake platform mockup

Reply #4 on: May 22, 2011, 07:51:03 am
I read in some of your earlier posts, Kasumi, that sprite palettes can be switched out every scan line. Are there any original examples where this technique was employed?

In SMB, there are a few sprites that change palettes within the same level (red/1up mushroom, red/green turtle, etc.). Meanwhile, red koopas do not fall off ledges. How does palette swapping work in that case?

Anyway, in addition to updating the snake/mouse sprites a bit, I made some enemy sprites using existing palettes, but I'm not sure if I'm happy with them. They don't seem to fit well with the snake/mouse sprites. They read well, but lack detail. Meanwhile, I'm trying to come up with a fourth palette that would utilize pink, so that I don't waste a whole palette on overlay colors.

Offline Kasumi

  • 0010
  • *
  • Posts: 275
  • Karma: +1/-0
    • View Profile

Re: [wip] NES Snake platform mockup

Reply #5 on: May 22, 2011, 09:36:04 pm
I read in some of your earlier posts, Kasumi, that sprite palettes can be switched out every scan line. Are there any original examples where this technique was employed?
First I will say we are definitely getting into things that may be inconsequential to know unless you are really making an NES game, but I will answer your questions regardless:
Sprite palettes every scanline? Nothing comes to mind. Changing the background palettes takes exactly the same timing, though. I linked a video of this in my last post: http://www.youtube.com/watch?v=ecJiKqQonDc

It's not done for a reason. Say I'm changing the sprite palettes every scanline. (Which... is mostly impossible to do while actually displaying sprites. Updating palettes can only be done during vblank. Updating sprites for display can only be done during vblank. Doing this the easy way takes almost a quarter of the vblank time, and updating the palettes every scanline probably takes almost all of it). But let's say for a second that it's possible. Let's say I have four identical boxes that are all using palette 0 arranged like this:

They're allowed to be different colors using the same palette because that palette is being changed every scanline. But... what happens when one of the boxes in the middle moves two pixels up, and the other moves two pixels down? Probably something like this:

I'm sure there are games that change the sprite palette once mid rendering, but none immediately come to mind. What Kirby's Adventure and Super Mario Bros. 3 do to get their HUDs not to move with the background is nearly exactly the same, except they write a byte to change the scroll rather than bytes to change the palette. Changing the background palettes mid frame can be used for many more practical things, but it's the same difficulty to change either the sprites or the background palettes.
In SMB, there are a few sprites that change palettes within the same level (red/1up mushroom, red/green turtle, etc.) How does palette swapping work in that case?
There are 64 hardware sprites. They're not always visible, but they're drawn every frame. Each sprite has 4 bytes that tell it how to be drawn. There are 256 8x8 tiles that can be used for sprites that the NES has access to at any given time. Newer cart hardware allowed them to be changed, but Super Mario Bros. never changes them. Here are its sprite tiles:
Every moving thing in that entire game uses only these.

Now, one of the four bytes given to each hardware sprite tell it which of the tiles to use. If I write $00 to it, the upper left of Big Mario's head gets displayed using that sprite. $01, the upper right part of Big Mario's head. If I write $A0, I get a part of a koopa's head.

Another of the four bytes has two bits that tell the hardware sprite which palette to display as. Two bits, two possibilities per bit. 4 palettes. The rest of that byte is used for sprite flipping, and whether or not the sprite is drawn behind the background.

The other two bytes are for its position on screen, one for X and one for Y.

So Mario has a red koopa on screen. It writes $A8 to one hardware sprite's tile byte. It writes the other tile numbers to the other hardware sprites that would make up the koopa. It writes 2 to the palette bits of all the hardware sprites that would make up the koopa. The koopa is draw using those tiles, and red. To change its color to green one would just write 1 to those palette bits instead of 2. If I wanted to add a green koopa to the screen at the same time, I'd go to the next set of hardware sprites and do exactly that. Write the same tile numbers to the new hardware sprites, but with 1 for the new palette bits instead of 2. The sprite palette NEVER changes in the middle of a Super Mario Bros. level. (IIRC) How about when Mario gets a star? Setting all his hardware sprites to a different one of the four palettes quickly is all that's happening to make him flash. Super easy. He actually flashes different colors when he's underground than when he's above ground because the palettes are different, but the game logic is not. flashing ? Mark blocks is done by updating the actual background palette.

Displaying and moving sprites on NES is one of the easiest things you can do with it. If I want a hardware sprite to move, I write a new byte to that sprite's X location. It'll be there next frame. I want to change its tile, I just write the tile I want to a byte in RAM. All the rendering is done automatically. Because the order the NES draws the hardware sprites in is always the same, you have to make sure to use higher priority hardware sprites for overlays, but... inconsequential. Too much information?:D

The different behavior between the different koopas is just game logic, if that's what you mean. Both the program and the NES don't care what the koopas eventually end up looking like. I could hack Tetris to turn off the rendering, and still play by looking at where the blocks are in RAM.

Quote
Meanwhile, I'm trying to come up with a fourth palette that would utilize pink, so that I don't waste a whole palette on overlay colors.
A good idea, but I wouldn't worry about it if you have trouble. There's nothing stopping you from using the mouse's colors to overlay on top of what I've been calling the overlay palette. Any single (not hardware) "sprite" can technically use all 12 sprite colors.


Anyway, I often worry making posts like this scares others away, so if anyone has critique for the aesthetics for him please post!


Here are some quick points of mine. The cat looks as though he's holding his head back in surprise. You could shift his head a pixel or so to the left. I also wonder why he's in a different perspective than the others. I'm also not sure if the change the Mr. Cuddles was successful. At 1x, I'm not sure I can't quite tell it's a tongue, and at any other zoom, I see only an eye in his mouth. I like the new feet on the mouse much more.
« Last Edit: May 22, 2011, 09:53:48 pm by Kasumi »
I make actual NES games. Thus, I'm the unofficial forum dealer of too much information about the NES

Offline lilwing

  • 0001
  • *
  • Posts: 95
  • Karma: +0/-0
    • View Profile

Re: [wip] [NES] Mr. Cuddles

Reply #6 on: June 05, 2011, 03:12:57 pm
Bumping this thread for a progress update. Looking forward to some critiques on my work.

Offline infinitegames

  • 0010
  • *
  • Posts: 130
  • Karma: +0/-0
    • View Profile

Re: [wip] [NES] Mr. Cuddles

Reply #7 on: June 05, 2011, 04:54:22 pm
I'd say ditch the dithering on the ground and the box. It doesn't fit in and doesn't really look that good generally. It'd also allow you to make your ground clearer

Offline lilwing

  • 0001
  • *
  • Posts: 95
  • Karma: +0/-0
    • View Profile

Re: [wip] Mr. Cuddles

Reply #8 on: June 10, 2011, 11:54:42 pm
Bumped for update. Please see original post.

Most recent work (these are all incomplete, some more than others):



Rough draft walking animation: