7th Edition Combat Simulator

Combat rules discussion. Beat them up, blow them up, burn them up, blow them away. If it ruins someone's day, this is probably the forum to talk about it.
trevlix
Investigator
Investigator
Posts: 510
Joined: Sun Aug 19, 2012 2:58 am
Contact:

7th Edition Combat Simulator

Post by trevlix » Wed Jun 24, 2015 12:49 pm

To help learn the 7th edition combat rules a few months ago, I decided to create a program to simulate Call of Cthulhu 7th Edition combat. Since then, its been sitting in my github but I have not made any announcements about it, so here it is!

https://github.com/trevlix/cthulhu

The repository contains a number of Python scripts that will simulate the majority of 7th edition combat. There are some things that are not implemented (see the TODO file), but its still a work in progress.

In the contrib directory are a few scripts to create characters, a byakhee for them to fight, and then to run the combat. The scripts are still very raw, and are not meant to be polished by any means. Any suggestions are welcome. Thanks!
[Trafford: Insanity: 4, Exhaustion: 2]

http://keepingthegame.blogspot.com/

Dr. Gerard
Professor
Professor
Posts: 1353
Joined: Wed Jul 25, 2012 2:00 pm

Re: 7th Edition Combat Simulator

Post by Dr. Gerard » Wed Jun 24, 2015 10:22 pm

Oh, this is super exciting!

I had thought about doing the very same thing, but my code chops in Python are at a very beginner level and I got overwhelmed by the learning curve. I was inspired to try modeling the combat because I had seen claims and counterclaims about the new systems that I felt people were making based on zero data and very little experience. Is 7E combat more deadly? Does simultaneous attacks / counterattacks really reduce combat time, and is the "fighting back" mechanic OP against multiple opponents? And so on.

I can't wait to look at this code to learn how you went about modeling this. As a suggestion, I wonder how hard it would be to modify to make a 6E sim that we could use for comparison? (When I say we I probably mean you, though I'd love to take a stab.) I bet we could isolate some important differences and perhaps unravel some of the claims with real data.

Freaking science!

:science:
Keeper of the Cthulhu Dark "Secret Everest Expedition" PbP scenario
Rip Wheeler in the Call of Cthulhu "No Man's Land" scenario
Plays for Keepers

Dr. Gerard
Professor
Professor
Posts: 1353
Joined: Wed Jul 25, 2012 2:00 pm

Re: 7th Edition Combat Simulator

Post by Dr. Gerard » Wed Jun 24, 2015 11:12 pm

I'm having trouble running testCombat.py

Traceback:

Traceback (most recent call last):
File "C:\Users\chadb_000\Documents\000 MU PODCAST\cthulhu-master\cthulhu-master\contrib\testCombat.py", line 4, in <module>
import cthulhu.combat as combat
ImportError: No module named 'cthulhu'

I'm sure I have done something bone-headed. But I don't find this file in the downloaded folders.
Keeper of the Cthulhu Dark "Secret Everest Expedition" PbP scenario
Rip Wheeler in the Call of Cthulhu "No Man's Land" scenario
Plays for Keepers

trevlix
Investigator
Investigator
Posts: 510
Joined: Sun Aug 19, 2012 2:58 am
Contact:

Re: 7th Edition Combat Simulator

Post by trevlix » Thu Jun 25, 2015 1:07 pm

Dr. Gerard wrote:I had thought about doing the very same thing, but my code chops in Python are at a very beginner level and I got overwhelmed by the learning curve. I was inspired to try modeling the combat because I had seen claims and counterclaims about the new systems that I felt people were making based on zero data and very little experience. Is 7E combat more deadly? Does simultaneous attacks / counterattacks really reduce combat time, and is the "fighting back" mechanic OP against multiple opponents? And so on.
Agreed - this is the real reason I wrote this - to figure out if the fight back mechanic affected combat any and how different the combat in the 2 editions really were. At the time I did not have any experience running 7th edition, and I wanted to see how things actually worked out when played. I could either have run it manually or write a program to do it. The techno geeky side won out. :)

From looking at some of the fights I've simulated, it does seem like it does speed things up, although I have not yet compared it to 6th ed yet. With the way I wrote it, I'm hoping it will be easy to create a new module for 6th ed combat so we can compare.

Understand, I'm not a python developer either and this is all just hacked together. But it (appears to) work, which is good enough for me!
Dr. Gerard wrote:I'm having trouble running testCombat.py

Traceback:

Traceback (most recent call last):
File "C:\Users\chadb_000\Documents\000 MU PODCAST\cthulhu-master\cthulhu-master\contrib\testCombat.py", line 4, in <module>
import cthulhu.combat as combat
ImportError: No module named 'cthulhu'

I'm sure I have done something bone-headed. But I don't find this file in the downloaded folders.
This means you have not installed the module. To get it to run, run the following at the command line:

set PYTHONPATH=%PYTHONPATH%:C:\Users\chadb_000\Documents\000 MU PODCAST\cthulhu-master\cthulhu-master

That should let you run it in that command shell (where you are running "python testCombat.py").
[Trafford: Insanity: 4, Exhaustion: 2]

http://keepingthegame.blogspot.com/

Dr. Gerard
Professor
Professor
Posts: 1353
Joined: Wed Jul 25, 2012 2:00 pm

Re: 7th Edition Combat Simulator

Post by Dr. Gerard » Sun Oct 30, 2016 9:10 pm

Circling back on this after ... 2 years?

Today I found myself in an emulator for old Basic trying to investigate the same questions, and remembered that you made a whole granular simulator that I was never able to run.

Trevlix, could you give me a step-by-step on how to install and run this sim? Perhaps describe it to me like I'm a Labrador retriever? I really want to mess around with this and see if I can generate some data.
Keeper of the Cthulhu Dark "Secret Everest Expedition" PbP scenario
Rip Wheeler in the Call of Cthulhu "No Man's Land" scenario
Plays for Keepers

trevlix
Investigator
Investigator
Posts: 510
Joined: Sun Aug 19, 2012 2:58 am
Contact:

Re: 7th Edition Combat Simulator

Post by trevlix » Sun Oct 30, 2016 11:15 pm

Heh - sure. What OS are you using?
[Trafford: Insanity: 4, Exhaustion: 2]

http://keepingthegame.blogspot.com/

Dr. Gerard
Professor
Professor
Posts: 1353
Joined: Wed Jul 25, 2012 2:00 pm

Re: 7th Edition Combat Simulator

Post by Dr. Gerard » Mon Oct 31, 2016 12:41 am

Windows 10...

Sent from my VS985 4G using Tapatalk
Keeper of the Cthulhu Dark "Secret Everest Expedition" PbP scenario
Rip Wheeler in the Call of Cthulhu "No Man's Land" scenario
Plays for Keepers

trevlix
Investigator
Investigator
Posts: 510
Joined: Sun Aug 19, 2012 2:58 am
Contact:

Re: 7th Edition Combat Simulator

Post by trevlix » Mon Oct 31, 2016 1:22 am

OK - give me about a day and I'll write up instructions.
[Trafford: Insanity: 4, Exhaustion: 2]

http://keepingthegame.blogspot.com/

trevlix
Investigator
Investigator
Posts: 510
Joined: Sun Aug 19, 2012 2:58 am
Contact:

Re: 7th Edition Combat Simulator

Post by trevlix » Mon Oct 31, 2016 2:39 pm

OK - I tested this out on my box step by step and it worked, so hopefully it will for you as well. (BTW this is much easier in Linux or Mac :D )

1. Download and install Python 2 for Windows from https://www.python.org/downloads/release/python-2712/ . You will download "Windows x86 MSI installer" if you have a 32-bit CPU or "Windows x86-64 MSI installer" if you hav ea 64-bit CPU.
1a. You can just click through everything EXCEPT when you get to the Customize screen with options you can choose. Make sure you select to have "Add python.exe to Path".

2. Go to https://github.com/trevlix/cthulhu. Click on the button "Clone or Download" and then click on "Download ZIP". Save that file, then extract the contents to some directory on your system. Remember this directory.

3. Open up a command prompt. You can do this by typing Command in the "Search Windows" bar and selecting "Command Prompt".

4. At the command prompt type "pip install jsonpickle". It will take a minute or so for it to install.

5. At the command prompt, go into the directory you unzipped the archive into. There should be a directory in there named "cthulhu-master"; go into that directory.

For example, if you unzipped it into c:\temp, type "cd \temp\cthulhu-master".

6. type "python setup.py install". It should run without errors. If it does error out, let me know.

7. Go into the contrib directory: cd contrib

8. The first thing we need to do is create some characters. The easiest way is to run the following commands (you should still be in the contrib directory):

python characters\testChar.py > char.json
python characters\testChar.py > char2.json
python characters\testChar.py > char3.json

This creates 3 characters named Tyler all with similar skills, but different stats.

9. Now we create 2 byakhees. Run the following commands:

python monsters\byakhee.py > byakhee.json
python monsters\byakhee.py > byakhee2.json

10. Now we run combat. Run the following command:

python testCombat.py

If it works, you'll start getting prompted for combat information.

If this does work, let me know and I'll write up some info on how you can start customizing the characters, monsters, etc.

As a side note, this is not very user friendly, but was never meant to be at this time. If I ever get time, I plan on going back in, fixing some bugs, adding more features, and making a GUI interface.
[Trafford: Insanity: 4, Exhaustion: 2]

http://keepingthegame.blogspot.com/

Dr. Gerard
Professor
Professor
Posts: 1353
Joined: Wed Jul 25, 2012 2:00 pm

Re: 7th Edition Combat Simulator

Post by Dr. Gerard » Mon Oct 31, 2016 5:53 pm

Getting there...

But I did actually get an error on setup.py.
Attachments
CthulhuInstall.jpg
CthulhuInstall.jpg (123.34 KiB) Viewed 14198 times
Keeper of the Cthulhu Dark "Secret Everest Expedition" PbP scenario
Rip Wheeler in the Call of Cthulhu "No Man's Land" scenario
Plays for Keepers

Post Reply