Live data from Hacker News

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

github.com

71–80 of 179 posts

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

#71
post #61
post #49

Earlier quoted context omitted.

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.

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 allocating. I hear Go does better than Java in this regard. But if you're facing a performance issue at the level where you're fighting the GC as the biggest barrier, and the language doesn't give you much assistance (like being able to choose latency/throughput tradeoffs or controls on non-determinism), that's a sign the language isn't that suitable for that performance problem domain. With performance sensitive games, you're already in the corner of having to worry about hardware details, so there's a strong incentive to just start the fight at the beginning without your hands tied by some language's static GC.

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

#73
post #56
post #33

Earlier quoted context omitted.

Instead of using a constructor you can use a constructor method e.g.: class Foo { public: static std::optional create(); private: Foo(); };

In general if you're not using exceptions, you're not going to be using features that haven't actually been published in a formal standard (optional). This now means that you can't use any constructors, so how do you have Containers of foo?

> you're not going to be using features that haven't actually been published in a formal standard (optional).

So you then have things like:

  class Foo
  {
  public:
    static Foo* create();
    ...
  };
  ...
  Foo* foo = Foo::create()
  if ( foo != nullptr ) ...
> so how do you have Containers of foo?

std::vector

Not saying either of those are better than the alternative (I prefer using exceptions and RAII), just pointing out what I've seen in real world projects.

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

#76
post #56
post #33

Earlier quoted context omitted.

Instead of using a constructor you can use a constructor method e.g.: class Foo { public: static std::optional create(); private: Foo(); };

In general if you're not using exceptions, you're not going to be using features that haven't actually been published in a formal standard (optional). This now means that you can't use any constructors, so how do you have Containers of foo?

[deleted]

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

#78

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.

I'm really excited about this language. Here is a link where Blow live codes and explains features:

https://www.youtube.com/playlist?list=PLmV5I2fxaiCKfxMBrNsU1...

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

#79

A cross platform project in modern C++ that doesn't use CMake? Unsure if want.

It is not "modern" C++. It uses GENie, a fork of premake.

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?

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

#80

Earlier quoted context omitted.

It is not "modern" C++. It uses GENie, a fork of premake.

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.
Post reply on HN