Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make all immobiles have no radar drift. #1831

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

saurtron
Copy link
Collaborator

@saurtron saurtron commented Dec 18, 2024

Work done

  • Make immobile units have no radar drift

Related issues

Note I also intend to later work on the problem of nanos can't be buildings (#1597), but making ghosts also not drift or dissapear from radar for any immobile sounds more than reasonable behaviour.

Remarks

  • Marking as DRAFT to validate the general approach before dedicating more work to this.
  • This still needs a bitmore work to make it behave completely right:
    • change ghostedBuildings to ghostedImmobiles (and export/accept also ghostedBuildings alias for now).
    • adapt also UnitDrawerData.cpp and GroundDecalHandler.cpp (and maybe some other places) so the ghosts won't go away like with buildings.

Open problems

  • Whats the best way to handle the situation where the building/immobile is actually moved for any reason, like transport
  • Also whats the best way to give lua fine grained control over this, unitDef?, unit flag?
    • probably need something at unit itself, since many times override will need to be done per unit

Reference

IsImmobileUnit -> (pathType == -1U && !canfly && speed <= 0.0f)
IsBuildingUnit -> (IsImmobileUnit() && !yardmap.empty())
IsGroundUnit   -> (pathType != -1U && !canfly)

@sprunk
Copy link
Collaborator

sprunk commented Dec 18, 2024

This just forces immobiles to have ghosts while leaving games no control. Add a new unit def tag, bool leavesBuildingGhost, and make ghosts look for that.

That tag should default to true for buildings and false for mobiles, but I dug a bit and I'm no longer sure whether that new tag should default to true for immobiles. See 30c07c5, e573bdb, and https://springrts.com/mantis/view.php?id=6127.

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.

2 participants