Draft
Conversation
Summary Implements player-controlled industrial elevators per BattleTech rules, distinct from the existing Solaris 7 random "moving walls" elevator system. Key Features - New terrain type: INDUSTRIAL_ELEVATOR (type 60) - separate from Solaris ELEVATOR (type 36) - Player-controlled movement: Units on the platform can ascend/descend at 1 MP per level - Platform tracking: Elevator platform position persists across turns - Shaft boundaries: Configurable shaft top/bottom limits from terrain data - Capacity system: Elevators have tonnage limits (encoded in terrain) - Client-server sync: Platform state synchronized via UPDATE_INDUSTRIAL_ELEVATORS packet Terrain Encoding industrial_elevator:<shaftBottom>:<encoded> - shaftBottom: Lowest level of shaft (can be negative for basements) - encoded: (shaftTop << 8) | capacityTons - top level and capacity in one value Example: industrial_elevator:-4:50 = shaft from -4 to 0, 500 ton capacity Files Changed New Files: - megamek/src/megamek/common/IndustrialElevator.java - Elevator state model - megamek/src/megamek/server/IndustrialElevatorProcessor.java - End-phase processing - megamek/src/megamek/common/actions/CallElevatorAction.java - Future: call elevator from adjacent hex - megamek/src/megamek/common/moves/ElevatorAscendStep.java - Ascend movement step - megamek/src/megamek/common/moves/ElevatorDescendStep.java - Descend movement step Modified Files: - Terrains.java - Added INDUSTRIAL_ELEVATOR constant - MoveStepType.java - Added ELEVATOR_ASCEND, ELEVATOR_DESCEND - MoveStep.java - Elevator movement validation - MovePath.java - Elevator step handling - Game.java - Industrial elevator state storage - TWGameManager.java - Initialization and sync methods - MovePathHandler.java - Server-side movement processing, fall logic - MovementDisplay.java - UI buttons for elevator control - Client.java - Receive elevator updates - PacketCommand.java - New packet type - report-messages.properties - Elevator movement reports Board/Tileset Files: - 32x17 Heliport - Lift.board - Updated to use industrial_elevator terrain - StandardIndustrialElevator.tileinc - Tileset mappings - saxarba.tileset, hq_saxarba.tileset - Graphics entries How It Works 1. Initialization: TWGameManager scans board for INDUSTRIAL_ELEVATOR terrain, creates IndustrialElevator objects 2. Movement Phase: When unit is on elevator platform, Up/Down buttons enabled based on shaft bounds 3. Elevator Movement: Platform moves WITH the unit (1 MP cost per level) 4. State Sync: After each move, server sends updated elevator state to all clients 5. Persistence: Platform position preserved across turns (fixed reinitialization bug) Test Plan - Elevator buttons enable when standing on elevator platform - Elevator buttons respect shaft boundaries (top/bottom limits) - Platform position persists across multiple turns - Movement costs 1 MP per level - Both ascend and descend work correctly - Client receives platform updates after server processes move Notes - This system is intentionally separate from ElevatorProcessor (Solaris 7 random elevators) - The "Call Elevator" feature (from adjacent hexes) is stubbed but not yet implemented in UI - Fall-into-shaft logic exists but needs additional testing - Includes data and a test board
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements player-controlled industrial elevators as distinct from the existing Solaris 7 random elevator system. The implementation adds a new terrain type (INDUSTRIAL_ELEVATOR) with platform state tracking, movement validation, and client-server synchronization.
Key Changes:
- New industrial elevator system with player-controlled movement costing 1 MP per level
- Elevator state management including platform position, shaft bounds, and tonnage capacity
- Movement phase integration with UI buttons and server-side validation
- End-phase automatic elevator movement toward queued calls
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 17 comments.
Show a summary per file
| File | Description |
|---|---|
| IndustrialElevator.java | Core elevator model with platform tracking, capacity checking, and call queue management |
| IndustrialElevatorProcessor.java | End-phase processor for initializing elevators and handling automatic platform movement |
| CallElevatorAction.java | Action for calling elevators from adjacent hexes (stubbed for future use) |
| ElevatorAscendStep.java, ElevatorDescendStep.java | Movement step handlers for elevator ascent/descent |
| MoveStep.java | Validation logic for elevator movement steps |
| MovePathHandler.java | Server-side movement processing with platform updates and fall detection |
| Game.java | Storage and retrieval methods for industrial elevators |
| TWGameManager.java | Initialization and client synchronization for elevators |
| MovementDisplay.java | UI button enablement logic for elevator controls |
| Client.java | Packet handling for elevator state updates |
| Terrains.java, MoveStepType.java, PacketCommand.java | New constants for elevator terrain, move types, and packets |
| IndustrialElevatorTest.java, IndustrialElevatorMovementTest.java | Comprehensive unit tests for elevator functionality |
| report-messages.properties, messages.properties | Localized strings for elevator reports and UI |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Changes Made Code Changes | File | Change | |------------------------|---------------------------------------------------------------------------| | Terrains.java | ELEVATOR → SOLARIS_ELEVATOR, terrain name "elevator" → "solaris_elevator" | | ElevatorProcessor.java | Updated all Terrains.ELEVATOR → Terrains.SOLARIS_ELEVATOR | | BoardsTagger.java | Updated static import reference | Tileset Changes | File | Change | |---------------------------------|------------------------------------------------------------------| | StandardElevator.tileinc | Renamed to StandardSolarisElevator.tileinc, updated terrain refs | | StandardFluff.tileinc (2 files) | "elevator:" → "solaris_elevator:" | | saxarba.tileset | Updated terrain refs | | hq_saxarba.tileset | Updated terrain refs | | defaulthexset.txt | Updated terrain refs | | 7 other tilesets | Updated include path to StandardSolarisElevator.tileinc | Board Files Updated (11 files) - Steiner Stadium, Coliseum, various Solaris arenas - All "elevator:" → "solaris_elevator:" Clear Distinction Now | Terrain | Type ID | Processor | Behavior | |---------------------|---------|-----------------------------|-----------------------------| | solaris_elevator | 36 | ElevatorProcessor | Random d6-based (Solaris 7) | | industrial_elevator | 60 | IndustrialElevatorProcessor | Player-controlled |
Logging:
- Change all [ELEVATOR] logs from INFO to DEBUG level in:
- IndustrialElevatorProcessor.java
- TWGameManager.java
- MovePathHandler.java
- Client.java
- MovementDisplay.java
- MoveStep.java
- ElevatorAscendStep.java
- ElevatorDescendStep.java
Thread safety:
- Use ConcurrentHashMap for industrialElevators in Game.java
- Use CopyOnWriteArrayList for callQueue in IndustrialElevator.java
Validation:
- Add shaftBottom <= shaftTop check in IndustrialElevator constructor
---
Summary of changes:
- 7 files - Changed LOGGER.info("[ELEVATOR]... to LOGGER.debug("[ELEVATOR]...
- Game.java - HashMap → ConcurrentHashMap for thread safety
- IndustrialElevator.java - ArrayList → CopyOnWriteArrayList for thread safety, added constructor validation
ElevatorCall implements Comparable but was missing equals() and hashCode(), which could cause inconsistency between natural ordering and equality. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Create IndustrialElevatorDialog with user-friendly spinners for shaft top and capacity configuration (instead of manually encoding exits value) - Integrate dialog into BoardEditorPanel for INDUSTRIAL_ELEVATOR terrain - Add i18n strings for dialog labels The dialog automatically encodes/decodes the exits field: exits = (shaftTop << 8) | (capacityTons / 10) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Create IndustrialElevatorDialog with user-friendly spinners for configuring
shaft top level and cargo capacity, replacing manual exits value encoding.
Changes:
- Add IndustrialElevatorDialog.java with spinners for shaft top (-100 to 100)
and capacity (0-2550 tons in 10-ton increments)
- Integrate dialog into BoardEditorPanel for INDUSTRIAL_ELEVATOR terrain
- Add EditorTextField.setMinValue() to allow negative terrain levels for
basement elevator shafts
- Auto-enable elevator properties when terrain type selected
- Set sensible defaults (shaft top 0, capacity 100 tons)
- Add i18n strings for dialog labels and Solaris elevator display name
The dialog automatically encodes/decodes the exits field:
exits = (shaftTop << 8) | (capacityTons / 10)
Files changed:
- NEW: megamek/src/megamek/client/ui/dialogs/IndustrialElevatorDialog.java
- megamek/src/megamek/client/ui/boardeditor/BoardEditorPanel.java
- megamek/src/megamek/client/ui/boardeditor/EditorTextField.java
- megamek/resources/megamek/client/messages.properties
- megamek/resources/megamek/common/messages.properties
---
Summary of changes by file:
| File | Changes |
|-------------------------------|---------------------------------------------------------------------------------------------------------------------------|
| IndustrialElevatorDialog.java | New dialog with shaft top and capacity spinners |
| BoardEditorPanel.java | Integrated dialog, added CMD_EDIT_INDUSTRIAL_ELEVATOR, auto-enable elevator checkbox, dynamic min value for terrain level |
| EditorTextField.java | Added setMinValue()/getMinValue() methods |
| client/messages.properties | Added dialog title, labels, and help text |
| common/messages.properties | Added Terrains.editorName.solaris_elevator
…' into Implement-Controllable-Elevators
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements player-controlled industrial elevators per BattleTech rules, distinct from the existing Solaris 7 random "moving walls" elevator system.
Key Features
Terrain Encoding
industrial_elevator::
Example: industrial_elevator:-4:50 = shaft from -4 to 0, 500 ton capacity
Files Changed
New Files:
Modified Files:
Board/Tileset Files:
How It Works
Test Plan
Notes
TODO