Alternative Alt Mode


Replaces the standard Alt-Mode by providing more information for more objects. This information is shown only for entities around the player cursor, so the graphics of other objects can be enjoyed without always having an information overlay on top of them.

Utilities
26 days ago
2.0
460

i Show data without selecting an entity

3 months ago

Is it possible to get the Alt-mode permanent/without the need to mouse over entity

3 months ago

Unfortunately mouse position is not available through the API.

The only solution I can think of is to litter the area around a player's character with invisible, selectable objects and check for that. I'm looking into that, but this might run into performance issues.

I also tried to just center around the player's character instead of the selected entity. That way it's always on, but not as nice as around the mouse position.

3 months ago

Update. I've got something working. It is indeed littering the area with entities. Except doing so as a binary search.

So it first creates a bunch of 32x32 entities. And on the one that is then selected the next tick it creates 4 16x16 entities, tick later 8x8. All the way down to 1x1.
That means there is a 5 tick delay in getting the position. (I'll make it a bit smarter that the positions around the last known position have smaller subdivisions.)

It's quite ugly to implement, I'm still ironing some things out.

Main thing I'm worried about is that the final 1x1 entity shouldn't be destroyed, and should stay selectable. That gives an ugly red selection box around it, and some gui info on the right. Not sure if I can remove those.

Is that an issue?

If I do destroy it, the mouse is lost again and to detect movement it would have to find it every 5 ticks. Which is a performance issue.

https://i.imgur.com/9Ui50G8.png

3 months ago

Let me answer my own question. Yes it is an issue

https://i.imgur.com/xjjgAnh.mp4

3 months ago

Fixed it!

https://i.imgur.com/FNdMbbv.mp4

But indeed running into this

If I do destroy it, the mouse is lost again and to detect movement it would have to find it every 5 ticks. Which is a performance issue.

There's a continuous 0.3 ms/tick time usage when just hovering over a tile, not sure how much of a problem that is. There is a way higher time usage when there are lots of entities in the search radius.

I'll make the interval it searches for the mouse configurable. Larger intervals means better performance, but it "feels" more laggy.
If you move your mouse quickly it will also take longer, so it feels like the search circle is lagging behind.

There are still a few optimisations I have in mind.

3 months ago

Hmm for me, it only shows the info when I hover over something. like a stone/ore/object.

3 months ago
(updated 3 months ago)

Yes, I'm working on it. Will be there in 0.2.0

Not released yet, should be soon.
Just wanted to use this thread a bit as a dev blog.

3 months ago

0.2.0 now released with this functionality. Feedback appreciated

2 months ago

Sorry for the late responce, it works great.

New response