2023-Mar-28, Tuesday

It's all just math

2023-Mar-28, Tuesday 09:42
dorchadas: (Office Space)
Thank you for your good wishes for [instagram.com profile] sashagee's health! She's doing a little better, though still not back to where she was a couple weeks ago. She's scheduled for some more tests soon so hopefully that will get her back on track.

Working more on my Cataclysm mod and someone just added the ability to use arithmetic expressions in spell fields, unlike the previous limit of integers only. Right now, since psionics should be a little unpredictable, the powers are designed so that the damage is totally random within defined bounds, and leveling up the power decreases the randomness. Because of the way the syntax works, however, I couldn't previously increase the possible max damage at higher levels without allowing that amount of damage as a random possibility at lower levels--but now I can! And then I thought, oh, I should also scale damage based on Intelligence too, so I needed to come up with a mathematical formula for that. After a while of trying to figure out how to get +1 Intelligence to mean +5% damage normalized around 10, I gave up and went with adding 5 to Intelligence, dividing by 15, and then using that as the multiplier. That gives +6% damage at 11 Intelligence, +13% at 12, +20% at 13, +27% at 14...

...and I just figured out that answer while writing this post. Add 10 and then divide by 20. Emoji Picard facepalm That would give me exactly the values I was looking for.

Anyway, it didn't matter in the end because I wrote up the formula like so:
"max_damage": { "arithmetic": [ { "arithmetic":
[ { "u_val": "spell_level", "spell": "pyrokinetic_eruption" },
"*", { "const": 3 } ] }, "+", { "const": 97 }, "/"
{ "const": 15" }, "*", { "arithmetic": [
{ "u_val": "intelligence" }, "+",
{ "const": 5 } ] } ] }
...and then the game told me "too many args," because each arithmetic operation can only take two arguments and you can only nest them two deep, so it's flatly impossible to do what I want. Oh well. Maybe in the future someone will add a way that it can work.

At work they're refining the database we currently use to try to make it something that's remotely functional at scale. They have actually done a lot of refinements from the initially basically unusable state and now it is actually possible for me to accomplish some work in a day--[instagram.com profile] sashagee was initially like "White collar jobs are a scam! You're not working at all! You just play games and occasionally look at your screen!" until we switched back to the old database and she realized that I did actually have work to do when the tools didn't prevent me from doing it--but while the minutes' long wait between every action has actually been fixed, having to click through seven or eight screens to do anything still exists. I'm trying out the new refinements and it does seem to work a bit better, in that there's a work queue on the same screen as the one where the work takes place which is actually a massive improvement! I currently can't test record management because the list of test profiles does not include anything that I can manipulate...but it does show the same record multiple times in a row. Well, I'm sure eventually it will all get fixed.

Eventually, eventually, eventually.