Tilemap Game Engine Development - Agon Light C Programming

  Рет қаралды 6,817

NCOT Technology

NCOT Technology

Күн бұрын

In this video, I took the next step in my game development for the Agon Light by building a tilemap system and integrating it with the existing physics engine from the previous video. The tilemap, a classic way to structure game levels, includes solid tiles that interact with game sprites. While detecting collisions with tiles is usually straightforward, incorporating a physics engine made things more complex.
I decided to let the sprite system handle everything-deciding when to call the physics code or resolve collisions with the tilemap. After a few false starts and bugs, I managed to get everything working smoothly. To speed up the process, I used Tiled for map creation and wrote custom Python code to convert its output into a format my game engine could use.
Testing on hardware revealed some critical bugs and performance issues, which I tackled by implementing dirty rectangle optimization. In the end, I had a functional, efficient sprite system with physics and tilemap integration, setting the foundation for designing and building the actual game. There's still plenty of work ahead, but the core of the engine is now in place.
Find me Online
==============
ncot.uk
Support The Channel!
====================
Thanks a lot for watching this video! If you're not a subscriber, consider becoming one!
If you want to support what I do, consider the links below.
paypal.me/NCOT...
ko-fi.com/ncot...
liberapay.com/...
patreon.com/ncot_tech
Hashtag Soup
============
#programming #agonlight #cprogramming #retrocomputer #linux #gamedev #c

Пікірлер: 61
@klever-kenneth
@klever-kenneth 3 ай бұрын
"We don't call these problems, we call them design constraints" That cracked me up.
@venizz5112
@venizz5112 3 ай бұрын
I'm watching your videos because I love "low" level programming languages and game dev. I've tried to get into game dev multiple times with Unity and failed. I think it was because I felt like I was learning Unity too much, and not feeling like I could get much coding done. I saw your first episode of this series, and it 100% made me realize I could just code a game in C++. Huge props for your videos for inspiring me to attempt game dev in C++.
@mathiaspampus813
@mathiaspampus813 2 ай бұрын
I started doing this sort of stuff when I got my first own PC in 2001. My brother provided me with a pirated Turbo Pascal package, and that got me hooked 😃 It was a bit of a surprise when in 2008 he learned that I was still using TP, so he suggested I learn a more modern language like Ruby, which I did. From there I went on with Arduno, Processing, now also doing electroinics, then Python and C# and OpenGL (like 20 years late, but whatever). What ever I did, I kept reinventing the wheel, writing my own units/modules/libraries for loads of readily available things, just to learn about them. Programming computer graphics has taught me more about physics and math than highschool ever could. So, what I mean to say is, I totaly see the appeal of this project, and I enjoy watching you take it on. You're a very pleasant person to watch 🙂
@SuperEndeg
@SuperEndeg 3 ай бұрын
Don't you dare calling your fashion sense questionable! This shirt is amazing!
@CasualInventor
@CasualInventor 3 ай бұрын
I used to do a bit of amateur game development back in the day (probably more than 15 years ago). I like this kind of content and the way you present it. The thumbnails are quite eye-catching too, possibly the best use of AI I've seen really. Also the shirts are spectacular.
@stephenelliott7071
@stephenelliott7071 3 ай бұрын
I love these types of video. Coding for a limited system and making something interesting happen without the use of an off the shelf game engine.
@AndrewBorrill1
@AndrewBorrill1 3 ай бұрын
Nice to see your code examples, it may help the viewers if you add in some extra comments to explain what small blocks of code do, you know what the code does but viewers may not find it easy to decipher. I have been programming since I was at school and I'm now 65! My first experience of assembler programming was on a Science of Cambridge Mk 14. It was a small single board computer with a small led display and a hex input keyboard. Programs had to be loaded into memory, by hand, each time you switched it on! You had two work out the assembler you needed on sheets of paper and then allocate the appropriate hex values to match the assembler mnemonics. Then type them in through the hex keyboard and finally run the program. A very small program could take hours to hand assemble and enter. Pure torture! But back in those days very exciting. Your game task is very interesting so I am looking forward to the next installment.
@diegofloor
@diegofloor 3 ай бұрын
I love low level programming. I was working on a megadrive game a while ago. Also, you are very entertaining to watch. Half the time I don't know if you have an amazing dead pan humor or you're just unintentionally funny. Regardless, it's a lot of fun!
@jirihoogeveen3775
@jirihoogeveen3775 3 ай бұрын
I'm watching this kinds of video's to see how other developers work and think. And dreaming of creating a big game one day. But I'm guessing, that that will take another 20 years :)
@paulabery771
@paulabery771 3 ай бұрын
Love this series, started to follow along myself.
@mickre-fuses
@mickre-fuses 3 ай бұрын
I thought I'd comment to help the algorithm. I love your style (video format not shirt. 😁😁) . I would seriously consider the Usagi Electric format of a few different projects on the go and rotate. Usagi is one of my favourite channels and you're not far behind. 😉
@AndyH2O
@AndyH2O 3 ай бұрын
You asked. I will answer. I'm watching because it is interesting to see the development process, warts and all, it is fascinating to get an insight into it. I used to do a bit of C++ and other programming but nothing to any great end, but if I ever decide to return to doing that, rather than my other projects, this provides (and will provide) inspiration. Thanks for the interesting videos.
@baxterdevin
@baxterdevin 3 ай бұрын
I tried doing something like this when I first learned C and it was overwhelming. Now that I'm experienced enough it's fascinating following along the process. Ignore the Python haters, it's a great language to build data tools with. They are just jealous you are so competent in multiple languages. I'm building my own 2D game in GameMaker Studio and these videos are also a real motivation to sit down and write my own code instead of clicking on the other random stuff suggested on the side of this video.
@johnhaugabook
@johnhaugabook 3 ай бұрын
Watching because - overall process is interesting, good fun facts here and there, and; oh - I saw something shiny and got distracted.
@arronshutt
@arronshutt 3 ай бұрын
I like the idea of you writing DOS based gaming stuff, and having people shouting at you to fix things..is also engagement!. Also doing stuff on the Raspberry PI, expecially if it's unusual stuff on the Rasberry PI rather than the usual turning on a LED etc. I think I spotted your deliberate mistake in the code. I'll send you my internet driving licence so you can endorse it with my 100 internet points and you can advise me on the monetary fines that have to be paid and what mandated video punishment I need to sit though to atone for my careless observation that allowed me to fall into your trap there ...! ;)
@sofandr
@sofandr 3 ай бұрын
Awesome video, programming is always fun, thanks and good luck)
@oilovcloves63
@oilovcloves63 3 ай бұрын
Inspiring stuff, must get my Agon Light 2 setup again and try some of this stuff. Many Thanks
@Reveletur
@Reveletur 3 ай бұрын
I like watching for aspirational reasons.
@charlesdorval394
@charlesdorval394 3 ай бұрын
Thank you for not making "One of those videos" ! And I have to agree, I've been messing with C strings for a while on my current project, it's ... something.
@kevinpeno
@kevinpeno 3 ай бұрын
I'm just here for the shits and giggles, learning something new comes second but is certainly part of the experience. Really though, I'm here because its not a typical "gamedev" series and the way you're willing and able to talk to me like I'm there pair programming with you, bouncing ideas off each other and coming up with a solution. Since I can't speak back realtime, I suppose I'm the rubber ducky in this relationship. 🦆🦆
@kevinpeno
@kevinpeno 3 ай бұрын
About your flash drive. Does the Agon support network drives for booting or loading an HDD? You should then be able to connect via eth between the two (crossovers are usually not needed anymore these days) if you want to keep it off the main network. You may also have some luck connecting via USB-C if the Agon supports thunderbolt 3 or some other protocol that allows for USB-C negotiation.
@LakeEola
@LakeEola 3 ай бұрын
This is an amazing effort. Well done. Use the right tool for the right job, I agree with you completely. This is not the project to do in assembler. Adding python in where it makes sense is a perfect choice. Python is well equipped for handling data and XML is data. I love 6502 assembler by the way, was my first language. This is quite the labor of love. Good for you. Don't listen to any naysayers 👍🏼
@grumble2009
@grumble2009 3 ай бұрын
Great to see the game coming along, but sadly I've no Agon light (yet) to follow along with. Looking forward to some x86 / vga assembly stuff that i can play with in Virtual Box :) Thanks for the videos!
@Netherilt
@Netherilt 3 ай бұрын
Nice shirt, bro! Love your tutorials!
@jamesfloyd6693
@jamesfloyd6693 3 ай бұрын
I love your fashion sense sir.
@natah_the_ninja6121
@natah_the_ninja6121 3 ай бұрын
I watch these videos, because I’m a nerd who collects old tech, and I want to make it more fun
@RockTo11
@RockTo11 3 ай бұрын
I like your tile data type, BTW. It reminds me of Photoshop .atn files. Great that you're using a specified length for the name string, rather than relying on NULL character termination.
@TSteffi
@TSteffi 3 ай бұрын
Just so you know: The eZ80 does actually execute normal bog standard Z80 code just fine. I have my own eZ80 board here, and have written a complete CP/M 3 BIOS on it, all using the original ZMAC macro assembler running on CP/M. You can treat the eZ80 as just a very fast Z80 from a software perspective, and it works perfectly fine. The only differences are in the bus timings and hardware IO. But even the hardware dependent things can be handled in Z80 assembly using a vintage Z80 assembler. Yes, the eZ80 has some advanced addressing modes and stuff, but you don't have to use them. In fact there are only two places in my code, from the boot ROM to the A:> prompt, that use eZ80 instructions: That is one LDIR in 24 bit mode right at the start, to copy the ROM code to RAM, and the MLT (multiply) instruction in a subroutine.
@UnderArea51
@UnderArea51 3 ай бұрын
LOVE this idea! 🎉
@flamingo2946
@flamingo2946 3 ай бұрын
I watch these videos because I like to pretend I understand what low level programming is. Or programming in general, really. I'd like to see you doing that DOS 3D thing you were talking about. It would give me nostalgia, I think
@micaiahstevens8840
@micaiahstevens8840 3 ай бұрын
SOO you asked why we are here. I have no interest in the Agon; except it's an interesting platform to see you work on. I am here for the C, although I use C# as my go to language. (Didn't even know how to spell Agon.) Although some Pi and other things MIGHT be fun to mess around with personally. I love your style and comments very umm nice explanations a lot of the time. I imagine, and NOT sure I would do it, but I made a Zelda clone on basic, back in the day. Maybe I should revisit that. IF I had the time, money to do it. I always wanted to do a Text based game again. I have a small one in C# core, should revisit that. Then you got to build all the tools to even make a game hehe. I would suggest next time you're doing the Agon hardware. If you could show your debug screen. I imagine it still refreshes weird as it clears the screen each frame. You might put in a second or two of delay to let your eyes adjust while it goes to a low flicker. Some tinkering might get it to a reasonable state. I would be interested in a one-off tutorial, for your basic setup, for python, agon and c setup. Getting a working platform is always the REAL challenge for me. I mean a step-by-step guide. You explained your sprite and tools, but missing some of the connection bits. (AND if you take on a new challenge, seeing a tutorial for that would rock.) SUCH as I have an arcade machine that does blah. I need to take the C to a rom module and install it in the cabinet like this. (As an outrageous example.) Keep up the great work. I am not suggesting PI but would be interested in whatever you had in mind.
@signal2_
@signal2_ 3 ай бұрын
There's another channel called "Memelvar" here on KZbin, who's making an NES game in assembly, in case you're curious. I also tried programming for the Sega Genesis, and I can totally understand the pain of little documentation for these old machines. I didn't get much farther than some flashing colors on my attempt, lol.
@Fuzzwah
@Fuzzwah 3 ай бұрын
20:10 I came to watch some C code, stayed for the shirt
@RockTo11
@RockTo11 3 ай бұрын
Have you considered using an integer mask for the direction, so you can support multiple directions simultaneously? This can also reduce the number of CPU instructions for querying, thus saving memory. Additionally, using bit logic might save some additional cycles. Something like this (move_player function): typedef struct Direction { DIR_NONE 0x0 DIR_LEFT 0x1 DIR_RIGHT 0x1 move_amount.x += (dir & DIR_LEFT) + (dir & DIR_RIGHT); player->move_amount.y += (dir & DIR_UP) + (dir & DIR_DOWN); } ...of course, you can also pass in an easing curve. Perhaps sinusoidal or quartic ... Another bonus is that as you update code and add or remove features which touch the mask code, it won't break and you won't introduce a difficult to find bug.... since it is just "ANDing" and "ORing: values. If you don't handle a case, it will still work. If you handle a case for something which was removed, it will still work. I think the only time you'd need to be vigilant is if you replace a mask definition with something totally different... i.e replace DIR_RIGHT = 0x1
@peterdidow3228
@peterdidow3228 3 ай бұрын
Coding with hardware limitations is fun! I have a version of asteroids running on an 32x24 LED matrix, Red ONLY and it looks terrible! Terribly fun to code though. Written in python. Also, TILED is a great tool for game dev. I've used it on other projects
@warrenbullock3165
@warrenbullock3165 3 ай бұрын
Great videos, if you also include bare metal raspberry pi programming I’m watching that too.
@RockTo11
@RockTo11 3 ай бұрын
As far as handling errors, such as file loading and parsing... a way to get around quitting is to have no errors. What I mean by that isn't that your code will be perfect and never encounter an unavoidable issue.... but I mean, make zeroed data a valid result for anything which then just takes another path through your code, just like anything else in the program. So, when a file cannot be found, the zero result would result in calling a function to display an error message on the screen.
@bitinsistencia4649
@bitinsistencia4649 3 ай бұрын
I hug from Brazil!
@elTurBoss
@elTurBoss 3 ай бұрын
I like the z88dk dev kit :)
@RockTo11
@RockTo11 3 ай бұрын
I apologize if I am writing too many comments. Re: memory. Rather than using malloc and free, how about allocating all free memory as a single thing, and then using bump allocation within that? Removing or resizing blocks can optionally call a coalising function to defragment the memory. This can easily automatically avoid memory errors such as leaks and use of freed mem. Thus as the game becomes more complex, you won't have to think about memory.
@ncot_tech
@ncot_tech 3 ай бұрын
I was thinking about doing my own memory allocation, I couldn't decide whether it was a good idea or just an excuse to get lost on a side quest. I still might do it though since it sounds like an interesting problem to solve.
@edgarmatzinger9742
@edgarmatzinger9742 3 ай бұрын
Nice video! I noticed your IDE/font combines characters. Personally I find _!=_ more readable than *≠* Or _->_ instead of *→* But, each his or her own.
@ncot_tech
@ncot_tech 3 ай бұрын
No I'm with you on that, the code is actually done in a website that turns code into pretty formatted images, and I noticed it'd done strange things to the characters too. I'll switch the font for the next one, it was annoying me too!
@DefaultFlame
@DefaultFlame Ай бұрын
3:10 System Shock. You are describing System Shock.
@TheDarkelvenangel
@TheDarkelvenangel 3 ай бұрын
I'm watching your video because I'm interested in how you are making this game on a limited system. I'm building my own limited system so this is very interesting for me.
@spounka
@spounka 3 ай бұрын
A great video! Questions I have: - You did notice that your tilemap was slow, but how did you know "Why" it was slow? I find the investigation of such things interesting - You did mention that you're using dimensions as a physics, while it does work, why haven't you for example baked the collisions into convex shapes and just load them with your engine, now I know doing it with the console real-time is slow, but your levels are static, so why not writing a python script for it? it seems way more robust to me as even with bullets and such, these won't be an issue
@kalpi_plays
@kalpi_plays 3 ай бұрын
I found your videos when i was looking at the rc2014; really liked your presentation style so I stuck around. Have you considered a neo6502 for when you are ready to jump into asm; similar product to the agon but has a real 6502 instead of a ez80 microcontroller larping as a cpu
@jonwest776
@jonwest776 3 ай бұрын
Just a thought. Make your rooms different sizes.
@Seb00lean
@Seb00lean 3 ай бұрын
Awesome series! But I’m guessing I got in at a later video. Which part is this in the series?
@ncot_tech
@ncot_tech 3 ай бұрын
@@Seb00lean this is part 3, if you look in my channel you'll see the other videos 😀
@CasualInventor
@CasualInventor 3 ай бұрын
@@ncot_tech I think these videos would benefit from having the episode number in the title text (e.g. "#3") so people don't accidentally watch them in the wrong order. Also I think it would be good to have them in a dedicated playlist so we can binge them in an afternoon with a bucket of popcorn :)
@syntaxed2
@syntaxed2 3 ай бұрын
You can just check if player is colliding with a wall type tile just before the physics runs and if so disable physics?
@Saboteur709
@Saboteur709 3 ай бұрын
Low level coding, game programming, fashion influencer, and very funny. What's not to love?
@SilasTheSilent
@SilasTheSilent 3 ай бұрын
Youre cool man
@RockTo11
@RockTo11 3 ай бұрын
Why do I watch these videos?.... because the vast majority of indy games use or make an entire game engine. Most of these games are so simple, that they would be far better off just writing the game code to do what it needs. Using generic code makes everything more complex. Sure, sometimes it is easier to get up-and-running, quicky, but later on the progress of development will crawl due to complex and state-resulted bug fixing, getting around dependencies not quite doing the right things, and optimization issues. So, I think you're going the right way, whether targeting a Z80 or a Threadripper.
@dziuaftermidnight
@dziuaftermidnight 3 ай бұрын
where can i buy your shirt?
@ncot_tech
@ncot_tech 3 ай бұрын
@@dziuaftermidnight I think they came from somewhere like Shein.
@UnderArea51
@UnderArea51 2 ай бұрын
QUESTION: can you demonstrate the process of this game’s game design doc, prior to writing code? You do deliver it verbally but I have noticed the most missing piece of almost every tutorial- throughout KZbin, is showing how to first walk through steps, of writing the program design - the so called rough draft.
Writing a game the hard way - from scratch using C. #1
34:20
NCOT Technology
Рет қаралды 202 М.
Sinclair BASIC vs BBC BASIC - How to fit an entire devkit inside 64K
22:01
Thank you mommy 😊💝 #shorts
0:24
5-Minute Crafts HOUSE
Рет қаралды 33 МЛН
УНО Реверс в Амонг Ас : игра на выбывание
0:19
Фани Хани
Рет қаралды 1,3 МЛН
ВЛОГ ДИАНА В ТУРЦИИ
1:31:22
Lady Diana VLOG
Рет қаралды 1,2 МЛН
Andro, ELMAN, TONI, MONA - Зари (Official Music Video)
2:50
RAAVA MUSIC
Рет қаралды 2 МЛН
Programming Windows Screensavers - Agon Light Graphics Programming
37:49
Stealing the secrets of the NES - Agon Light Tilemaps in C
18:56
NCOT Technology
Рет қаралды 3 М.
How I put a game on Steam with a custom engine in 2 months
24:21
prophet goddess
Рет қаралды 2,7 М.
The Insane Engineering of the Gameboy
17:49
Real Engineering
Рет қаралды 2,2 МЛН
The Dark Art of Programming - Writing Cursed Code
13:12
NCOT Technology
Рет қаралды 2,9 М.
Better Than the Arcade 2
39:26
Game Sack
Рет қаралды 110 М.
I built my own 3D Game Engine with Open-Source Tools
15:00
Modern Vintage Gamer
Рет қаралды 120 М.
Coding Adventure: Rendering Fluids
58:41
Sebastian Lague
Рет қаралды 618 М.
Agon Light 2 - C Programming, Better Keyboard Routines, Joystick Ports
35:36
The Closest We’ve Come to a Theory of Everything
32:44
Veritasium
Рет қаралды 9 МЛН
Thank you mommy 😊💝 #shorts
0:24
5-Minute Crafts HOUSE
Рет қаралды 33 МЛН