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

Teleport noobs off Arrivals shuttle to spawn #17189

Merged
merged 6 commits into from
Aug 22, 2023

Conversation

tom-leys
Copy link
Contributor

@tom-leys tom-leys commented Jun 7, 2023

About the PR

  • Resolve Arrivals kills new players #17154 by teleporting arriving players to a late-spawn point on station if they dawdle on the shuttle. Currently only does this on first arrival for a player.
  • Estimate shuttle arrival time when you spawn in arrivals
  • AutoOrientComponent is only removed as the shuttle warps away leaving you on station. This means you will auto-rotate as you enter the station grid.
  • PendingClockInComponent is removed as the ship warps away and you're on station, rather than as you ride the shuttle away from Arrivals. Resolves If you have a skill issue arrivals shuttle will leave you behind #14937
  • If you are teleported away from arrivals anywhere else by an admin, you'll still lose these components up to a minute later when the shuttle next FTLs to arrivals.
  • You don't need PendingClockInComponent to ride the shuttle AWAY from arrivals if you somehow end up there again. Should resolve Reinforcement teleporter goonie gets stuck in Arrivals #15271

Requires: space-wizards/RobustToolbox#4257

Media

arrival_teleport.mp4

image

  • I have added screenshots/videos to this PR showcasing its changes ingame, or this PR does not require an ingame showcase

Changelog

🆑

  • add: To increase employee retention and new staff experience, we've installed a short range teleporter on our Arrivals Shuttle. However we only had sufficient budget to use it once per shift per staff member.
  • tweak: You might notice yourself adjusting as you step off the arrivals shuttle, with our patented rotation acclimation system. It might make you dizzy, but it helps the station make sense.

@github-actions github-actions bot added the S: Needs Review Status: Requires additional reviews before being fully accepted label Jun 7, 2023
@tom-leys
Copy link
Contributor Author

tom-leys commented Jun 7, 2023

@metalgearsloth This Arrivals PR transports players off the arrival shuttle. It spaces them if they come back to the shuttle. Should it teleport them every time?

@metalgearsloth
Copy link
Contributor

Nah just the first time, we just need turnstiles for other times to avoid people using it for easy spacing #16419

@tom-leys tom-leys closed this Jul 22, 2023
@tom-leys tom-leys reopened this Jul 31, 2023
@tom-leys tom-leys requested a review from EmoGarbage404 as a code owner July 31, 2023 22:04
@tom-leys
Copy link
Contributor Author

Nice to see you in the code owner rotation now @EmoGarbage404

Copy link
Member

@EmoGarbage404 EmoGarbage404 left a comment

Choose a reason for hiding this comment

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

very cool, just a few things that caught my eye.

Comment on lines 280 to 290
// Spawn them at a passenger location
foreach (var (spawnPoint, xform) in points)
{
if (spawnPoint?.Job?.ID != "Passenger" || _station.GetOwningStation(spawnPoint.Owner, xform) != stationId)
continue;

// Move the player to the spawnpoint.
transform.Coordinates = xform.Coordinates;

return true;
}
Copy link
Member

Choose a reason for hiding this comment

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

All stations have latejoin spawn points already so there isn't really a need to have a hardcoded backup to passengers.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is there any harm in doing so though? I'm coding defensively here I guess.

Copy link
Member

Choose a reason for hiding this comment

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

it's unnecessary but moreover, hardcoding in a prototype ID is generally frowned upon.

@Slava0135 Slava0135 added the S: Awaiting Changes Status: Changes are required before another review can happen label Aug 1, 2023
@tom-leys tom-leys requested a review from EmoGarbage404 August 2, 2023 05:28
@github-actions github-actions bot removed the S: Awaiting Changes Status: Changes are required before another review can happen label Aug 2, 2023
@tom-leys
Copy link
Contributor Author

tom-leys commented Aug 2, 2023

Thanks for the review @EmoGarbage404. I have applied your suggestions which was mostly changing how I got TransformComponent and adding better comments.

@metalgearsloth metalgearsloth added S: Awaiting Changes Status: Changes are required before another review can happen and removed S: Needs Review Status: Requires additional reviews before being fully accepted labels Aug 2, 2023
@tom-leys tom-leys force-pushed the feat/arrivals-respawn branch from 5f502df to 04d86c1 Compare August 2, 2023 23:05
@tom-leys tom-leys requested a review from metalgearsloth August 3, 2023 02:35
@github-actions github-actions bot added S: Needs Review Status: Requires additional reviews before being fully accepted and removed S: Awaiting Changes Status: Changes are required before another review can happen labels Aug 3, 2023
Comment on lines 383 to 387

// The ArrivalsCooldown includes the trip there, so we only need to add the time taken for
// the trip back.
comp.NextArrivalsTime = _ticker.RoundDuration() +
TimeSpan.FromSeconds(_cfgManager.GetCVar(CCVars.ArrivalsCooldown) + tripTime);
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't be using RoundDuration and also += like NextTransfer is.

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 removed roundDuration. However it doesn't make sense to use += here because the time estimate is not based on the old time estimate.

Comment on lines 269 to 270
var possiblePositions = new List<EntityCoordinates>();
var passengerPositions = new List<EntityCoordinates>();
Copy link
Contributor

Choose a reason for hiding this comment

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

ValueList?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wow, I didn't know we had that.

Copy link
Contributor Author

@tom-leys tom-leys Aug 11, 2023

Choose a reason for hiding this comment

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

Now require space-wizards/RobustToolbox#4257 for Pick(ValueList)

@metalgearsloth metalgearsloth added S: Awaiting Changes Status: Changes are required before another review can happen and removed S: Needs Review Status: Requires additional reviews before being fully accepted labels Aug 7, 2023
@github-actions github-actions bot added S: Needs Review Status: Requires additional reviews before being fully accepted and removed S: Awaiting Changes Status: Changes are required before another review can happen labels Aug 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S: Needs Review Status: Requires additional reviews before being fully accepted
Projects
None yet
5 participants