minicraft-plus-revived icon indicating copy to clipboard operation
minicraft-plus-revived copied to clipboard

Adds a Debug Panel

Open BenCheung0422 opened this issue 1 year ago • 27 comments

This adds a debug panel and removes all in-world debugging key bindings. This could make the key bindings cleaner and neat. Instead, a list entry menu (triggered by F4) is used and searching is available. (No localization) This would be a way to organize all the debugging functions and features without a lot of (confusing or messy) key bindings.

BenCheung0422 avatar Jun 19 '23 09:06 BenCheung0422

No new debug panel is needed. The arguments I presented in #502 still apply. This is bloat, and I would prefer going back to the way it was before #454 (although not all changes are bad in that pull-request).

Makkkkus avatar Jun 20 '23 13:06 Makkkkus

However, I think there might be too many key bindings and that might make confusion. And I prefer reducing unnecessary key bindings as not all debugging keys are always used and sometimes they bind to different modifiers .

BenCheung0422 avatar Jun 20 '23 13:06 BenCheung0422

It doesn't matter. They're only possible to use when using debug mode.

Makkkkus avatar Jun 20 '23 14:06 Makkkkus

It can still be a problem as sometimes looking-up for key bindings is still required if the key bindings are forgotten or not yet known.

BenCheung0422 avatar Jun 20 '23 14:06 BenCheung0422

That's why we have our wiki. Using F3 or F4 won't change that.

Makkkkus avatar Jun 20 '23 14:06 Makkkkus

And a in-game instant lookup. F3 only triggers the debugging information panel, but this F4 triggers an action panel.

BenCheung0422 avatar Jun 20 '23 14:06 BenCheung0422

Yeah, it's not needed.

Makkkkus avatar Jun 20 '23 20:06 Makkkkus

There are 23 associated debugging key bindings, if every time using the bindings requires lookup, using built-in interface with only 1 key would be better than opening up the wiki page on browser and find line by line the key bindings required. This compresses 23 key bindings into 1 key. Sometimes, if it is required to add debugging functions, new key bindings are always needed, but in the panel, it is not a hard requirement.

BenCheung0422 avatar Jun 21 '23 04:06 BenCheung0422

I'll reopen this on the condition that you readd the --debug launch argument.

Makkkkus avatar Jun 23 '23 13:06 Makkkkus

I have re-added Game#debug and --debug flag. The corresponding codes that was relying on that field have also recovered. I am not sure if the detailed debugging flags --debug-* should be enabled only when --debug is also enabled.

BenCheung0422 avatar Jun 23 '23 13:06 BenCheung0422

There could be a function to area set tiles with using menus (inputs) and some more useful functions can be used for making maps?

BenCheung0422 avatar Jul 09 '23 06:07 BenCheung0422

I don't understand what you mean?

Makkkkus avatar Jul 09 '23 12:07 Makkkkus

When making maps, special actions to changes tiles and entities are required. Testing some features may also require large range tiles.

BenCheung0422 avatar Jul 09 '23 13:07 BenCheung0422

Still don't understand. Creating maps?

Makkkkus avatar Jul 09 '23 21:07 Makkkkus

Customizing worlds in creative mode. Although there are currently no trends in making maps and publishing maps because there is lack of this kind of functionality, testing some features is still requiring an environmental setup and that might require major change to the testing world. Having this kind of debugging or creative mode exclusive functions could reduce the work required and make convenience. Some of this kind of functions I can think of are tile setting, region filling, entity summoning, potion effect modifying, etc.

BenCheung0422 avatar Jul 10 '23 07:07 BenCheung0422

What do you want to do?

Makkkkus avatar Jul 13 '23 00:07 Makkkkus

Add a debug function entry in the panel and use menus to do the actions.

BenCheung0422 avatar Jul 13 '23 02:07 BenCheung0422

We already have creative mode. Don't destroy that.

Makkkkus avatar Jul 13 '23 12:07 Makkkkus

It also adds another function to creative mode, like Minecraft's fill command.

BenCheung0422 avatar Jul 14 '23 14:07 BenCheung0422

Okay. That's something I see the use for.

Makkkkus avatar Jul 14 '23 15:07 Makkkkus

There are several functions I want to add for the panel (might be enabled in creative mode?):

  • regional tile filling - implementation with using a sub-menu of tile list or input entry for tile selection and another 2 sets of input entries specifying the region.
  • tile setting - specifying a tile with positions and modifying the tile data.
  • entity killing - killing entities by conditions.
  • item giving - giving an item with using an input entry and may allow modifying item data.
  • status effect modifying - adding or removing player's status effects (potion effects).
  • inventory clearing - clearing the whole inventory.
  • day locking or time locking - locking the daytime and day-night cycle.
  • entity summoning - summoning a or a number of specific entity(s) without a spawner (softly or forcedly).

BenCheung0422 avatar Jul 14 '23 15:07 BenCheung0422

Nothing should be enabled when you aren't in debug mode. It shouldn't matter if you are playing on creative or survival.

Makkkkus avatar Jul 19 '23 20:07 Makkkkus

Right, since they are debug functions. Then what about the functions mentioned to be added?

BenCheung0422 avatar Jul 20 '23 06:07 BenCheung0422

All of them are fine. It's the implementation that matters in this case.

Makkkkus avatar Jul 20 '23 17:07 Makkkkus

However, I am not sure how should I do for tile selection. Tile (or entity, etc.) list menu could be intuitive, but an input entry could be convenient without scrolling.

BenCheung0422 avatar Jul 21 '23 04:07 BenCheung0422

We might change some of them into string commands if we need to. Also, the implementations of the commands proposed previously have been done.

BenCheung0422 avatar Aug 15 '23 15:08 BenCheung0422

I have reviewed the PR, but I don't approve of the changes as explained in Discord.

ChristofferHolmesland avatar Aug 16 '23 17:08 ChristofferHolmesland