refactor event schedulers to use explicit game rules (#29320)

* 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
This commit is contained in:
IProduceWidgets
2024-08-14 01:21:01 -04:00
committed by GitHub
parent 58a33b2593
commit 07ec00ed05
21 changed files with 600 additions and 241 deletions

View File

@@ -1,3 +1,22 @@
# Tables -- Add your new event to this Table if you want it to happen via the basic/ramping schedulers.
- type: entityTable
id: CargoGiftsTable
table: !type:GroupSelector # ~~we need to pass a list of rules, since rules have further restrictions to consider via StationEventComp~~ But we arent doing that shit yet, it picks a random one StationEventComp be damned.
children:
- id: GiftsEngineering
- id: GiftsFireProtection
- id: GiftsJanitor
- id: GiftsMedical
- id: GiftsPizzaPartyLarge
- id: GiftsPizzaPartySmall
- id: GiftsSecurityGuns
- id: GiftsSecurityRiot
- id: GiftsSpacingSupplies
- id: GiftsVendingRestock
# Game Rules
- type: entity
id: CargoGiftsBase
parent: BaseGameRule

View File

@@ -1,3 +1,40 @@
- type: entityTable
id: BasicCalmEventsTable
table: !type:AllSelector # we need to pass a list of rules, since rules have further restrictions to consider via StationEventComp
children:
- id: AnomalySpawn
- id: BluespaceArtifact
- id: BluespaceLocker
- id: BreakerFlip
- id: BureaucraticError
- id: ClericalError
- id: CockroachMigration
- id: GasLeak
- id: IonStorm # its calm like 90% of the time smh
- id: KudzuGrowth
- id: MassHallucinations
- id: MimicVendorRule
- id: MouseMigration
- id: PowerGridCheck
- id: SlimesSpawn
- id: SolarFlare
- id: SpiderClownSpawn
- id: SpiderSpawn
- id: VentClog
- type: entityTable
id: BasicAntagEventsTable
table: !type:AllSelector # we need to pass a list of rules, since rules have further restrictions to consider via StationEventComp
children:
- id: ClosetSkeleton
- id: DragonSpawn
- id: KingRatMigration
- id: NinjaSpawn
- id: RevenantSpawn
- id: SleeperAgents
- id: ZombieOutbreak
- type: entity
id: BaseStationEvent
parent: BaseGameRule
@@ -526,45 +563,6 @@
sounds:
collection: Paracusia
- type: entity
id: ImmovableRodSpawn
parent: BaseGameRule
components:
- type: StationEvent
startAnnouncement: station-event-immovable-rod-start-announcement
startAudio:
path: /Audio/Announcements/attention.ogg
weight: 3.5
duration: 1
earliestStart: 30
minimumPlayers: 20
- type: ImmovableRodRule
rodPrototypes:
- id: ImmovableRodKeepTilesStill
prob: 0.95
orGroup: rodProto
- id: ImmovableRodMop
prob: 0.0072
orGroup: rodProto
- id: ImmovableRodShark
prob: 0.0072
orGroup: rodProto
- id: ImmovableRodClown
prob: 0.0072
orGroup: rodProto
- id: ImmovableRodBanana
prob: 0.0072
orGroup: rodProto
- id: ImmovableRodHammer
prob: 0.0072
orGroup: rodProto
- id: ImmovableRodThrongler
prob: 0.0072
orGroup: rodProto
- id: ImmovableRodGibstick
prob: 0.0072
orGroup: rodProto
- type: entity
parent: BaseGameRule
id: IonStorm

View File

@@ -1,21 +1,39 @@
- type: entity
parent: BaseGameRule
id: GameRuleMeteorScheduler
components:
- type: GameRule
minPlayers: 25
cancelPresetOnTooFewPlayers: false
- type: MeteorScheduler
# Event Tables
- type: weightedRandomEntity
id: DefaultConfig
weights:
GameRuleSpaceDustMinor: 44
GameRuleSpaceDustMajor: 22
GameRuleMeteorSwarmSmall: 18
GameRuleMeteorSwarmMedium: 10
GameRuleMeteorSwarmLarge: 5
GameRuleUristSwarm: 0.05
- type: entityTable
id: MeteorSwarmDustEventsTable
table: !type:AllSelector # we need to pass a list of rules, since rules have further restrictions to consider via StationEventComp
children:
- id: GameRuleSpaceDustMinor
- id: GameRuleSpaceDustMajor
- type: entityTable
id: MeteorSwarmSmallChanceEventsTable
table: !type:AllSelector # we need to pass a list of rules, since rules have further restrictions to consider via StationEventComp
children:
- id: GameRuleMeteorSwarmSmall
prob: 0.15
- type: entityTable
id: MeteorSwarmMildTable
table: !type:AllSelector # we need to pass a list of rules, since rules have further restrictions to consider via StationEventComp
children:
- !type:NestedSelector
tableId: MeteorSwarmDustEventsTable
- !type:NestedSelector
tableId: MeteorSwarmSmallChanceEventsTable
- type: entityTable
id: BasicMeteorSwarmEventsTable
table: !type:AllSelector # we need to pass a list of rules, since rules have further restrictions to consider via StationEventComp
children:
- !type:NestedSelector
tableId: MeteorSwarmDustEventsTable
- id: GameRuleMeteorSwarmSmall
- id: GameRuleMeteorSwarmMedium
- id: GameRuleMeteorSwarmLarge
- id: GameRuleUristSwarm
- id: ImmovableRodSpawn
- type: weightedRandomEntity
id: MeteorSpawnAsteroidWallTable
@@ -29,7 +47,46 @@
AsteroidRockPlasma: 2
AsteroidRockDiamond: 2
AsteroidRockUranium: 0.5
AsteroidRockBananium: 0.5
AsteroidRockBananium: 0.5
# Event Schedulers
- type: entity
parent: BaseGameRule
id: MeteorSwarmScheduler
components:
- type: GameRule
- type: BasicStationEventScheduler
minimumTimeUntilFirstEvent: 300 # 5 min
minMaxEventTiming:
min: 750 # 12.5 min
max: 930 # 17.5 min
scheduledGameRules: !type:NestedSelector
tableId: BasicMeteorSwarmEventsTable
- type: entity
parent: BaseGameRule
id: MeteorSwarmMildScheduler
components:
- type: GameRule
- type: BasicStationEventScheduler
minimumTimeUntilFirstEvent: 300 # 5 min
minMaxEventTiming:
min: 750 # 12.5 min
max: 930 # 17.5 min
scheduledGameRules: !type:NestedSelector
tableId: MeteorSwarmMildTable
- type: entity
parent: BaseGameRule
id: KesslerSyndromeScheduler
components:
- type: GameRule
- type: RampingStationEventScheduler
scheduledGameRules: !type:NestedSelector
tableId: BasicMeteorSwarmEventsTable
# Game Rules
- type: entity
parent: BaseGameRule
@@ -37,12 +94,19 @@
abstract: true
components:
- type: GameRule
- type: StationEvent
earliestStart: 12
minimumPlayers: 25
- type: MeteorSwarm
- type: entity
parent: GameRuleMeteorSwarm
id: GameRuleSpaceDustMinor
components:
- type: StationEvent
weight: 44
earliestStart: 2
minimumPlayers: 0
- type: MeteorSwarm
announcement: null
announcementSound: null
@@ -60,6 +124,9 @@
parent: GameRuleMeteorSwarm
id: GameRuleSpaceDustMajor
components:
- type: StationEvent
weight: 22
minimumPlayers: 0
- type: MeteorSwarm
announcement: station-event-space-dust-start-announcement
announcementSound: /Audio/Announcements/attention.ogg
@@ -77,6 +144,9 @@
parent: GameRuleMeteorSwarm
id: GameRuleMeteorSwarmSmall
components:
- type: StationEvent
weight: 18
minimumPlayers: 15
- type: MeteorSwarm
meteors:
MeteorSmall: 7
@@ -86,6 +156,8 @@
parent: GameRuleMeteorSwarm
id: GameRuleMeteorSwarmMedium
components:
- type: StationEvent
weight: 10
- type: MeteorSwarm
meteors:
MeteorSmall: 3
@@ -96,6 +168,8 @@
parent: GameRuleMeteorSwarm
id: GameRuleMeteorSwarmLarge
components:
- type: StationEvent
weight: 5
- type: MeteorSwarm
meteors:
MeteorSmall: 2
@@ -106,6 +180,8 @@
parent: GameRuleMeteorSwarm
id: GameRuleUristSwarm
components:
- type: StationEvent
weight: 0.05
- type: MeteorSwarm
announcement: station-event-meteor-urist-start-announcement
announcementSound: /Audio/Announcements/attention.ogg
@@ -117,3 +193,42 @@
meteorsPerWave:
min: 10
max: 10
- type: entity
id: ImmovableRodSpawn
parent: BaseGameRule
components:
- type: StationEvent
startAnnouncement: station-event-immovable-rod-start-announcement
startAudio:
path: /Audio/Announcements/attention.ogg
weight: 3.5
duration: 1
earliestStart: 30
minimumPlayers: 25
- type: ImmovableRodRule
rodPrototypes:
- id: ImmovableRodKeepTilesStill
prob: 0.95
orGroup: rodProto
- id: ImmovableRodMop
prob: 0.0072
orGroup: rodProto
- id: ImmovableRodShark
prob: 0.0072
orGroup: rodProto
- id: ImmovableRodClown
prob: 0.0072
orGroup: rodProto
- id: ImmovableRodBanana
prob: 0.0072
orGroup: rodProto
- id: ImmovableRodHammer
prob: 0.0072
orGroup: rodProto
- id: ImmovableRodThrongler
prob: 0.0072
orGroup: rodProto
- id: ImmovableRodGibstick
prob: 0.0072
orGroup: rodProto

View File

@@ -262,17 +262,68 @@
prototype: InitialInfected
# event schedulers
- type: entityTable
id: BasicGameRulesTable
table: !type:AllSelector # we need to pass a list of rules, since rules have further restrictions to consider via StationEventComp
children:
- !type:NestedSelector
tableId: BasicCalmEventsTable
- !type:NestedSelector
tableId: BasicAntagEventsTable
- !type:NestedSelector
tableId: CargoGiftsTable
- type: entityTable
id: SpaceTrafficControlTable
table: !type:AllSelector # we need to pass a list of rules, since rules have further restrictions to consider via StationEventComp
children:
- !type:NestedSelector
tableId: UnknownShuttlesFriendlyTable
- !type:NestedSelector
tableId: UnknownShuttlesFreelanceTable
- !type:NestedSelector
tableId: UnknownShuttlesHostileTable
- type: entity
id: BasicStationEventScheduler
parent: BaseGameRule
components:
- type: BasicStationEventScheduler
scheduledGameRules: !type:NestedSelector
tableId: BasicGameRulesTable
- type: entity
id: RampingStationEventScheduler
parent: BaseGameRule
components:
- type: RampingStationEventScheduler
scheduledGameRules: !type:NestedSelector
tableId: BasicGameRulesTable
- type: entity
id: SpaceTrafficControlEventScheduler # iff we make a selector for EntityTables that can respect StationEventComp restrictions, or somehow impliment them otherwise in said tables,
parent: BaseGameRule # we can remerge this with the other schedulers, but it will silently fail due to that limitation without a separate scheduler to balance atm.
components:
- type: BasicStationEventScheduler
minimumTimeUntilFirstEvent: 1200 # 20 mins
minMaxEventTiming:
min: 600 # 10 mins
max: 1800 # 30 mins
scheduledGameRules: !type:NestedSelector
tableId: SpaceTrafficControlTable
- type: entity
id: SpaceTrafficControlFriendlyEventScheduler
parent: BaseGameRule
components:
- type: BasicStationEventScheduler
minimumTimeUntilFirstEvent: 1200 # 20 mins
minMaxEventTiming:
min: 600 # 10 mins
max: 1800 # 30 mins
scheduledGameRules: !type:NestedSelector
tableId: UnknownShuttlesFriendlyTable
# variation passes
- type: entity

View File

@@ -1,3 +1,28 @@
# Shuttle Game Rule Tables -- If you dont add your rules to these they wont be used by the games schedulers.
- type: entityTable
id: UnknownShuttlesFriendlyTable
table: !type:AllSelector # we need to pass a list of rules, since rules have further restrictions to consider via StationEventComp
children:
- id: UnknownShuttleCargoLost
- id: UnknownShuttleTravelingCuisine
- id: UnknownShuttleDisasterEvacPod
- id: UnknownShuttleHonki
- type: entityTable
id: UnknownShuttlesFreelanceTable
table: !type:AllSelector # we need to pass a list of rules, since rules have further restrictions to consider via StationEventComp
children:
- id: UnknownShuttleSyndieEvacPod
- type: entityTable
id: UnknownShuttlesHostileTable
table: !type:AllSelector # we need to pass a list of rules, since rules have further restrictions to consider via StationEventComp
children:
- id: LoneOpsSpawn
# Shuttle Game Rules
- type: entity
abstract: true
parent: BaseGameRule

View File

@@ -6,12 +6,31 @@
showInVote: false # secret
description: survival-description
rules:
- MeteorSwarmScheduler
- RampingStationEventScheduler
- GameRuleMeteorScheduler
- SpaceTrafficControlEventScheduler
- SpaceTrafficControlFriendlyEventScheduler
- BasicRoundstartVariation
- type: gamePreset
id: KesslerSyndrome
alias:
- kessler
- junk
- meteorhell
name: kessler-syndrome-title
showInVote: false # secret
description: kessler-syndrome-description
rules:
- KesslerSyndromeScheduler
- RampingStationEventScheduler
- SpaceTrafficControlEventScheduler
- BasicRoundstartVariation
- type: gamePreset
id: AllAtOnce
alias:
- all
name: all-at-once-title
description: all-at-once-description
showInVote: false
@@ -20,8 +39,34 @@
- Traitor
- Revolutionary
- Zombie
- KesslerSyndromeScheduler
- RampingStationEventScheduler
- GameRuleMeteorScheduler
- SpaceTrafficControlEventScheduler
- BasicRoundstartVariation
- type: gamePreset
id: AllerAtOnce
alias:
- allall
- aller
- badidea
- punishment
name: aller-at-once-title
description: all-at-once-description
showInVote: false #Please god dont do this
rules:
- Nukeops
- Traitor
- Revolutionary
- Zombie
- BasicStationEventScheduler
- KesslerSyndromeScheduler
- MeteorSwarmMildScheduler
- MeteorSwarmScheduler
- RampingStationEventScheduler
- SpaceTrafficControlEventScheduler
- SpaceTrafficControlFriendlyEventScheduler
- BasicRoundstartVariation
- type: gamePreset
id: Extended
@@ -33,7 +78,8 @@
description: extended-description
rules:
- BasicStationEventScheduler
- GameRuleMeteorScheduler
- MeteorSwarmScheduler
- SpaceTrafficControlEventScheduler
- BasicRoundstartVariation
- type: gamePreset
@@ -45,6 +91,7 @@
showInVote: false #4boring4vote
description: greenshift-description
rules:
- SpaceTrafficControlFriendlyEventScheduler
- BasicRoundstartVariation
- type: gamePreset
@@ -67,7 +114,9 @@
description: secret-description
rules:
- BasicStationEventScheduler
- GameRuleMeteorScheduler
- MeteorSwarmScheduler
- SpaceTrafficControlEventScheduler
- BasicRoundstartVariation
- type: gamePreset
id: SecretGreenshift #For Admin Use: Runs Greenshift but shows "Secret" in lobby.
@@ -76,6 +125,9 @@
name: secret-title
showInVote: false #Admin Use
description: secret-description
rules:
- SpaceTrafficControlFriendlyEventScheduler
- BasicRoundstartVariation
- type: gamePreset
id: Sandbox
@@ -92,6 +144,7 @@
id: Traitor
alias:
- traitor
- tator
name: traitor-title
description: traitor-description
showInVote: false
@@ -99,7 +152,8 @@
- Traitor
- SubGamemodesRule
- BasicStationEventScheduler
- GameRuleMeteorScheduler
- MeteorSwarmScheduler
- SpaceTrafficControlEventScheduler
- BasicRoundstartVariation
- type: gamePreset
@@ -126,7 +180,8 @@
- Nukeops
- SubGamemodesRule
- BasicStationEventScheduler
- GameRuleMeteorScheduler
- MeteorSwarmScheduler
- SpaceTrafficControlEventScheduler
- BasicRoundstartVariation
- type: gamePreset
@@ -142,7 +197,8 @@
- Revolutionary
- SubGamemodesRule
- BasicStationEventScheduler
- GameRuleMeteorScheduler
- MeteorSwarmScheduler
- SpaceTrafficControlEventScheduler
- BasicRoundstartVariation
- type: gamePreset
@@ -159,5 +215,22 @@
rules:
- Zombie
- BasicStationEventScheduler
- GameRuleMeteorScheduler
- MeteorSwarmScheduler
- SpaceTrafficControlEventScheduler
- BasicRoundstartVariation
- type: gamePreset
id: Zombieteors
alias:
- zombieteors
- zombombies
- meteombies
name: zombieteors-title
description: zombieteors-description
showInVote: false
rules:
- Zombie
- BasicStationEventScheduler
- KesslerSyndromeScheduler
- SpaceTrafficControlEventScheduler
- BasicRoundstartVariation

View File

@@ -3,6 +3,8 @@
weights:
Nukeops: 0.20
Traitor: 0.60
Zombie: 0.05
Survival: 0.10
Zombie: 0.04
Zombieteors: 0.01
Survival: 0.09
KesslerSyndrome: 0.01
Revolutionary: 0.05