Skip to content

Commit

Permalink
improt from wiki (#104)
Browse files Browse the repository at this point in the history
  • Loading branch information
wsor4035 authored Dec 22, 2024
1 parent 4f85a4d commit e27bce0
Show file tree
Hide file tree
Showing 8 changed files with 735 additions and 0 deletions.
98 changes: 98 additions & 0 deletions content/debug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
---
title: Debug
aliases:
- /Debug
---

# Debug


The **debug screen** can be accessed by pressing the F5 key (by default) and shows various technical information about Luanti which are mostly interesting for developers, but some information are also useful for players, especially the [coordinates](https://wiki.luanti.org/Coordinates "Coordinates").

It contains various information useful for development and testing. Press F5 to access different debug screen modes:

* Debug screen disabled
* Debug info
* Debug info + profiler graph
* Debug info + wireframe (only with “debug” [privilege](https://wiki.luanti.org/Privileges "Privileges"))

Debug info
----------

### Basic debug info

The basic debug information is located at the top left of the screen. It looks like this:

[![Debug.png](/images/Debug.png)](/images/Debug.png)

#### First row

* **Luanti X.Y.Z**: The [version number](https://wiki.luanti.org/Version_number "Version number") of [Luanti](https://wiki.luanti.org/Luanti "Luanti")
* **FPS**: Number of [frames per second](https://en.wikipedia.org/wiki/Frames_per_second), denotes how fast everything is [rendered](https://en.wikipedia.org/wiki/Rendering_%28computer_graphics%29). Higher = better. It is limited at 60 by default. An FPS lower than 30 is pretty bad (try to lower graphics settings or close some background applications)
* **drawtime**: An average time (in milliseconds) it's taking to render each frame, not including processing other than rendering. Lower is better
* **dtime jitter**: Jitter in the time difference between rendering frames, including all processing. Luanti remembers the previous drawtime values over a few seconds in the past. This value shows how much higher than the average the _peak_ value (over the last few seconds) was. A value of 50% or lower is considered okay
* **view range**: Your current viewing range in nodes. “All” means unlimited. By default, you can adjust this with +, \- and R.
* **RTT**: [Round Trip Time](https://en.wikipedia.org/wiki/Round_trip_time). This is especially important when connected to a server. Lower is better

#### Second row

* **pos**: Your [coordinates](https://wiki.luanti.org/Coordinates "Coordinates"): X, Y and Z
* **yaw**: Your current horizontal looking direction (also known as “yaw”). For convenience, also the cardinal direction (e.g. “North”)[\[1\]](#cite_note-1) as well as the approximate axis direction are shown (e.g. “+Z”)
* **pitch**: Your current vertical looking direction (i.e. “pitch”). 0° means you look horizontally, positive numbers means looking upwards and negative numbers means looking downwards
* **seed**: The [random seed](https://en.wikipedia.org/wiki/Random_seed) used by the [map generator](https://wiki.luanti.org/Map_generator "Map generator") to generate the current world. Equal seeds (along with equal mapgen settings) will lead to equal worlds
* **pointed**: The [itemstring](https://wiki.luanti.org/Itemstrings "Itemstrings") / “technical name” of the current [pointed](https://wiki.luanti.org/Pointing "Pointing") [node](https://wiki.luanti.org/Blocks "Blocks") (if any).
* **param2**: Value of `param2` of the current pointed node (if any). This contains some additional info for a node, such as rotation, color, etc, which is important for programmers. The meaning of `param2` is explained in the Lua API documentation.

Note: The entire second row is hidden when the debug view is restricted (see below).

### When pointing an entity

When you point an entity or object (such as a dropped item or player), the following information is shown to the left:

* Entity type: See [ActiveObject](http://dev.minetest.net/ActiveObject) on the Minetest Developer Wiki
* **hp**: Health in hit points (→[Player#Health](https://wiki.luanti.org/Player#Health "Player"))
* **armor**: Armor groups, determine how the entity receives damage (see below)

Note: This is hidden when the debug information is restricted (see below).

#### Armor groups

The armor groups are used internally by Luanti to tell how “vulnerable” an entity (including players) is to different forms of attack. Each armor group has a name and a number. The number is a percentage, 100 means you get 100% of the damage, 200 means you get double the damage, 50 means you get 50% of the damage, etc. Any armor group that is \*not\* in this list means that the entity does not take damage from attacks of this group.

By default, the armor group “fleshy=100” is used for entities. Most armor mods use these armor groups to reduce damage. [Games/Minetest Game](https://wiki.luanti.org/Games/Minetest_Game "Games/Minetest Game") only uses this armor group for both weapons and entities, and so do many other games. The name “fleshy” does not mean the entity is actually made of flesh, this is just the default name.

But some games might use more complex systems. Think, for example, of elemental creatures that are vulnerable to ice-based attacks but immune to physical attacks.

The armor group “immortal=1” is a special case and means the entity does not take any damage by conventional means (however, mods might still manage to handle damage in a completely different manner).

### Profiler graphs

The profiler graphs show the performance of Luanti in a more detailed fashion. This information is most useful for engine developers.

See [\[1\]](https://dev.minetest.net/Profiler_graph) for more information.

### Wireframe

If this mode is active, the world will be drawn as a wireframe, which reveals the technical structure of the 3D models in the game. See [\[2\]](https://en.wikipedia.org/wiki/Wire-frame_model) for more about wireframes.

Because for players, this is basically an X-ray vision and very overpowered, access to the wireframe mode is only possible if you have the “debug” privilege.

Restricted debug view
---------------------

A few games and mods might restrict the amount of debug information by hiding gameplay-relevant information like the coordinates. If you have the “debug” privilege, this does not affect you, and you always get to see the full debug information. By default, the debug screen is _not_ restricted in this way; games or mods have to actively decide to restrict it. For example, [Minetest Game](https://wiki.luanti.org/Games/Minetest_Game "Games/Minetest Game") does _not_ restrict the debug view.

This is a list of things that will be hidden/restricted in a restricted debug view:

* Position, yaw, pitch, seed, pointed node and param2 of pointed node
* Entity information (type, hp, armor groups)
* The ability to display mapblock bounds

The reason why a game might choose to restrict the debug view is to make it more challenging, like if the game wants players to “earn” the ability to see coordinates or other info by crafting a special item first. Otherwise, players could just skip that with only one keypress, which would fly in the face of game design.

In singleplayer mode, remember you can always say “/grantme debug” in chat to get the full debug info back and ignore all game restrictions (this is often considered a cheat).

Footnotes
---------

1. [](#cite_ref-1) 0° translates to “North”, 270° to “East”, 180° to “South” and 90° to “West”. Note that the concept of cardinal directions does not really make sense in Luanti, as the world is a cube, not a sphere, and there are no poles. In this context, the names “North”, “South”, “West” and “East” are just synonyms for the 4 directions
Loading

0 comments on commit e27bce0

Please sign in to comment.