Allow the player to toggle a waypoint that directs them towards the world origin - #533
Conversation
|
Keeping as a draft for now. There's a bug where toggling the waypoint on and off causes the UI to flicker. I think this may be a bug in yakui itself, as there doesn't seem a good way to prevent this bug. I seem to be able to avoid this bug by always rendering a mesh. It doesn't have to be the same mesh, but it does at least need either the same number of vertices or the same number of indices, or both (I'm not exactly sure what the requirement is). It may be okay to merge this while the bug is still active. It looks silly, but it's not game-breaking. |
|
Are the validation layers clean? Anything funny in the number of vertices/draws/whatever yakui generates? Probably worth updating yakui to see if that helps, though I'm not sure how churny that will be. |
|
Very happy to have this feature, btw! This is an overwhelmingly important primitive to make the game playable. Follow-up work is probably to attach the marker to an entity and let the player move the entity around. |
c4ed901 to
c2f955d
Compare
Just to make sure I understand, is the primitive you are calling important the I made a mistake in this PR and accidentally included #532 unnecessarily. |
c2f955d to
b2e8a20
Compare
|
The part users will care about is obviously the UI, but finding a path is presumably an inextricable part of that. |
|
I guess not actually necessary when the waypoint is the origin, but it will be for the natural evolution of the feature. |
While the validation errors and synchronization hazards are clean, I do now think it's more likely to be a bug in Hypermine than a bug in Vulkan, as I was not easily able to reproduce the issue with similar code in yakui's Vulkan example. It could still go either way, but I would like to double-check Hypermine's logic. One bug that my be related: It appears that the waypoint is slightly desynced with the rendering of the voxels. Interestingly, it seems to be one frame ahead instead of one frame behind. |
|
Yeah, sounds like some flavor of sync issue all right. |
This might be a yakui issue after all. Since Yakui shares a single vertex buffer and a single index buffer between all draw calls, I think the issue might be that if I call My guess is that validation layers don't catch this because the memory is The function in Yakui |
|
@Ralith, I'm not sure if the effort of fixing this bug and/or finding a workaround is worth blocking this PR. I'm going to go ahead and remove the "draft" status from this PR. If this gets merged, I can file an issue for the race condition. |
d1ab4bf to
3852c22
Compare
3852c22 to
42c18a0
Compare
42c18a0 to
78e4d74
Compare
The button on the keyboard to toggle this is "Home".

The waypoint marker will be stopped by the boundaries of the viewport, allowing it to always be visible regardless of which direction the player is looking.