Page 1 of 9

ROTK11 Random Scenarios

Unread postPosted: Fri Feb 20, 2015 7:21 pm
by Zetta
Last edit : I am not playing ROTKXI anymore and I have abandoned this program. However, the program (v1.06) should still be available here:
and the source code for version 1.06 should be here:

Hello everyone !

I have been working recently on a project that would allow us to play new ROTK11 Scenarios. Once, I discovered a random scenario creator on chinese ROTK11 forums. I decided to make one myself and a few days ago I spent a good amount of time programing a Python script that I am going to shortly present to you. In its current form, it is able to open a scenario file (SCEN0XX.S11, XX between 00 and 16) and turn it into a fully randomized scenario with a bunch of custom features that you can select.

I present you RandOTK11 v1.07
RandOTK11 v1.06

-- Features --
Supports Chinese, Japanese and English scenarios
Graphical User Interface !
Choose the starting year
Choose either historical or random leaders
Choose the number of forces and free cities
Choose how the forces share the cities
Choose to randomize the research level
Choose the IA Behavior : aggressive, moderate or random
Choose to add alliances or not
Change the officers lifespans, relationships, stats, weapons APT and skills randomly
Distribute randomly items among leaders and cities
Either spread cities owned by forces or only have neighboring cities distributed to each force

-- Possible Upcoming Features --
Feel free to suggest features for this program. I will see if they can easily be implemented.

Now to the main point : If I want to use it, how does it work ?!?

1) You need to download and install a program that can run Python 3.x scripts. I would suggest downloading the latest version of Python (3.4.2), since I developped this program with it. You can find it for free here: ... -3.4.2.msi
(From the website: Python is a programming language that lets you work more quickly and integrate your systems more effectively. It is powerful... and fast; plays well with others; runs everywhere; is friendly & easy to learn; is Open.)

2) Once you have installed Python (or anything that can execute a Python program), please download which you can find HERE.
or the source code here, that you can copy, paste and save into a .txt file: (v1.06) (1.05) (v1.04) (v1.03) (1.02) (1.01) (v1.00)

3) Now, if you are using Python there are two ways to launch the program:
3.a) Go to your desktop and click: Start --> Programs --> Python 3.4 --> IDLE (Python 3.4 GUI)
Next, click on: File --> Open... and open the script
Then, go to: Run --> Run Module or simply press F5
3.b) Simply double click on the to launch it up with Python

4) A GUI should open up and look like this :
All you have to do is open a scenario file and enter your parameters. Then click Randomize button, and there you go ! When you are finished you can just use the Exit button to close the program. The file is automatically saved.
WARNING ! The previous scenario file will be lost ! Make sure you have a copy before randomizing !

... And that's it ! You should now be able to open and play your randomized scenario in-game ! I hope you'll have fun with it !

How the code actually works is quickly described HERE.
EDIT: I have already found a few bugs, and among them is one that will just create a blank scenario instead of a randomized one. Until I can find and fix this bug , I suggest you just re-launch the program and give it another try. I'll try to update it as soon as possible!
EDIT 2: Updated to v1.01 with a bunch of new features.
EDIT 3: Updated to v1.02 with a small GUI.
EDIT 4: Updated to v1.03, added options to randomize lifespans and city distribution, fixed a few bugs.
EDIT 5: Updated to v1.04 with japanese and chinese scenarios now supported !
EDIT 6: Updated to v1.05 with new item randomizer and a bit more balanced officer randomizer. Fixed a few bugs.
EDIT 7: Updated to v1.06 with a bunch of new features.

Re: ROTK11 Random Scenarios

Unread postPosted: Fri Feb 20, 2015 7:48 pm
by Zetta
Here are a few examples of what can be obtained with RandOTK11 :

Obtained with v1.00
Preview :
Scenario set in 227 with 19 forces and 5 free cities. The major enemy is the red force, Wang Lang !
Download link

Preview :
Scenario set in 191 with 30 forces and 12 free cities. A scenario that is a kind of smaller Rise of Heroes.
Download link

Preview :
Scenario set in 196 with 6 forces (Ma Chao, Li Jue, Han Sui, Liu Bei, Jin Xuan and Liu Biao) with 12 free cities.
Download link

Obtained with v1.01
Preview :
Set in 234 with 8 forces: Cao Rui, Sun Quand, Liu Chan, Zhang Lu, Zhuge Dan, Sima Yi, Meng Huo and Guanqiu Jian.
Download link

Obtained with v1.03
Preview :
Set in 189 with 16 forces. It's a showdown between Ma Teng and Lu Bu !
Download link

Obtained with v1.06
8 Forces fight for supremacy. Cities have been randomized and 118 new random officers are added. There are no ties between officers and relationships are all randomized.
Download :

Re: ROTK11 Random Scenarios

Unread postPosted: Fri Feb 20, 2015 9:16 pm
by Lord_Cao_Cao
Zetta? What a pleasant surprise to see you here! :)

Interesting tool you've developed here, I might take a look at it in the near future, though I have to say that I haven't played XI for ages.

Re: ROTK11 Random Scenarios

Unread postPosted: Sat Feb 21, 2015 10:30 am
by Zetta
Lord_Cao_Cao wrote:Zetta? What a pleasant surprise to see you here! :)

Interesting tool you've developed here, I might take a look at it in the near future, though I have to say that I haven't played XI for ages.

Well, hello there, Lord_Cao_Cao, it's been a while :D !

When the Koei forums stopped working a few years ago, I was already slowly losing interest in the game, and unfortunately I stopped updating the guide. Then a friend invited me over Steam and we played a lot of different games (Magicka, L4D2, C&C RA3, Torchlight 2, Terraria...). I completely forgot about ROTK11. But I still had an itch for a strategy game set in ancient China. Since there's not a lot of those on the market, I'm back at ROTK11 and I have a few ideas that have been wandering in my mind for some time. I'd like to study a little bit more how the save files and the tutorial / challenge files work, to see if we could make our own challenges or stories... I also wanted to develop a tool like this one to make endless new scenarios. I'd like to rekindle my own interest for the game and see if the community is still active !

Re: ROTK11 Random Scenarios

Unread postPosted: Sat Feb 21, 2015 12:06 pm
by Lord_Cao_Cao
It isn't that active at the moment. Maybe that will come again if everyone sees that something's happening again. :)

Yeah, my attention also shifted more towards other games. The last thing I did for XI was a character creation project, but I did it for PUK and only finished the YTR. I'd basically have 100 CCs divided into 40 original and 60 historical officers that would appear in every scenario, +50 CCs that were mostly historical and scenario specific and then use the remaining free/dead officer slots in the scenario files themselves to fill in even more historical officers.

Maybe it was a coincidence that I remembered the project yesterday morning and in the evening, I saw you posting here. :lol:
It's really a shame that PUK wasn't released overseas. I was always torn between playing the English version and do some editing related work or play the PUK and do stuff there.

Re: ROTK11 Random Scenarios

Unread postPosted: Fri Feb 27, 2015 8:11 am
by Zyzyfer
The legendary warrior Zetta returns!

This project sounds pretty cool. I'll have to take a closer look when I'm not at work haha

I am wondering, since it randomizes lots of things, does it also randomize things like life spans, officer status, stuff like that?

Anyway, good to see you around again.

Re: ROTK11 Random Scenarios

Unread postPosted: Fri Feb 27, 2015 7:57 pm
by Zetta
The program doesn't randomize officer life spans (for now) . But I could indeed implement something like that in a next update. I've been thinking about making a small windows to select the file (GUI : graphical user interface) and add checkboxes to choose randomization parameters, but that's a little bit more work for me...

Actually, any byte can be changed to a random value using the right coding. We only need to know the address and which values the byte can take to precisely control the results.

EDIT : I had a good amount of free time this weekend, so I designed a GUI to make the randomization process less tedious. Gonna be available in the next update !

Re: ROTK11 Random Scenarios

Unread postPosted: Sat Mar 07, 2015 10:53 am
by Zetta
Just updated the Scenario Randomizer and added a graphical user interface to make things more easy for people. Any suggestions or feedback is welcome !

EDIT : Updated to v1.03, with a few new features. I had a hard time making random alliances work properly, but I think they should be fine now. I discovered the hard way that alliances are not based on district number but force color...

Re: ROTK11 Random Scenarios

Unread postPosted: Sat Mar 14, 2015 11:23 am
by Calamitus
I guess it does not work with PUK, right?

Re: ROTK11 Random Scenarios

Unread postPosted: Sat Mar 14, 2015 2:29 pm
by Zetta
Calamitus wrote:I guess it does not work with PUK, right?

No it won't (at least for now). I developped this program only for the U.S. / European version of ROTK 11. It doesn't support chinese or japanese scenarios at all (Normal or PUK game). But I admit it could be done, it's just a matter of programming.