[4.5.2] 6 color player

Later in the NES's life, games employed a "paperdolling" sort of mechanic for their hero character sprites. The process involved drawing two sprites on top of each other, and each one using a different palette for each part of the hero. This allowed what looked like 6 color sprites, and drastically improves the player character details, while being relatively lightweight. This resulted in what appears to be up to 6 colors per tile even though its actually two sprites right on top of each other. This works great for player characters as you get all that extra detail, but definitely should not be used on enemies as that is just way to expensive.

I realize NES maker gets quite close to this already with the different palettes per sprite tile if you have multiple tile sprites, but its not quite what we are looking for.

I took a look at making a separate monster follower (thanks to another users post on here) and I got a ways down that path before I realized how much I would lose on the monster side of things. My implementation was a bit different, in that whenever the player input was updated I was just going to set my "monster" to be in the same position as my player. I didn't follow that all the way to the end though, as it felt like I was just trying to push NESMaker to do something that it wasn't setup to do that way. Unless I dont understand it correctly, you only get one Monster Group per screen, and each monster group is only 1 tileset. So I would have to have my entire characters alt sprite sheet as a monster sheet...and then basically no monsters...which is like...obviously terrible haha.

SO! I have begun the steps towards learning 6502 Assembly to see about modding things to get what I want, but before I went way down this path and run straight into a brick wall. I wanted to see if anyone else has explored this, or might have some pointers of a way to accomplish this with what is already in place in NES Maker.
 
I also have to say, I am continuing down the tutorials, I got distracted by this idea when my friend and I were discussing how he should build the art assets. He made a dope sprite sheet and I got stoked at the prospects and ran off into the woods chasing the dream haha.
 

mouse spirit

Well-known member
You could have a monster "follow" the player but be over top of the player constantly.
Another way may be to control 2 players at the same time but one is immune to monsters n such.

I think the mega mans used what you are talking about,or maybe another method, for his face and eyes.
 
Yeah the monster "following" was what I was starting to do, but instead of following it just always set itself to my players position. I lose available monsters that way unfortunately, so I am trying to find a work around if possible.
 

mouse spirit

Well-known member
Gotchya. I think alot of those later titles used "better boards" or atleast newer tech boards/chips.
With nesmaker, id say the best route for this is a workaround if you need it.Otherwise id say ask yourself
if you do need it.Thirdly if you do need it, you will probly have to know and do alot to achieve this,if its
viable for nesmaker in general.

Another thing to try with your workaround is making a specific monster type that does like 0 checks(other than pos/palette/graphic).
Like it doesnt need to check collisions,health,ect.Maybe that way it doesnt take up alot of cpu.

If what you want can be done here alongside nemaker , maybe it has to do with just drawing/moving the graphic at position of player constantly.
Like, not a monster, just draw a graphic.

I'm no expert, and its hard to go from a program where i could do anything you ask, like gamemaker,
but then go to something where i have to relearn everything ,like nesmaker.
So, i have ideas, but no code to help you here. Just suggestions.
I understand your plight with monster limitations on the screen.
 

CutterCross

Active member
Make 2 variables for your layered sprite's X and Y pixel offsets from the player.

Set each variable to the offset value you want.

Use a DrawSprite macro with the X and Y parameters being the player object's current X position + X offset and the player object's current Y position + Y offset. Put that DrawSprite macro in a script that's run every frame (like Sprite PreDraw).

Do some conditionals depending on the direction of the player object to flip the layered sprite and/or change X and Y offsets accordingly.

Done.

Same technique I did for Tower of Turmoil back in 2018, without some extra logic for multiple layered sprite positions and graphics:

h9l7uzp.png
RLNM9Ys.png
zEYiCDn.png
Sl7boFa.png
 

CutterCross

Active member
Honestly I should have talked about how this was done much sooner but only recently I was able to fully explain how it all works haha. It's pretty simple in the grand scheme of things. I've had plenty of NESmaker and ASM experience since Tower of Turmoil and Jorotroid was the one who actually helped me implement that original layered sprite code for that game. Big kudos to him.
 

CutterCross

Active member
Basically any tile loaded in the sprite pattern table in PPU RAM. Game object tiles or Monster object tiles, doesn't matter.
 
Ahhhh, yeah that makes sense. I also see now how to draw sprites from specific tiles, and how to get the player object...slowly peeling back the layers. I will HAVE THIS FEATURE! haha.
 

Mugi

Member
the feature you're talking about is commonly referred to as sprite layering.
not a particularly complicated thing at the end of the day, but definitely a little overwhelming if you're just starting.
Like cutterCross said, in NESMaker, propably the easiest way is to actually implement a player x/y pos tracking into sprite pre-draw script and use that to draw overlaying sprites.
im not sure about the current version of nesmaker but earlier versions (4.1.x) had problems with this due to predraw "dragging" behind player position updates so the overlayed sprite's position was a bit of a hit or miss.

I ended up writing a completely new draw routine for this purpose (i use it to draw weapons instead of multicolor sprites) but the idea is the same.
you can see it in action here: http://nesmakers.com/viewtopic.php?f=51&t=1820&start=360#p22342
 

CutterCross

Active member
Mugi said:
im not sure about the current version of nesmaker but earlier versions (4.1.x) had problems with this due to predraw "dragging" behind player position updates so the overlayed sprite's position was a bit of a hit or miss.

The way to fix that issue for me was to draw the layered sprite AFTER the HandleUpdateObjects routine was run. At least it worked that way in 4.0.11.
 

pierski

New member
CutterCross would it be possible to share the code ASM from this? I am attempting to connect two objects to the player's position, at anytime. Thank you.
 

PasseGaming

Active member
CutterCross would it be possible to share the code ASM from this? I am attempting to connect two objects to the player's position, at anytime. Thank you.
Probably could but the issue is that it would be different for each person trying to use it depending on the sprite they are trying to overlay.
 

pierski

New member
Probably could but the issue is that it would be different for each person trying to use it depending on the sprite they are trying to overlay.
True, but seeing a working example can be altered to match. Could be as simple as adjusting names and coordinates.
 

dale_coop

Moderator
Staff member
Keep it mind, that overlaying sprites will bring you closer to the 8 sprite per scanline limitation!
And if you use several objects to do that... it will also add slowdowns to your game.
My advice would be to stay in the limitations of the colors... and make a fun game (not broken, not laggy,...) ;)
 

pierski

New member
Keep it mind, that overlaying sprites will bring you closer to the 8 sprite per scanline limitation!
And if you use several objects to do that... it will also add slowdowns to your game.
My advice would be to stay in the limitations of the colors... and make a fun game (not broken, not laggy,...) ;)
I appreciate your reply, but connecting additional objects to the player is essential to what I am trying to accomplish. Nonetheless, even with the attached sprites, no row would ever have more than 5 sprites appear at the same time.
 

dale_coop

Moderator
Staff member
5 sprites come very ... quickly.
Let's say your player is a small 16px x 16 px, it's already 2 sprites wide. If you attached another 16px object, it's already 4 sprites on the same row. Now, adding a weapon or projectile or magic effect (...it's at least 1 sprite more)... and maybe 1 monster ? (2 sprites wide)... you can't have more monsters on the same row...

I'd suggest to start making smaller scaled projects, to work with the limitations (NES and NEsmaker ones)... reiterating each time adding more complex stuffs, optimizing,... until the point you are comfortable enough wit the code to implement the sprite layer thing.
 
Top Bottom