beyond-all-reason / beyond-all-reason/RecoilEngine
featureID in orders is handled in an unintuitive way
- Dominant language
- C++
- Stars
- 679
- Forks
- 290
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 40
Description
To give an order "reclaim the feature with the featureID `123`" via Lua you need to send an order with the parameter `Game.maxUnits + 123`. This is because there could be a unit with the unitID 123 and it's needed to disambiguate those.
The simplest solution (from a gamedev interface PoV) seems to be to just shift their possible ID pool as seen by Lua by maxUnits, so they get assigned IDs between 32k and 64k.
Contributor guide
Research direction
Start by tracing the Lua order path that handles featureID and the Game.maxUnits offset. Check how unit and feature IDs are distinguished, then determine the affected engine and Lua-facing behavior. Done means feature IDs can be addressed through Lua without the unintuitive manual offset while unit IDs remain unambiguous.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, lua
- Domain
- game-dev
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100