Creative mode should default to no damage #3191

Open
opened 2022-12-25 03:38:38 +01:00 by kneekoo · 13 comments
Contributor

Before anything, we can switch from creative to survival with the /gamemode command.

/gamemode creative
/gamemode survival

Survival should obviously default to enable_damage = true. Creative should be the opposite of that, so players don't have to write commands to stay safe.

Technically, we can get away from restarting the client whatever the defaults, considering Minetest accepts changing server settings like this:

/set enable_damage false
/set enable_damage true

However, the game currently ignores that setting if you start the game with [x] Enable Damage from the Minetest client - which is why I marked this as a bug.

As I argued in #3102, we should keep it simple and only have zero damage in creative. But if the developers want to support all gamemodes with and without damage, at least let's have a proper default and make sure our game obeys changing the enable_damage setting, so people don't have to exit the game to toggle it.

Before anything, we can switch from creative to survival with the /gamemode command. ``` /gamemode creative /gamemode survival ``` Survival should obviously default to `enable_damage = true`. Creative should be the opposite of that, so players don't have to write commands to stay safe. Technically, we can get away from restarting the client whatever the defaults, considering Minetest accepts changing server settings like this: ``` /set enable_damage false /set enable_damage true ``` However, the game currently ignores that setting if you start the game with `[x] Enable Damage` from the Minetest client - which is why I marked this as a bug. As I argued in #3102, we should keep it simple and only have zero damage in creative. But if the developers want to support all gamemodes with and without damage, at least let's have a proper default and make sure our game obeys changing the `enable_damage` setting, so people don't have to exit the game to toggle it.
kneekoo added the
bug
gameplay
commands
needs discussion
incomplete feature
creative mode
labels 2022-12-25 03:38:38 +01:00
Member

I did not know settings could be changed while Minetest is running that is why the enable_damage setting is cached.

Survival should obviously default to enable_damage = true. Creative should be the opposite of that, so players don't have to write commands to stay safe.

How is that possible? You can't get minetest to uncheck the enable damage enabled when creative is checked.

The problem with the enable_damage setting is that it can only apply globally and not to specific players. You could have per player enable damge but that would obviously be more complicated than assuming enable damage based on game mode.

But then what will the enable_damge setting mean?
One possiblity is that it could be PvP. If it is disabled players can't harm each other directly. However changing the meaning of the enable_damage setting would potentially break worlds/servers.

BTW /gamemode survival from global creative mode does nothing.

I did not know settings could be changed while Minetest is running that is why the enable_damage setting is cached. > Survival should obviously default to enable_damage = true. Creative should be the opposite of that, so players don't have to write commands to stay safe. How is that possible? You can't get minetest to uncheck the enable damage enabled when creative is checked. The problem with the enable_damage setting is that it can only apply globally and not to specific players. You could have per player enable damge but that would obviously be more complicated than assuming enable damage based on game mode. But then what will the enable_damge setting mean? One possiblity is that it could be PvP. If it is disabled players can't harm each other directly. However changing the meaning of the enable_damage setting would potentially break worlds/servers. BTW /gamemode survival from global creative mode does nothing.
Author
Contributor

By default, Minetest makes games start in survival mode with damage enabled.

default game start

With the above client settings, we can use both these commands:

/gamemode creative|survival
/set enable_damage true|false

If it's possible for games to override Creative mode and Enable damage in the client, great. If not, we should not to support them. We can disable both from the Minetest UI, according to this Minetest PR.

We would have to add this in game.conf:
disabled_settings = creative_mode, enable_damage

This is how it looks:
Minetest main menu without the creative_mode and enable_damage options

With this in mind, we can also add buttons in the inventory, so players can switch from one mode to another, and maybe even toggle damage. But at least the commands would work anyway.

By default, Minetest makes games start in survival mode with damage enabled. ![default game start](https://i.imgur.com/NAqRdRa.jpg) With the above client settings, we can use both these commands: ``` /gamemode creative|survival /set enable_damage true|false ``` If it's possible for games to override `Creative mode` and `Enable damage` in the client, great. If not, we should not to support them. We can disable both from the Minetest UI, according to [this Minetest PR](https://github.com/minetest/minetest/pull/11524). We would have to add this in `game.conf`: `disabled_settings = creative_mode, enable_damage` This is how it looks: ![Minetest main menu without the creative_mode and enable_damage options](https://i.imgur.com/1K1Loxe.jpg) With this in mind, we can also add buttons in the inventory, so players can switch from one mode to another, and maybe even toggle damage. But at least the commands would work anyway.

I think the /gamemode creative should also set enable_damage to false if it can. /gamemode survival should set enable_damage to true. People should only use /set enable_damage if they don't want to use a default.

I think the /gamemode creative should also set enable_damage to false if it can. /gamemode survival should set enable_damage to true. People should only use /set enable_damage if they don't want to use a default.
Member

I think that it should be a command, and should check privs. I mean, it's that way in Minecraft...

I think that it should be a command, and should check privs. I mean, it's that way in Minecraft...
Author
Contributor

I think that it should be a command, and should check privs. I mean, it's that way in Minecraft...

I took a better look at it, and Minecraft actually has four player-related damage settings in the game rules:

Rule Default
drowningDamage true
fallDamage true
fireDamage true
freezeDamage true

These should be accessible via the /gamerule command, part of the rules I mentioned in #2331.

> I think that it should be a command, and should check privs. I mean, it's that way in Minecraft... I took a better look at it, and Minecraft actually has four player-related damage settings in the [game rules](https://minecraft.fandom.com/wiki/Game_rule#List_of_game_rules): | Rule | Default | | - | - | | drowningDamage | true | | fallDamage | true | | fireDamage | true | | freezeDamage | true | These should be accessible via the `/gamerule` command, part of the rules I mentioned in #2331.
Author
Contributor

I just tested the latest master and apparently you can't disable the damage at all. Here's what I tried:

  1. With Creative Mode enabled from the Minetest menu
  • /set enable_damage false from the game
  • switched enable_damage to False from the client Settings
  1. Without Creative mode enabled from the client menu
  • /gamemode creative + /set enable_damage false
  • enable_damage set to False from the client Settings, with /gamemode creative

Just go to a pillager outpost with the damage "disabled", and you'll get murdered. They shouldn't even be aggressive in the first place, let alone do damage, so this is another bug on its own.

P.S. When you /set enable_damage false, the health bar will be disabled/hidden. But as you will still take damage, and you won't know how low your health is.

I just tested the latest master and apparently you can't disable the damage at all. Here's what I tried: 1. With Creative Mode enabled from the Minetest menu - `/set enable_damage false` from the game - switched `enable_damage` to `False` from the client Settings 2. Without Creative mode enabled from the client menu - `/gamemode creative` + `/set enable_damage false` - `enable_damage` set to `False` from the client Settings, with `/gamemode creative` Just go to a pillager outpost with the damage "disabled", and you'll get murdered. They shouldn't even be aggressive in the first place, let alone do damage, so this is another bug on its own. P.S. When you `/set enable_damage false`, the health bar will be disabled/hidden. But as you will still take damage, and you won't know how low your health is.

We will probably need an API, which checks order of precedence or priority. Game command should override both. Then the individual parts of the code can know nothing about the implementation, just call the API and get the single source of truth.

We will probably need an API, which checks order of precedence or priority. Game command should override both. Then the individual parts of the code can know nothing about the implementation, just call the API and get the single source of truth.
Member

We will probably need an API, which checks order of precedence or priority. Game command should override both. Then the individual parts of the code can know nothing about the implementation, just call the API and get the single source of truth.

Just check creative mode?

> We will probably need an API, which checks order of precedence or priority. Game command should override both. Then the individual parts of the code can know nothing about the implementation, just call the API and get the single source of truth. Just check creative mode?

Which one? The client code, or the one you set from the gamemode command? Each code reference will have to have that logic, then you just have duplicated logic in.

Which one? The client code, or the one you set from the gamemode command? Each code reference will have to have that logic, then you just have duplicated logic in.
Member

Which one? The client code, or the one you set from the gamemode command? Each code reference will have to have that logic, then you just have duplicated logic in.

There is no difference between checking gamemode and MT creative setting.

5c464f1c1d/mods/HUD/mcl_inventory/init.lua (L192)

> Which one? The client code, or the one you set from the gamemode command? Each code reference will have to have that logic, then you just have duplicated logic in. There is no difference between checking gamemode and MT creative setting. https://git.minetest.land/MineClone2/MineClone2/src/commit/5c464f1c1dc3da3a0ab15ba350ce6701dbd21163/mods/HUD/mcl_inventory/init.lua#L192
Author
Contributor

/set enable_damage true|false should have the top priority, as that's explicit from the user.

As for the other ways to disable the damage, we could remove the creative and damage options from the client, to check one less thing, and add creative + damage toggles in the inventory UI - more formspec work for @AFCMS. :D

game.conf:
disabled_settings = creative_mode, enable_damage

This is how it looks:
Minetest main menu without the creative_mode and enable_damage options

`/set enable_damage true|false` should have the top priority, as that's explicit from the user. As for the other ways to disable the damage, we could remove the creative and damage options from the client, to check one less thing, and add creative + damage toggles in the inventory UI - more formspec work for @AFCMS. :D > `game.conf`: > `disabled_settings = creative_mode, enable_damage` > > This is how it looks: > ![Minetest main menu without the creative_mode and enable_damage options](https://i.imgur.com/1K1Loxe.jpg)
Author
Contributor

Some recent testing (#3682) reminded me of this issue. We still need our game modes to make sense.

These are the defaults we should have:

Setting Survival Creative
drowningDamage true false
fallDamage true false
fireDamage true false
freezeDamage true false
hostileAggro (by player in range) true false
mobRetaliation (against players who damage them) true false

The players with the correct privileges would be able to toggle these for themselves, or globally. The last two settings don't exist in Minecraft, probably because they don't want to give the players the option to change the defaults. We could do the same, or not, we can discuss this.

The command would be: /set <setting> true|false [global]

It would be useful to register a privilege for players who would be entrusted to change their own game mode (usually mods or admin helpers). Changing the global setting should probably be limited to those having the server privilege.

Minecraft also has universalAnger (defaults to false in both modes), which makes angered neutral mobs attack any nearby player, not just the player that angered them. Works best if forgiveDeadPlayers is disabled. I only mentioned this to be here, I'm not sure if we really need it, but I can see why some server owners would do it for fun.

Now the problem with multiple damage-related settings is that enable_damage would no longer be consistent because it's a boolean and we can't set it to "custom" when we have mixed states on the granular settings. So either we disable all damage with enable_damage, or go custom.

A potential advantage of sticking with enable_damage is compatibility with mods that care about this setting. But does Minetest treat it per-user or globally?

Some recent testing (#3682) reminded me of this issue. We still need our game modes to make sense. These are the defaults we should have: | Setting | Survival | Creative | | - | - | - | | drowningDamage | true | false | | fallDamage | true | false | | fireDamage | true | false | | freezeDamage | true | false | | hostileAggro (by player in range) | true | false | | mobRetaliation (against players who damage them) | true | false | The players with the correct privileges would be able to toggle these for themselves, or globally. The last two settings don't exist in Minecraft, probably because they don't want to give the players the option to change the defaults. We could do the same, or not, we can discuss this. The command would be: `/set <setting> true|false [global]` It would be useful to register a privilege for players who would be entrusted to change their own game mode (usually mods or admin helpers). Changing the global setting should probably be limited to those having the `server` privilege. Minecraft also has `universalAnger` (defaults to `false` in both modes), which *makes angered neutral mobs attack any nearby player, not just the player that angered them. Works best if `forgiveDeadPlayers` is disabled.* I only mentioned this to be here, I'm not sure if we really need it, but I can see why some server owners would do it for fun. Now the problem with multiple damage-related settings is that `enable_damage` would no longer be consistent because it's a boolean and we can't set it to "custom" when we have mixed states on the granular settings. So either we disable all damage with `enable_damage`, or go custom. A potential advantage of sticking with `enable_damage` is compatibility with mods that care about this setting. But does Minetest treat it per-user or globally?
Member

My thoughts are... two weeks ago I probably would have argued against per-user creative mode. Now, I have seen realistic uses for that.
the problems I see with the damage settings based on individual users, is that it would get checked in the mob's do_step() and that would make things laggy-er.

I can see where some people on the server do not want to be in survival - they just want to build cool things. And, for them, having creative mode (individually) makes sense. Personally, I prefer Survival over Creative. I dunno, something about just having everything at my finger tips just takes the fun out of it. And, I feel that it lessens the things that I create. But, others just want to play with cool digital Legos and make artistic builds. And, for replayability and survival of the game, that needs to happen.

My real "ugh" about the additional settings is that Minetest built in their modes, and also the additional performance overhead. And, the way that I see it, it's going to be implemented as a check of a list, and then choosing to do/do not damage/attack the player. And, while this wouldn't be too bad if it was one or two players, it would be an issue if it's a good chunk of players that it has to check for. The other downside I see, is having to go through and implement the settings in a number of places so that the code actually respects the command settings. That's going to make a nightmare PR.

Right now, it just checks for enable_damage and if it's false mobs don't target players. But, this is all part of building one's own creative mode, and related settings. Though, in this, one could create a Spectator Mode, too, as it's going to use the same no-damage per-user settings. So, might as well. And, it would allow for some of the more cool things like screenshots, vids etc.

My thoughts are... two weeks ago I probably would have argued against per-user creative mode. Now, I have seen realistic uses for that. the problems I see with the damage settings based on individual users, is that it would get checked in the mob's do_step() and that would make things laggy-er. I can see where some people on the server do not want to be in survival - they just want to build cool things. And, for them, having creative mode (individually) makes sense. Personally, I prefer Survival over Creative. I dunno, something about just having everything at my finger tips just takes the fun out of it. And, I feel that it lessens the things that I create. But, others just want to play with cool digital Legos and make artistic builds. And, for replayability and survival of the game, that needs to happen. My real "ugh" about the additional settings is that Minetest built in their modes, and also the additional performance overhead. And, the way that I see it, it's going to be implemented as a check of a list, and then choosing to do/do not damage/attack the player. And, while this wouldn't be too bad if it was one or two players, it would be an issue if it's a good chunk of players that it has to check for. The other downside I see, is having to go through and implement the settings in a number of places so that the code actually respects the command settings. That's going to make a nightmare PR. Right now, it just checks for enable_damage and if it's false mobs don't target players. But, this is all part of building one's own creative mode, and related settings. Though, in this, one could create a Spectator Mode, too, as it's going to use the same no-damage per-user settings. So, might as well. And, it would allow for some of the more cool things like screenshots, vids etc.
Sign in to join this conversation.
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: VoxeLibre/VoxeLibre#3191
No description provided.