Improve player zoom control, doc updates

Players can use sneak and/or aux1 for far-zooming, so they can
far-zoom while treading water in an ocean to look at distant
islands, instead of using the aux1=climb down hack, which causes
all sorts of weird issues with other features that try to detect
movement controls
This commit is contained in:
Aaron Suen 2022-10-25 07:48:01 -04:00
parent 36fef1771f
commit b393ce0a93
5 changed files with 11 additions and 10 deletions

View File

@ -37,6 +37,11 @@ issue.
- Z-fighting against normal nodes; no way to both show inside
surface against air AND avoid z-fighting.
- Multiple kinds of water don't "mix"
- Because only nodes can produce light, dynamic lights require
use of fake air-like nodes, and because liquids don't mix,
I can't make fake water-like nodes for underwater dynamic
lighting, thus all dynamic lights do NOT work at all
underwater.
- Can't do the sky navigation thing fully
- Client resource GC for computed textures could fix the memory

View File

@ -154,13 +154,6 @@ ISSUES-GAME: Gameplay-affecting issues
down to regular cobble, but it only works with the base node, not the
etched ones.
- Players losing run speed on damage would be simplified by checking for
<max health instead of time of last damage.
- Should lose farzoom when damaged too.
- We can reliably detect the zoom player control, make far-zoom only
work while zooming, and add hints for it.
- Valleys mapgen rivers seem to rely on having an actual separate
river water registration with a specific liquid range.

View File

@ -15,5 +15,7 @@ itself.
- Soak-tickling
- Zoom and far-zoom
........................................................................
========================================================================

View File

@ -122,7 +122,7 @@ nodecore.player_anim = nodecore.player_anim or function(player, data)
if mine then data.animcontrol_mine_exp = nodecore.gametime + 0.25 end
mine = mine or data.animcontrol_mine_exp and data.animcontrol_mine_exp >= nodecore.gametime
end
local aux = ctl.aux1
local aux = ctl.aux1 and not ctl.zoom
if data then
if aux then data.animcontrol_aux_exp = nodecore.gametime + 1 end
aux = aux or data.animcontrol_aux_exp and data.animcontrol_aux_exp >= nodecore.gametime

View File

@ -11,8 +11,9 @@ nodecore.register_playerstep({
label = "zoom focus",
action = function(_, data)
local ctl = data.control
local focusing = ctl.sneak and (not ctl.jump) and (not ctl.up)
and (not ctl.down) and (not ctl.left) and (not ctl.right)
local focusing = ctl.zoom and (ctl.aux1 or ctl.sneak)
and (not ctl.jump) and (not ctl.up) and (not ctl.down)
and (not ctl.left) and (not ctl.right)
local zoom = zoom_base
if focusing and data.zoomfocus then
zoom = zoom_base - zoom_base * zoom_ratio * (1 - 1 /