October progress: Basic inventory and block placement
Posted by Jeff Disher
October progress: Basic inventory and block placement
Now that the latest re-work on consensus and timed mutation has been completed, moving on to some new mutations to support inventory item selection, inventory movement, and block placement was comparatively simple.

Still, these are somewhat complicated: Picking up an item from the ground requires asking the entity to request it, then sending a mutation to the block to extract items, then sending a mutation back to the entity to deposit the items (potentially failing and destroying items in the process). Despite this, at least the complexity is largely self-contained: All of this functionality was added without touching the core system, only the mutations themselves (which are pretty small).

In the future, some kind of 2-stage transaction design might be employed to avoid the corner-cases where conflicting changes require item destruction, but that isn't currently a priority (and may not reasonably happen outside of trying to force it to happen).

In the UI, this is currently done somewhat blindly as items on the ground aren't yet rendered and getting a sense of where things are spatially happening is not obvious due to some mouse tracking being a bit off (it handles the grid, just not the offset of the current entity within it - means the selection is sometimes off by half a block).

Next steps, after some small changes to make common idioms less tedious (inventory interactions are very verbose) is to add an overlay to view the inventory and change selection. Also, the items on the ground need to be rendered (just as a generic "debris pile", though). Then, either the basic network creation (which was written a while ago, just needs to be connected) or a crafting UI. Those are really the only tasks remaining until the first tech demo release can be tested.

Overall, aside from the aforementioned tedium of some idioms and the usually gruelling process of UI work, progress seems to be going in the right direction. Of course, until it is to the point where I can test hundreds of entities interacting with the system and some more complex block updates, it won't be obvious if this design is worth it for scalability.

Work continues,
Jeff.