Luck design doc

A place to record your ideas for the game.
Post Reply
User avatar
PKPenguin321
Site Admin
Joined: Tue Jul 01, 2014 7:02 pm
Byond Username: PKPenguin321
Github Username: PKPenguin321
Location: U S A, U S A, U S A

Luck design doc

Post by PKPenguin321 » #609726

Found this on my PC dated to October 2019, a design doc for what is basically a luck stat that would interact with the game in minor fun ways. I had forgotten all about this but I figure I might as well share it
Spoiler:

Code: Select all

main thing:
- all mobs now have a luck component that primarily stores a luck value (an int from -100 to 100).
  by default, this value is 0.

- generally, positive luck should not have a combat advantage (if it does, it should be very minimal).
  negative luck, however, should have major combat disadvantages.


helper procs:
- getluck(): checks if an atom has a luck component. if it does not, return the luck as 0.
  if it does, return the luck value.

- addluck(x): add x to luck value

- setluck(x): set luck value to x

- probluck(x): a prob() check where luck is flat added onto the end. IE: probluck(50) with a mob that has 10 luck
  is the same as prob(60). min cap 0, upper cap 100
  Examples:
  - chance of getting a good event in orion trail
  - chance of succeeding in a risky surgery operation

- lucksave(x, y): a prob() check where luck has a chance of being flat added. y is the prob of luck being added.
  by default, this value is set to luck, so 1 luck = 1/100 chance of 1 being added to a prob. (maybe make this
  an algorithm...) good for dice rolls or other things with small values.
  Examples:
  - literal ingame dice rolls (maybe not die of fate though)
  - chance to not drop things when you cough
  - chance to bump roulette wheel towards your chosen number
  - chance for flash to not burn out if it would have
  - chance that you get stun punched (negative luck only)

- getLucky(): equal to prob([luck value]). used for things where no prob previously existed.
  Examples:
  - orion trail glitches in your favor and grants free resources
  - "You slip on the water, but do a backflip and land on your feet!"
  - chance of avoiding appendictus (it gets passed to the next guy)
  - "Despite saying that you lost, the slot machine still spits out a coin. How fortunate!"

- getUnlucky(): if your luck is negative, this is prob(|[luck value]|). outputs should be bad
  Examples:
  - your arcade machine freezes in the middle of your game, so you have to reboot it and lose progress
  - "The slot machine starts to pay out your winnings, but the coin slot gets jammed..."
  - "The airlock doesn't notice you, and you bump headfirst into it. Ow..."
  - nanotrasen paycheck error means you dont get paid this cycle
  - slipping makes things fall out of your pockets, will activate any dropped grenades
  - getting up from a slip will make you slip *again*
  - harvesting plants has a lower yield, x* smaller yield for clovers where x is |your luck| (min 0).
  - you have a chance to screw up (de)construction steps of basic things like walls and windows
  - your gun jams and is disabled for a few seconds
  - when you throw something you accidentally only throw it a tile ahead
  - your voice can crack mid-sentence, giving you a wacky font
  - spells you cast misfire (like what happens when you read a used spellbook)
  - getting stunned can knock your shoes off
  - burn damage will ignite you


other examples:
 - prob(min(0, max((victim.getluck() - attacker.getluck())), 10))//prob(your luck - their luck) min 0 max 10
   	"[attacker] swings to punch you, but misses and hits [him/her]self instead!"

 - //die of fate
   roll = rand(1,20)
   if(roller.getUnlucky())
   	roll += roller.getluck
   	roll = min(1, roll)
   else if(roller.getLucky())
   	roll += floor(roller.getluck()/10)
   	roll = max(20, roll)

luck modifiers:
- lucky trait: +3 luck

- unlucky trait: -3 luck

- break a mirror: -7 luck for 7 minutes

- add a boon/punishment admins can do on prayers that give/remove luck.

- being a bit drunk/high makes you luckier, being blackout drunk/hallucinating makes you un-luckier

- new alcohol that specifically raises your luck by a slight extra amount, a second new alcohol that lowers it

- (lavaland?) cursed amulet of luck: you can choose to either permanently gain +30 luck at the cost of taking 5% more damage, or take 5% less at the cost of -30 luck

- corgi paw necklace: get a corgi paw by butchering a corgi. add it to a necklace chain to make a necklace.
  making the necklace gives you a curse of -5 luck, but wearing it gives +5 luck.

- new plant, clovers, can be eaten for a status effect that gives luck. if you have luck, they have a chance
  of being x-leafed (x = 3 + luck), giving 2x the luck.
  - green beers and clover cakes can be made that give a stronger version of the effect that stacks with the first

- devils are very lucky (+50), and their contracts can steal luck from whoever signs them. this would
  siphon 5(?) luck.

- wizards can see luck on examine, and can buy an amulet of extreme luck that gives a flat buff to luck (+50?)
  and prevents all luck loss. goes in necklace slot.

- chaplains smacking you with a bible blesses you with better luck for a short time

- summon event that applies a status effect on all mobs that modifies sets luck to a random amount for a decent time.
  ("You feel as though your destiny has slipped away...")

- wand of misfortune, which gives the victim a 1 minute debuff that sets their luck to -100

- lavaland reward: miracle cream. 5-use item that
  gives a 30 second buff of +100 luck (and a random genetics power?).


other additions:
- new span class that's like notify but green, for when lucky things happen to you
https://pastebin.com/jGG0SP1U
i play Lauser McMauligan. clown name is Cold-Ass Honkey
i have three other top secret characters as well.
tell the best admin how good he is
Spoiler:
Image
User avatar
RaveRadbury
In-Game Game Master
Joined: Fri Mar 08, 2019 3:41 am
Byond Username: RaveRadbury
Github Username: RaveRadbury
Location: BK ChatZone
Contact:

Re: Luck design doc

Post by RaveRadbury » #609738

I love Luck stat
User avatar
Super Aggro Crag
In Game PermaBanned
Joined: Sat Mar 21, 2015 9:47 pm
Byond Username: Super Aggro Crag

Re: Luck design doc

Post by Super Aggro Crag » #609744

luck
Image
Image
Image
Image
Image
Image
Image
User avatar
Armhulen
Global Moderator
Joined: Thu Apr 28, 2016 4:30 pm
Byond Username: Armhulenn
Github Username: bazelart
Location: The Grand Tournament

Re: Luck design doc

Post by Armhulen » #609771

I've always really liked the idea, it's just come with the understanding that the code cost of implementing it is huge and repository wide which sucks. you have to manually sort every probability into something that can be lucky and based off of someone and a probability that should be immutable
User avatar
PKPenguin321
Site Admin
Joined: Tue Jul 01, 2014 7:02 pm
Byond Username: PKPenguin321
Github Username: PKPenguin321
Location: U S A, U S A, U S A

Re: Luck design doc

Post by PKPenguin321 » #609772

Armhulen wrote:I've always really liked the idea, it's just come with the understanding that the code cost of implementing it is huge and repository wide which sucks. you have to manually sort every probability into something that can be lucky and based off of someone and a probability that should be immutable
The doc pretty much says it should only actually take luck into consideration on a few select things, but yeah you would have to pretty much comb through a lot of prob() calls to see where it would fit in
i play Lauser McMauligan. clown name is Cold-Ass Honkey
i have three other top secret characters as well.
tell the best admin how good he is
Spoiler:
Image
User avatar
Shadowflame909
Joined: Mon Jun 05, 2017 10:18 pm
Byond Username: Shadowflame909
Location: Think about something witty and pretend I put it here

Re: Luck design doc

Post by Shadowflame909 » #609774

PKPenguin321 wrote:Found this on my PC dated to October 2019, a design doc for what is basically a luck stat that would interact with the game in minor fun ways. I had forgotten all about this but I figure I might as well share it
Spoiler:

Code: Select all

main thing:
- all mobs now have a luck component that primarily stores a luck value (an int from -100 to 100).
  by default, this value is 0.

- generally, positive luck should not have a combat advantage (if it does, it should be very minimal).
  negative luck, however, should have major combat disadvantages.


helper procs:
- getluck(): checks if an atom has a luck component. if it does not, return the luck as 0.
  if it does, return the luck value.

- addluck(x): add x to luck value

- setluck(x): set luck value to x

- probluck(x): a prob() check where luck is flat added onto the end. IE: probluck(50) with a mob that has 10 luck
  is the same as prob(60). min cap 0, upper cap 100
  Examples:
  - chance of getting a good event in orion trail
  - chance of succeeding in a risky surgery operation

- lucksave(x, y): a prob() check where luck has a chance of being flat added. y is the prob of luck being added.
  by default, this value is set to luck, so 1 luck = 1/100 chance of 1 being added to a prob. (maybe make this
  an algorithm...) good for dice rolls or other things with small values.
  Examples:
  - literal ingame dice rolls (maybe not die of fate though)
  - chance to not drop things when you cough
  - chance to bump roulette wheel towards your chosen number
  - chance for flash to not burn out if it would have
  - chance that you get stun punched (negative luck only)

- getLucky(): equal to prob([luck value]). used for things where no prob previously existed.
  Examples:
  - orion trail glitches in your favor and grants free resources
  - "You slip on the water, but do a backflip and land on your feet!"
  - chance of avoiding appendictus (it gets passed to the next guy)
  - "Despite saying that you lost, the slot machine still spits out a coin. How fortunate!"

- getUnlucky(): if your luck is negative, this is prob(|[luck value]|). outputs should be bad
  Examples:
  - your arcade machine freezes in the middle of your game, so you have to reboot it and lose progress
  - "The slot machine starts to pay out your winnings, but the coin slot gets jammed..."
  - "The airlock doesn't notice you, and you bump headfirst into it. Ow..."
  - nanotrasen paycheck error means you dont get paid this cycle
  - slipping makes things fall out of your pockets, will activate any dropped grenades
  - getting up from a slip will make you slip *again*
  - harvesting plants has a lower yield, x* smaller yield for clovers where x is |your luck| (min 0).
  - you have a chance to screw up (de)construction steps of basic things like walls and windows
  - your gun jams and is disabled for a few seconds
  - when you throw something you accidentally only throw it a tile ahead
  - your voice can crack mid-sentence, giving you a wacky font
  - spells you cast misfire (like what happens when you read a used spellbook)
  - getting stunned can knock your shoes off
  - burn damage will ignite you


other examples:
 - prob(min(0, max((victim.getluck() - attacker.getluck())), 10))//prob(your luck - their luck) min 0 max 10
   	"[attacker] swings to punch you, but misses and hits [him/her]self instead!"

 - //die of fate
   roll = rand(1,20)
   if(roller.getUnlucky())
   	roll += roller.getluck
   	roll = min(1, roll)
   else if(roller.getLucky())
   	roll += floor(roller.getluck()/10)
   	roll = max(20, roll)

luck modifiers:
- lucky trait: +3 luck

- unlucky trait: -3 luck

- break a mirror: -7 luck for 7 minutes

- add a boon/punishment admins can do on prayers that give/remove luck.

- being a bit drunk/high makes you luckier, being blackout drunk/hallucinating makes you un-luckier

- new alcohol that specifically raises your luck by a slight extra amount, a second new alcohol that lowers it

- (lavaland?) cursed amulet of luck: you can choose to either permanently gain +30 luck at the cost of taking 5% more damage, or take 5% less at the cost of -30 luck

- corgi paw necklace: get a corgi paw by butchering a corgi. add it to a necklace chain to make a necklace.
  making the necklace gives you a curse of -5 luck, but wearing it gives +5 luck.

- new plant, clovers, can be eaten for a status effect that gives luck. if you have luck, they have a chance
  of being x-leafed (x = 3 + luck), giving 2x the luck.
  - green beers and clover cakes can be made that give a stronger version of the effect that stacks with the first

- devils are very lucky (+50), and their contracts can steal luck from whoever signs them. this would
  siphon 5(?) luck.

- wizards can see luck on examine, and can buy an amulet of extreme luck that gives a flat buff to luck (+50?)
  and prevents all luck loss. goes in necklace slot.

- chaplains smacking you with a bible blesses you with better luck for a short time

- summon event that applies a status effect on all mobs that modifies sets luck to a random amount for a decent time.
  ("You feel as though your destiny has slipped away...")

- wand of misfortune, which gives the victim a 1 minute debuff that sets their luck to -100

- lavaland reward: miracle cream. 5-use item that
  gives a 30 second buff of +100 luck (and a random genetics power?).


other additions:
- new span class that's like notify but green, for when lucky things happen to you
https://pastebin.com/jGG0SP1U
Oh man I'd totally be the dude who when the long shift gets boring makes 1000 corgi paws just to get trolled by the game. Sounds like a fun time
► Show Spoiler
User avatar
Mothblocks
Code Maintainer
Joined: Fri Jul 27, 2018 9:33 am
Byond Username: Jaredfogle

Re: Luck design doc

Post by Mothblocks » #609784

seems funny
Shaps-cloud wrote: Mon Dec 07, 2020 7:59 am May eventually become one of the illusive maintainer-headmins if they choose to pursue that path, having a coder in the senior admin leadership has usually been positive for both sides in the past.
Head Coder of /tg/station, hi!

Head Admin of /tg/station Feb 2022.

Mothblocks everywhere, >>> Say nice things about me <<<
User avatar
Farquaar
Joined: Sat Apr 07, 2018 7:20 am
Byond Username: Farquaar
Location: Delta Quadrant

Re: Luck design doc

Post by Farquaar » #609813

I dig it.
► Show Spoiler
User avatar
Agux909
Joined: Mon Oct 07, 2019 11:26 pm
Byond Username: Agux909
Location: My own head

Re: Luck design doc

Post by Agux909 » #609931

+1 sounds like fun.

A question tho. What defines the amount of luck/bad luck you accumulate? Or is it completely random?
Image

Image

Image
Image
Image
User avatar
PKPenguin321
Site Admin
Joined: Tue Jul 01, 2014 7:02 pm
Byond Username: PKPenguin321
Github Username: PKPenguin321
Location: U S A, U S A, U S A

Re: Luck design doc

Post by PKPenguin321 » #609971

Agux909 wrote:+1 sounds like fun.

A question tho. What defines the amount of luck/bad luck you accumulate? Or is it completely random?
It says so in the doc under luck modifiers. Traits, certain items, a new botany blant, drunkenness, blessed by the chaplain...
i play Lauser McMauligan. clown name is Cold-Ass Honkey
i have three other top secret characters as well.
tell the best admin how good he is
Spoiler:
Image
User avatar
Agux909
Joined: Mon Oct 07, 2019 11:26 pm
Byond Username: Agux909
Location: My own head

Re: Luck design doc

Post by Agux909 » #609976

PKPenguin321 wrote:
Agux909 wrote:+1 sounds like fun.

A question tho. What defines the amount of luck/bad luck you accumulate? Or is it completely random?
It says so in the doc under luck modifiers. Traits, certain items, a new botany blant, drunkenness, blessed by the chaplain...
Missed that, thanks. Also that's cool!
Image

Image

Image
Image
Image
Post Reply

Who is online

Users browsing this forum: No registered users