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

Improving the usability of automappers #9512

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

VoxelDoesCode
Copy link
Contributor

@VoxelDoesCode VoxelDoesCode commented Jan 12, 2025

Summary

As of: Jan. 12, 2025:

This PR focuses on making the automapping feature much more manageable and flexible for mappers and map designers. The features included/planned are as follows:

  • Adding a reference layer that focuses on Game Tiles and Game Tile types (or possibly other tile layers in the future!)
  • Adding a guide layer, and adding a new rule to the automap code to compare the current layer and the guide layer!
    • For example: Index 37; Pos 0 0 Index 1 Guide (This will check the guide layer to see if that position if index 1, rather than the current layer.
    • This will make it much easier to make proper freeze automaps, because it will let you scan the blocks it touches so there's no visible gaps!
  • Adding a modulo command in the automap code, making checkerboard patterns automated!
    • For example: Index 2; Pos 0 0 Mod 2 2 0 1 (The Mod command will have 4 inputs: moduloX, moduloY, offsetX and offsetY)

Examples:

automapper.demo.v1.mp4

What is the motivation behind this?

When making a map, a lot of people focus on mapping out in entities first, which can make decorating after very tedious. Mappers made a workaround that utilize a blank image, a,d if you copy the entire game layer onto the blank tile layer, there provides options for how you can filter out tiles. I find that very inefficient, and almost like a chore. I am making this with the same thought process behind all my other editor ideas: make maps easier. I am aware that you can decorate first and then copy that onto the game layer, but that feels like you have to decorate first in order to see if the map is playable. Game play should always come first!

Checklist

TODO:

  • Allow for a reference layer to be used
  • Add the reference button
  • Make it so that no reference still works
  • Have the filtered tile types work
  • Allow for a guide layer to be used
  • Make the logic in the automap code
  • Have it look at every tile layer
  • Allow for modulo scanning in automapping
  • Make the logic in the automap code

Meta:

  • Tested the change ingame
  • Provided screenshots if it is a visual change
  • Tested in combination with possibly related configuration options
  • Written a unit test (especially base/) or added coverage to integration test
  • Considered possible null pointers and out of bounds array indexing
  • Changed no physics that affect existing maps
  • Tested the change with ASan+UBSan or valgrind's memcheck (optional)

@def-
Copy link
Member

def- commented Jan 12, 2025

This looks very cool!

@VoxelDoesCode
Copy link
Contributor Author

I found an issue: How do I make it work for any automap that doesn't start with an additive rule? For example in basic_freeze.rules, it starts out with removing every unnecessary corner piece, resulting in: Index 0; Pos 0 0 NOTINDEX [...]. Because of how I set it up, where it first reads a reference layer, and then switches back to itself after the first run, there's not really anything it can work off of.
Should I add extra checks for a tile is additive or not?

Code fixes to be squashed
src/game/editor/auto_map.cpp Outdated Show resolved Hide resolved
src/game/editor/auto_map.cpp Outdated Show resolved Hide resolved
src/game/editor/auto_map.cpp Outdated Show resolved Hide resolved
if(DoButton_Ex(&pIds[i], pName, 0, &Shifter, 0, nullptr, IGraphics::CORNER_ALL))
PopupSelectAutoMapReferenceInvoke(pProps[i].m_Value, Ui()->MouseX(), Ui()->MouseY());

int r = PopupSelectAutoMapReferenceResult();
Copy link
Member

Choose a reason for hiding this comment

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

r -> Result

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But it's r everywhere else in the code. Should there be a seperate PR to focus on that soon?

src/game/editor/auto_map.cpp Fixed Show resolved Hide resolved
hotfix

Much cleaner hotfix

Compile error fixes, to be squashed

Error fixes to be squashed 2: electric boogaloo

check_style fix to be squashed
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.

3 participants