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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overmap Autopilot Adjustments #23846

Merged

Conversation

SierraKomodo
Copy link
Contributor

@SierraKomodo SierraKomodo commented Nov 22, 2018

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:

@Roland410
Copy link
Contributor

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.

@SierraKomodo
Copy link
Contributor Author

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.

@Roland410
Copy link
Contributor

Roland410 commented Nov 22, 2018

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.
Edit: After talking on Discord the autopilot doesn't respect speed caps (you can set it above the cap and it works) and setting it to zero gives it unlimited speed, which should be addressed.

@SierraKomodo SierraKomodo force-pushed the adjust-default-autopilot-speed branch 2 times, most recently from b84528f to 0e6b5d4 Compare November 23, 2018 07:19
@SierraKomodo
Copy link
Contributor Author

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.

@SierraKomodo
Copy link
Contributor Author

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.

@SierraKomodo SierraKomodo changed the title [WIP] Overmap Autopilot Adjustments Overmap Autopilot Adjustments Nov 23, 2018
@SierraKomodo
Copy link
Contributor Author

UI stuff I'll have to deal with in another PR. It's being dumb. This is ready for review.

Copy link
Contributor

@afterthought2 afterthought2 left a 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
Copy link
Contributor

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.

Copy link
Contributor Author

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()))
Copy link
Contributor

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.

Copy link
Contributor Author

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

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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if(speed[1])

Copy link
Contributor Author

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'?

Copy link
Contributor

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).

Copy link
Contributor Author

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

@afterthought2 afterthought2 merged commit 22ab340 into Baystation12:dev Nov 25, 2018
@SierraKomodo SierraKomodo deleted the adjust-default-autopilot-speed branch November 29, 2018 07:07
WhiteHusky pushed a commit to WhiteHusky/Baystation12 that referenced this pull request Dec 11, 2018
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.

None yet

4 participants