6150th poster gets a cookie (cookie thread (Part 7)) (Part 8)

for coding

1 Like

I think I would resolve this as:
Doctor (No. 4) heals themself.
Roleblocker (No. 1) gets jailed.

Roleblocker (No. 1) gets told their action failed. Everyone else gets told that their action succeeded.

with most abilities you should generally be able to find a better resolution tho

1 Like

oh damn have you been like, thinking about coding that kind of thing?

2 Likes

whyd u become an aussie at the end there

3 Likes

alr guys im gonna write the wandering souls OP wish me luck

general cw (i am treating a serious topic kinda lightly)

a second muer has hit the afterlife

2 Likes

I’ve personally referred to it as Chain Resolution.
The way I’ve tried approaching it is like a linked list, where you keep working backwards through a chain of “that person was targeted by this person, who was targeted by this person” until you find the earliest person not targeted by what I’d dub an “action-affecting effect” (RB, bus drive, etc). From there, you resolve things.

1 Like

Yes. On and off for years lol. Like sometimes I don’t think about it for months, but I do think about it and I’ve made some progress. So much of mafia game rules is just kinda fiat and not formalized that it makes writing the code for how I want it to work really difficult because it forces me to consider all of these questions. And I want it to be generalizable so I really have to decide how things work and interact with each other.

1 Like

yea fair

Same.
It’s kind of an across-the-board mess to do this because various people have different assumptions on how action resolution should be handled.

1 Like

there’s a LOT of mafia rules that are unspoken because they’re so universal, even in game OPs that are supposed to describe it

i’ve also (kinda) tried coding a framework that you could put abilities into as mentioned before, and really what i was doing was making a thing that you put abilities into and then it spits out results & feedback n shit. as a proof of concept
really what i came up with there extended basically to “how do you fit all of these unique abilities into one tos-like resolution” and i ended up with extremely abstracted abilities (e.g. jailkeeper → an instance of roleblock and an instance of doctor, targeted on the same person)

1 Like

this in particular does result in some counter-intuitive resolutions (in this case, the roleblock immunity attribute is assigned to the roleblock but not the doctor, so they become a roleblocker for the night if they get rb’d) but i think manipulative abilities are guranteed to result in that in general

1 Like

in terms of Macro :tm: you can usually go with the ~general order of “manipulative > killer/protective (however u wanna make those work) → investigative”
but it doesn’t work for everything so

1 Like

I would construct a directed graph and then use a function to construct a directed acyclic graph (DAG) from that for actual resolution order. A graph is going to be more natural than a linked list both literally in terms of programming and in your brain when you think about how these things relate to each other. Like 5 players may target the same player, and none of them interact so their order relative to each other is irrelevant. You can represent that with 5 nodes having edges to that single node, and then your traversal function can choose any of those 5 to resolve first arbitrarily. That’s the idea anyway. You want to start with just a directed graph because want to have a record of actions as submitted, and the DAG is what things look like after you break cycles and get things into the final order.

2 Likes

i would probably create a few extra general tiers within there too
(e.g. a tier below maniplautive for things that can’t be manipulated and that impact manipulative abilities as if they didn’t have rb immunity could be good
along with a tier in between manip and kills for misc effects that need to go before kills, and between kills and investigations for misc effects that need to go after kills. the distinction here is less relevant given the fact that death doesn’t stop actions, but still useful probably
i would also have two or three after investigations; one for trackers, one for misc end-of-night effects, and the final one for role/alignment changes)

this isn’t very useful for coding but you can use it to have different “phases” of the resolution ig, and then you divide the actual resolution in between those phases

yea i have no idea what any of this means

Willow this just isnt something you take lightly or make jokes about.

that’s why i put it under a spoiler

Yeah you’re working your way towards a similar abstraction of abilities being compositions of effects lol

1 Like