PDA

View Full Version : Statistics: Simulating combat



Darash
2013-05-01, 07:37 AM
As a beginning DM and role-player in general I found myself wondering how to make a fun combat encounter. One of the base requirements I could think of is making a brute force solution -just hit things with your biggest stick - unfavorable. To design an encounter with this in mind, one of course needs to know the odds of winning when using the brute force solution.

Here's the thing, I'm kind of a nerd. Just placing a random CR-appropriate encounter for the players to fight and hope they'll lose if they play stupid doesn't do it for me. So, I wrote a script to calculate the actual odds of winning such a battle.

Of course this is useless. No player is ever going to mindlessly bash things 'till they die, but it's more of a hobby project for me than anything of practical use. Still, I'd like to share my code with you guys. The layout and code itself are horrible, I just picked up javaScript and HTML a week ago, but here it is:

https://dl.dropboxusercontent.com/u/31956412/WebsitePublic/mainPage.html

The already filled-in stats are the ones of the battle of my previous post (http://www.giantitp.com/forums/showthread.php?t=277612), but you can add creatures and edit stats yourself. Just press the 'Go!' button and it will calculate the odds. A negative horizontal axis value means team 2 wins and a positive means team 1 wins. The number is how many turns it takes. The height of the bar is proportional to the chance of winning (100% all bars total)

The rules used are those of the Pathfinder Beginner Box. There is no AI, movement or any advanced tactics. A battle of ethereal, infinite movement mindless zombies or something of the like will be a good in-game representation of this battle ;)

I'm now working on expanding my code with the following things:
- Initiative (now, team 1 always goes first)
- A battlegrid (which means being able to implement movement, range, AoE etc. My definition of vision is still a bit wonky, and calculating distances is hard. Currently using a variation of Dijkstra's Algorithm.)
- AI (so I can implement multiple kind of attacks)

By the way, would it be legal to use my code to make a small game based on the Pathfinder rules? Or is that outside the OGL?

stack
2013-05-01, 08:31 AM
While we cannot give legal advice on the boards, I believe I have read that video games are NOT covered by the OGL. Paizo is working on a game now (with goblin works? something like that), so I would tread carefully around that stuff.