Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In-game editor #299

Merged
merged 98 commits into from May 7, 2022
Merged

In-game editor #299

merged 98 commits into from May 7, 2022

Conversation

ds-sloth
Copy link
Collaborator

@ds-sloth ds-sloth commented Feb 28, 2022

The in-game editor has been ported and is ready for testing and feedback as we prepare to merge. To enable the editor for testing, please set the "enable-editor" flag in the "[main]" section of the settings ini. Additionally, the editor icons found here (https://github.com/Wohlstand/TheXTech/blob/master/docs/EditorIcons.png) should be placed in the ui asset directory.

It should currently have full game-controller support (without multiplayer / multicursor at this time) for in-couch editing and testing.

It currently lacks support for most TheXTech-exclusive features, but it will not damage levels that include them.

In case of any issues, please back up any of your own work before editing it in the in-game editor at this time.

On my side, I think we are ready for a merge, maybe with a minor notice that the editor is in a beta state. However, I am sure that community members will have some good feedback before we do so.

Todo list:

  • Confirm and fix controls issues
  • (need test) tested by @0lhi , thank you!
  • Implement the new npc_special_data system
  • (need Wohlstand's feedback and test)
  • Implement all (most) of Wohlstand’s other new features
  • Tune the controls for devices without two directional controls

@0lhi
Copy link
Collaborator

0lhi commented Feb 28, 2022

I cannot navigate the levels with arrow keys unless I start testing and leave it again.

I can control Mario with a keyboard, but not with a controller.

When I repeatedly press Start with a Controller, this happens:

Scr_2022-02-28_18-57-27

(Start doesn't leave the Pause Menu, but seems to "reopen" it.)

else if(n.Type == 86)
npc.special_data = n.Special7;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the time, there are more NPCs got the support for Special7 such as rail platforms, bill blasters, etc.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we just set npc.special_data = n.Special7 for everything?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔
Not so, just for these NPC that got this rule at the side of the main level file loader. There are some custom rules that could be done.

@ChristianSilvermoon
Copy link

ChristianSilvermoon commented Mar 5, 2022

So as mentioned over on Discord, I'll keep this comment up to date with my suggestions, findings, etc.

Last Updated: 2022/03/23 @ 8:40 PM (UTC)

Polish Suggestions

Improve UI Visuals

  • Try replacing the top bar's flat color with a simple gradient that fits within the 16-bit aesthetic and add a simple border-frame (the sides of the frame can/should be cropped on lower resolutions
    image
  • For the large menu, use the same transparent black background seen in the Abstract Controls Menus and extend the frame down/around it
  • Consider removing the dark squares behind icons.
  • Add a splash of color to some more of the editor icons
    image
  • For the Music Setting in the menu, use the Music Note Editor Icon as opposed to the Orange Hand.
  • For True/False checkboxes in the UI, use the "" or "✘" Editor Icons instead of a green outline
  • For the Destroyed Blocks Layer, use the "block-4" graphic as opposed to the orange hand
  • For the Spawned NPCs layer, use the "npc-1" graphic as opposed to the orange hand

Visual Feedback

  • When switching sections using Editor hotkeys display "Section 2", "Section 3", etc in the middle of the screen for a second.
  • Display text centered below the top bar that identifies the hovered element (IE "Selection Tool", "Eraser", "Blocks", "Background Objects", "NPCs", "Water and Quicksand", "Warps", "Level and Section Settings", "Layers", "Events", "Save and Load", "Play Test")
  • When a layer other than Default is selected, display the layer name next to the cursor (As in the original SMBX editor)
  • If possible add an option to dim the graphics that belong to layers other than the one selected.

Audio Feedback

  • When clicking UI Elements, play "sound-74" (smw-saw.ogg)
  • When changing sections, play "sound-26" (slide.ogg)
  • When toggling large menu, play "sound-30" (pause.ogg)

Quality of Life

  • During Playtesting, bring up the pause menu on death. This can prevent being stuck in death loops if you die too quickly after re-spawning. It can be very difficult to pause in time in these situations and this would effectively solve that problem for the play tester. Can be made optional with a 'editor-pause-on-death' setting

Support More Limited Input Devices

  • Attempt to keep all functionality with only a d-pad, start/select, and A/B/X/Y, so that no additional inputs are required to use the editor beyond what are required to play the game. Extra Quality of Life Features can still be on additional inputs, but it should be possible to create and edit levels without them.

Bugs Found

  • Cursor sometimes behaves strangely when using Gamepad. Possibly a bug in the saving of Abstract Controls
    Scr_2022-02-27_21-22-23
  • Cursor does not line up with where clicks occur on the on screen keyboard in Editor
    image
  • Pressing the Menu button also counts as a click on icons. This can lead to unintentionally activating menu items as soon as the menu comes up, before it even renders, like so
    Scr_2022-03-23_13-27-03
  • Exiting the editor shows a visual error when returning to the Title Screen. This visual error is not picked up by the in-game GIF recorder.
    thextech-editor-menu-bug

@P-Star7
Copy link
Contributor

P-Star7 commented Mar 14, 2022

Why are some of the SMW 16x16 hill sceneries enlarged, and others are not?

Also don't worry, if the editor UI is in the repo then I can enhance the icons later.

@ds-sloth
Copy link
Collaborator Author

@P-Star7 to my knowledge they are all treated the same way, maybe the hills that are not enlarged are actually on 32x32 canvases?

@ds-sloth
Copy link
Collaborator Author

@ChristianSilvermoon I fixed the cursor line-up issue, thanks for reporting it.

When a layer other than Default is selected, display the layer name next to the cursor (As in the original SMBX editor)

This should already be done. Are you not seeing it?

@Wohlstand I should have fixed the MagicHand integration, but I realize, there are certain events at the PGE editor that might break the integration (making a new layer, mainly). Should we worry about this or keep it as-is?
Similarly, any changes in the TheXTech editor (like changing a block's ID after picking it up) are not reflected. Should we try to fix this, or should we disable the in-game editor UI when Interprocess is active?
Also, I am surprised that Water/Quicksand can't be changed during MagicHand, and I might change this at the in-game editor. If you want to synchronize with this, you would need to update the Moondust editor on your side also.

@ChristianSilvermoon
Copy link

@ChristianSilvermoon I fixed the cursor line-up issue, thanks for reporting it.

When a layer other than Default is selected, display the layer name next to the cursor (As in the original SMBX editor)

This should already be done. Are you not seeing it?

@Wohlstand I should have fixed the MagicHand integration, but I realize, there are certain events at the PGE editor that might break the integration (making a new layer, mainly). Should we worry about this or keep it as-is? Similarly, any changes in the TheXTech editor (like changing a block's ID after picking it up) are not reflected. Should we try to fix this, or should we disable the in-game editor UI when Interprocess is active? Also, I am surprised that Water/Quicksand can't be changed during MagicHand, and I might change this at the in-game editor. If you want to synchronize with this, you would need to update the Moondust editor on your side also.

I was not, but I'll check and report back when I can

@LoveBodhi
Copy link
Contributor

I still need to verify the new editor after finish.

@ds-sloth
Copy link
Collaborator Author

Powered up eraser and added the single vs multi-type ("axe mode") erase distinction as we discussed in Discord.

@LoveBodhi
Copy link
Contributor

Axe mode is like Mario Editor, when clear the selection, will remove all objects.

@LoveBodhi
Copy link
Contributor

LoveBodhi commented Apr 23, 2022

Found some problems

Scr_2022-04-23_16-45-38

Sizable block can only be placed one per ID

Scr_2022-04-23_16-32-41

Custom GFX effect vanish when enter world name (Intro Level)

Scr_2022-04-23_16-33-53

Scr_2022-04-23_16-35-54

Custom / Extended Slot doesn't shown, and the music name displaying issue

Scr_2022-04-23_16-50-18

Doesn't support custom size of block GFX

(I used Nostalgic Paradise for testing)

Copy link
Contributor

@LoveBodhi LoveBodhi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there's asset-based elements and custom block GFX, that's fine.

@ds-sloth
Copy link
Collaborator Author

Thanks @LoveBodhi for the review!

I've fixed the issue you spotted where the title's assets were unloaded. Thank you for reporting this.

Some questions:

Sizable block can only be placed one per ID

I can't reproduce this issue. Can you follow up with a screenshot including you selecting the sizable block you are trying to place?

Custom / Extended Slot doesn't shown,

The in-game editor is not intended to show options that are absent from the SMBX editor with only a few exceptions. Can you explain how you would want this to be changed? I can consider this feature but I do not think it is needed before we merge the in-game editor.

and the music name displaying issue

What is the issue here? How would you want the music names to be displayed?

Doesn't support custom size of block GFX

Is this feature supported in SMBX? Where is custom block GFX size set?

@LoveBodhi
Copy link
Contributor

LoveBodhi commented Apr 24, 2022

What is the issue here? How would you want the music names to be displayed?

Asset-varied. It should be a configurable name like music.ini.

For custom size of block GFX, It can only be placed via Moondust. SMBX supports custom block size.

As for sizable block placing issue it's:

Scr_2022-04-25_06-53-01

Might be Windows®issue.

Doesn't support custom size of block GFX

Is this feature supported in SMBX? Where is custom block GFX size set?

Yes, depend by the image size (e.g. using a 64x64 block in a 32x32 block).

@LoveBodhi
Copy link
Contributor

Also, Tileset Organization should be asset-varied instead of just SMBX 1.3 constant.

@ds-sloth
Copy link
Collaborator Author

The infrastructure for this option does not exist at the moment, but I can add an option to display them in ID order without headings if that would be useful?

@LoveBodhi
Copy link
Contributor

LoveBodhi commented Apr 26, 2022

The infrastructure for this option does not exist at the moment, but I can add an option to display them in ID order without headings if that would be useful?

That should can be done...

(possible more...)

Suggested to always write floating point numbers in complete form,
I don't remind where, but was explained that using incomplete forms like ".42" or "42."
is not good and leads some issues, I still attempting to find the explanation of this to proof it...
X = -4000.0;
Y = -4000.0;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not to make the sort of -9999999999999 (something ultra-huge and being constant in binary form to avoid possible false positives, or something, but right, Editor won't allow non-multiple 32 camera location being set).

src/graphics/gfx_update.cpp Outdated Show resolved Hide resolved
- Added license headers where missing
- tweaked "write_common" module, make it look nicer and don't produce weird errors while using header
- added missing header guards (using both pragma once and define-based)
- added loading of heads at src/editor directory to make them display at IDE like Qt Creator and others
- etc.
Use the RENDER_FULLSCREEN_ALWAYS where is needed to enforce fullscreen only mode
Otherwise, lots of annoyance while clicking page switching
@Wohlstand
Copy link
Owner

Okay, I had checked the most of basic stuff on the PC platform, and seems it's fine if don't count some places which need to be tested/polished more. That could be done later, and Editor itself could be kept as an "experimental" thing even after release.

Copy link
Owner

@Wohlstand Wohlstand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All seems to look fine, we can merge this soon if nothing special is needed. All bug fixes related to the Editor could be done after merging easily. Also, I will need to test out the work of things on Android using the touchscreen and plugged gamepad.

The editor seems still needs more polishing (regarding events settings, etc.), and so, even if we release the general thing, we can mark this editor as an experimental thing easily.

@Wohlstand
Copy link
Owner

Forgot to mention that there is still be a problem at the main menu that you can't point the lowerest menu item by mouse when Editor is enabled:

Снимок экрана от 2022-05-04 03-52-15

@Wohlstand Wohlstand merged commit f6e3e21 into master May 7, 2022
21 checks passed
@Wohlstand
Copy link
Owner

Keeping in a mind, the menu bug still not been fixed, so, keeping it to be fixed later into branch "master" directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants