Ludum Dare #46compo
Protector
PROTECTOR
A Ludum Dare 46 game jam compo entry. April 2020.
THEME : *KEEP IT ALIVE*
Platform : Nintendo Entertainment System \[NES\]
Language : C *(ASM source included in source code were either generated, or are existing library necessary to build the ROM.)*

Description
This a 1-player Arcade action game.
You are a hero, with your antivirus gun, you must destroy the incoming viruses, survive and protect the nurse in an hospital.

Controls
* Hold A to run
* Press B to shoot
* Use D-PAD to move around
* Press SELECT to toggle the music if it annoys you
* Press START to pause the game

How to run
Download .nes ROM. Open it in your favorite NES emulator.
I recommend to use Mesen for an optimal experience.
If you do not want to install an emulator, you can just go to https://jsnes.org/, then drag and drop the .nes rom on the webpage to play.
How was it made
Libraries :
* Shiru's neslib
* Shiru's famitone2
Tools used :
* Visual Studio Code (Code editor)
* Shiru's NES Screen Tools (CHR graphic bank editor, and nametable map tool, NES palette editor)
* CA65 compiler (Compiler)
* Famitracker (Sound & Music)
* Mesen (Emulator & Debug tools)
* Shiru's NES Space Checker (Check generated ROM)
Special Thanks
I'd like to thanks :
* Shiru for his invaluable NES development tutorials, tools, examples and learning resources
* All the developers of the tools i used. (Mesen, Famitracker, Visual Studio Code, CA65)
* The LDJAM event organizers
* Anyone that is going to play and rate this game during the competion
* ...
* AND all the people fighting the pandemic while i'm at home making silly games !
--------------------------------------------
How to run
Download the .nes ROM. Open it in your favorite NES emulator.
I recommend to use Mesen for an optimal experience.
If you do not want to install an emulator, you can find a web-based one, then just drag and drop the .NES rom.
I found these working online html5/javascript NES emulators :
- https://app.7io.org/CycloaJS/ : Just drag and drop the .nes file on the webpage to start playing. [Recommended]
- https://jsnes.org/ : Just drag and drop the .nes file on the webpage to start playing. [Does not work entirely as expected]
--------------------------------------------

Comments27

ToC20 Apr 2020, 11:18
I have not seen an NES entry to LD before, very interesting. There is a bit of a learning curve but once you get the feeling for it, very fun. Gets very hectic for me after the first 20 virusses.

singleshoe20 Apr 2020, 15:20
I definitely didn't expect playing a NES game. Not only that's more work than the usual, but you also provided super easy ways of playing the game. The game itself I found interesting, definitely very reminiscent of the era. I found it quite hard as the virus moved too fast for me, however that's also on brand for NES games, as they usually weren't very easy.
Nice job!
Nice job!
FedorL20 Apr 2020, 16:12
WOW NES!! Awesome job!

LeYamez20 Apr 2020, 16:51
Very innovative! A bit confusing to run to say the least :sweat_smile: but was definitely worth it! Liked the classic art style.

yetanother20 Apr 2020, 18:41
Choosing to make a NES game for the LDJam is very impressive.
The Theme quite feet with the current time :)
The Theme quite feet with the current time :)

Malai20 Apr 2020, 19:48
Got a high score of 46 by holding B and shooting across the room :D But very impressive game given the incredible time and hardware constraint

dooskington20 Apr 2020, 19:56
Love that this is an NES game.

Lestat20 Apr 2020, 20:05
A NES game, nice, that's extra points :p It fits the theme and it's overall a good game. GHood Job!
psydack20 Apr 2020, 20:08
Wow, that's awesome! The game is simple but I liked! love the sound effects =p
greizgh20 Apr 2020, 20:09
Seeing a NES ROM is immediately appealing!
The game plays nicely in online emulator or mednafen, the experience is complete with a controller :smile:
I didn't get the logic behind projectile speed? They seem to be really fast when spawning, but this may just be an emulation quirk.
Really pleasant experience though, and friendly fire is a nice detail!
Also fits the theme really well, keep those 8bits machines alive!
The game plays nicely in online emulator or mednafen, the experience is complete with a controller :smile:
I didn't get the logic behind projectile speed? They seem to be really fast when spawning, but this may just be an emulation quirk.
Really pleasant experience though, and friendly fire is a nice detail!
Also fits the theme really well, keep those 8bits machines alive!

ObscenelyTrue20 Apr 2020, 20:23
Very nice entry! It is nice to see such a complete game on NES. There is even a story... wow! Of course, this console is not the best 8-bit machine (the Amstrad CPC is far ahead and I don't say that because I developed a compo game for CPC:)

khopa20 Apr 2020, 21:30
Ha ha :smile: Thanks. I really loved your entry @obscenelytrue, very impressive to see an Amstrad game in the compo.
Thanks everyone for the feedback.
@greizgh, @magnusfurcifer, Yes, the projectiles are really fast, it did not seems too extreme for me though, maybe your emulator is making the game faster than it actually is ?
But yeah the player's projectile are really fast by design and there is actually a technical reason behind this choice.
By making the player projectile that fast, it means that they also dissapear faster, which save on sprite count on screen, on RAM needed to store the state of the bullets and on the number of collision checks to perform on each frame.
Because, the NES has a limit of 64 '8x8' sprites displayed on screen, and a maximum of 8 '8x8' sprites can be displayed on each 'scanline'. So to avoid any issues, and flickering i limited the player gun to 4 projectile. So it is enough to display two virus, the Player, the NPC, and the 4 bullets, on one line before flickering starts.
Otherwise should the player fire from the extreme left side of the screen to the right side, there would be a lot of bullets to display, as well as lag because of the increasing number of collision check to perform. (And the game is far from being perfectly optimized for the system, as it is written in C)
To demonstrate what could happen, I just built an example ROM where i increased the number of bullets the player can fire, and reduced their speed to 1 px per frame (which is really slow for demonstration purpose), look at how glitchy and laggy it can get :
https://github.com/Khopa/protector_ldjam46/releases/download/1.0.1-glitchy/protector_slow_bullets_example.nes
Thanks everyone for the feedback.
@greizgh, @magnusfurcifer, Yes, the projectiles are really fast, it did not seems too extreme for me though, maybe your emulator is making the game faster than it actually is ?
But yeah the player's projectile are really fast by design and there is actually a technical reason behind this choice.
By making the player projectile that fast, it means that they also dissapear faster, which save on sprite count on screen, on RAM needed to store the state of the bullets and on the number of collision checks to perform on each frame.
Because, the NES has a limit of 64 '8x8' sprites displayed on screen, and a maximum of 8 '8x8' sprites can be displayed on each 'scanline'. So to avoid any issues, and flickering i limited the player gun to 4 projectile. So it is enough to display two virus, the Player, the NPC, and the 4 bullets, on one line before flickering starts.
Otherwise should the player fire from the extreme left side of the screen to the right side, there would be a lot of bullets to display, as well as lag because of the increasing number of collision check to perform. (And the game is far from being perfectly optimized for the system, as it is written in C)
To demonstrate what could happen, I just built an example ROM where i increased the number of bullets the player can fire, and reduced their speed to 1 px per frame (which is really slow for demonstration purpose), look at how glitchy and laggy it can get :
https://github.com/Khopa/protector_ldjam46/releases/download/1.0.1-glitchy/protector_slow_bullets_example.nes

NEKORUMA21 Apr 2020, 01:38
i love nintedo nes!! this game made me nostalgic! great job !!

stolen_biscuit21 Apr 2020, 23:29
Awesome concept! Was really fun, the controls were nice and I thoroughly enjoyed playing it. Well done!
keanutah21 Apr 2020, 23:37
Really cool that you made a legit NES game! Wish I had a flashcart to play this on real hardware. I think there are some obvious gameplay improvements you could add, but making this all for a jam is really really awesome

thewrath22 Apr 2020, 08:08
Your game is both very interesting in terms of programming and gameplay, simple and efficient like a real NES game ! I'm going to visit the github repo it must be interesting ! A great entry for the Jam.

khopa22 Apr 2020, 10:57
@thewrath
Thanks !
If you are interested in programming for the NES, you should definitely check this website out :
https://shiru.untergrund.net/articles/programming_nes_games_in_c.htm
It has a bunch of very simple examples, tools, resources, and general advices that might be better to get you started.
Thanks !
If you are interested in programming for the NES, you should definitely check this website out :
https://shiru.untergrund.net/articles/programming_nes_games_in_c.htm
It has a bunch of very simple examples, tools, resources, and general advices that might be better to get you started.
pcmaster22 Apr 2020, 19:05
Impressive, small, simple, minimalistic (also due to the truly oldskool platform), nice. I wish I could 'control' the nurse by herding her (away from me, for example). Good job :)

Ismael Rodriguez22 Apr 2020, 19:41
Really cool to play an indie NES game! Feels super authentic as retro game, so everything as far as quality goes is more forgivable. Good job putting this together. My 1 wish for this game, is for the sprint button to be replaced by a "strafe" button, so I can hold the strafe button to sidestep and back-peddle while shooting.

khopa22 Apr 2020, 20:07
@ismael-rodriguez
That's a really good idea for the A button ! I might experiment this, as it's true the current sprint behaviour doesn't work very well.
That's a really good idea for the A button ! I might experiment this, as it's true the current sprint behaviour doesn't work very well.

baylej22 Apr 2020, 20:15
Thanks for this game, really fun, wished I could load it on a cartridge and play it on the original hardware.
Question, the doctor in the intro, is that Prof Didier Raoult? :thinking:
Question, the doctor in the intro, is that Prof Didier Raoult? :thinking:

SoKette22 Apr 2020, 20:55
I had a craving for NES game right before the ludum dare week-end, thank you sir for that :D
It's kinda hard to give feedback on this one, since I grew up with a SNES, but not an NES, and so I don't really know what is a technical difficulty or impossibility or what is a choice imposed by the console's limitation :P
I'm definitly going to try to do something for the NES in the future !
It's kinda hard to give feedback on this one, since I grew up with a SNES, but not an NES, and so I don't really know what is a technical difficulty or impossibility or what is a choice imposed by the console's limitation :P
I'm definitly going to try to do something for the NES in the future !

khopa22 Apr 2020, 22:29
@baylej
Yes it is. :sweat_smile:
Just don't read too much into it. I needed a doctor photography, and the guy being kind of a meme, i decided to go with that. I'm surprised that he's even recognizable, as i did an awful job when trying to convert the picture to 4 color NES compatible format.
Yes it is. :sweat_smile:
Just don't read too much into it. I needed a doctor photography, and the guy being kind of a meme, i decided to go with that. I'm surprised that he's even recognizable, as i did an awful job when trying to convert the picture to 4 color NES compatible format.

khopa22 Apr 2020, 22:52
@sokette
I did not grew up with the NES either, and i totally get your point. I played most of the popular games later, but still.
I wasn't aware of most limits before i started really reading about the system and coding for it.
And now that i know a little bit more about it, i'm actually really impressed by the games that were released back then, and what developers achieved with the system.
I did not grew up with the NES either, and i totally get your point. I played most of the popular games later, but still.
I wasn't aware of most limits before i started really reading about the system and coding for it.
And now that i know a little bit more about it, i'm actually really impressed by the games that were released back then, and what developers achieved with the system.


Fractal12 May 2020, 15:48
Cool retro game, even though there isn’t that much to do, but I’m guessing it’s not easy to write a NES game! CycloaJS doesn’t seem to work on Chromium for me (I got 18 FPS or so, which was super slow, and the music was completely chopped up), but it worked with Firefox.


I played it on CycloaJS and while the sprites moved SUPER fast, because the projectiles were also so fast that they were essentially a laser beam it wasn't to hard to intercept them.