-
-
Notifications
You must be signed in to change notification settings - Fork 100
Experimental rulesets preparations #419
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
Changes from all commits
27a5a4e
d145720
59d031e
f3e45f8
134be96
8cfc90c
ab37478
1eb817d
e73284d
d2e3386
f9cd8c0
f62227a
aad9d46
7916668
2897924
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| MP.Layer("no_animation_timer", { | ||
| preview_calculate_delay = 1.5, | ||
| preview_calculate_cost = 3.5, | ||
| timer_base_multiplier = 4/5, | ||
| }) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| MP.Layer("smods_version_check", { | ||
| is_disabled = function(self) | ||
| return MP.UTILS.check_smods_version() or MP.UTILS.check_lovely_version() | ||
| end, | ||
| }) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| [manifest] | ||
| version = "1.0.0" | ||
| dump_lua = true | ||
| priority = 2147483600 | ||
|
|
||
| # Force gamespeed to vanilla 4x when we need to | ||
| [[patches]] | ||
| [patches.pattern] | ||
| target = 'game.lua' | ||
| pattern = 'self.TIMERS.TOTAL = self.TIMERS.TOTAL + dt*(self.SPEEDFACTOR)' | ||
| position = 'before' | ||
| payload = ''' | ||
| if MP.TIMER_FORCE_GAMESPEED and (G.STAGE == G.STAGES.RUN and not G.SETTINGS.paused and not G.screenwipe) then | ||
| self.SPEEDFACTOR = math.max(self.SPEEDFACTOR, 4 + math.max(0, math.abs(G.ACC) - 2)) | ||
| end | ||
| ''' | ||
| times = 1 | ||
| match_indent = true |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,3 +33,9 @@ SMODS.Joker({ | |
| end | ||
| end, | ||
| }) | ||
|
|
||
| MP.ReworkCenter("j_mp_ticket", { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. making a note to take this out because of reworkcenter rarity desync shenanigans etc. |
||
| layers = "experimental", | ||
| config = { extra = { dollars = 4 }, mp_balanced = true }, | ||
| rarity = 2, | ||
| }) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| MP.Ruleset({ | ||
| key = "blitz", | ||
| layers = { "standard", "pressure_timer" }, | ||
| layers = { "standard" }, | ||
| }):inject() |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,23 @@ | ||
| MP.Ruleset({ | ||
| key = "experimental", | ||
| layers = { "experimental", "ranked", "pressure_timer" }, | ||
| key = "experimental_pressure", | ||
| layers = { "ranked", "experimental", "pressure_timer" }, | ||
| forced_gamemode = "gamemode_mp_attrition", | ||
| }):inject() | ||
|
|
||
| MP.Ruleset({ | ||
| key = "experimental_no_animation", | ||
| layers = { "ranked", "experimental", "no_animation_timer" }, | ||
| forced_gamemode = "gamemode_mp_attrition", | ||
| }):inject() | ||
|
|
||
| MP.Ruleset({ | ||
| key = "experimental_pressure_only", | ||
| layers = { "standard", "ranked", "pressure_timer" }, | ||
| forced_gamemode = "gamemode_mp_attrition", | ||
| }):inject() | ||
|
|
||
| MP.Ruleset({ | ||
| key = "experimental_no_animation_only", | ||
| layers = { "standard", "ranked", "no_animation_timer" }, | ||
| forced_gamemode = "gamemode_mp_attrition", | ||
| }):inject() |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| MP.Ruleset({ | ||
| key = "legacy_ranked", | ||
| layers = { "classic", "ranked" }, | ||
| layers = { "classic", "ranked", "smods_version_check" }, | ||
| forced_gamemode = "gamemode_mp_attrition", | ||
| }):inject() |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| MP.Ruleset({ | ||
| key = "standard_ranked", | ||
| layers = { "standard", "ranked", "no_animation_timer" }, | ||
| layers = { "standard", "ranked", "smods_version_check" }, | ||
| forced_gamemode = "gamemode_mp_attrition", | ||
| }):inject() |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| MP.Ruleset({ | ||
| key = "smallworld", | ||
| layers = { "standard", "smallworld", "pressure_timer" }, | ||
| layers = { "standard", "smallworld" }, | ||
| }):inject() |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -235,6 +235,10 @@ function G.FUNCS.set_timer_box(e) | |
| end | ||
| end | ||
|
|
||
| local animation_budget_capacity = 40 | ||
| local animation_budget_restore_rate = 2.5 | ||
| local animation_budget_decay_rate = 1 | ||
|
Comment on lines
+238
to
+240
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. magic constants? |
||
|
|
||
| local gameUpdateRef = Game.update | ||
| ---@diagnostic disable-next-line: duplicate-set-field | ||
| function Game:update(dt) | ||
|
|
@@ -253,6 +257,8 @@ function Game:update(dt) | |
| local new_time = love.timer.getTime() | ||
| local timer_dt = new_time - (MP.TIMER_CLOCK or new_time) | ||
| MP.TIMER_CLOCK = new_time | ||
| MP.TIMER_ANIMATION_BUDGET = math.min(animation_budget_capacity, (MP.TIMER_ANIMATION_BUDGET or animation_budget_capacity) + timer_dt * animation_budget_restore_rate) | ||
| MP.TIMER_FORCE_GAMESPEED = false | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Regrdless of ruleset or mode every frame we set TIMER_FORCE_GAMESPEED to false just to sometimes set it to true below While this is a no-op for irrelevant rulesets it adds to the confusion of this method Should probably make the different branches between
crystal clear |
||
|
|
||
| -- Bail fast: not an MP PvP-timer context | ||
| if G.STATE == G.STATES.GAME_OVER then return end | ||
|
|
@@ -264,20 +270,28 @@ function Game:update(dt) | |
|
|
||
|
|
||
| local is_no_animation_timer = MP.is_layer_active("no_animation_timer") | ||
| local is_pressure_timer = MP.is_layer_active("pressure_timer") | ||
| -- Tick gating differs by layer: | ||
| -- pressure_timer ON -> tick during regular play (not ready_blind, not pvp boss) | ||
| -- pressure_timer OFF -> tick whenever someone pressed a timer button. | ||
| -- timer_started = YOU pressed it; nemesis_timer_started = OPPONENT pressed it | ||
| -- (i.e. they're timering you). Either way your local timer should tick. | ||
| if MP.is_layer_active("pressure_timer") or is_no_animation_timer then | ||
| if is_pressure_timer or is_no_animation_timer then | ||
| if is_pressure_timer or (is_no_animation_timer and MP.GAME.nemesis_timer_started) then | ||
|
Comment on lines
+279
to
+280
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same if check twice?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this fixes itself if you refactor the 3 timer case spaghetti |
||
| MP.TIMER_FORCE_GAMESPEED = true | ||
| end | ||
| if MP.GAME.ready_blind or MP.is_pvp_boss() then return end | ||
| -- Tick when "unready" blind or old timer, and opponent "timering" you | ||
| if (MP.GAME.pvp_reached or is_no_animation_timer) and not MP.GAME.nemesis_timer_started then return end | ||
|
|
||
| -- Don't tick during animations, unless the user is paused or has a menu open | ||
| local interactive = not (G.CONTROLLER.locked or (G.GAME.STOP_USE or 0) > 0) | ||
| local menu_or_paused = G.SETTINGS.paused or G.OVERLAY_MENU | ||
| if not (interactive or menu_or_paused) then return end | ||
|
|
||
| if not (interactive or menu_or_paused) then | ||
| MP.TIMER_ANIMATION_BUDGET = math.max(0, MP.TIMER_ANIMATION_BUDGET - timer_dt * (animation_budget_restore_rate + animation_budget_decay_rate)) | ||
| if MP.TIMER_ANIMATION_BUDGET > 0 then return end | ||
| end | ||
| else | ||
| if not (MP.GAME.timer_started or MP.GAME.nemesis_timer_started) then return end | ||
| end | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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.
typo