https://github.com/mrange/minesweeper2024
Minesweeper 2024
https://github.com/mrange/minesweeper2024
Last synced: about 1 year ago
JSON representation
Minesweeper 2024
- Host: GitHub
- URL: https://github.com/mrange/minesweeper2024
- Owner: mrange
- License: wtfpl
- Created: 2024-06-10T19:41:45.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-23T06:14:16.000Z (almost 2 years ago)
- Last Synced: 2025-04-02T02:09:05.274Z (about 1 year ago)
- Language: HTML
- Size: 7.82 MB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.TXT
Awesome Lists containing this project
README
# Minesweeper/2024, 2nd place in Evoke 24 interactive

## Development Notes
### Code and Optimization
The game's loader and logic are primarily written in C++, with some assembler code for byte-saving optimizations. While my initial plan was to rely heavily on assembler for further size reduction, I found that the compiler already does a decent job of minimizing code size. However, I did manage to outsmart it occasionally for additional savings.
### Audio
The music is composed using Sointu, which converts the tracks into assembly code for further size reduction. The soundtrack was composed by Virgill, a prolific artist known for creating compact yet high-quality music.
### Graphics
All graphics are handled in a single fragment shader. The game state is passed to the shader as a uniform array. This approach keeps the graphics code minimal. The shader code is further minified using FsShaderMinifier.
### Compilation and Optimization
I use a specialized linker called Crinkler to compress the code and data, stripping out any unnecessary metadata. This process can sometimes trigger false positives in virus scanners due to the lack of metadata.
Despite the small final size, the Crinkler's thorough optimization process—testing around 30,000 compression variations—results in a build time of about one minute.
### Final Optimization
Initially, the executable was around 5 KiB. Reducing it to under 4 KiB took significant effort, with most gains coming from simplifying the fragment shader. Each optimization step, often requiring hours of work, could yield just a few bytes of savings. The final push to fit everything into 4 KiB involved stripping out several graphical features.