ROTK11 Random Scenarios

Use this forum to discuss hex-editing or otherwise altering any Three Kingdoms game, and to promote modded titles and patches.

ROTK11 Random Scenarios

Unread postby Zetta » Fri Feb 20, 2015 7:21 pm

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:
https://www.python.org/ftp/python/3.4.2 ... -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 RandOTK11.py which you can find HERE.
or the source code here, that you can copy, paste and save into a .txt file:
http://pastebin.com/9gXKy7jz (v1.06)
http://pastebin.com/SgANJeGR (1.05)
http://pastebin.com/X4375xd3 (v1.04)
http://pastebin.com/060D0UdJ (v1.03)
http://pastebin.com/uEe9DDLq (1.02)
http://pastebin.com/auY7pMVH (1.01)
http://pastebin.com/S9L2QzeT (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 RandOTK11.py
Then, go to: Run --> Run Module or simply press F5
3.b) Simply double click on the RandOTK11.py to launch it up with Python


4) A GUI should open up and look like this :
Image
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.
Last edited by Zetta on Sat Oct 17, 2015 1:08 pm, edited 13 times in total.
User avatar
Zetta
Initiate
 
Posts: 77
Joined: Fri Feb 20, 2015 11:22 am

Re: ROTK11 Random Scenarios

Unread postby Zetta » Fri Feb 20, 2015 7:48 pm

Here are a few examples of what can be obtained with RandOTK11 :

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


Preview :
Image
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 :
http://i.imgur.com/EL3BbQJ.jpg
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 : http://i.imgur.com/jx2XOtF.jpg
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 : http://i.imgur.com/LKtdSZF.png
Set in 189 with 16 forces. It's a showdown between Ma Teng and Lu Bu !
Download link


Obtained with v1.06
Image
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 : https://www.sendspace.com/file/sd91ij
Last edited by Zetta on Mon Jul 27, 2015 8:53 pm, edited 3 times in total.
User avatar
Zetta
Initiate
 
Posts: 77
Joined: Fri Feb 20, 2015 11:22 am

Re: ROTK11 Random Scenarios

Unread postby Lord_Cao_Cao » Fri Feb 20, 2015 9:16 pm

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.
User avatar
Lord_Cao_Cao
Scholar of Shen Zhou
 
Posts: 1341
Joined: Sun Mar 21, 2010 9:14 am
Location: Germany

Re: ROTK11 Random Scenarios

Unread postby Zetta » Sat Feb 21, 2015 10:30 am

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 !
User avatar
Zetta
Initiate
 
Posts: 77
Joined: Fri Feb 20, 2015 11:22 am

Re: ROTK11 Random Scenarios

Unread postby Lord_Cao_Cao » Sat Feb 21, 2015 12:06 pm

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.
User avatar
Lord_Cao_Cao
Scholar of Shen Zhou
 
Posts: 1341
Joined: Sun Mar 21, 2010 9:14 am
Location: Germany

Re: ROTK11 Random Scenarios

Unread postby Zyzyfer » Fri Feb 27, 2015 8:11 am

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.
Gamefaqs: KongZhou
Steam: heinous_won
User avatar
Zyzyfer
Scholar of Shen Zhou
 
Posts: 3088
Joined: Thu May 08, 2008 1:17 pm
Location: South Korea

Re: ROTK11 Random Scenarios

Unread postby Zetta » Fri Feb 27, 2015 7:57 pm

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 !
Last edited by Zetta on Tue Mar 10, 2015 12:49 pm, edited 1 time in total.
User avatar
Zetta
Initiate
 
Posts: 77
Joined: Fri Feb 20, 2015 11:22 am

Re: ROTK11 Random Scenarios

Unread postby Zetta » Sat Mar 07, 2015 10:53 am

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...
User avatar
Zetta
Initiate
 
Posts: 77
Joined: Fri Feb 20, 2015 11:22 am

Re: ROTK11 Random Scenarios

Unread postby Calamitus » Sat Mar 14, 2015 11:23 am

I guess it does not work with PUK, right?
Calamitus
Apprentice
 
Posts: 36
Joined: Sat Jan 11, 2014 12:35 pm

Re: ROTK11 Random Scenarios

Unread postby Zetta » Sat Mar 14, 2015 2:29 pm

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.
User avatar
Zetta
Initiate
 
Posts: 77
Joined: Fri Feb 20, 2015 11:22 am

Next

Return to Three Kingdoms Game Editing & Mods

Who is online

Users browsing this forum: No registered users and 3 guests

Copyright © 2002–2008 Kongming’s Archives. All Rights Reserved