ATBTT - Experiments - Terrain Costs #2

ATBTT - Experiments - Terrain Costs #2

Modifying Terrain Movement Costs in Game Development

Introduction to Terrain Map

  • The speaker revisits a terrain map created previously, prompted by a developer's question about varying movement costs for different terrains.
  • A new inquiry from another developer, Augmented Smurf, focuses on modifying terrain behavior, particularly regarding water tiles and movement termination.

Water Movement Mechanics

  • The goal is to allow units to enter water but prevent them from moving out until the next turn, regardless of their remaining movement points.
  • Additional requests include adjusting movement costs when transitioning between different elevations and providing extra movement for units starting on road tiles.

Implementing Movement Changes

  • The tutorial will address three main modifications: water entry rules, height-based movement costs, and road tile advantages.
  • The current setup allows defining terrain costs within each unit; however, water needs special handling to behave differently than other terrains.

Pathfinding Adjustments for Water

  • The existing pathfinding logic must be modified so that entering water does not add it to the list of valid tiles for further searching.
  • If a tile is identified as water during pathfinding checks, it should not contribute to the search paths despite being reachable.

Enhancing Pathfinding Logic

  • New variables are introduced in the pathfinding function to track total movement cost while ensuring efficient processing without redundant calculations.
  • Units can still enter water tiles but cannot continue moving through them until their next turn; this requires careful management of pathfinding conditions.

Testing Water Movement Functionality

  • After implementing changes, testing shows that units can enter water but cannot move through it immediately. This aligns with Augmented Smurf's request.

Implementing Height-Based Movement Costs

Road Tile Advantages

  • Next steps involve enhancing unit capabilities based on starting positions on road tiles by increasing their available movement range.

Adjusting Pathfinding for Roads

  • By checking if a unit starts on a road tile (dirt), its move range can be increased by three units during pathfinding operations.

Visualizing Movement Changes

  • Adjustments are made to the grid UI for clearer visualization of movements across different terrains and ensure accurate representation of available moves.

Managing Height Differences in Terrain

Creating Platforms with Height Variations

  • A new grid actor is introduced to facilitate height differences in gameplay. This involves creating platforms that players can navigate vertically.

Configuring Grid Manager Settings

  • Modifications are needed in the grid manager settings to enable height differences effectively while maintaining proper collision detection during placement.

Finalizing Height Adjustment Logic

  • The edge cost calculation logic is updated so that moving up incurs higher costs compared to moving down. This reflects realistic elevation challenges within gameplay mechanics.

Conclusion and Further Discussion Opportunities

Open Invitation for Questions

  • The speaker encourages viewers with additional questions or clarifications regarding these implementations or related topics to engage via Discord or support threads.

Turn any video into a summary like this

YouTube links, meetings, lectures. With transcripts, search, and chat.

Video description

In this video I demonstrate how to tweak and modify pathfinding in ATBTT in various ways, based on a question asked in my support thread. Here I add water that halts movement, roads that grant extra move points and one directional move cost penalties for tile height differences. Even though this was made over a year later, I build upon the features I added in Terrain Costs #1. So if you want to follow along I recommend watching that one first: https://www.youtube.com/watch?v=8JEzy1Z80xU Link to support thread on the UE4 forums: https://forums.unrealengine.com/unreal-engine/marketplace/31005-support-advanced-turn-based-tile-toolkit?60108-Advanced-Turn-Based-Tile-Toolkit-Released-Large-Images= Join the ATBTT Discord: https://discord.gg/pYvPwCG Available at the Unreal Engine Marketplace: https://www.unrealengine.com/marketplace/en-US/product/advanced-turn-based-tile-toolkit