HackerTrans
TopNewTrendsCommentsPastAskShowJobs

mknsri

no profile record

Submissions

Show HN: The full source code and assets for my custom game engine and game

128 points·by mknsri·3년 전·35 comments

How I made a game engine and game from (almost) scratch

hockeyslam.com
3 points·by mknsri·5년 전·0 comments

comments

mknsri
·3년 전·discuss
Thanks! I got help for the 3D models and they turned out great.
mknsri
·3년 전·discuss
Yeah I remember that Android pretty good had documentation and tutorials about the native-activity. It was not really advertised, more of "do this if you really want to" kind of feature. But it worked perfectly.
mknsri
·3년 전·discuss
Exactly! Thanks for the kind words
mknsri
·3년 전·discuss
It depends a little bit on how comfortable you are with the platform and the technologies used in the codebase. Generally speaking you would look for the entrypoint into the application.

For Hockey Slam you can look for the entrypoint in Windows:

https://github.com/Mknsri/HockeySlam/blob/main/windows/win_m...

or Android:

https://github.com/Mknsri/HockeySlam/blob/main/android/app/s...

Then start tracing through, looking at any function calls that look like they contain anything interesting. Additionally in this project you can jump straight to the entrypoints of the game code:

https://github.com/Mknsri/HockeySlam/blob/main/game/game_mai...

Or the rendering code:

https://github.com/Mknsri/HockeySlam/blob/main/ogl/ogl_main....

Another way would be to look at the files and see if anything catches your interest, for example if you want to learn about the UI system, you could look at how a button is defined:

https://github.com/Mknsri/HockeySlam/blob/main/game/imui_sys...

Fabien Sanglard has great articles on studying classic video game engines, and could be used as a guide on how to approach codebases: https://fabiensanglard.net/quake2/index.php
mknsri
·3년 전·discuss
I mentioned in a couple of places that I did use other people's file loading libraries (mainly Sean Barrett's excellent stb libs).

“If you wish to make an apple pie from scratch, you must first invent the universe” :)
mknsri
·3년 전·discuss
I could have definitely used that and I'm surprised I didn't realise it when researching how to include shader code. Luckily my setup required very little work and with my system I could share snippets between GLES and GL.
mknsri
·3년 전·discuss
Yeah the privacy policy page had an expired certificate and Google delists the app automatically when that happens.
mknsri
·3년 전·discuss
Thanks! Finishing such a large project feels great and you learn a lot when you have to implement so much you take for granted when using things other people have built
mknsri
·3년 전·discuss
Thanks, it's not the cleanest code and for example my immediate mode GUI is nowhere near IMGUI but theres still plenty to look at.
mknsri
·3년 전·discuss
You would have to write the platform code for iOS similarly to how the Android and Windows is written. The initial idea was to release it on iOS as well but at the end I didn't want to invest in buying a Mac, the license and the time to port it.

Edit: As for the release, I think it barely broke a couple of hundred downloads. I didn't do any real marketing and had no real goal of really getting the game out there as it was a learning experience for me first and foremost.
mknsri
·3년 전·discuss
True, Casey/HH was a huge inspiration and the project started from following the first few days of Handmade Hero. I should mention it.
mknsri
·3년 전·discuss
The HTTPS certificate expired on my privacy policy page and Google delists the app when that happens. After you renew they require that you resubmit the app and I didn't bother since there were barely any downloads then.
mknsri
·3년 전·discuss
I wanted to include common code for all shaders in a simple way, but I was too lazy write a proper parser. So instead I used the C++ preprocessor and macros to include things from common shader code and combine them in the build step.
mknsri
·4년 전·discuss
Yeah that works for selecting contiguous blocks of text. Multi-cursor editing allows for selecting rows that are further apart.
mknsri
·4년 전·discuss
I am aware that I could extend vim with all the missing features, but that seems error-prone and not worth the time investment, since other editors have them out-of-the-box.
mknsri
·4년 전·discuss
Oh yeah I did use "dd" and "p". They work OK, although they don't allow selecting multiple lines that don't follow each other.
mknsri
·4년 전·discuss
Yeah this is the way I tried it. I did not find as fast.
mknsri
·4년 전·discuss
I tried out vim for a month or so. I did enjoy using it, although I'm not sure if using vim just feels more productive because you press more keys to do the same thing. However multi-cursor editing and cutting whole lines in modern editors is way more conducive to my workflow and eventually stopped using vim.

Do vim users know if there was anything like Select next occurrence in vim? Feature discovery is not one of vims strong suites

EDIT: More specifically by multi-cursor editing I mean selecting multiple occurrences of a word, and then editing in place. For example selecting all occurrences of the word user -> (getUser, setUserId, variable declarations with user) and then replacing them with account. This can be done with vim but is nowhere near as fast, since every change needs to be done one-by-one. Or selecting all the above occurrences, and pasting them somewhere for an interface declaration.
mknsri
·4년 전·discuss
Care to elaborate? I've recently had to research E.164 and haven't come across this being mentioned. In fact I remember more sources claiming that the plus-sign is a required part of the format