Stealing the secrets of the NES - Agon Light Tilemaps in C

Ғылым және технология

Support the channel: ncot.uk/support
Github: github.com/ncot-tech/agon-gra...
In this video, I explore how early computers used clever tricks to create moving graphics, focusing on how Nintendo developed tile-based games on the NES. Using these techniques, I built a scrolling tilemap system for the Agon Light using C.
We start with a quick look at the evolution of game graphics, from text-based to visual, and how the NES managed to create a continuous scrolling world with tiles. Then, I demonstrate how to implement a similar tilemap system on the Agon Light, building on our previous video on bitmap graphics.
Join me as we look at the challenges and solutions of creating a smooth scrolling tilemap for the Agon Light using C programming. We'll cover everything from the basic setup to optimizing performance. If you're into programming, retro games, or the Agon Light, this video is for you.
#AgonLight #NES #Tilemaps #RetroGaming #CProgramming #GameDevelopment #ScrollingTilemaps #Programming #RetroTech #8bitGaming #Coding #NESDevelopment #TechTutorial #GameDev #RetroCoding

Пікірлер: 17

  • @ncot_tech
    @ncot_techАй бұрын

    @learnagon points out that "In 14:50 you say 27, 3 and I see putch(23); putch(7); putch(3); putch(1); putch(1); is this a typo or should it be 27, 3?" The code is correct, I said the wrong words, even though I was reading them out 🤦‍♂

  • @Roxor128
    @Roxor12823 күн бұрын

    Makes me think of the tiling engine used by Commander Keen. It writes tiles into EGA memory and uses the hardware to scroll around. The hardware can only scroll so far, so the game writes tiles to video memory just off the edge of where the screen is scrolling to, plus replacing tiles where sprites in the main screen were before drawing new sprites.

  • @MadsterV
    @MadsterVАй бұрын

    pro tip: modern 3d engines also do not draw whole tilemaps offscreen. There's a culling stage where triangles that fall outside the render viewport are discarded.

  • @vruz
    @vruzАй бұрын

    Excellent work, James! Congrats!

  • @arronshutt
    @arronshuttАй бұрын

    Nice cat shirt. Although the beard seems to be a lot shorter :) Very impressive video. I think that you should be able to do some kind of scrolling platform shooting things fairly easily. Seems odd to me that the Agon Light is not more fully featured for writing games on, but I guess it just needs more code to overcome the various issues with the demo that you put together. But, looking good for doing a proper game on :)

  • @SmashCatRandom
    @SmashCatRandomАй бұрын

    Nice video :) I've written a game engine for the old Arduino UNO 8-bit (16Mhz, 8bit, no video or audio), which drives composite output at 50fps, with split/full screen scrolling, sprites and a tile-map background with a resolution of 256x256. I've converted a couple of arcade games, including the scrolling Scramble, and the ZX Spectrum game Manic Miner to run on it (that one was a challenge as the 32K of the Arduino had to run the 48K spectrum game :) ) In my case I don't have nearly enough memory for a frame-buffer, so generate each scanline on-the-fly (AKA "racing the beam") using ASM to ensure it's cycle-perfect to match the screen refresh. The Scramble game and other demos are on my channel (flickering is just due to recording the screen with my phone - in real life they're super smooth).

  • @braveitor
    @braveitorАй бұрын

    Nice video and explanations. Those old programmers where really clever.

  • @archibaldbuttle7
    @archibaldbuttle7Ай бұрын

    hey James - another excellent video - nice work! you're right that using VDU 23,27,1... to copy an area of the screen to a bitmap will only work with 8-bit IDs - which is why there's also VDU 23,27,&21... which works with 16-bit IDs 😁 another thing - it is possible to only plot part of a bitmap. if you set a graphics viewport, then a bitmap plotted using PLOT &ED will only draw pixels within the viewport. (NB this isn't true if you use VDU 23,27,3 to draw bitmaps). just set a viewport to be just the column(s) revealed on the screen edge and then use your existing loop to plot the edge bitmaps - the underlying code in the VDP deals with the clipping and will give you a bit of a speed boost. you'd just need to remember to clear that viewport afterwards. (or use the multi-context API to swap between contexts and remove the need to set and clear the viewport, just have one context with that viewport set, and a different context for other things - it's a shorter command to change contexts 😉) for drawing things like this it can also be a good idea to switch to using pixel coordinates, rather than using OS coordinates. it makes dealing with the Agon's slightly wacky OS scaling somewhat easier. btw, if you're after more performance, vertical scrolling is much more efficient inside the VDP... and RGBA2222 format bitmap plotting in 64 colour modes is inherently the quickest... 😀

  • @ncot_tech

    @ncot_tech

    Ай бұрын

    I'll have a play with viewports and stuff at some point. A vertical scrolling shooter seems like a fun thing to try and make.

  • @MrGareth1973
    @MrGareth1973Ай бұрын

    Great video. Thank you!

  • @LearnAgon
    @LearnAgonАй бұрын

    Enjoying this new video very much, thanks 🙏 🎉

  • @LearnAgon

    @LearnAgon

    Ай бұрын

    In 14:50 you say 27, 3 and I see putch(23); putch(7); putch(3); putch(1); putch(1); is this a typo or should it be 27, 3? Gracias 🙏

  • @ncot_tech

    @ncot_tech

    Ай бұрын

    @@LearnAgon it's 23,7 I said the wrong words, the code is correct.

  • @Jackpkmn
    @Jackpkmn29 күн бұрын

    I'm hoping that you go into the whole super mario bros biggest smoke and mirrors thing is that there is no level data as we would conceptualize it. The game works like a little assembly line that constructs the whole game world on top of a endless pre-formed void right before it's rendered to the graphics buffer. And that thinking about trying to go backwards in a level in SMB creates the absurd concept of how to run an assembly line in reverse.

  • @AlexEvans1
    @AlexEvans1Ай бұрын

    I presume there is a reason why you aren't using the Agon's "hardware" sprites for your sprite.

  • @ncot_tech

    @ncot_tech

    Ай бұрын

    I need to have a play with those, although according to the docs for the Console8 firmware which I use, it says "For completely optimal graphical performance, it is usually best to avoid using sprites, and instead use the bitmap system directly. Using a small number of sprites can be a reasonable compromise." agonconsole8.github.io/agon-docs/vdp/Bitmaps-API/

  • @delphicdescant
    @delphicdescantАй бұрын

    I get a kick out of your disdain for Mario.

Келесі