-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inventory item schema redesign #480
Comments
Brainstorming. New schema idea no. 1:
Hmm, that's a bit complex, and is using
Advantages over no. 1:
Disadvantages:
|
I think I need to think harder about what characteristics items/tools should have that aren't their icons or their operations. What characteristics might tools have? Which ones fit well into being just block attributes? I think the following are conditionally good fits:
Bad fits for this model:
|
Note that
|
Belated thought: rotation during placement (something we already have a block attribute field for) is very similar to "which of these two cubes". Not sure what that tells us. |
Part of <#480>; this moves in the direction of being able to eliminate `Tool` entirely in favor of `Block`s with extra behaviors. Missing functionality: The placement action cannot have any custom interaction with the character's inventory. This should be fixed as part of generally making `Operation`s more able to interact with inventories.
Commit d241be8 adds |
I sat down to implement blocks containing and displaying inventories, and discovered a problem: right now, the signature of
Tool::icon()
iswhich can't be called inside of block evaluation because there's no place for the
BlockProvider
to come from — block evaluation takes no context inputs. More abstractly, the idea that the appearance of tools depends on the viewer is incompatible with the idea of letting them appear in the world. (Unless we add a whole special system for displaying intangible viewer-dependent voxels, which is, well, probably something we want to do, but not now and not part of normal block rendering.)Therefore, we need to change something so that the necessary information is available:
Inventory
has aBlockProvider<Icons>
associated when it's created, orBlockProvider<Icons>
associated when it's created.If we go with items/tools owning their icons, then either:
all-is-cubes
crate built-in tools have specific icons intrinsically — but we've so far avoided having any voxel block definitions be part ofall-is-cubes
itself, and they'd need to be a newPrimitive
,PlaceBlock
?), orTool::Custom
does now), separate from the tool's action definition (which might be the currentTool
enum or it might beOperation
?).I think that it probably makes sense to go with that third option, because that also gives us a place to stand to customize the gameplay rules for tools (e.g. which blocks can be removed from the world, and which blocks can be automatically displaced by placing another block). But it will require thinking up various new schema pieces.
The text was updated successfully, but these errors were encountered: