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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Overmap Autopilot Adjustments #23846
Overmap Autopilot Adjustments #23846
Conversation
If you think this'll fix the issues with the autopilot, then #23794 can be closed should this get merged before, however the main issue still stands that the autopilot doesn't really do pathfinding. |
Pathfinding I don't think is something that can be fixed. Autopilot isn't a set it and forget it system. My goal here is to make it more viable as an alternative means of controlling the Torch. |
The max autopilot speed should be reduced a bit more as well in my opinion, as 15 seconds for a tile is a bit too fast and still easily abuseable. |
b84528f
to
0e6b5d4
Compare
Current commit ticks off the first 3 TODOs. Autopilot no longer burns fuel constantly bouncing above and below your speedlimit, and can properly change directions if you change destination targets while in motion. |
0e6b5d4
to
c01ebc3
Compare
I think I'm going to leave out the hardcap. I don't believe it's going to do much more than inconvenience players - If people are abusing the helm, they'll abuse the helm whether autopilot has a hardcap on speed or not and need to be dealt with appropriately. I'll look at the UI ideas tomorrow. |
UI stuff I'll have to deal with in another PR. It's being dumb. This is ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can have it try and stop if there's anything on the turf in front of it to make it more player-friendly if you want, but this looks good.
@@ -12,7 +12,7 @@ LEGACY_RECORD_STRUCTURE(all_waypoints, waypoint) | |||
var/list/known_sectors = list() | |||
var/dx //desitnation | |||
var/dy //coordinates | |||
var/speedlimit = 2 //top speed for autopilot | |||
var/speedlimit = 0.002 //top speed for autopilot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should use the same format as for speed, 1/(X SECONDS)
, for better readability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I adjusted the default speed to 40 seconds instead of 45 - 1/450 resulted in a speedlimit setting of 0.0022222222, which doesn't look very clean. 1/400 gives 0.0025 instead.
if ((get_dist(linked.loc, T) <= brake_path) || ((speedlimit) && (speed > speedlimit))) | ||
linked.decelerate() | ||
// Heading does not match direction | ||
else if ((heading & ~direction) && !(linked.is_still())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The is_still
call is redundant, as get_heading
returns 0
precisely when is_still
is true.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in the latest commit
code/modules/overmap/ships/ship.dm
Outdated
if(!is_still() && can_burn()) | ||
if (MOVING(speed[1])) | ||
if(((abs(speed[1]) > 0) || (abs(speed[2]) > 0)) && can_burn()) | ||
if (abs(speed[1]) > 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if(speed[1])
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does byond not treat negative numbers as 'falsey'?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only falsey things in byond are 0
,null
, and ""
(also the FALSE
define, but I believe that is set to 0
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in the latest commit
c01ebc3
to
51d12e2
Compare
51d12e2
to
6153655
Compare
DNM if #23794 is merged
Various tweaks and fixes to autopilot.
馃啈 SierraKomodo
tweak: Autopilot default speed lowered from 2 (Exceeds max speed hardcap of 0.1) to 0.0025 (40 seconds ETA per tile)
fix: Autopilot no longer burns fuel needlessly bouncing above/below the speedlimit, and will now never go above the speedlimit.
tweak: Autopilot now handles changing direction/destination and diagonal movement much more efficiently fuel wise
fix: It is once again possible to decelerate to a speed of 0.
/:cl: