Posted by Battles between lions

sychik (#211762)

Lone Wanderer
View Forum Posts


Posted on
2022-05-26 11:39:06
TL/DR: code for handling storytelling battles between lions, with a dropbox link to txt file and instructions. NOT a script

Introduction
so, I'd been thinking lately about how I was going to choose an heir (because the whole point of the challenge I'd taken on is to not base my decisions on appearance) or to otherwise maybe settle some quarrels within pride. I really don't like completely making something up, so I decided to try making a small piece of code that could help me with that. idk, maybe it has been done before, but it is my interpretation of how such battles should work. also, I couldn't figure out where to post it, so if anyone knows it should be in another forum section, please tell me. I'm neither suggesting adding this to lioden nor trying to compete with the devs, this is just for the purposes of external help for storytelling. I re-read ToS and CoC and in my understanding this post shouldn't violate any rules, but if it is inappropriate for some reason (links, content itself, etc), I apologize in advance, and it can be taken down - or I'll correct it in accordance with the rules.

Description of the system
it is a very simple RNG system. there are some personalities that I consider more likely to start a battle. there are some which might spare the opponent earlier, but there are also some which would rather kill. you won't be able to spare an opponent who wants to kill you, they will make you fight until someone is dead, even if you're the kindest lion on earth. two kind lions, though, might compare their strength and part ways only slightly wounded.
lions attack each other in turns with attack success rate depending on number of stats they excel at compared to the opponent (namely advantage in agility, speed and smarts). health depends on stamina, damage depends on strength and smarts. lion with advantage in skill stat has a 25% chance of dealing double damage. as long as the lion who's being attacked has advantage at least in one of the stats (agility, speed, smarts, skill), they have additional 10% chance to dodge the attack. the code can be used for both male and female lions (I mean, both male and female personalities are included). flavor texts are nothing fancy, just the most basic information.



all in all, it is something you can totally do with a pen and paper and DnD dice. it would just take much longer. I tried to do it that way but I got tired.

Link and instructions
https://www.dropbox.com/s/s0vj3stb8pqk2gv/BATTLING%20python%20code.txt?dl=0
here is the link to a completely safe txt file, the contents of which you (and the mods of course) can check without running the code itself. I deliberately didn't hide the full link behind a tag, just in case. you can see that it isn't a script, it doesn't interact with the lioden site in any way. you can copy-paste and run it on any site which allows compiling and running python code.
I suggest this one, just choose the "PYTH 3.6" option from the dropdown - , paste the file contents into the huge blank space, manually change the lions' names, personalities and stats, scroll down and click "Run", scroll down again to see the results in "Output".
you can also download it and change the file format to .py and run it wherever you want (maybe even on that same site, just choose "Open file" instead of copy-pasting).

also, any suggestions are welcome!



Hrt Icon 0 players like this post! Like?

Before (#25066)

Lone Wanderer
View Forum Posts


Posted on
2022-05-27 09:14:56
Whoa, someone else who made their own fight calculator!

Years ago I made one in Google Sheets: https://docs.google.com/spreadsheets/d/1rKAgfQpC10L13xN9XLkRkJ5mDGpX3ErTgR1GGHVoJm8/edit

And then a couple of years ago I used it as Python practice and made a copy that does the same thing but is infinitely scaleable rather than maxing out at 10 lions. I don’t have that public, though, since it’s not very user-friendly. (You have to type in the stats exactly right and if you make a mistake you have to start all over.) It does do RNG for you, though, unlike the Sheets version.

Mine just generates a win percentage based on comparing their stats (pooling and splitting stat totals depending on the month) and also giving a nerf if they’re too young or old.

I’ve been using it to determine my king for a long time. Very often there’s some upset - my current king was a teen, and I hadn’t even given him a personality yet, but his sister won the fight for him and gave him the throne.

I’ll check yours out when I have more time - probably over the weekend.



Hrt Icon 0 players like this post! Like?

sychik (#211762)

Lone Wanderer
View Forum Posts


Posted on
2022-05-27 14:03:47
oohh, I checked out your sheets and I see there are more interesting ideas, like the inbreeding consequences and cub mortality. really detailed, but probably also a lot to keep track of :D my formula doesn't take age into account at the moment, but it makes perfect sense so I think I'm going to add it sooner or later. thank you for sharing! it's always so interesting to see what rules people can invent for their gameplay.



Hrt Icon 0 players like this post! Like?

Before (#25066)

Lone Wanderer
View Forum Posts


Posted on
2022-05-28 13:36:07
Haha, forgot about the inbreeding/cub mortality stuff. There was one summer I got really into making up rules for my pride, but it got to be too much to keep track of so I scaled back. I try to use in-game RNG as much as possible now instead of external RNG, with the exception of the fights since those don't happen too often. I've changed my in-pride inbreeding rules since then (I used to not stud ever - now I stud the current king's descendants out) and am playing with what I want to do with cub mortality (most recent system is a simple check to see if they gain Skill at the age of 0 and 5, as there's a 50% chance to gain Skill when you Play with lions 2 years and younger and I wanted a 1 in 4 mortality rate).

But glad I can be an inspiration, at least with the age modification!

I just checked yours out - it's neat that you have it do a play-by-play of the fight, and I like how you have Personality play a role.

How it runs makes for a much more stable outcome than mine has - if one of the lions has significantly higher stats than the other, it seems to be impossible for the other to win. I ran it a few times with my king (3064 total stats) and highest-statted lioness (1888 total stats) and none of the fights were even close. Versus mine where I had to adjust it to have a 50% auto-win for higher stats with the other 50% being based on the percentages as they're displayed because upsets were happening too often.

I'm mostly just happy to see someone else had a similar idea to me! And I may try to see if I can do a play-by-play sort of thing, too, without changing the win percentages (because I like upsets). It'd be pretty interesting in the more chaotic fights with over a dozen lions involved.



Hrt Icon 0 players like this post! Like?







Memory Used: 627.38 KB - Queries: 0 - Query Time: 0.00000 - Total Time: 0.00339s