115 Commits

Author SHA1 Message Date
Aaron Suen
883e37a493 Typo 2021-12-27 20:44:09 -05:00
Aaron Suen
c5e19ed1b5 Just show exact stack counts in looktips
Was there ever really any value to forcing a player to
pick up a stack to inspect it instead of just telling them
how many up front?  Probably not.
2021-12-15 02:38:07 -05:00
Aaron Suen
5caf66f6ea Add an "uncheat" command 2021-12-11 21:09:33 -05:00
Aaron Suen
7da2ed13df Fix crosshairs/looktips in the void
It seems like Minetest actually generates terrain
beyond the map limit boundaries and raycast
and get_node can retrieve them server-side, even
though they aren't rendered client-side and air is
still filled with ignores.  This causes players to see
"stone" with looktips looking thru the bottom of
the world.  Fix it with an explicit check for world
bounds.
2021-11-27 09:24:28 -05:00
Aaron Suen
b73d1d1290 Pre-clean-transparent filter on all textures
Some users may use filtering but not have the "clean transparent"
filter enabled in the Minetest engine config.  Bake this filter
into all images to (1) avoid the consequences of this (i.e. black
halos), and (2) possibly speed up startup time (the filter will
converge immediately).
2021-09-23 07:36:21 -04:00
Aaron Suen
7dc18b3eab Fix crosshair in darkness
Crosshair can no longer be used to "sense" solid
nodes in darkness; need to punch or create a
light spot.
2021-08-22 08:53:01 -04:00
Aaron Suen
977eab5231 Slightly more nuanced looktip delay
Player can trigger looktips by standing still
for a while (looktips on everything instantly),
by holding focus on a specific face for a
while (looktip just on that one face), or by
punching (instant looktip for that one face).
2021-08-19 20:17:09 -04:00
Aaron Suen
0c893e1183 Try to mitigate spammy looktips
Right now looktips are rather obtrusive to
the overall game experience, and should
show up on some kind of delay to mitigate
this.

I tried having a delay for looking at a node
before a looktip showed up, but it felt sort
of annoying when switching from node to
node, especially since the faster response
on the face-dependent location of the tip
is helpful for building.  The code for it also
turned out to be messy, since node and
object handling needed to be different, since
it was unrealistic to actually hold the
crosshair on a moving thrown object.

What I've got for now is just disabling the
looktip during, and for a slight delay right
after, any player movement, based on
movement input controls.  This prevents
the player from having a bunch of looktips
juddering across the screen while walking,
but allows them whenever standing still.

This MAY be good enough, but it may take
some play-testing to confirm.
2021-08-18 22:46:53 -04:00
Aaron Suen
16959bf2ee Resimplify crosshair
The "player character" only assists with "depth
perception" and determining if pointing at
something within reach; diggability, protection,
and other consequences of touching the thing
should really be the actual player's responsibility.
We don't want things to be too "automatic" for
the player; they are supposed to learn about the
world, not about the HUD instrumentation.
2021-08-14 23:21:52 -04:00
Aaron Suen
16246baaad Crosshair shape by protection instead of type
The use of object vs node crosshair is less important now
due to our ability to rely on the looktips to differentiate
which thing we're pointing at (and which face), and
makes less sense in terms of NodeCore's everything-is-a-
node nature.

Protection, however, is more useful to show, where in
use, so players can avoid interacting with things and
triggering protection alerts.  Use the old everted
crosshair design to now mean "protected" instead of
"pointing at entity."

The old use of the crosshair shape should have been
uncommon enough that players should be able to
adapt to the change alright.
2021-08-14 16:22:49 -04:00
Aaron Suen
de6206d6d9 Fix broken object crosshair 2021-08-11 06:44:40 -04:00
Aaron Suen
f7461414d2 Move lazy raycast into playerstep API 2021-08-06 21:33:23 -04:00
Aaron Suen
362ff17bb2 Don't crash on pointing at non-luaentity 2021-08-04 20:46:37 -04:00
Aaron Suen
531d259775 Fix looktip darkness punch fallback 2021-07-31 22:23:36 -04:00
Aaron Suen
6927552f8b Touchtips for ents 2021-07-31 21:05:52 -04:00
Aaron Suen
cbb3d59b2f Enable looktips for non-interact players too 2021-07-31 20:40:30 -04:00
Aaron Suen
cb7b3f7bea Redo touchtips into looktips
- Separate touchtips into in-world looktips vs
  wieldtips for inventory.
- Automatically raycast and show tips for
  anything we're looking at.
- Looktips don't work in full darkness, punch
  to activate a temporary touchtip for it, or
  use synesthesia lighting.
- nodecore.show_touchtip API stubbed out
  (used in yctiwy).

TODO:
- Need to rework hint discovery to use raycast
  instead of just punching
2021-07-31 15:54:11 -04:00
Aaron Suen
6e1df14c1b Dynamic custom crosshair
- Crosshair hidden when !interact
- Fade out crosshair when not pointing
- Makes crosshair HUD-scalable (not sure if
  this is definitely good or bad yet)
- Forces crosshair appearance on mobile to
  match desktop

Since the crosshair position is already used in
gameplay i.e. for item dropping on mobile, it's
important that mobile have consistent access
to it compared to desktop.

Also, mobile's lack of crosshair was one of the
main blockers to having look-tips instead of
touch-tips, so forcing a crosshair opens that
up again.  Forcing punch interactions to see
anything causes issues with ember/pumwater
where punching hurts.

A crosshair would also be necessary for
star navigation assistance tools.
2021-07-31 08:43:38 -04:00
Aaron Suen
9995d9bfc8 Add a use for dry sponges
Dry sponges act as air tanks while diving, but the effect is
limited by their tendency to soak up water from the environment.
2021-07-27 07:42:40 -04:00
Aaron Suen
a16ceda69a Detect cheat status changes bypassing events 2021-07-11 15:25:27 -04:00
Aaron Suen
1f4bdeb059 Remove cheating alert for spectators 2021-06-30 07:38:20 -04:00
Aaron Suen
1f3ea458a0 Fix cheat detection
A couple of simple baseline checks I missed that
aren't necessarily tied to privs but may be handled
by mods as well.
2021-06-27 19:50:56 -04:00
Aaron Suen
bf8d8e5877 Display when cheats are enabled on-screen
Without this, some players are likely to enable
certain privs and abilities without knowing that
they're cheats and will break the designed
gameplay.  Similarly, server admins may be likely
to use the same default_privs for a nodecore server
as they might for an MTG or even creative server,
causing accidental cheating as well.  Adding this
messages makes it hard to be unaware that your
game is at least misconfigured.
2021-06-23 22:46:07 -04:00
Aaron Suen
95f0fb0ee9 Heaviest image compression option 2021-03-09 08:33:58 -05:00
Aaron Suen
410ebd5d8d Recompression using ECT
https://github.com/fhanau/Efficient-Compression-Tool
2021-03-09 08:16:23 -05:00
Aaron Suen
c10e80ef87 Set name in mod.conf as demanded by 5.5+ 2021-03-01 20:10:27 -05:00
Aaron Suen
51b5aa8b94 Playerstep microoptimization
Avoid calling get_player_name too much
2021-03-01 18:58:34 -05:00
Aaron Suen
b73e70d351 Fix some translate inform warnings. 2020-09-27 09:30:57 -04:00
Aaron Suen
f24230e924 Late-bind touchtip API
Allow mods to intercept/override
2020-09-16 20:53:22 -04:00
Aaron Suen
0f8459c1c7 Fix code formatting issue 2020-09-12 16:30:15 -04:00
Aaron Suen
80ad330a15 Touchtips for fluids above nodes 2020-09-11 19:23:35 -04:00
Aaron Suen
d712ad3668 Stone brick hints 2020-09-10 23:21:36 -04:00
Aaron Suen
efa2446e42 Add hints for player mods 2020-09-10 22:28:25 -04:00
Aaron Suen
4f24397869 Mirror object crosshair left/right
It looks more aligned with the original this way.
2020-09-04 21:45:33 -04:00
Aaron Suen
e51d9a5a70 Rename textures again to not collide
This allows a texturepack to support both the
original hotbar (for release edition) and the new
hotbar (for the alpha edition) at the same time,
while giving us time to test out the alpha version
and roll out the new release when it's ready, and
without forcing TP authors to trade off support.

Names are also lexically consistent and more
consistent with internal names.
2020-09-04 20:50:29 -04:00
Aaron Suen
76176ea648 Rename selection reticle back 2020-09-04 20:30:44 -04:00
Aaron Suen
b7d6015906 Add back in legacy bar as background
This allows monolithic hotbar drawing, and
variations by position, and brings back partial
support for existing TPs.
2020-09-04 20:16:10 -04:00
Aaron Suen
d7f231f083 Retire redunant textures 2020-09-04 20:03:36 -04:00
Aaron Suen
5059f9b3c3 Alternative hotbar approach
We still change the background, but only depend
on the state of the slot, not on wield index.  Go
back to a traditional slot selection ring for the
selection index.

Slot backgrounds are a little bolder normally, and
when broken, especially bold around the broken
areas.

The selection ring itself is broken so that the
gaps in broken slots are still "open" to the outside
when the selection ring is in place.
2020-09-04 19:59:12 -04:00
Aaron Suen
1c0a9f1ade Add a lagless hotbar cursor
- Highlight behind item may lag behind the
  new cursor, but the new cursor will show
  which slot you're trying to select when
  scrolling rapidly.
- Also fix the margins/centering for hotbar
  image.

Will have to see how this plays on the actual
MP server, where there's notable RTT lag.
2020-09-04 13:55:13 -04:00
Aaron Suen
ca20aa5584 Refac HUD into separate files 2020-09-04 13:35:38 -04:00
Aaron Suen
79622ce150 Unalias hotbar slot textures
This was causing a texture from texture packs
to be reinterpreted differently, causing buggy-
looking hotbars, and TP authors would not
have been able to change the hotbar to work
with both versions.

Now before and after use different sets of
textures so a single TP can safely support
both before and after.
2020-09-04 12:56:18 -04:00
Aaron Suen
d88e1a9c11 Hotbar fixes
- Hide the redundant selector
- Properly use NC PlayerStep API
2020-09-04 12:34:54 -04:00
Aaron Suen
f8da98acf7 Fixes/tidying 2020-09-04 12:29:34 -04:00
Aaron Suen
5b2e61be75 Merge branch 'dev' into fancy_hotbar_9271_fixed 2020-09-04 12:29:08 -04:00
Aaron Suen
3f5f78bbe0 New entity crosshair 2020-09-03 21:02:10 -04:00
Aaron Suen
2d1f61ee97 Touchtips support "touch thru" API
Allow the "above" node to override the "under"
node's description.  Use this mechanism to
append charcoal glyph descriptions to the
touchtips, but only when punching a face that
has a glyph on it.
2020-06-28 12:38:14 -04:00
Aaron Suen
466805da48 Enroll skybox, fix some bugs 2020-06-22 23:17:01 -04:00
Aaron Suen
5648331c9f Replace all perplayer with playerstep 2020-06-22 22:47:33 -04:00
Aaron Suen
e0156b4742 Add profiler instrumentation metadata everywhere
N.B. the MT built-in profiler doesn't yet actually support reading
labels from bare-function registrations, so a builtin hack is
needed.
2020-06-15 07:21:39 -04:00