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

refactor event schedulers to use explicit game rules #29320

Merged
merged 39 commits into from
Aug 14, 2024

Conversation

IProduceWidgets
Copy link
Contributor

@IProduceWidgets IProduceWidgets commented Jun 21, 2024

About the PR

Refactors basic & ramping event scheduler to take explicit event definitions in yml instead of just doing whatever the hell they wanted to. Also ported meteor scheduler over to the other scheduler types with more variety.

Added two (really just tweaked) gamemodes as rare chances in secret to flex the scheduler utility a bit.

Why / Balance

Shuttle events, gift events, the desire to add things that shouldn't be in event schedulers.
I cannot overstate how many levers this adds to event balancing by using combinations of multiple schedulers, table selectors & station event weights.

Technical details

Now uses EntityTableSelectors. Also, since it allows for multiple uses of the different event schedulers I removed the ccvars for meteors and ramping schedulers and placed them on the components.

Media

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

Breaking changes

The cvars for ramping event scheduler severity and for meteor timing have been removed, and moved to fields on their respective components.
If you have events you want run via the basic/ramping event scheduler, they need to be defined explicitly now.

Changelog

🆑

  • tweak: shuttle events have been separated from other midround events and can now happen concurrently.
  • tweak: Cargo Gift events should be less likely.
  • tweak: meteors have been changed to be more responsive to player count.
  • add: Game mode: Kessler syndrome - What if survival but also the apocalypse?
  • add: Game mode: Zombeteors - Zombies and a meteor shower all at once!

@github-actions github-actions bot added the S: Needs Review Status: Requires additional reviews before being fully accepted label Jun 21, 2024
@TheShuEd
Copy link
Member

would it make sense to exclude rules from a possible choice if it has already been selected before? thus ensuring that all rules are selected before they start repeating

@IProduceWidgets
Copy link
Contributor Author

would it make sense to exclude rules from a possible choice if it has already been selected before? thus ensuring that all rules are selected before they start repeating

You could achieve this by rule by setting the specific rule's params

@IProduceWidgets
Copy link
Contributor Author

Survival not getting gifts from NT was an accident, but it is funny, so I'm leaving it.

@IProduceWidgets
Copy link
Contributor Author

Ready for review. I handled all the issues I could dream up.

Content.Server/GameTicking/Rules/RandomRuleSystem.cs Outdated Show resolved Hide resolved
Content.Server/GameTicking/Rules/RandomRuleSystem.cs Outdated Show resolved Hide resolved
Content.Server/GameTicking/Rules/RandomRuleSystem.cs Outdated Show resolved Hide resolved
Content.Server/GameTicking/Rules/RandomRuleSystem.cs Outdated Show resolved Hide resolved
Content.Server/GameTicking/Rules/RandomRuleSystem.cs Outdated Show resolved Hide resolved
Comment on lines 19 to 25

/// <summary>
/// The gamerules that the scheduler can choose from
/// </summary>
[DataField(required: true)]
public List<EntitySpawnEntry> ScheduledGameRules = new();
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Aren't these supposed to be components on the entity anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Some use type to subset the events like the secret gamerule, but that doesn't allow for using them in multiple different places with different balance if you wanted to. I didn't remove the type schema though because I didn't want to mess up the secret game rule or something else I hadn't considered.

Content.Server/StationEvents/EventManagerSystem.cs Outdated Show resolved Hide resolved
Content.Server/StationEvents/EventManagerSystem.cs Outdated Show resolved Hide resolved
@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 Jun 22, 2024
@IProduceWidgets
Copy link
Contributor Author

Should all be addressed with the exception of the IComponentFactory dependency thing which I think I need a hint on if its a big issue.

@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 Jun 23, 2024
@EmoGarbage404
Copy link
Member

with the exception of the IComponentFactory dependency thing which I think I need a hint on if its a big issue.

you can grab it by doing EntityManager.ComponentFactory

@IProduceWidgets
Copy link
Contributor Author

you can grab it by doing EntityManager.ComponentFactory

Thanks! done!

Content.Server/GameTicking/Rules/RandomRuleSystem.cs Outdated Show resolved Hide resolved
Content.Server/GameTicking/Rules/RandomRuleSystem.cs Outdated Show resolved Hide resolved
Content.Server/GameTicking/Rules/RandomRuleSystem.cs Outdated Show resolved Hide resolved
Resources/Prototypes/GameRules/cargo_gifts.yml Outdated Show resolved Hide resolved
Resources/Prototypes/GameRules/roundstart.yml Outdated Show resolved Hide resolved
Resources/Prototypes/GameRules/roundstart.yml Outdated Show resolved Hide resolved
Resources/Prototypes/GameRules/unknown_shuttles.yml Outdated Show resolved Hide resolved
Content.Server/GameTicking/Rules/RandomRuleSystem.cs Outdated Show resolved Hide resolved
@EmoGarbage404 EmoGarbage404 added the S: Awaiting Changes Status: Changes are required before another review can happen label Jul 2, 2024
@IProduceWidgets
Copy link
Contributor Author

Woohoo She floats!

Okay I updated this to use EntitySpawnEntries.

The only thing I'm kind of uncertain about working is the toolshed commands in the BasicStationEventSchedulerSystem.
I have no idea how to test them, so I just updated the logic to how they should work with the new stuff. I don't know if its okay to make them take an EntityPrototype as an argument, maybe it needs to be a string and then cast. If someone can make me a toolshed call that works on the current build I'll make sure it works. I've never seen any of those commands get used before though, and I have nfi how to use them.

@metalgearsloth metalgearsloth enabled auto-merge (squash) August 14, 2024 05:20
@metalgearsloth metalgearsloth merged commit 07ec00e into space-wizards:master Aug 14, 2024
11 checks passed
formlessnameless pushed a commit to formlessnameless/imp-station-14 that referenced this pull request Aug 14, 2024
…9320)

* works, still has testing values, im sure I did stupid shit.

* shitvent crapfactor

* snap extra word out of existence

* shit I died of old

* remove useless inaccurate design comments

* Oopsie, handle requirement params in RandomRuleSystem too

* I'm a slash slinging hasher

* Address reviews, add admin alerts I forgor

* EntityMan saves the day

* address reviews 1

* eh, I actually don't care about the cargo gifts thing.

* started

* Do reviews

* you actually meant 1.2 lmao

* dependency inheritance is a fickle bitch

* I have no idea.

* Threads are for sheets not computers.

* fix traitor rule test

* fix round type tattling

* break things

* It worky

* Toolshed makes we want to drink depresso.

* Finished?

* remove debug values

* timings

* use defaults

* alphabetize

* bobby drop tables

* Float required fr fr

* continue

* more continence

* uno mas

* obsolution

* cleanup and documentations

* Yell at self

* use the right value defaults

* housekeeping
@kanopus952
Copy link

Hello! Do you know of a bug that may have been caused by your changes? Check this issue: #31090

@IProduceWidgets
Copy link
Contributor Author

Hello! Do you know of a bug that may have been caused by your changes? Check this issue: #31090

I have been sent a couple occurrences, but have thus far been unable to replicate it. Please do let me know of more occurrences, or if you find a consistent occurrence.

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
Development

Successfully merging this pull request may close these issues.

5 participants