HN user

eigenbom

674 karma
Posts18
Comments97
View on HN

From their GitHub page: "ChaiScript is one of the only embedded scripting language designed from the ground up to directly target C++ and take advantage of modern C++ development techniques, working with the developer how they would expect it to work. Being a native C++ application, it has some advantages over existing embedded scripting languages:

It uses a header-only approach, which makes it easy to integrate with existing projects.

It maintains type safety between your C++ application and the user scripts.

It supports a variety of C++ techniques including callbacks, overloaded functions, class methods, and stl containers."

The joy of max() 8 years ago

In libcxx it's a few lines. Unless you also count the overloads for initialiser_list etc.

I'm excited by this feature, along with all the other compile-time programming stuff (reflection, concepts). The downside I see is having to remember how a metatype works.. e.g., the default access type for member variables of struct, class, interface, value, .. and on and on. But if we keep the number of metatypes low, this may manageable.

I'm a dad 9 years ago

Took a few rounds but the Angels were in on this one.. ;)

I'm a dad 9 years ago

I think she triggered an interrupt in my brain and now I'm running a deep hidden subroutine..

You could definitely make them full entities, it would depend on your use case. If you're making a bullet hell shooter then maybe bullets need to be handled as a special case. Either way best not to get caught up in ideology or finding a perfect architecture, just do what works for you and your game.

It's a problem, but I'm not sure it's a big enough problem to seek out an alternative architecture altogether.

Bullets probably would be simple structs in a shooty game, not full blown entities.

The next step beyond that simple approach is to store the components outside the entity. E.g. using SoA that Jon's new language has support for.

In my game (http://moonman.io) i use an approach similar to that in the bitsquid engine, with static polymorphism and crtp and other nonsense. It works but i admit is probably overkill.

Have you written about this in more detail Jon? I'd love to read about it.

I'm not sure if there's an explicit definition somewhere, but i think an ECS could be as simple as an entity struct that contains an (optional) physics struct, that is then operated on by some physics module.

I think there's a distinction between prototypes of parts of the game and the full game.

I remember Carmack building a prototype of the texturing system for Rage to see if it would all work, so maybe the prototyping was always just an implicit part of JC's programming.

Browsing the source of games like Nethack and Battle for Wesnoth (around a decade ago) opened my eyes - sometimes code quality can seem poor but the product can be great.

Blender is another one that seems very ramshackle and complex. I won't go as far as saying it's poorly written, but it's a product of many contributors, including students, and yet it's an amazing piece of software.

This thread is not meant to be a criticism of projects, but a celebration that code quality is not the be all and end all.

BlackBox 10 years ago

Yep! We've got lots of great artists here. I met him once, shortly after he did the Simpsons intro piece.

BlackBox 10 years ago

Paul Robertson -- one of the best pixel artists of this era.