PDA

View Full Version : I've created a free 5e D&D combat simulator website



gregc
2021-08-29, 10:33 AM
I always loved carefully balancing encounters in older editions, comparing total hit points on either side with total damage/round either side throws out. This goes much further to be a full blown simulation calculating spell area of effects, ranges of weapons, movement per turn, actions, bonus actions and much more. I don't have every spell/class feature/monster full implemented but there is a ton already done over the last year.

Its not designed for mobile, though will work. Its quite advanced, you can build custom characters, create unique monsters, you can setup battles of PC vs PC or monster showdown. You can simulate multi wave encounters. Its a little slow to load the first time you open the page but your browser will cache the page content and run faster next time.

dndcombat.com

If you have any questions hit me up on the discord: discord.gg/Sp8EASB

MaxWilson
2021-08-29, 10:43 AM
Link for convenience: https://dndcombat.com

Sounds interesting. Can you view the battles, or does it just report statistics?

gregc
2021-08-29, 11:00 AM
Sounds interesting. Can you view the battles, or does it just report statistics?

Oh yes :-) You can watch one fight go turn by turn, seeing in detail what each character did, what their dice rolls were, why they had advantage, why they didnt pick a spell, watch their movement, see where that fireball landed etc.

EggKookoo
2021-08-29, 11:11 AM
This is very intriguing...

Lupine
2021-08-29, 11:13 AM
That sounds very interesting…

Might take a look sometime.

PhantomSoul
2021-08-29, 11:16 AM
This is cool -- I'll have to give it a look (just watched the intro vid) and potentially keep tabs. The idea of having an ML-trained simulator could turn into incredible tools!

TigerT20
2021-08-29, 11:31 AM
Could you make a version that only uses the SRD, so it can be shared in communities that frown on piracy?

gregc
2021-08-29, 11:44 AM
Could you make a version that only uses the SRD, so it can be shared in communities that frown on piracy?

You still have to buy the books to use it in your games, similar to kobold fight club and the like, the vast majority of interesting content is missing. Really it just gets your excited about buying more stuff :-)

But sure I can add a source filter.

EDIT

Added a source filter and made it clear it is a Fan Content site.

Demostheknees
2021-08-29, 11:55 AM
I found this tool just last week! Really loved the ability to import PCs from D&D Beyond.

I'm curious what can of logic goes into the actions chosen during the simulation? Sometimes the PCs would cast specifically non-combat spells during the simulation, which might cause a loss.

MaxWilson
2021-08-29, 11:56 AM
I tried a couple fights and found some glitches (using Mass Cure Wounds to heal only one person; four 11th level PCs trounce four CR 9 Fire Giants, a double-Deadly fight by DMG standards, but four 9th level PCs get massacred (triple-Deadly)) which lead me to believe it's overestimating difficulty. But that's fine. I can always mentally adjust, e.g. when I see these Fighters plinking away without Sharpshooter and still winning, I know that in an actual game with skilled players they'll do even better, and with novice players at least they are unlikely to do worse.

I love being able to see the battles, and I love that monsters can be on both sides. I will have fun crashing PCs + Beholders into Mind Flayers and Dragons, etc.

This tool is a marked advancement over DMG tables because of the specificity. "Players won 92% of the time and took 1.2 casualties on average" is far less ambiguous than "Hard fight." An individual DM can decide if that's too hard or not hard enough (bearing in mind again that skilled players will do better).

Thanks again for doing this!

gregc
2021-08-29, 12:01 PM
I found this tool just last week! Really loved the ability to import PCs from D&D Beyond.

I'm curious what can of logic goes into the actions chosen during the simulation? Sometimes the PCs would cast specifically non-combat spells during the simulation, which might cause a loss.

So if you created the PC, and you edit it, you will see all the "weights", numbers from 20-80 attached to each action and each spell. These were created by a background process running pretend fights.
Each turn it takes those numbers and adds adjustments based on a variety of things, like favoring buffs in the first round, or prioritizing heals, or give "melee fighters" more likely to pick weapons etc.
The real time AI also prioritizes actions based on which is best in the moment.

The final numbers are put together and highest chosen. You can override your action/spell weights on your own PCs or monsters you have created.

Its a complex thing, and something we are always improving. If you wave your mouse over the "valid actions" you can see calculated weights in parenthesis.

stoutstien
2021-08-29, 12:09 PM
I tried a couple fights and found some glitches (using Mass Cure Wounds to heal only one person; four 11th level PCs trounce four CR 9 Fire Giants, a double-Deadly fight by DMG standards, but four 9th level PCs get massacred (triple-Deadly)) which lead me to believe it's overestimating difficulty.

This tool is a marked advancement over DMG tables because of the specificity. "Players won 92% of the time and took 1.2 casualties on average" is far less ambiguous than "Hard fight." An individual DM can decide if that's too hard or not hard enough (bearing in mind again that skilled players will do better).

Thanks again for doing this!

100% agree on all three points. Really solid but of kit and it's lining up pretty close to my pseudo parties I use to test encounters for soundness.

gregc
2021-08-29, 12:10 PM
I tried a couple fights and found some glitches (using Mass Cure Wounds to heal only one person;
I think it will if they are damaged enough, there are some checks if not so damaged. I've made a note to check the logic.



four 11th level PCs trounce four CR 9 Fire Giants, a double-Deadly fight by DMG standards

I haven't tested fire giants in a while, I think the issue is they defaulted to preferring ranged which has been a problem lately. I fixed them at melee and its more even (e.g. see fight=VUGI)



But that's fine. I can always mentally adjust, e.g. when I see these Fighters plinking away without Sharpshooter and still winning, I know that in an actual game with skilled players they'll do even better, and with novice players at least they are unlikely to do worse.

For sure, until all the class features and spells are implemented, and bugs shaken out, its not comparable to players (but its a lot faster haha).

Sandeman
2021-08-29, 12:48 PM
Average HP left after a fight:
Acererak: 285/285
Acolyte: 0/9


:biggrin:

EggKookoo
2021-08-29, 01:34 PM
Tried out some fights as well. All in all, this is pretty cool. Couple of things...

I have an artificer battle smith in my party. It doesn't look like the simulator understands the Steel Defender?

Somehow my artificer cast false life and for the life of me I can't figure out where it came from.

The bard spent an action casting barkskin on the artificer, who already has a very high AC.

Speaking of the bard, I flagged her as a spellcaster but she insisted on running up into the middle of the fight instead of keeping distance. Funnily enough, the bard's IRL player tended to do this until she learned the class better. Maybe her spell selection weighed her toward melee? In the end she finished off the last monster with a rapier hit. But she went down and up a lot during the fight, costing other players healing magic.

IRL, my moon druid player will jump out of wild shape and then go right back in if her wild shape HP is getting low. Maybe it's a cheese tactic but it works.

Despite all this, the simulator is pretty cool. It caught how the warlock is an offensive powerhouse and made ample use of the bard's inspiration. Very cool stuff!

MaxWilson
2021-08-29, 01:41 PM
For sure, until all the class features and spells are implemented, and bugs shaken out, its not comparable to players (but its a lot faster haha).

And there's a LOT of variance in player skill and willingness to exploit loopholes. Besides, many good strategies can be sort of faked into this tool indirectly, e.g. add an Earth Elemental and sixteen wolves to the 9th level party's side when they fight the Fire Giants, to represent what a Wizard and Druid might be doing with their concentration. (The wizard will still cast Stoneskin on somebody on round 1, based on what I've seen, instead of casting Hypnotic Pattern or Wall of Force, so this effectively isn't double-dipping on concentration.)

gregc
2021-08-29, 02:42 PM
I have an artificer battle smith in my party. It doesn't look like the simulator understands the Steel Defender?

Somehow my artificer cast false life and for the life of me I can't figure out where it came from.


Yeah I haven't got artificer yet, sadly still trying to finish up the PHB class features. Getting there though, I'm working on warlocks and should be on artificer within a week or two.

gregc
2021-08-29, 02:48 PM
instead of casting Hypnotic Pattern or Wall of Force
Until I get to the point where I record square specific terrain effects, wall of force won't do anything.
Hypnotic pattern should in theory but the charms are vastly under rated due to some bug I need to dig into.

gregc
2021-08-29, 02:49 PM
IRL, my moon druid player will jump out of wild shape and then go right back in if her wild shape HP is getting low. Maybe it's a cheese tactic but it works.

Someone on discord mentioned this tactic, I will add it so we got some cheese too.

MaxWilson
2021-08-29, 04:23 PM
Until I get to the point where I record square specific terrain effects, wall of force won't do anything.
Hypnotic pattern should in theory but the charms are vastly under rated due to some bug I need to dig into.

That wasn't a criticism, just a example
In this case it's actually a good thing the wizard isn't casting a useful spell because it means including an Earth Elemental isn't "cheating" with double concentration.

gregc
2021-08-29, 04:29 PM
That wasn't a criticism, just a example
In this case it's actually a good thing the wizard isn't casting a useful spell because it means including an Earth Elemental isn't "cheating" with double concentration.
Its all good, I like the examples, just explaining the mechanics or bugs that explain the behavior.

Valmark
2021-08-29, 04:59 PM
This program's pretty neat.

Something to note: running a fight between a red and a gold dragon figured them repeatedly breathing on each other even after having seen that it did nothing (since they are both immune).

gregc
2021-08-29, 05:22 PM
This program's pretty neat.

Something to note: running a fight between a red and a gold dragon figured them repeatedly breathing on each other even after having seen that it did nothing (since they are both immune).

Good find, it was only checking spells before, that should be fixed now thanks !

Dalinar
2021-08-29, 05:33 PM
By way of bug reports, a Ranger 10 decided to use Spike Growth on a single Abyssal Chicken at the end of an encounter, which immediately did 5 damage and killed it. https://www.dndcombat.com/dndcombat/Welcome.do?fight=EUSK

stoutstien
2021-08-29, 05:34 PM
By way of bug reports, a Ranger 10 decided to use Spike Growth on a single Abyssal Chicken at the end of an encounter, which immediately did 5 damage and killed it. https://www.dndcombat.com/dndcombat/Welcome.do?fight=EUSK

Seems on point for some players I know.

PhantomSoul
2021-08-29, 05:35 PM
Seems on point for some players I know.

Especially if they then put on sunglasses while walking away from the corpse!

EggKookoo
2021-08-29, 05:36 PM
I've spent way too much time playing with this. It's great.

I'm curious, are the PCs just doing the most effective thing they can at any given time? My suspicion is there's no attempt to save spell slots and whatnot for subsequent fights. That might be a beast to predict. We can handle that by manually depleting spell slots and whatnot, I guess, but it would be cool to be able to set an overall level of "freshness" for the party.

gregc
2021-08-29, 05:44 PM
doh it crashed, be back up in a bit.


I've spent way too much time playing with this. It's great.

I'm curious, are the PCs just doing the most effective thing they can at any given time? My suspicion is there's no attempt to save spell slots and whatnot for subsequent fights. That might be a beast to predict. We can handle that by manually depleting spell slots and whatnot, I guess, but it would be cool to be able to set an overall level of "freshness" for the party.

Well you can run multi-wave fights, so you can soften them up with some earlier encounters, that will certainly deplete resources. Some requests have been made to install some behaviours like "conserve resources". I think later we can do that by examining how many waves are coming up.

gregc
2021-08-29, 05:53 PM
I wish when the server crashes, it was a little faster to force a reboot, anyway it is back up.

gregc
2021-08-29, 05:56 PM
By way of bug reports, a Ranger 10 decided to use Spike Growth on a single Abyssal Chicken at the end of an encounter, which immediately did 5 damage and killed it. https://www.dndcombat.com/dndcombat/Welcome.do?fight=EUSK

He seems to be defaulting as a healer (heart), I'll change that, but FYI you can click on those icons and change their "type". I guess as a healer he likes his spells, its a pain trying to figure out what kind of player they are.

Dalinar
2021-08-29, 08:29 PM
He seems to be defaulting as a healer (heart), I'll change that, but FYI you can click on those icons and change their "type". I guess as a healer he likes his spells, its a pain trying to figure out what kind of player they are.

Sorry, I should have specified a little more. Tactical wisdom of the move aside, Spike Growth doesn't deal any immediate damage (unless the chicken somehow moved as a reaction to the cast?)

gregc
2021-08-29, 08:38 PM
Sorry, I should have specified a little more. Tactical wisdom of the move aside, Spike Growth doesn't deal any immediate damage (unless the chicken somehow moved as a reaction to the cast?)

Ah gotcha, nah it was won of those early spells where I just did something quick and dirty, as if whoever would be caught moving on it a little.
Nowdays I would just put it on hold until the terrain code goes in and spells can modify the grid (and we distinguish between move and fly).

Oramac
2021-08-29, 11:24 PM
Man this is awesome!! Thank you for taking the (probably obscene) time to put this together. I can't praise this enough!

That said, I fiddled with it and did find a few oddities. For example, I ran a fight with 4 20th level PCs against a Lich and 3 Death Knights, and all 3 DKs used Hellfire Orb in the first round against 1 target. Also, the sim only rolled half the damage. Hellfire Orb is 10d6 fire AND 10d6 necrotic, but the sim only rolled 10d6 once, instead of 20d6.

I find the selection of Hellfire Orb difficult to believe, at least for all 3 DKs, since they'd presumably be smart enough to ensure it hits multiple targets. Or to cast Banishment or Destructive Wave early in the fight instead.

Overall, though, I love this tool and will be using it a TON in my current campaign! Thank you again for the hard work.

EDIT: To the example, in this image (https://ibb.co/K517XYz), the DK would be far better off targeting the Hellfire Orb at the Wizard/Fighter/Cleric than the Rogue. It's 3 targets instead of one, and none of the 3 have Evasion, netting the DK much better damage overall.

gregc
2021-08-30, 08:19 AM
Man this is awesome!! Thank you for taking the (probably obscene) time to put this together.
Thanks, if I knew how long it was going to take I might not have started lol.



That said, I fiddled with it and did find a few oddities. For example, I ran a fight with 4 20th level PCs against a Lich and 3 Death Knights, and all 3 DKs used Hellfire Orb in the first round against 1 target.
They weren't being fair? haha



Also, the sim only rolled half the damage. Hellfire Orb is 10d6 fire AND 10d6 necrotic, but the sim only rolled 10d6 once, instead of 20d6.

Thanks, I've updated the creature with the addition damage, ouch !



I find the selection of Hellfire Orb difficult to believe, at least for all 3 DKs, since they'd presumably be smart enough to ensure it hits multiple targets. Or to cast Banishment or Destructive Wave early in the fight instead.

No, its not that smart. But they will avoid moving into melee with more than 2 per target if they can. Also I don't have all spells implemented (you can see which on the spells tab) so it doesn't know banishment yet.




EDIT: To the example, in this image (https://ibb.co/K517XYz), the DK would be far better off targeting the Hellfire Orb at the Wizard/Fighter/Cleric than the Rogue. It's 3 targets instead of one, and none of the 3 have Evasion, netting the DK much better damage overall.

Ah, the hellfire orb was incorrectly defined as a single target spell, I have changed it to 20 foot radius, thanks for that !

gregc
2021-08-30, 10:25 AM
https://www.youtube.com/watch?v=J8qfCAX193k

Oramac
2021-08-30, 11:42 PM
Thanks, if I knew how long it was going to take I might not have started lol.

Ah, the hellfire orb was incorrectly defined as a single target spell, I have changed it to 20 foot radius, thanks for that !

You're welcome! Hopefully we here on GITP can help more as well. I apologize if my reply seemed overly harsh. I didn't intend that.



https://www.youtube.com/watch?v=J8qfCAX193k

I will most definitely be sharing this!

Thunderous Mojo
2021-08-31, 12:12 AM
Man this is awesome!! Thank you for taking the(probably obscene) time to put this together. I can't praise this enough!
Heartily Agree!


I find the selection of Hellfire Orb difficult to believe, at least for all 3 DKs, since they'd presumably be smart enough to ensure it hits multiple targets. Or to cast Banishment or Destructive Wave early in the fight instead.



No, its not that smart. But they will avoid moving into melee with more than 2 per target if they can. Also I don't have all spells implemented (you can see which on the spells tab) so it doesn't know banishment yet.

Ah, the hellfire orb was incorrectly defined as a single target spell, I have changed it to 20 foot radius, thanks for that !

So I think a case could be made for 3 Death Knights vs a 4 person all 20th Level character party, coordinating a Necrotic Nuclear First Strike on a single character.

Action Economy is against the Death Knights, if the Death Knights can tangle up PC actions by dropping someone into Code Blue territory, this might be the best option available.

Three Death Knights versus four, 20th Level Adventurers is an encounter where the Death Knights are fighting for a strategic withdrawal and,(hopefully), some meaningful drain of the party resources.

As I have seen discussed elsewhere, a Necromancer that uses a Feeblemind spell in conjunction with their Command Undead ability, can own a Death Knight.

gregc
2021-08-31, 12:22 AM
You're welcome! Hopefully we here on GITP can help more as well. I apologize if my reply seemed overly harsh. I didn't intend that.

I didn't read it as such, having concrete examples where it is not acting sanely is useful, I only test a fraction of the content, one day it will all be perfect :-)

T.G. Oskar
2021-09-02, 02:24 AM
Ran a few tests, using a team of my favorite builds (Scourge Aasimar Crown Paladin/Hexblade Warlock, Half-Elf Spirits Bard, Rock Gnome Alchemist Artificer and Mark of Handling Human Beastmaster Ranger; I'll eventually test it with a Tiefling Divine Soul Sorcerer as well), and it's been pretty interesting to see how the simulation runs up. I've been working a little bit with tweaking the weights to how I feel I'd play the character, but even then, I've noticed a few things.

For starters: I had to tweak things a LOT to have the Paladin/Hexblade start by casting Spirit Guardians. While I understand the Volo's version of the Aasimar isn't set yet (otherwise, I'd be using Radiant Consumption on Turn 2 to really rack up the damage), I really had to tweak it since otherwise there wouldn't be a pre-buff. It's cool to see that the toon used a couple of bonus action spells (Divine Power, a couple of Smites), though I noticed it used them once. (Probably 'cause it burned Spell Slots like nobody's business!) Also, like that it did the smart thing and used Lay on Hands as soon as it got on low HP.

Conversely, I find it odd that my Bard (which, again, doesn't have all of its spells and none of the subclass features since they're not placed in) decided to cast a 9th-level Heightened Healing Word instead of a Power Word: Heal, which would be far, FAR more useful in the long run. The lack of feats to justify some options (both the Alchemist and the Bard have Fey Initiate, therefore getting access to Bless; likewise, they have access to Magic Initiate, with the Alchemist getting a handful of Wizard spells while the Bard has Eldritch Blast) hurts a bit, but the spells can be added directly, which made it fun as the Bard suddenly had a magic machinegun in its hands. (Even more hilarious was to see the ALCHEMIST switch from Fire Bolt and Acid Splash, which were dealing no damage, to moving closer and risking a long-range Pistol shot.)

However, though I understand the code is incomplete, it does hinder some of the builds' power. For example: without Scourge Aasimar, some cantrips (ahem, Booming Blade) and feats, my Paladin/Warlock struggles to keep its concentration against really powerful enemies, which is harsh because she's the party's tank. (Specifically, the lack of War Caster means no advantage on Concentration saves to retain spells, meaning that anything dealing over 50 damage will invariably down Concentration. The Artificer has most of the class features but none of the Alchemist's ones, meaning it wasn't healing (or dealing damage) to full capacity. Most egregiously, the Beastmaster has the features but no way to justify summoning or getting the Ranger's Companion feature, meaning it was playing at half its potential. (Unless that means you need to construct the beast companion separately?) I understand this may be fixed as you work on the code (kudos for undergoing this mammoth endeavor!), but it feels like the toons aren't played to their full capacity.

The one recommendation I could make is to create a "gambit" system (think Final Fantasy XII), where you can "program" the character to do certain actions based not necessarily on weights, but on circumstances. This could probably mimic human behavior a bit better; i.e., determining which spell is better to use when healing (therefore, allowing someone with a better healing spell to use that instead of a lower-level spell heightened to maximum, but not spend that spell slot as soon as the ally takes damage to preserve it as a last-ditch healing), or when to go melee and when to go ranged. I don't hold to it, as I'm no expert at coding and that definitely sounds like the kind of thing for an overall revision once the basics are established, but it's nice to keep in mind.

And the one bug I MUST mention is that concentration buffs prevail when a creature is downed. This has happened every time; Paladin/Warlock gets downed while holding a Divine Favor spell, but the effect persists once she gets healed. By the rules, if you're taken to 0 HP and incapacitated, you lose concentration on any spell you have. You might want to revise that, since it means some of the numbers may be inflated with longer-lasting buffs persisting over takedowns. (Since spells like Divine Favor apply to all attacks you make, that adds up to damage that shouldn't be accounted for, which can hinder the simulation.)

That said; seeing the simulations is kinda fun. It does play a lot like it'd play on a table (one melee soaking everything, lots of people on the back with healing abilities and buffs that exist mostly to keep the tank alive and distracting the boss while unloading spells), even if it's still bare-bones. Good job on it; it's a massive resource for DMs and players alike.

gregc
2021-09-02, 08:50 AM
For starters: I had to tweak things a LOT to have the Paladin/Hexblade start by casting Spirit Guardians.
Its a good spell, I think the current coding it is a little simple, a full implementation and it would get picked more.



9th-level Heightened Healing Word instead of a Power Word: Heal

Can you link the fight? I removed the upcasting limit, in general it goes for the strongest heal it needs at the time.



The lack of feats to justify some options
Yeah feats and magic items are big ones still to do.



The Artificer has most of the class features but none of the Alchemist's ones, meaning it wasn't healing (or dealing damage) to full capacity.

Yeah I just added the Battle Smith, but that was mostly things you add to your character sheet anyway.




Most egregiously, the Beastmaster has the features but no way to justify summoning or getting the Ranger's Companion feature, meaning it was playing at half its potential.
(Unless that means you need to construct the beast companion separately?)

When you use the pregens, those subclasses are relatively complete, up to 10th level for most. But Ranger beast master I didn't choose, so its skills aren't their yet.
For the battle smith you would add the companion separately, for ranger not sure yet. We have summoning spells e.g. Strahds Animate Objects so could be implemented either way.




"gambit" system where you can "program" the character to do certain actions based not necessarily on weights, but on circumstances.
So the easiest way to achieve that is to let the users add custom scripts so they program certain behaviours e.g.
if (me.getCurrentHitpoints() < 25 && me.canCast(MistyStep) {
// blah blah
}
But the main issue is - how many users can write Javascript? Maybe 5%?
I thought of an alternative where you could just order your actions round by round in your preferred order e.g.
Round 1: Invisibility
Round 2: Fireball
Round 3: Stoneskin
etc.
idk will keep adding content while thinking about it.




And the one bug I MUST mention is that concentration buffs prevail when a creature is downed. This has happened every time; Paladin/Warlock gets downed while holding a Divine Favor spell, but the effect persists once she gets healed. By the rules, if you're taken to 0 HP and incapacitated, you lose concentration on any spell you have.

Ahh I didn't think about, I will added that ASAP.

Great feedback, and very useful, if you link me the fight I can let you know when most of the spells you use are complete.

thanks!

Greg

EggKookoo
2021-09-02, 09:29 AM
So the easiest way to achieve that is to let the users add custom scripts so they program certain behaviours e.g.
if (me.getCurrentHitpoints() < 25 && me.canCast(MistyStep) {
// blah blah
}
But the main issue is - how many users can write Javascript? Maybe 5%?
I thought of an alternative where you could just order your actions round by round in your preferred order e.g.
Round 1: Invisibility
Round 2: Fireball
Round 3: Stoneskin
etc.
idk will keep adding content while thinking about it.

I can't express how much I would love something like this. I've thought about it for years but I lack the focus or time to work it all out myself, plus the lack of framework (i.e. the encounter simulator itself).

Back in the early days, World of Warcraft allowed an addon called LazyScript that dynamically remapped one or more buttons to execute character abilities/spells/etc. based on conditions. It was originally written for healers, who would use it to auto-target teammates with the lowest health to hit with healing spells, which was very useful on a raid with 20+ PCs. The devs didn't mind that so much, but it soon got expanded to other classes, and the most notorious was LazyRogue, which could detect if someone was about to cast a spell and remap your main attack to a quick interrupt (I think it was kick?) and then map it back to your attack, all without the player necessarily being consciously aware of it. That kind of stuff got used in PvP and caused Blizzard to enforce their policy of "no remapping," which ultimately killed LazyScript.

Anyway, it had a convoluted but chainable syntax based on Lua (the language WoW addons are written in) which went something like DO X IF Y OR IF Z IS LESS THAN 10 OR DO A IF B IS NOT TRUE OR DO C IF... etc.

For me as a DM, I would love to be able to set up an encounter and then give each NPC a set of goals. Bob the guard will defend the door and not leave it, while Sue the guard will run up to the nearest threat and engage it, while Tim the guard (who is a healer) will heal either Bob or Sue, but will have a preference toward Sue. So Tim will heal Sue if her health gets down to 2/3 but only Bob if Bob's health is less than half. Meanwhile, Sue will feel protective of Tim, so if anyone attacks Tim she will make that attacker her new "focus." And so on...

Then when running the encounter, as long as I'm keeping the NPCs relevant values (like HP) up to date, the system runs through the decision tree and suggests a course of action. Oh, hey, Tim was just hurt by PC John, so Sue now wants to run up to PC John and attack him, possibly despite incurring an OA on herself. As the DM I'm not bound by these suggestions, but they're there.

The thing with this is that once the basic IF-THEN mechanism is put in place, I can make these decision trees as complex as I want. I could write whole romantic sagas for the guards, where they pull out specific abilities or defend each other in particular ways based on the changing conditions of the fight. Of course I can do that in real time, but in practice a lot of it falls out of my head when the time comes to run the encounter. And I could write it all down, but then I'm parsing this chain of events, also in real time, while the players are waiting for me to make a decision.

I know what I'm describing is outside of the scope of what you're building. Maybe someday, though...

gregc
2021-09-02, 10:35 AM
I know what I'm describing is outside of the scope of what you're building. Maybe someday, though...

Not at all, adding scripting is coming a little later, and that scripting will let you do all sorts of things - create actions and spells that do things that don't exist today. Included in that would be override movement or action selection behavior. I could do it fairly soon however I need to finalize the flow of the code and the API that your script interacts with so that it is something I can support.

You gave me a good idea, obviously we will have the ability for people to create spells that have custom effects.
But it would be great for the programming users to be able to create a Special Trait that affects movement/action selection.
e.g. Perhaps someone creates and publishes a Run Away trait that anyone can use, and it works that if suddenly in melee, the PC misty steps or teleports away.

Another piece of functionality that will be coming this year is for users to be able to run the players actions. So you run a game against the computer, the SIM does all the monsters moves (or players depending on which you choose) and it runs the fight turn by turn, on your teams turn you make the choice of a) movement b) action selection, then the fight continues.

The upgraded version of that functionality would be like online chess where you can setup a Fight and then challenge a friend to play one site instead of the computer. Even better, you can throw out a challenge to anyone on the website and take turns to play (like play by post). One could enhance it to make the challenge a real challenge, like each player has 10,000 gold and 20 levels to spend on building a PvP team :-)

These are the things that are going to be super fun once we have all the 5e spells and monsters implemented.

gregc
2021-09-02, 12:32 PM
.
Thanks for the link. One thing I would be curious if you have thoughts on.
My PCs can be generated as json, but it would be a directly reflect reflect on my datamodel.
Do you know of a D&D (5e ideally) *standard* format for JSON that multiple applications can all use?

D&DBeyonds Json is unusable, someone sent me a json for a custom roll20 export but it had no real structure, just a dump of properties with name and values.
Someone posted https://gist.github.com/tkfu/9819e4ac6d529e225e9fc58b358c3479 but that is skimpy.

Best I found is this https://api.open5e.com/monsters/
idk if you have heard of others.

EggKookoo
2021-09-02, 01:25 PM
I don't know of any that I wouldn't also just be googling for.

It occurs to me that it might be more scalable in the long run to have a collection of components rather than a single massive JSON for a PC. By that I mean, maybe break things down by class, race, etc., and then the PC references those as much as possible. No need to describe Uncanny Dodge for each and every rogue PC. Just have it in the rogue JSON and the PC references it. Might make it easier to tackle creating them as well?

For all I know you're already doing this under the hood. I assume DnDBeyond is to some degree, even if their PC JSON replicates feature descriptions.

gregc
2021-09-02, 01:57 PM
I don't have any descriptions to export so it would only be pure numbers and names of spells etc. Maybe I am over thinking it and I'll just use my own simplified version.

Hael
2021-09-02, 03:39 PM
Looks fantastic! A few rounds and I did pick up some non optimal play (eg wizard casting chain lightning and using haste on the wrong target), but this looks like a tremendous tool with a bright future.

I'll play with it more when I have the time.

gregc
2021-09-02, 05:12 PM
Looks fantastic! A few rounds and I did pick up some non optimal play (eg wizard casting chain lightning and using haste on the wrong target), but this looks like a tremendous tool with a bright future.

I'll play with it more when I have the time.

Cool, yeah thats probably not uncommon.

MaxWilson
2021-09-02, 05:54 PM
Cool, yeah thats probably not uncommon.

It's also probably not uncommon for actual human players at the table. :-P

PhantomSoul
2021-09-02, 05:54 PM
It's also probably not uncommon for actual human players at the table. :-P

...Why is that blue? :P

stoutstien
2021-09-02, 05:56 PM
...Why is that blue? :P

Most players are 4 racoons in a hoodie?

LordShade
2021-09-02, 06:05 PM
This is very cool, thanks for creating

PhantomSoul
2021-09-02, 11:29 PM
Most players are 4 racoons in a hoodie?

Does fit with the snacking, hm...

Foolwise
2021-09-03, 01:00 AM
And looting around thrashed cans of monsters

gregc
2021-09-04, 04:43 PM
FYI you can now import your DnDBeyond characters with one click (and paste in your character number).
Need to get them into the fight as fast possible.

https://www.reddit.com/r/dndcombat/comments/pi003t/version_337_dndbeyond_integration/

https://youtu.be/oP_XDeMa_K8

gregc
2021-09-07, 06:08 AM
Good job on it; it's a massive resource for DMs and players alike.

FYI custom scripting has started, you can write some javascript snippets to implement preconditions or damage/condition effects now.

https://www.dndcombat.com/doc/scripting.html

follacchioso
2021-09-07, 08:09 AM
This is an amazing project, thanks for setting it up!

Have you thought of integrating it with Avrae? it could be a blessing for many D&D discord servers, as it would allow people to play into arenas and simplify the life of DMs.

Watch out for the costs, though. I guess you are running this on a cloud; if many people start using it, the costs could ramp up for you.

Hael
2021-09-07, 08:43 AM
Couple bugs I picked up..

1) Summons attack their own team. This includes animate objects.
2) divine smite, improved divine smite and crit interaction is wonky.
3) I don't quite understand all the damage calculations. I will see things like 1d10 (2) + 5 + 1d6 (3), but then the total damage will be some other number, implying additional hidden factors are contributing.

gregc
2021-09-07, 07:59 PM
This is an amazing project, thanks for setting it up!

Have you thought of integrating it with Avrae? it could be a blessing for many D&D discord servers, as it would allow people to play into arenas and simplify the life of DMs.

The website or discord? I have the Avrae bot on discord but discord is just for discussion, bugs, etc. It wouldn't apply to the website.



Watch out for the costs, though. I guess you are running this on a cloud; if many people start using it, the costs could ramp up for you.
Last months bill was not that small due to a reddit post blowing up, but there is no price too large to bring happiness to the kids.

gregc
2021-09-07, 08:01 PM
Couple bugs I picked up..

1) Summons attack their own team. This includes animate objects.
2) divine smite, improved divine smite and crit interaction is wonky.

I'll take a look at those



3) I don't quite understand all the damage calculations. I will see things like 1d10 (2) + 5 + 1d6 (3), but then the total damage will be some other number, implying additional hidden factors are contributing.
Usually pretty good about getting the numbers written to the log right, if you can you link the fight/turn and I'll take a look. thanks!

gregc
2021-09-09, 11:42 PM
idk how many people use Foundry, but I added a very rudimentary import for that JSON file. That one is a work in progress though.

sambojin
2021-09-10, 05:20 PM
I know this'll take heaps of bug-fix passes to get everything running smoothly, but one thing I noticed was that Heat Metal can be used on something without armour. It's not a Natural armour thing, or a whatever armour thing, they'll use it on anything. I guess a "metal armour" tag, applied to a tonne of different monsters could fix it? Pretty small quirk though...

(8 Magma Mephits just toasted 2 Giant Elk in a matter of moments. Retried a Magma vs Magma battle, and they do respect fire immunity, so don't bother casting it. Tried a Magma vs Ice mephit battle, and they still cast it (they shouldn't be able to), but it doesn't seem to respect fire vulnerability in damage calcs)

Seems like Warhorses don't get their charge bonuse attack (which is fiddly to code because it's conditional on movement and prone condition), though I may have simply missed it. Elk do get their charge bonus damage, so it's kind of already there. Jaculi seem to think Spring is some kind of 30' ranged attack with 2d6 damage that *auto-hits*, which it isn't (it kind-of teleports the Jaculi up to 30' towards the thing it sprung attacked, if it travelled 10' or more then the attack it made is with advantage. Regardless of the 10' travelled thing, it adds 2d6 damage to the attack if it hits. +4 to-hit (possibly with advantage for 10'+ spring), 4d6+2 piercing damage). I'd probably just change them to be 60' movement with an Elk style 0' charge damage boost and 10'+ advantage if it's too fiddly to have all those features, Jaculi are pretty unique in that attack style anyway. It is pretty hilarious how much 2d6 auto-hit stacks up though.

Great simulator though. This'll be handy in so many ways. I'm pretty sure many here would be happy to kick in a bit for server costs if it does end up being a bit pricey to maintain.

gregc
2021-09-10, 06:05 PM
I know this'll take heaps of bug-fix passes to get everything running smoothly, but one thing I noticed was that Heat Metal can be used on something without armour. It's not a Natural armour thing, or a whatever armour thing, they'll use it on anything. I guess a "metal armour" tag, applied to a tonne of different monsters could fix it? Pretty small quirk though...


Yeah its very tricky that one, it would be a monumental effort to go through and mark every monster that does or does not wear metal armor.

Its like that with the magic weapons. At level 6 I have it assume you are wielding a magic weapon. Its an option to tick weapon is magical on your character attacks, but nobody does it :-)



but it doesn't seem to respect fire vulnerability in damage calcs)
Technically when it is running the calculations to decide an action, something with vulnerability should end up being weighted more highly. I've never validate that though.

I'm very excited for the next piece I am doing which is allowing people to write javascript to customize their movement and action selection choices.

sambojin
2021-09-10, 06:14 PM
Sweet.

On the above Jaculi thing, another way of doing it would be to give them their basic Bite attack, and then give them a Spring attack, which gives +30' movement for a round and is a +4to-hit 4d6+2 piercing damage attack, and they get advantage on the to-hit if they move 10'+. Kind of like the Elk attack, but it's a possible advantage instead of damage on movement, and it always gives +30' movement.

That might be easier to code, you can possibly reuse code, and might give results more consistent with what the Spring action does. Then just weight them to pretty much always use spring attack, because it's almost always better than bite.

gregc
2021-09-10, 06:57 PM
Seems like Warhorses don't get their charge bonuse attack (which is fiddly to code because it's conditional on movement and prone condition), though I may have simply missed it. Elk do get their charge bonus damage, so it's kind of already there.

For many(most) monsters that have a charge I've added a special charge attack which does all the stuff needed, movement prone etc.
Warhorse has a slightly different trait so hasn't been done yet.
On the compendium tab you can filter by status for which creatures have been completed, if they have not then your mileage will vary.

gregc
2021-09-10, 07:01 PM
Sweet.

On the above Jaculi thing, another way of doing it would be to give them their basic Bite attack, and then give them a Spring attack, which gives +30' movement for a round and is a +4to-hit 4d6+2 piercing damage attack, and they get advantage on the to-hit if they move 10'+. Kind of like the Elk attack, but it's a possible advantage instead of damage on movement, and it always gives +30' movement.


When I wrote the charge attack I forced the user (which was me) to add an extra attack, give it a special name. That was over a year ago. I think I can do a much better implementation now that we have many more tools to use, so I will probably rewrite them all.

Wizard_Lizard
2021-09-11, 04:02 AM
Oo I'll be sure to check it out!!

gregc
2021-09-11, 09:40 PM
One thing that seems limiting is Time Stop. It was a powerful spell in 2e but in 5e its hard to do much with it due to the limitation of how many spells you can concentrate on.

T.G. Oskar
2021-09-21, 02:53 AM
Most recent update claims magic items are working as intended, but it seems that Cloak of Displacement isn't working properly. Checking the usual party (5v1 against Zariel) and the Paladin doesn't get the benefit from the item, as the first attack is made normally. Checked the item and it says nothing.

Another thing I noticed was how Aura of Protection seems to do nothing. Normally, it should offer a 30' buff where all saves are improved, but it seems to do nothing as saves are as expected (which causes a lot of trouble with concentration checks).

That said, some weight redistributions seem to make things work strangely more interesting, and bonus action abilities can be used before or after your action, which is good. Not just that, it seems that certain buffs are working as indicated (Hunter's Mark being the most obvious, though it appears that the concentration effect isn't lost after getting hit.)

gregc
2021-09-25, 04:24 PM
Most recent update claims magic items are working as intended, but it seems that Cloak of Displacement isn't working properly. Checking the usual party (5v1 against Zariel) and the Paladin doesn't get the benefit from the item, as the first attack is made normally. Checked the item and it says nothing.


There is a status column on the Items tab, you can see which items are tested (and so implemented), there is none. What the last update did was allows you to add Spells to any item, add some charges, and those spells are now available to the character in battle. So I had one example battle on discord with a character using the Staff of the Magi, kicking ass way above their level.

But items are not really the focus right now, right now I'm working through subclasses and creating the powerful characters like the Hexblade Warlock to be available as pregens you can quickly add to a fight.




Another thing I noticed was how Aura of Protection seems to do nothing. Normally, it should offer a 30' buff where all saves are improved, but it seems to do nothing as saves are as expected (which causes a lot of trouble with concentration checks).


Paladins aura didn't write to the log, but you should get the charisma as a bonus to your save if in range. I've added it to the log now so you can confirm




That said, some weight redistributions seem to make things work strangely more interesting, and bonus action abilities can be used before or after your action, which is good. Not just that, it seems that certain buffs are working as indicated (Hunter's Mark being the most obvious, though it appears that the concentration effect isn't lost after getting hit.)

Any damage should cause a concentration check, I would have to look into examples where its not working properly.

Bjarkmundur
2021-09-26, 04:24 AM
Dammit why did I have to see this now! I'm so excited to play the simulator tonight, I won't be able to concentrate on anything today x'D

dpencil
2021-09-28, 01:12 PM
Nice plug for Foundry VTT on the webpage. I agree it is the premier VTT experience. Your site looks very cool. Well done.

gregc
2021-10-04, 05:50 PM
Nice plug for Foundry VTT on the webpage. I agree it is the premier VTT experience. Your site looks very cool. Well done.

You reminded me I needed to plug my favorite podcast too lol.