Logo

dev-resources.site

for different kinds of informations.

Practicing Low Level Programming with Games

Published at
11/5/2024
Categories
gaming
lowlevelprogramming
exapunks
Author
jeffrey04
Categories
3 categories in total
gaming
open
lowlevelprogramming
open
exapunks
open
Author
9 person written this
jeffrey04
open
Practicing Low Level Programming with Games

In my day-to-day work, I mostly communicate with computers through high-level languages. High level languages are designed such that instructions are written with a small subset of vocabulary we use in day-to-day life. For instance, we use the keyword for / while / map etc. to repeat certain operations, defining function or subroutine for repeatable tasks.

However, this is not how computer works. Few years ago, I signed up to a course explaining how computers are built. We eventually built a imaginary 8-bit CPU (but some people programmed an FPGA according to the spec) through carefully assembling logic gates (which are a series of electronic components). The CPU recognizes only 2 states, either yes or no, either through presence of electric current, or through the amount/level. Aligning them in proper order, through the input interface, will yield results in a set of yes and no on the output end.

Therefore the input is a set of yes and no, on and off arranged in very specific order, and we can eventually represent them as a series of 1 s and 0 s, which is also known as the machine code. However, while it is doable, it is not very convenient. Hence, from here we build layers of abstractions / tools to make it easier to instruct the CPU to do computations.

The first thing we built was an assembler, which is pretty much a translator to turn assembly code into machine code. The assembly code is pretty much a direct translation of machine code in a slightly more readable way. So when we say low-level programming, we usually mean either writing raw machine code, or just assembly.

Learning to code in assembly does makes me appreciate a lot of things when I code. Arguments about whether we should follow this paradigm, or that design pattern is meaningless because nothing is pure in the low level programming space.

With the new found knowledge, I eventually discovered some games that introduces low-level programming to the general public. First was Human Resource Machine, which simplifies the language into a list of commands you can drag-and-drop to the editor.


Image credit Tomorrow Corporation

Going through the game was a fun experience, it reminded me a lot of the times I struggle with the nand2tetris course I mentioned previously. Then a few years later, I saw another game, and got into it out of curiosity.


Image credit Zachtronics

Exapunks sets the game in a cyberpunk world where a disease slowly turns human beings into computers. In some of the puzzles, one can even fix oneself through the computing interface exposed and link it to a computer.

One proceeds the game through solving the programming puzzles presented. Sometimes the game requires to read a file, and write it to a register elsewhere, scan for some information scattered across the network, send it back and write to some register etc. The challenge is that the number of available commands and even the number of registers are limited. No more spamming endless list of variables to hold intermediate computed values.

How does that benefit one’s programming skills? It probably doesn’t, in the end, like other programming challenges, the thought process matters. The written code, is just a mean to represent our thought process. On the other hand, knowing how values are being computed in the hardware, helps when you learn some languages, for instance Rust and the ways they ensure memory safety.

Meanwhile I do have a life-streaming archive of solving the puzzles. While I do not talk much, it may serve as a reference to the future posts.

gaming Article's
30 articles in total
Favicon
Discover the Unexpected with 7.bet
Favicon
Cowboy Casino Major Update
Favicon
Generative AI in Gaming: The Future of Game Development
Favicon
Tiranga Game Download: Your Ultimate Guide to Enjoying the Online Game
Favicon
Ray Browser - The only browser built for gaming
Favicon
Fortnite dev
Favicon
10. Minecraft for PC’de hesap nasıl oluşturulur?
Favicon
"Free Kirin Game - Claim Your $150 Adventure Bonus!"
Favicon
Hititbet Casino 2024 - Hititbet Login New Login Address Current Hititbet
Favicon
Cowboy Casino
Favicon
Panduan Menarik dan Informatif Tentang Slot Online: Hiburan Digital yang Semakin Populer
Favicon
Ok Win: A Premier Destination for Online Gaming
Favicon
Implementing breadth-first search in low-level setting
Favicon
optifast. A Pc Optimization Software for everyone !
Favicon
Tiranga: Your Ultimate Destination for Online Casino Games
Favicon
Discover Pokémon TCG Pocket: Your Ultimate Card Game Experience
Favicon
Practicing Low Level Programming with Games
Favicon
Cowboy Casino Major Update
Favicon
Best Practices for Gaming SEO: The Do's and Don'ts
Favicon
遊戲巔峰:YYGame 打造次世代娛樂王國
Favicon
A New Word Puzzle Game
Favicon
Gaming SEO: The Importance of Gaming Websites in Increasing Visibility
Favicon
How to Find the Best Online Cricket ID for Seamless Betting
Favicon
How GameNGen Transforms Your Gaming Experience with AI-Driven Dynamic Worlds
Favicon
Playdate Review
Favicon
Top 10 4K Monitors for Gamers in 2024
Favicon
Gaming DApps: The Future of Decentralized Gaming
Favicon
PcGameLab
Favicon
PcGameGirl
Favicon
There’s a magic to Game Mechanics In Video Games

Featured ones: