Ported autotiling algorithm from the original UH and added road building mechanics. The unchecked tasks are meant to be done in a succeeding PR, so that the base functionality is already in place.
To check out tiling, open PlayerCamera node and set the root node's default_interaction_context to the TileContext sub node inside PlayerCamera. Also follow the note in the TileContext script in _ready.
Later on, the context should be interchangeable through to the UI by utilizing PlayerCamera's switch_context method.
Requirements:
Two tiling modes:
[x] Click and release to draw planned line from point of activation. Click again to place it effectively. (slow method)
[ ] Click and hold to draw a planned line up to two cells minimum. Release to place it effectively. (fast method)
Abortion:
[x] Cancel tiling in any mode immediately by the cancel action (right click by default).
Visuals:
[x] Indicate valid lines (green).
[ ] Indicate invalid lines (red).
Additional remarks (issues):
Currently, the trail won't be built correctly along the terrain when the cursor is moved too fast. To resolve it, all GridMap tiles passed by the cursor should be registered (as a path in an array) and an appropriate A* calculated road built along of them.
The trail should remain the axis it is drawn on for a certain extent to allow for straight lines to be drawn simpler (see FIFE UH for reference code).
Added Utils/GridMapCreatePathModes.gd which can be used on tile scenes (i.e. TrailMeshes, GravelPathMeshes, StonePathMeshes) to add differently colored tiles (green/red for valid/invalid cells).
@sairam4123
@artism90 wanted to finish this pr. But at the moment he don't have the time for it.
But you can start to work on some different if you like?
Ported autotiling algorithm from the original UH and added road building mechanics. The unchecked tasks are meant to be done in a succeeding PR, so that the base functionality is already in place.
To check out tiling, open
PlayerCamera
node and set the root node'sdefault_interaction_context
to theTileContext
sub node insidePlayerCamera
. Also follow the note in theTileContext
script in_ready
. Later on, the context should be interchangeable through to the UI by utilizingPlayerCamera
'sswitch_context
method.Requirements:
Two tiling modes:
Abortion:
Visuals:
Additional remarks (issues):
Added
Utils/GridMapCreatePathModes.gd
which can be used on tile scenes (i.e.TrailMeshes
,GravelPathMeshes
,StonePathMeshes
) to add differently colored tiles (green/red for valid/invalid cells).