Back to front pageView on Hacker News (opens in a new tab)Show HN: I wrote my own RTS game engine in C (opens in a new tab)github.com1102 pointsby epermyakov (on Hacker News)5 years agogithub.com (opens in a new tab)GitHub - eduard-permyakov/permafrost-engine: An OpenGL RTS game engine written in CAn OpenGL RTS game engine written in C. Contribute to eduard-permyakov/permafrost-engine development by creating an account on GitHub.Comments (262) 55 threadsEarlier commentsashdev5 years ago#This is super impressive considering it's written in C. Well done and keep it up.[-]djoldman5 years ago3 replies#Quick question: all the goto fail's where fail: return false; This is just to perhaps change return false to something else in the future, correct? Else why not just return false everywhere instead of goto failnamdnay5 years ago#I think it’s to cleanly show when he is using his pseudo-exception handling system. So goto fail would be “throw”alksjdalkj5 years ago#Not sure if this is the author's reason but I find it helpful to have a single return point from functions. Much easier to follow code paths.You'll see this in some places in Linux's source too.slim5 years ago#Not op, but that's obviously in case you need to do something more complicated than returning false later. It's good practiceoptymizer5 years ago#As someone who's working on his own game engine in C, I applaud you for releasing an engine, a game and with such great code quality!Thank you for open sourcing it as well. I've already learnt a thing or two by skimming the code.hgs35 years ago#Nice project! I too am working on my own game engine in C. The language gets a reputation for being inaccessible to mere mortals, but I find it refreshingly simple.Load more commentsAll comments shown.Couldn't load more comments. Check your connection and try again.
Show HN: I wrote my own RTS game engine in C (opens in a new tab)github.com1102 pointsby epermyakov (on Hacker News)5 years ago
djoldman5 years ago3 replies#Quick question: all the goto fail's where fail: return false; This is just to perhaps change return false to something else in the future, correct? Else why not just return false everywhere instead of goto fail
namdnay5 years ago#I think it’s to cleanly show when he is using his pseudo-exception handling system. So goto fail would be “throw”
alksjdalkj5 years ago#Not sure if this is the author's reason but I find it helpful to have a single return point from functions. Much easier to follow code paths.You'll see this in some places in Linux's source too.
slim5 years ago#Not op, but that's obviously in case you need to do something more complicated than returning false later. It's good practice
optymizer5 years ago#As someone who's working on his own game engine in C, I applaud you for releasing an engine, a game and with such great code quality!Thank you for open sourcing it as well. I've already learnt a thing or two by skimming the code.
hgs35 years ago#Nice project! I too am working on my own game engine in C. The language gets a reputation for being inaccessible to mere mortals, but I find it refreshingly simple.
Comments (262) 55 threads
Earlier commentsYou'll see this in some places in Linux's source too.
Thank you for open sourcing it as well. I've already learnt a thing or two by skimming the code.
All comments shown.
Couldn't load more comments. Check your connection and try again.