3 ms·
Lookup tables are the only reason I was able to get this effect working at all: https://twitter.com/zeta0134/status/1756988843851383181 https://twitter.com/zet
by zeta0134 3y ago
Lookup tables are the only reason I was able to get this effect working at all:
https://twitter.com/zeta0134/status/1756988843851383181 https://twitter.com/zeta0134/status/1756988843851383181
The clever bit is that it's two lookup tables here: the big one stores the lighting details for a circle with a configurable radius around the player (that's one full lookup table per radius), but the second one is a pseudo-random ordering for the background rows. I only have time to actually update 1/20th of the screen each time the torchlight routine is called, but by randomizing the order a little bit, I can give it a sortof "soft edge" and hide the raster scan that you'd otherwise see. I use a table because the random order is a grab bag (to ensure rows aren't starved of updates) and that bit is too slow to calculate in realtime.
- sourthyme 3y agoThe 1/20 update works well because it gives the illusion of tiles popping into view naturally as the lamp moves. This is a cool effect to get away with.
- ecshafer 3y agoThat looks pretty awesome, and the graphics are way better than any NES game I can remember, it looks more like an SNES level graphics. Since you are running on an emulator there, does the emulator lock you to NES level performance?
- zeta0134 3y agoYes, though full disclaimer, the cartridge is a tiny bit more powerful than your average NES game, and that is definitely contributing. The capabilities of the cartridge I'm using are something like Nintendo's MMC5 (used for Castlevania 3) but with a slightly more useful ExRAM implementation. The main benefit for this effect is that I can write to the nametable outside of vblank, and that helps with the double-buffer setup. The NES CPU isn't fast enough to process all of the enemies at once, so I batch the changes over time, and then present the updated board when the musical beat advances. This should run on real hardware, I'm just waiting on a dev board from my cart supplier before I'll be able to test that properly. Mesen is what I use in the meantime. It is pretty darn accurate, and I haven't overclocked it or cheated any of the console's constraints away.
- crtasm 3y agoWhere's good to follow for news of a release? Patreon? I don't twitter.
- nicole_express 3y agoVery nice work! Definitely looks way better than the contemporary NES attempts at doing it (thinking of MMC1 Ultima Exodus here)
- rightbyte 3y agoHeh, cool. I always find it fascinating how games for the same console could get so much prettier as people learned to code for them. E.g. Mario 1 and 3 or the two Zeldas for N64.
- eurekin 3y agoAlso, 2d games have one significant advantage over many 3d titles: you are not burdened with extra "camera operator" task so much
- trealira 3y agoThat looks like a pretty cool game! Were you inspired by Crypt of the Necrodancer? That's one of my favorite games. I was thinking about whether an NES (or another older console) would have been able to handle a game with those mechanics if they had been invented back then (and if so, to what extent), and it looks like you're proving it possible.
- a1369209993 3y ago> I use a table because the random order is a grab bag (to ensure rows aren't starved of updates) I think the search keyword for this is "quasirandom", FWIW.
- JohnBooty 3y agoWow! Impressive! At first I thought it was just pretty cool. And then I saw you're doing it on a NES game. Bravo.