Skip to content

Comments

Subject: Feature Request/Pull Request: Dynamic Camera Movement Speed based on Height#49

Open
winyunq wants to merge 11 commits intoHeyZoos:mainfrom
SecondSinoJapaneseWar:main
Open

Subject: Feature Request/Pull Request: Dynamic Camera Movement Speed based on Height#49
winyunq wants to merge 11 commits intoHeyZoos:mainfrom
SecondSinoJapaneseWar:main

Conversation

@winyunq
Copy link

@winyunq winyunq commented Sep 22, 2025

Subject: Feature Request/Pull Request: Dynamic Camera Movement Speed based on Height

Hi, HeyZoos

First and foremost, I want to express my appreciation for your excellent RTS Camera plugin! It's a
fantastic piece of work, and I'm planning to integrate it into my own RTS game project.

During my development and testing, I identified an opportunity to enhance the camera's usability,
particularly in the context of RTS gameplay. I believe the current camera movement speed could benefit
from being dynamically linked to the camera's current height.

Motivation for this feature:
In RTS games, players often switch between macro-management (overview of the battlefield) and
micro-management (detailed unit control).
Higher camera altitudes* are typically used for macro-management, where faster movement across the map
is desirable for quick strategic adjustments.
Lower camera altitudes* are for micro-management, where slower, more precise movement allows for
accurate unit positioning and control.
This dynamic adjustment would significantly improve the player experience by intuitively matching movement
speed to the current strategic context.

Implemented Changes:
I've implemented a system that adjusts the camera's movement speed based on its height. Specifically, the
changes include:

  1. Unified Movement Parameter: Both edge scrolling and key-based movement now utilize a single,
    height-interpolated movement speed parameter.
  2. Base Speed Introduction: A foundational movement speed has been introduced.
  3. Height-Based Interpolation: The current camera speed is now interpolated based on the camera's height,
    ensuring a smooth transition between fast (high altitude) and slow (low altitude) movement.

These modifications are primarily contained within RTSCamera.cpp and RTSCamera.h.

I'm relatively new to the Git pull request process, but I've prepared these changes and hope you'll find
them a valuable addition to the plugin. I've focused on modifying RTSCamera.cpp and RTSCamera.h to achieve
this functionality.

Thank you again for your contribution to the community!

  - 左键点击:单选 (Exclusive Select)。
  - 左键框选:多选 (Box Select)。
  - Shift + 点击:反选/移除 (Toggle/Remove)。
  - Shift + 框选:追加选择 (Append),且具备类型一致性保护 (Type Consistency)。
  - Ctrl + 点击:全屏同类选择 (Select All On Screen)。
  - Tab:在选中单位的子组间循环切换 (Cycle Subgroup)。
- 优化框选判定阈值:
  - 引入 1像素 (1px) 严格阈值,区分点击与框选。
  - 只有拖拽距离 > 1px 时才绘制绿框和执行框选逻辑,实现所见即所得。
- 增强视觉反馈:
  - 绿框增加半透明蒙层 (SelectionBoxFillColor),提升辨识度。
  - UI 增加 Grid 池化复用逻辑,解决 Grid 布局抖动问题。
- 数据层完善:
  - URTSSelectable 组件新增 Icon, Health, Shield 等基础 RTS 属性。
  - SelectionSubsystem 正确读取并传递这些数据到 UI。
  - 左键点击:单选 (Exclusive Select)。
  - 左键框选:多选 (Box Select)。
  - Shift + 点击:反选/移除 (Toggle/Remove)。
  - Shift + 框选:追加选择 (Append),且具备类型一致性保护 (Type Consistency)。
  - Ctrl + 点击:全屏同类选择 (Select All On Screen)。
  - Tab:在选中单位的子组间循环切换 (Cycle Subgroup)。
- 优化框选判定阈值:
  - 引入 1像素 (1px) 严格阈值,区分点击与框选。
  - 只有拖拽距离 > 1px 时才绘制绿框和执行框选逻辑,实现“所见即所得”。
- 增强视觉反馈:
  - 绿框增加半透明蒙层 (SelectionBoxFillColor),提升辨识度。
  - UI 增加 Grid 池化复用逻辑,解决 Grid 布局抖动问题。
- 数据层完善:
  - URTSSelectable 组件新增 Icon, Health, Shield 等基础 RTS 属性。
  - SelectionSubsystem 正确读取并传递这些数据到 UI。
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.

1 participant