Skip to content

Symmetric Painting #465

@Goutte

Description

@Goutte

Is your feature request related to a problem? Please describe.

We want to make an approximately symmetric map (RTS duel), not an exactly symmetric one. Easiest way is to allow this gorgeous addon to paint symmetries, on-demand.

Describe the solution you'd like

A brush (or filter, whatever) option to enable/disable symmetric painting.

Describe alternatives you've considered

Using three HTerrains:

  • Top
  • Bottom (rotated HTerrain with the same data as Top)
  • Global (bigger HTerrain covering everything)

It's clunky to have all three for the minimap (which is easy with just one HTerrain), navmesh (that one's OK in both cases) and fog of war (urgh).

And for spatialized game data passed to shaders as images for rendering or computation, it's simpler with one single HTerrain covering the whole map, instead of juggling with a mosaic.

Additional context

Managed to make a PoC :

image

  • The brush configures the painter with the symmetry.
  • The painter paints as many times as necessary.
  • The PoC is quite hacky. (writing twice in the same frame would be better)
func paint_input(center_pos: Vector2):
	_do_paint_input(center_pos)
	if _brush_symmetry == Symmetry.CENTRAL:
		_do_paint_input_when_available(_texture.get_size() - center_pos)


# This stunt was performed by a trained professional. Please do not try this at home.
func _do_paint_input_when_available(center_pos: Vector2):
	while true:
		await get_tree().process_frame
		if is_operation_pending():
			continue
		_do_paint_input(center_pos)
		break

Anyone also interested in symmetries ?

Perhaps with guidance I could clean this up ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions