I made the same game in Assembly, C and C++

665,998
0
Published 2022-11-12

All Comments (21)
  • @blaser80
    This reminded me of the time a colleague thought he could rewrite his C code in assembly to get more performance, what he learnt at the end was that the C compiler optimisation was much better than his assembly coding skills.
  • This makes the fact that Roller Coaster Tycoon was written in Assembly even more mind blowing.
  • @JustinMasayda
    For his next trick, he writes it in transistors and binary
  • I’m 59 and wrote my first program in an assembly type language in 1977. We are truly standing on the shoulders of giants. I am an aerospace engineer, but still need to write code to automate engineering tasks. Visual Studio is my environment of choice because it makes my job so simple.
  • Admittedly, it's been some time since I last considered programming in C a "breath of fresh air" over something else 😂
  • @Spartan322
    What makes compiler optimization so great is its not just a single bit of contributed ideas from a single person whose smart in the field of assembly, but its a collection of all the smartest techniques anyone could functionally think of to optimize your code, as a result the compiler is the culmination of every idea of almost every geniuses' demonstrably proven optimization technique, its basically the collective execution of every single engineering wizard in a singular binary who also knows exactly how to evaluate your code most efficiently almost all the time. (granted we assume all compilers do the same optimizations to low level machine code, which outside of edge cases and small processing differences that's pretty much true)
  • @saksham2091
    I was thinking about learning assembly, thank you for changing my mind
  • @jaydenm8106
    I’m taking an assembly class right now. Really makes you appreciate c++
  • @icarvs_vivit
    >Using a linked list to write a breakout clone What is it with you modern, high level 'programmers' that feel the need to shoehorn random memory structures into your programs? You can write breakout with just statically defined, bss memory - you can even use bits in a calculated grid system for the blocks to maximize cache utilization in the collision detection and make massive games that still run fine. This is the thing about assembly that many people don't seem to understand: you control exactly how complex it is; you control exactly how much useless abstraction you add to your system. It just so happens that simple solutions to simple problems are also usually much faster than complex solutions.
  • @sorry4all
    You still code assembly faster than I do in python
  • Trying to wrap my head around how confused you would have to be to implement a linked list in assembly, or why you'd implement an allocator for a small dataset with a static maximum length.
  • i just took a look at your code and for some reason the assembly one looks way cleaner and simlper than the c++ one, at least for me. congrats on the readability of the asm version
  • I’m a bit lost as to why you would need linked lists for breakout. Breakout is a game that could be handled pretty easily using only the data segment to define your static array of bricks and player tokens. Biggest pain I foresee is the gameloop, graphics, and IO but none of that should require dynamic memory.
  • @Aethelia
    He then made the same game in Unreal Engine and it was 140GB
  • @krafs6537
    As a programmer myself, I'm really impressed at your level of knowledge. Very entertaining too. Keep making videos :D
  • @4lpha0ne
    Instead of forcing the use of linked lists in assembly, I'd go for different approaches, sometimes as simple as resw.
  • Great video, this is the kind of stuff I work with daily. How come you keep implementing linked lists? Would a normal array not work fine here? Linked lists are often more trouble than they are worth because of the memory overhead in each element and it is comparatively much more computationally expensive than a typical array.