Live data from Hacker News

Show HN: Crown – A flexible game engine written from scratch in C++

github.com

81–90 of 179 posts

Re: Show HN: Crown – A flexible game engine written from scratch in C++

#81
post #71
post #61

Earlier quoted context omitted.

Not all language-level GCs are untuneable . Also if one doesn't allocate like crazy on the heap, there is no reason the GC needs to work.

I agree, but the GP comment was in the context of Go. Nim is a newer option I'd like to see tried more, its GC is optional and swappable. If you never run out of memory you'll also never need to GC. ;) Or even free(), just let the program finish and reset the machine. (Actually not too weird in some embedded systems...) Some languages make it easier to not heap allocate than others, or notice when you are heap alloca…

Not all games need to be the next Crysis.

If fact, the majority of them gets abandoned even before memory pressure starts to be a relevant issue.

Even if Go isn't at the same level of D or Modula-3 in regards to memory management (heap, stack, global), it is already quite usable for many types of games.

Re: Show HN: Crown – A flexible game engine written from scratch in C++

#82

Earlier quoted context omitted.

Huh. Okay, that was not immediately apparent from viewing the project— it looked like a hand-written Makefile. Link for the curious: https://github.com/bkaradzic/GENie Appreciating that CMake has its warts, it also has a ton of mindshare and has lots of convenient modules for handling common dependencies. What are the motivations to use a Lua-based scheme instead?

I find GENie/premake way simpler to read and write. Also, you have more flexibility since your build scripts have full-fledged Lua capabilities.

Yeah, similar sentiments in the PPT presentation here: https://onedrive.live.com/view.aspx?cid=171ee76e679935c8&pag...

CMake is "too complicated" and "you need to be an expert". Understandable, I suppose. There are certainly specific things in CMake which are pretty terrible, like the add_custom_command/add_custom_target dance, but from the perspective of someone who has had to become an expert in it (via ROS/catkin), I would be unlikely to give it up. There's just way too much stuff it gives you for free, especially when it comes to things like packaging, testing, etc.

Re: Show HN: Crown – A flexible game engine written from scratch in C++

#83

If you come to finance, most of the developers love premature templatization, it makes them feel like they know something. Not sure it that can be attributed to their insecurity about C++ coding skills, but it gets really ridiculous at times.

What's wrong with using templates vigorously?

Re: Show HN: Crown – A flexible game engine written from scratch in C++

#84

Earlier quoted context omitted.

Huh. Okay, that was not immediately apparent from viewing the project— it looked like a hand-written Makefile. Link for the curious: https://github.com/bkaradzic/GENie Appreciating that CMake has its warts, it also has a ton of mindshare and has lots of convenient modules for handling common dependencies. What are the motivations to use a Lua-based scheme instead?

I find GENie/premake way simpler to read and write. Also, you have more flexibility since your build scripts have full-fledged Lua capabilities.

Okay, the other thing I would say having examined this a bit is that GENie seems to be much more "project" oriented than CMake. CMake has a concept of projects, but its usual model centers around targets and directories as the main unit to reason about. That is, CMake's most native output format is a Makefile, with adapters to generate IDE projects.

GENie seems to be focused first and foremost on a project/solution-oriented IDE workflow, with the Makefile generator as the one that's tacked on. So I can definitely appreciate that if you're working on a project where everyone's in an IDE anyway, it would make sense to use a generator that has the IDE's concepts as a first class citizen.

Re: Show HN: Crown – A flexible game engine written from scratch in C++

#85
post #8

It's a lost cause: there's no such thing as "sane" or "orthodox" C++. Instead, use something actually sane like Go. Or Rust, if you really must (first bad pun is free, then it's 50 cents each).

Fabien Sanglard and John Carmack definitely disagree with you on this regard: http://fabiensanglard.net/doom3/index.php http://fabiensanglard.net/doom3/interviews.php#qc++

[deleted]

Re: Show HN: Crown – A flexible game engine written from scratch in C++

#86
post #83

If you come to finance, most of the developers love premature templatization, it makes them feel like they know something. Not sure it that can be attributed to their insecurity about C++ coding skills, but it gets really ridiculous at times.

What's wrong with using templates vigorously?

Well, let me give you an example that I have seen recently. There was this function that suppose to convert numeric value to string. So numeric type was templatized. Then with combination of enable_if and static_asserts there were checks to avoid doubles/floats negative numbers. So whats there left besides unsigned integers?

Re: Show HN: Crown – A flexible game engine written from scratch in C++

#87
post #81
post #71

Earlier quoted context omitted.

I agree, but the GP comment was in the context of Go. Nim is a newer option I'd like to see tried more, its GC is optional and swappable. If you never run out of memory you'll also never need to GC. ;) Or even free(), just let the program finish and reset the machine. (Actually not too weird in some embedded systems...) Some languages make it easier to not heap allocate than others, or notice when you are heap alloca…

Not all games need to be the next Crysis. If fact, the majority of them gets abandoned even before memory pressure starts to be a relevant issue. Even if Go isn't at the same level of D or Modula-3 in regards to memory management (heap, stack, global), it is already quite usable for many types of games.

Yeah, at some point it doesn't matter what language if the game is just game logic on a standard input and output layer that are already fast. Even high end engines like CryEngine often include a scripting layer in some higher level language like Lua that probably has GC, because it's nice to have for game logic that doesn't have the same constraints as other parts of the game. (http://docs.cryengine.com/display/SDKDOC4/Lua+Scripting)

As I mentioned in another comment a lot of fun games have been made in all sorts of languages. That doesn't really make any of them suitable for games though, and you'll still find far fewer examples of game engines in GC languages.

Re: Show HN: Crown – A flexible game engine written from scratch in C++

#88
post #69

Earlier quoted context omitted.

sane like Go Yet Go uses the oh-so-error-prone return value error checking that has been so successful in C :/

Disclaimer: Not a go apologist, I admire it, but don't use it. With Go you get a compiler error if you don't do something with that error. You have to explicitly decide to ignore it with `_`. As far as I remember that's quite different from C where you can get an error code, ignore it, and never realize you've missed it.

Not quite. Try this:

    import "os"

    func main() {
	    os.Open("this file does not exist")
    }
This will compile just fine, producing no compiler error or warnings whatsoever. The error is just silently ignored.

Compare to Rust:

    use std::fs::File;

    fn main() {
        File::open("this file does not exist");
    }
This will produce the following warning:

    warning: unused result which must be used
      --> test.rs:14:5
       |
    14 |     File::open("this file does not exist");
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       |
       = note: #[warn(unused_must_use)] on by default
This example is a bit contrived, because if you open a file you probably want to do something with it. But imagine something where the only return value you care about is the error, like say "txn.commit()"

Re: Show HN: Crown – A flexible game engine written from scratch in C++

#89
post #87
post #81

Earlier quoted context omitted.

Not all games need to be the next Crysis. If fact, the majority of them gets abandoned even before memory pressure starts to be a relevant issue. Even if Go isn't at the same level of D or Modula-3 in regards to memory management (heap, stack, global), it is already quite usable for many types of games.

Yeah, at some point it doesn't matter what language if the game is just game logic on a standard input and output layer that are already fast. Even high end engines like CryEngine often include a scripting layer in some higher level language like Lua that probably has GC, because it's nice to have for game logic that doesn't have the same constraints as other parts of the game. ( http://docs.cryengine.com/display/SDK…

Actually, I am old enough to have heard the same kind of argumentation against adoption of C, Turbo Pascal and C++ for game development, depending when I heard it (80's, 90's, early 2000's), because how we do it today is the only way possible.

Game developers have a tendency to only update their tools when OS or console vendors force them to do so.

Re: Show HN: Crown – A flexible game engine written from scratch in C++

#90
post #2

Interesting! I'd be interested in better understanding the motivation behind Orthodox C++. In particular, you seem to dump most of the C++ standard library: "Don't use anything from STL that allocates memory, unless you don't care about memory management." I now mostly avoid templatization in my own code unless there's a really good reason. But the standard library often lets me avoid explicit memory allocation. Woul…

Generally speaking many C++ game engines avoid the STL stuff and reimplement their own more predictable containers, often with custom allocation schemes. The engine at the last game company i worked at, for example, had its own containers and memory allocator and allowed you to define the allocation category and pool per allocator and per object class (so, e.g., dynamic strings would be isolated to their own pool to…

I felt the same way dipping my toes in C++ for a few years. C99 is definitely my preferred language. But when in Rome...
Post reply on HN