Space - In StarSoldier and Others

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

Post Reply
ninn
Posts: 11
Joined: Mon Oct 10, 2011 3:23 am

Space - In StarSoldier and Others

Post by ninn »

Hi fellow Codemonkeys! :lol:

I have been lurking on this board for some month, reading lots of threads and trying to understand concepts behind nes games. Ultimately, I'd like to do a game at my own. But completing this task seems far, far away by now. :roll:

Nevermind, I just wanted to say "hi! 8) " and put down my first question.



Yesterday, after playing some Recca I put in my beloved copy of Star Soldier.

I noticed, that the star field in Star Soldier looks a lot better than, say, Recca or Xevious. Star Soldier (and Gun Nac) both use an effect that I can not explain at my own. Please help me explaining it, since it drives me nuts on how this effect was done.

While Recca and Xevious - and most shmups I know on the nes - got just single background plane, - the stars/ground just scrolls down exactly like they were alligned on the name table. Basicly, a painting that is moved to give the illusion of movement.

Where as in Star Soldier and Gun Nac, the stars scroll in - at least - two different speeds, which gives a nice feel of depth.

So: how was this effect done? Which trick is utilized to give that starfield background such a nice depth / two scrolling speed? Can you explain me the concept beind this effect? I dont think that this trick utilizes some hard core effects like scanlinecounter and/or mappers ...

I was first thinking of animated tiles for its backgrounds, but since I did not found any pattern in the star soldier star field, I don't think it was done that way.

Do you got an idea on how it was done? Please share it with me.

Kind regards,
Ninn :o
User avatar
thefox
Posts: 3139
Joined: Mon Jan 03, 2005 10:36 am
Location: Tampere, Finland
Contact:

Re: Space - In StarSoldier and Others

Post by thefox »

ninn wrote:So: how was this effect done? Which trick is utilized to give that starfield background such a nice depth / two scrolling speed? Can you explain me the concept beind this effect? I dont think that this trick utilizes some hard core effects like scanlinecounter and/or mappers ...
It renders the stars using sprites, so it can place them freely. Also the star sprites always have lower priority than other sprites, such as the player, enemies, projectiles etc. This way the stars will never make something important disappear from the screen.
Shiru
Posts: 1161
Joined: Sat Jan 23, 2010 11:41 pm

Post by Shiru »

The effect called 'parallax', you need to move bottom layers slower than front layers. In case of the game you talking about it creates virtual second (bottom) layer using sprites.
tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

Is that the same effect seen in the US version of Star Force? If so, that's a virtual background plane made out of sprites.
ninn
Posts: 11
Joined: Mon Oct 10, 2011 3:23 am

Post by ninn »

Hi Shiru, thefox, tepples,
Thanks a lot for your input!

Tepples, the background in Star Soldier is different than in Star Force.

In StarForce, the stars are on a flat plane - they all move at the same speed. And they vanish as bullets and enemy ships enter the screen. I am pretty sure they are sprites. And you can clearly see pattern in the stars.

But in Star soldier, they move at at east two different speeds. they are not disappearing at all - I am pretty sure about this, thou it is pretty hard following a single star in a star field.

---

Can someone proof me, that the stars in star soldier are made out of sprites? Like ... coloring all sprites with a red border, or turning them off entirely? I can not find an option like this in my emulator.

I'd absolutely love to see how this starfield is made. How do those sprites move? It is not about code, but demystifying the concept behind that starfield ...

---

I know (at least my brain tells me this) that these games have to be sprites. cause they move independently of the background.

I know they are fixed in both games. Stars never move left or right. but the background does.

And ... i can not stop thinking about it.

Do you know an emulator that can help me analyse that starfield?

ninn :o
User avatar
Dwedit
Posts: 4470
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Post by Dwedit »

There's nothing stopping sprites from moving at different speeds. Star soldier is all sprites, just like star force, they just move at different speeds.

And they do disappear, it's just harder to notice because they flicker in and out anyway.

In Mega Man 3, Gemini Man's stage uses a combination of background and Sprite stars. The background stars are scrolled at half speed by splitting the screen, nothing odd there.

FCEUX's Name Table viewer is good for seeing what's background and what's not.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

ninn wrote:Can someone proof me, that the stars in star soldier are made out of sprites? Like ... coloring all sprites with a red border, or turning them off entirely? I can not find an option like this in my emulator.
PocketNES running in VisualBoyAdvance emulates background as background and sprites as sprites. Turn off sprites in VBA, and you turn off NES sprites.
I'd absolutely love to see how this starfield is made. How do those sprites move?
I don't own a copy of the game, but I looked it up on YouTube, and it appears to be the same thing as Star Force, just with half the star sprites moving at double speed. I also see fewer stars on the screen when there are more enemies, so they're probably sprites that fill unused display list slots.
User avatar
tokumaru
Posts: 12106
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Post by tokumaru »

tepples wrote:ocketNES running in VisualBoyAdvance emulates background as background and sprites as sprites. Turn off sprites in VBA, and you turn off NES sprites.
You don't need to run an emulator inside an emulator for this...
Dwedit wrote:FCEUX's Name Table viewer is good for seeing what's background and what's not.
You can do that, or actually enable/disable the planes individually. Just go to Config -> Display and you can select which layers you want to see.
ninn
Posts: 11
Joined: Mon Oct 10, 2011 3:23 am

Post by ninn »

Thanks a lot, guys! :)

I created my first romhack in the meanwhile. 8)

I opened the rom in FCEUX, and turned off backgrounds. The red metal structures never appeared, but the stars stayed. Then I turned off sprites, and the stars vanished too. So you were all right!

I then opened the rom in a tile editor to find the right tiles that are used for the stars. Just 3 single-dotted sprites, with different colors. I edited them to lines to track them.

Image :P


Thats it.


Thats what I found out:
The starfield is made of sprites. The sprites are moving in at least two different speeds. Every sprite use 3 frames of animation, each frame shifts the color of the dot. The sprites alternate the frames several (at least 4 times, prob. 8 times) times before vanishing. they are hidden the same duration as animated and visible. All stars animate at the same speed/rate. They do flicker.


This pretty much solves the case for me. Thanks a lot for your friendly and pretty quick help! Without you, today evening, I'd continue to count stars on my CRT. :P Thanks a lot!


still, one question still puzzles me:
How can a nes game afford to put more than 1/3 of all possible sprites into "just" background animation. The programmers got big cohones for sure :)

I am pretty happy now. Thanks for helping me solve that puzzle,
Kind regards,
ninn :o
Shiru
Posts: 1161
Joined: Sat Jan 23, 2010 11:41 pm

Post by Shiru »

Well, obviously the star background has lowest importance, so when you need more objects, you just use as many sprites as needed, and have less stars at this moment. As player's attention will be on the objects, he won't even notice that there are fewer stars. When you don't need many objects, you can use all the free sprites for stars, anyway they would be simply unused otherwise.
Post Reply