Live data from Hacker News

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

github.com

41–50 of 179 posts

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

#41
post #40
post #30

Earlier quoted context omitted.

Why would RAII be especially attractive if disabling exceptions?

Probably because exceptions are the biggest source of pain with RAII.

I'd say that exceptions are the biggest source of pain if you don't have RAII.

Or, rephrased: RAII is incredibly attractive, especially when exceptions are being used.

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

#42
post #15

Earlier quoted context omitted.

Would love to hear more about the motivation for this (and other aspects of your C++ usage). I know EA wrote their own implementation of STL[1] to get around the problems that the standard implementation was causing in their game engines. Doing a 'diff' between that and a standard implementation should highlight some of the potential problems they found. [1] https://github.com/electronicarts/EASTL

What is "a standard implementation"?

The one that you get by default with your operating systems most popular C++ tool chain.

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

#43
post #26

Earlier quoted context omitted.

Is there not a point where GC overhead becomes negligible? There have been production examples of Go maintaining sub-millisecond GC pauses with a multi-GB heap under a server workload. https://twitter.com/brianhatfield/status/804355831080751104 Surely there are better reasons to disregard Go for gamedev by now.

I've dipped my toes into using OpenGL and Go a few times and it seems pretty nice. But I'm entry level graphics programming and so it scares me off to go further (surely someone would have used Go by now in a 3d game, if you can do Minecraft on the JVM, why not Go)? I keep wondering if it's not possible or if there's just not a lot of overlap between Go programmers and gamedevs? Wish someone knew.

I wouldn't predict a lot of overlap. On the game dev side, Go offers nothing new, and the forced untuneable gc will be an instant turnoff for the usual reasons. On the Go side, my outside perspective is most of its users seem to be focused on web server backends, trying to justify async everywhere, and/or rewriting slow Python or Perl or Bash scripts and assuming that makes it a systems language.

Go users interested in diving in to SDL or OpenGL bindings to make a game shouldn't be discouraged. Lots of games are made in all sorts of high level languages, the heavy lifting is put onto a few native libraries. But if the goal is to make a general engine, I'd question its utility apart from fun/learning. Again there are game engines in high level languages (with dark native-level secrets in any that try to be performant) but they don't seem to get traction. Even an engine in e.g. C++ doesn't necessarily help your performance goals (http://www.yosoygames.com.ar/wp/2013/11/on-mike-actons-revie...) if your plan is to make it general instead of make it just support whatever sorts of games you're making and planning to make.

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

#45

Wow it seems to contain a full level editor written in vala, a language I hadn't heard of. It seems to be a high level language similar to C# but with a native compiler and some different semantics (RC instead of a tracing GC for example). Is vala widely used?

Vala has been out for some time. I haven't used it since 2007 though. Vala would always come up in discussions about C# on GNU/Linux and Stallman in particular wanted no parts of C# or Mono in the operating system.

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

#46
While I find the "sane C++" approach pragmatic and practical all things considered, I'm firmly in the "time to use a better language if possible" camp.

The problem with approaches requiring extra discipline is: it's an extra mental burden to bear while programming. Also, you'll always be limited by the fact that you're working in a less pure ecosystem and will likely end up using libraries written in "not very sane C++" anyway.

We seem to have flexible compiler SDKs these days (LLVM etc.), why isn't there a strict "sane C++" or "orthodox C++" subset available as a custom language or compiler option yet?

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

#47

While I find the "sane C++" approach pragmatic and practical all things considered, I'm firmly in the "time to use a better language if possible" camp. The problem with approaches requiring extra discipline is: it's an extra mental burden to bear while programming. Also, you'll always be limited by the fact that you're working in a less pure ecosystem and will likely end up using libraries written in "not very sane C…

I guess the reason is that a combination of static analysis and code formatting does most of the same job.

But I would also love to have it as a compiler switch.

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

#48

While I find the "sane C++" approach pragmatic and practical all things considered, I'm firmly in the "time to use a better language if possible" camp. The problem with approaches requiring extra discipline is: it's an extra mental burden to bear while programming. Also, you'll always be limited by the fact that you're working in a less pure ecosystem and will likely end up using libraries written in "not very sane C…

People are working towards that objective, see for example Jonathan Blow's Jai.

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

#49
post #35

Earlier quoted context omitted.

Go is a bad choice for game with its unavoidable GC. And Rust is simply too complicated for a person wanting sane C++. D or Nim (or even C!) would make more sense.

> Go is a bad choice for game with its unavoidable GC. Better let the Unreal guys know about it then.

There's a big difference in engine support for GC of a certain object type with lots of support for tuning (https://wiki.unrealengine.com/Garbage_Collection_%26_Dynamic... and https://docs.unrealengine.com/latest/INT/Programming/UnrealA...) and language-level untuneable GC of everything.

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

#50
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…

> dynamic strings would be isolated to their own pool to avoid fragmenting the heap

Strings have arbitrary sizes. How does pooling them together reduce fragmentation? Do they always come and go in groups?

Post reply on HN