-
-
Notifications
You must be signed in to change notification settings - Fork 585
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
Creature delay bugfix and refactor, closes #2158 #2275 #2426
Creature delay bugfix and refactor, closes #2158 #2275 #2426
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Any chance this will be looked at/merged soon? I've got other code in the works, but it uses this branch as a starting point. |
Yeah, getting back at my desk in a bit and starting to catch up with work
again.
…On Mon, Jul 17, 2023, 5:44 PM andretchen0 ***@***.***> wrote:
Any chance this will be looked at/merged soon? I've got other code in the
works, but it uses this branch as a starting point.
—
Reply to this email directly, view it on GitHub
<#2426 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEPNX26MTYV7GGV5WIFYDDXQVFUBANCNFSM6AAAAAA2L3GXIM>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
I'm not sure if that's the right fix. In the old version of the code, in nextCreature() ...
Now ... The So ... I changed the condition to But the Do you have a preference? |
@andretchen0 Usually fighting games have an announcer be like "Round 1, Fight!" and then the gameplay starts. There's also some more silliness like that regarding counting players, so that P1 ends up with id 0 if I recall right. |
Not everywhere, but there's often a translation that happens from 0-indexing to 1-indexing when going from programmer-space to user-space. That's my preference frankly, but there are probably bigger fish to fry. I'm not sure what poking at |
Well, we could consider first one round 0, as it's a standard thingy, with Dark Priests only and probably no units acting, unless having some special passive ability to avoid materialization sickness (might happen eventually) or some alternative summoner type at some point that that can heal the sickness. I haven't found any other issues so far, might merge soon. |
@andretchen0 Your last patch somehow didn't changed things 😆 |
Ok. I'll have a look tomorrow. |
Ah, gotcha. I didn't have a clear understanding of what was missing. If I understand correctly, what was missing after the last fix was that "Round 1" wasn't shown in the "stringConsole" on the first round – before the mini tutorial. Everything else was fine? With this latest commit, "Round 1" is shown before the mini tutorial. |
I was talking about the unit queue, in beta.ancientbeast.com the first round marker shows "Round 2"; good catch though. |
Ok. Got it. |
I guess I'm not following. Option AHere's how it was: https://ancientbeast-qt9ebrojo-freezingmoon.vercel.app/ This shows "Round 2" in the round marker on game start – I guess this assumes that the round marker marks the start of a round. Option BHere's how it is currently: https://ancientbeast-byxfjd48f-freezingmoon.vercel.app/ This shows "Round 1" in the round marker on game start - I guess this assumes that the round marker marks the end of a round. Is either Option A or Option B correct? If so, which one? Otherwise, what should the round marker read at the beginning of the game? |
It used to be good, though it wasn't displaying properly for me for some reason. Anyway, interesting point of view, will think about it and pick one, though queue is for things to come, but we would be lacking some "Round 1" marker otherwise, hmm... |
Will leave it like this for now (option B), as I'll think of the marker like a tombstone for the round 🪦 "Here lies round 2" |
bugfix: fix creature delay reset and delays across rounds
creature.delay()
intocreature.hinder()
andcreature.wait()
creature.hinder()
is called when an attacker delays the creaturecreature.wait()
is called when the player delays their own creaturehinder
,wait
and related getterscreature.delayable
andcreature.delayed
src/creature_queue.ts
; its values are now derived on the fly – no need to callupdate()
ui/queue.ts
, removingstopGap
functions needed to derive correct data from buggy delaysSee #2158, #2275
Creature.delay()
Creature
delayed
/delayable
were set in different parts of the code. And theCreature
class treateddelay()
/delayed
as monolithic – however there were 2 distinct cases in code:These two cases are now separate methods:
wait()
andhinder()
, respectively.delayable
was converted tocanWait
and is no longer settable – it's derived.CreatureQueue
CreatureQueue (creature_queue.ts)
kept its own state related to creature delay status and turn position. That had to be kept updated and in sync with the world. Most of its methods have been removed. It now sufficient to change the creatures themselves.CreatureQueue
no longer holds any data. It merely derives it, so it's always up to date.Future
game
does a lot of UI calls, e.g., setting button states. Lots of care (or trial and error) is needed to tunesetTimeout
s so that the correct UI state ends up on screen. Using the current paradigms in the codebase, it would besimpler if
game
communicated the possible need for a UI update by dispatching an event. Then the UI could derive its state from the game.Likewise,
interface.js
does things like check if a button press should have an action, e.g., ifbtnDelay
is pressed, it checks whether thegame.activeCreature
can be delayed. These kinds of business rules shouldn't reside in the UI. It would be simpler if it merely fired off the button press and letgame
or the creature itself decide how to respond – the OOP principle of "tell, don't ask".