Skip to content

Commit

Permalink
Fix import problems with two more pages, move "Player-World Interacti…
Browse files Browse the repository at this point in the history
…on" to engine (#98)

* Move "Player-World interaction" to right place

* "Player-world interaction": fix indentation to make readable again (import problem...)

* Fix import issue of steam deck page
  • Loading branch information
grorp authored Dec 22, 2024
1 parent 1b94dd3 commit 371b7c7
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 75 deletions.
67 changes: 67 additions & 0 deletions content/engine/player-world-interaction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
title: Player-World interaction
aliases:
- /Player-World_Interaction
---

# Player-World Interaction

Digging a node
--------------

Preconditions are a node somewhere in the map.
This node is pointable, has a selection box and can be dug by the hand or the tool the player is wielding.
The player has interact priv and the tool has a tool range that the node can be pointed.
The node is not stuck somewhere the player can't point it.

* First look at the node, it becomes pointed\_thing.

Note that on android the node is pointed without looking (referring to the cross position) at it.

* Then LMB is pressed down while holding an item which does not have on\_use.

If LMB wasn't released before, a click happens, which causes a punch event.

- The client send a punch event (client->interact(4, pointed), see game.cpp:3657 (28.02.2017)).

- On server side the punch event is passed to mods, see on\_punch and the deprecated register\_on\_punchnode.

Then the client sends the digging start event to the server (interact(0, pointed), game.cpp:3948).

- The server uses this information for anticheat measurements.

* Now continue looking at the node, i.e. keep pointing it, and hold down LMB.

Periodically client-side: Crack animation is updated, digging particles are spawned (if not disabled in the settings) and the node dig sound is played.

- The dig sound is either the "dig" field in the "sounds" table in the nodedef

- or, if it's not present, the client uses the sound "default\_dig\_${groupname}" (file name extension omitted here), where $groupname is one of the groups the node has, see (game.cpp:4001), and gain is set to 0.5.

- The default\_dig\_ thing should be banned from source code in my opinion.

* Some time later, when the digging time elapsed,

the client sends a digging completion event to the server (interact(2, pointed), game.cpp:4018),

the node disappears client-side,

more particles are spawned (if enabled) and

the dug sound is played.

* Now the server recieves the digging completion event.

Anticheat probably, e.g due to lag, thinks the player dug the node too fast.

- dug\_too\_fast cheat is passed to mods, see register\_on\_cheat, and digging aborts.

If the nodedef has a can\_dig function, it's executed and probably stops the digging.

The on\_dig function in the nodedef is called now.

- The default on\_dig function problably removes the node:

- The on\_destruct is executed, air is set and after\_destruct is executed.

- And probably (the same probably as before) it then calls the after\_dig\_node function in the nodedef if present.
67 changes: 0 additions & 67 deletions content/player-world-interaction.md

This file was deleted.

16 changes: 8 additions & 8 deletions content/steamdeck.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ Uploading an AppImage using Deck DevKit
Source: https://partner.steamgames.com/doc/steamdeck/loadgames

* Name: MinetestAppImage
* Local folder: /home/user/dev/tmp/minetestdeck/
* Upload filtering [Include only] Minetest-dev.AppImage
* Start command: Minetest-dev.AppImage
* Local folder: `/home/user/dev/tmp/minetestdeck/`
* Upload filtering [Include only] `Minetest-dev.AppImage`
* Start command: `Minetest-dev.AppImage`
* Save config
* Click Upload
* On deck: cp /usr/lib/libcrypto.so ~/devkit-game/MinetestAppImage/libcrypto.so.1
* On deck: `cp /usr/lib/libcrypto.so ~/devkit-game/MinetestAppImage/libcrypto.so.1`
* Luanti should now be in Non-steam games as "Devkit games: MinetestAppImage"

Note, I had issues reusing the layout from the stable version of the game. Pressing "apply layout" did nothing. I needed to follow this bizarre workaround https://www.reddit.com/r/SteamDeck/comments/10tsp1a/i_cant_change_the_default_controller_layout/
Expand All @@ -31,9 +31,9 @@ Note, I had issues reusing the layout from the stable version of the game. Press
Source: https://partner.steamgames.com/doc/steamdeck/loadgames

* Name: Minetest
* Local folder: /home/user/dev/minetest/
* Upload filtering [Include only] /bin/*** /builtin/*** /games/devtest/*** /games/minetest_game/*** /textures/base/pack/*** /client/shaders/***
* Local folder: `/home/user/dev/minetest/`
* Upload filtering [Include only] `/bin/*** /builtin/*** /games/devtest/*** /games/minetest_game/*** /textures/base/pack/*** /client/shaders/***`
* Check "Delete remote files not present in local folder"
* Start command: bin/minetest
* Start command: `bin/minetest`
* Save config
* Click Upload
* Click Upload

0 comments on commit 371b7c7

Please sign in to comment.