Re: Game Engine

Re: Game Engine


I’m no expert on game engines or even game design, so I might not have the correct understanding of the underlying concepts here. I don’t know how well a Minecraft clone would perform under an entity-component system. I looked at your github project and you appear to have eschewed ECS, at least for the trivial implementation of your “chunk”.

My understanding is that under an ECS, you would have an actual array of instantiated entities instead of a single array of u8 integers. Each entity would have a position, texture reference, flammability, monetary value, weight, etc. packed together. So when you go to render blocks, that extra information would clog the cache and hurt performance.

Contrast with say, storing separate arrays to hold texture references, flammability, value, etc. Then only iterate over the specific array you need at the moment.

Amethyst bills itself as an ECS-centric game engine. If I am correct about the nature of entity-component systems, why Amethyst?



An ECS bunches up the Data in an easily processable format, unlike Objects. This makes Multithreading much easier as only the Data you need is accessed and not literally everything else. Do you need someones Coordinates to apply a Poison Effect on their Health? I do not think so, so the Coordinates are not retrieved from RAM. :wink:

What you are explaining as an “instead of ECS” is literally what an ECS is actually doing.

And I chose Amethyst because it is a still ongoing Project so people actually update it, while also being somewhat easy to use, from what I made with the Examples so far, before I ended up with a Factorio Addiction interrupting my coding process for a couple weeks. XD

The Block-Chunks will be stored in an Octree, so I can generate lower block resolution images for very far away things like Mountains (as mentioned in my other reply earlier). Each type of “Block” will only exist once and then referenced by the Octree, but Blocks can be generated on the fly too, in case someone does Microblock-like things with a Chisel of sorts.

Blocks will also have the ability to point towards an adjacent block and say “whatever thing I am part of is in that direction”, which can then chain until a central block that knows “I am a Pickaxe placed on the Floor”, so if you click that one Block it will point to another which points to another until the Pickaxe core block is found and execute the “pick up Item” Routine from that Block, which will recursively remove all Blocks that point to the Pickaxe Core along with the Core itself ofcourse. While Trees will use a similar System, they would be handled differently sine you can partially chop them up or trim them.

Oh and Pickaxes and other small Stuff will use something like Microblocks for display, when the Item is on the Floor. The Octree can go really High Resolution if needed, while staying Low Resolution for everything else. I plan for the Resolution to go as deep as a 32x32 Texturepack in Minecraft, which would be half the length of a single MC-Microblock dot.

Items will only be Entities in Situations comparable to falling Sand Entities in Minecraft, so only when they are thrown or falling or whatever, they will be Entities and once they are in a resting State they will become part of the Block Grid.

1 Like