ROTK11 Random Scenarios

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

Re: ROTK11 Random Scenarios

Unread postby Zetta » Thu May 21, 2015 8:40 pm

Zyzyfer wrote:...none of the strategy-based skills were assigned? It skipped from Stampede to Fame. Hands Divine X skills out like candy. No Puissance or Valiant General, or God's Command.

I'll have to work on this issue for the next update, it needs a bit more balance and variety. Any suggestions about the types of generals created and their % or about the conditions to get skills are welcome.

Zyzyfer wrote:And the jumbled-up officers is simply being caused by my historical xx officers having fixed data when the scenario gets wiped. I'm not sure what can be done about that, lol. X Series stuff basically filled up all of those slots with new officers so unless there's an alternate version of the program, oh well. Haha.

You can change manually which officers are modified during scenario creation. Open the program with a text editor and replace the occurences of "while x<670:" that you can find with "while x<700:" so that the program also modifies the "Historical XX" slots (the 30 additional officers). I'll change it in the next update though.

Zyzyfer wrote:Leader List: Curious why Yuan Yi is on it? Sun Qian should be removed from the choices. And maybe add Zhang Jiao, or at least one of his bros.

Lord_Cao_Cao wrote:Yuan Yi was a governor, so he seems reasonable as a random leader candidate I suppose.

That's my personal preference, as I like to have him as a force leader. But you can change manually the list if you want to: find the " leaders = [...]" list near the beginning of the file and add or remove the desired leaders numbers. I've added Zhang Jiao and Zhang Bao for the next update though.

Bourne Endeavor wrote:Aha! Once I moved the scenario to my desktop, it worked just fine. Thanks a lot Zetta for the help. :D

You're welcome. I hope you'll enjoy your random scenarios !
User avatar
Zetta
Initiate
 
Posts: 77
Joined: Fri Feb 20, 2015 11:22 am

Re: ROTK11 Random Scenarios

Unread postby Zyzyfer » Fri May 22, 2015 1:59 am

Zetta wrote:I'll have to work on this issue for the next update, it needs a bit more balance and variety. Any suggestions about the types of generals created and their % or about the conditions to get skills are welcome.


Without knowing specifics about how you've coded your program (feel free to point out if something is unfeasible)...and since you asked... :twisted:

Hero
Spear-Pike-Bows-Cavalry-Navy - B to S
Weaponry - C to S
LDR WAR - 65 to 100 (70 - 100)
INT POL CHR - 65 to 95 (70 - 100)

Perhaps a 10% ratio, guaranteed to get a skill, say a tier 4 or very handy tier 3 skill. I've seen a list of the skill tiers before but I'd have to go back and browse old threads to relocate it. But tier 4 skills are basically the ones that unlock after you finish collecting all of the event portraits. Some of them are obvious, like God's Command and Divine Potency, but I'm not so sure about things like Divine [Unit] or Agile Mind.

I don't know how you implement the skill selection based on APT but that should apply here.

Strategist
Spear-Pike - C to A
Bows-Weaponry-Navy - B to S
Cavalry - C to S (perhaps C to S for all APTs? Strategist APTs vary wildly and this is a randomizer, haha.)
LDR WAR - 50 to 80 (LDR max 95, WAR max 75. Or for randomness, go with 50-85 for both.)
INT POL CHR - 75 to 100

15% ratio, or even go for a split of 12.5% between hero and strategist if that's mathematically straightforward for the code (I am assuming the current code is just randomly picking one of five values, hence the even 20% spread). Their skill pool should be the segments devoted to strategy and domestics (Efficacy, etc), if that sort of spread is possible to implement. And highly likely to get a skill, if not guaranteed. Nobody likes seeing Yuan Shao strategists :wink:

General
Spear-Pike-Bows-Cavalry-Weaponry-Navy - C to S
LDR WAR - 80 to 97
INT POL - 40 to 80
CHR - 80 to 93

This all looks fine, honestly. 20% ratio is fine as well. However! I would suggest adding a "civil official" class, something like this.

Civil Official:
APTs - C to A
LDR WAR - 3 to 65/70
INT POL - 60 to 85
CHR - 40 to 85

20% ratio. While splitting the skills up meaningfully (battle stuff to generals, domestic stuff to civil officials) makes for more useful officers, it could be left alone in the spirit of randomness. That kind of code is probably a pain to write anyway.

My main point is, it's fun to see what sorts of mayhem gets produced, but when you get a hero/strategist type produced that has no skill, it's a bummer. With these two classes, they can either be relegated to somewhat narrower skill pools, or we can just let the randomizer do its thing. I'm on the fence when it comes to this point.

Standard
Spear-Pike-Bows-Cavalry-Weaponry-Navy - C to A
LDR WAR INT POL CHR - 20 to 60 (20 to 75)

AKA the dudes we toss in the rear cities and forget about. 15% ratio. Or bump general, civil, and random up to 25% and remove this class to promote more randomness.

Random
Spear-Pike-Bows-Cavalry-Weaponry-Navy - C to S
LDR WAR INT POL CHR - around 3 to 79 (1 to 100)

20% ratio. Can get any of the skills. That way, there is still plenty of room for totally off-the-wall officers!

To rehash my proposed ratios.

Hero 15%/Strategist 10% or Hero/Strategist 12.5% (total 25%)

And then either:
General Civil Random 20% Standard 15% OR General Civil Random 25% and delete the standard class. Either choice has its positives and negatives.

For skill distribution there are different conditions (such as having more than 75 in a specific stat or having an S rank in weapon APT and more than 85 WAR).


I think what you've done is fine for skill distribution, except for what I've addressed previously regarding strategy stuff. When I view all officers in a list, it pretty much jumped from the last battle skill to domestics. And Divine Spears/Pikes pops up a lot, while the ones like God's Command and so on never appear (the officer doesn't need all S APTs for the multi-unit ones to be helpful, haha)

That said! If it is easier to code, you might be better off foregoing the S Spears = Divine Spears/Spear General? And perhaps going with something like one S = skill pool 1, two Ss = skill pool 2, three Ss = skill pool 3, without any concern for matching skill to APT?

You can change manually which officers are modified during scenario creation. Open the program with a text editor and replace the occurences of "while x<670:" that you can find with "while x<700:" so that the program also modifies the "Historical XX" slots (the 30 additional officers). I'll change it in the next update though.


That sounds straightforward, thank you. I'll try to give it a shot on my own since not everyone takes advantage of those slots.

But you can change manually the list if you want to: find the " leaders = [...]" list near the beginning of the file and add or remove the desired leaders numbers. I've added Zhang Jiao and Zhang Bao for the next update though.


OK then.

=====

Edit: So I looked under the hood, made those little changes to the ruler options and the extra officers in my scenarios. I also located the code for randomizing the officers and managed to work out some of the basic structure on my own. I can tweak stats and APTs on my own, then. But the skills section, while I found it, I can't really figure out what's going on except that the code is checking for whether certain attributes pass or not. All the randrange and 255 stuff, I'm lost. :oops:

Edit 2: Yep, I can make out where it's saying things like "if WAR is 75 then f2 is something random between x and y".

Edit 3: Hmm I can work out some of it. Like I can see where you've put in the X General/Divine X lines. But the offsets are shifted by 8 from the in-game skills list?


Edit 4: I'm tweaking the code in my own file and haven't broken too much stuff yet. I've got an idea for the skills, but no idea how to do the code for it. I can see where you put the hex offsets, but I don't know how the programming between that part and the assorted randrange stuff interacts. Anyway, I was thinking, why not just define the skill based on officer type. You could randrange strategists easily this way. Something I'm noticing about your code is that it checks each APT and then goes to the next one. So a bunch of guys end up getting affected by the final line of code, which is of course the naval APT. You could probably code around this somehow, but it just seems easier to integrate it into the officer type?

Edit 5: If I knew what to type in to make the value for the skill bit maintain as an option, as in no change, would be perfect.
Gamefaqs: KongZhou
Steam: heinous_won
User avatar
Zyzyfer
Scholar of Shen Zhou
 
Posts: 3093
Joined: Thu May 08, 2008 1:17 pm
Location: South Korea

Re: ROTK11 Random Scenarios

Unread postby Calamitus » Fri May 22, 2015 3:17 pm

Zetta wrote:
Calamitus wrote:Which means it works on PUK now?

I have implemented two new types of scenario files that are supported: those which are 169 822 bytes long (chinese I think) and 167 559 bytes long (Japanese). Although I couldn't alpha-test it since I don't have the chinese or japanese version of the game, these randomized scenarios should work fine. I only used downloaded scenarios on foreign forums as a reference material. If you would like to try it and if you do encounter bugs of any kind though, I'd like to hear about them.

I see the program works on the japanese scenarios, but i can't test the details since i play with translated scenarios on which it does not work.
Calamitus
Apprentice
 
Posts: 36
Joined: Sat Jan 11, 2014 12:35 pm

Re: ROTK11 Random Scenarios

Unread postby Zetta » Fri May 22, 2015 4:19 pm

Thank you for your thorough (and fairly long :lol: ) input Zyzyfer, I'll delve into that to make the changes for v1.06. It might not come out soon though, since I'm working on other issues right now.

Zyzyfer wrote:Edit 4: I'm tweaking the code in my own file and haven't broken too much stuff yet. I've got an idea for the skills, but no idea how to do the code for it. I can see where you put the hex offsets, but I don't know how the programming between that part and the assorted randrange stuff interacts. Anyway, I was thinking, why not just define the skill based on officer type. You could randrange strategists easily this way. Something I'm noticing about your code is that it checks each APT and then goes to the next one. So a bunch of guys end up getting affected by the final line of code, which is of course the naval APT. You could probably code around this somehow, but it just seems easier to integrate it into the officer type?
Edit 5: If I knew what to type in to make the value for the skill bit maintain as an option, as in no change, would be perfect.

That's a good idea. First version was too chaotic with fully randomized skills. Second one is too restrictive and your idea looks like a good compromise. We could add a list of skills that can be chosen for each type of created officer and assign it to them every time one gets created. I also like your idea of adding a Civil Official type.


Calamitus wrote:I see the program works on the japanese scenarios, but i can't test the details since i play with translated scenarios on which it does not work.

Good god, how many versions of these scenario files exist :shock: ?! Could they be 170 010 bytes long, because I also found one of those online... I'm not sure that I will work to further expand compatibility, it's very time consuming (but then again I need to optimize the code to make it more readable and less prone to errors, so I might add it for the next update).
User avatar
Zetta
Initiate
 
Posts: 77
Joined: Fri Feb 20, 2015 11:22 am

Re: ROTK11 Random Scenarios

Unread postby Zyzyfer » Fri May 22, 2015 4:34 pm

Quick post, I tinkered a lot and maybe found something viable for the random officer testing, but got pulled away from my PC before I could start testing. If I like it I'll pass the file along so you can peruse it, Zetta.
Gamefaqs: KongZhou
Steam: heinous_won
User avatar
Zyzyfer
Scholar of Shen Zhou
 
Posts: 3093
Joined: Thu May 08, 2008 1:17 pm
Location: South Korea

Re: ROTK11 Random Scenarios

Unread postby Calamitus » Fri May 22, 2015 4:45 pm

Zetta wrote:
Calamitus wrote:I see the program works on the japanese scenarios, but i can't test the details since i play with translated scenarios on which it does not work.

Good god, how many versions of these scenario files exist :shock: ?! Could they be 170 010 bytes long, because I also found one of those online... I'm not sure that I will work to further expand compatibility, it's very time consuming (but then again I need to optimize the code to make it more readable and less prone to errors, so I might add it for the next update).

I use Nihil's translations, I guess this is the best translation available for PUK so far (actually, there are only 2 if I remember correctly). If you are curious, you can check the attachment.
Attachments
Nikhil Rath's patch.7z
(89.84 KiB) Downloaded 41 times
Calamitus
Apprentice
 
Posts: 36
Joined: Sat Jan 11, 2014 12:35 pm

Re: ROTK11 Random Scenarios

Unread postby Zetta » Fri May 22, 2015 6:45 pm

Zyzyfer wrote:Quick post, I tinkered a lot and maybe found something viable for the random officer testing, but got pulled away from my PC before I could start testing. If I like it I'll pass the file along so you can peruse it, Zetta.

That would be helpful ! If you'd like to contribute, a small code you can write to distribute skills for each type of officer would be something like this:
f2 = choice([1,2,5,12])
to add under every "f1==...:" condition.
#where 1,2,5,12 are the respective numbers for the skills. choice() is an alternative to randrange() that allows to choose one element randomly inside a list.

Then you could further delete the "f2 = 255" and all the "if f[x]>=...:" instructions and see how it works out.

Calamitus wrote:I use Nihil's translations, I guess this is the best translation available for PUK so far (actually, there are only 2 if I remember correctly). If you are curious, you can check the attachment.

Thank you, I just checked it out, it doesn't seem to be too complicated, all officers are at the same adresses. But forces, districts and cities are changed a bit. I'll have to adjust it.
User avatar
Zetta
Initiate
 
Posts: 77
Joined: Fri Feb 20, 2015 11:22 am

Re: ROTK11 Random Scenarios

Unread postby Zyzyfer » Fri May 22, 2015 7:49 pm

Let me send you my version of your v5 file and you can assess,Zetta. I think I did OK within the code you set but I can't boot to see now. But I'd love to pick around later and see if we can nail the randomizer! :)

edit: Finally got to run a trial. Now the top skills show up too much, haha. I think I can tweak the code a bit more to get the results I want. Thank you again Zetta for this program!

Zetta wrote:That would be helpful ! If you'd like to contribute, a small code you can write to distribute skills for each type of officer would be something like this:
f2 = choice([1,2,5,12])
to add under every "f1==...:" condition.
#where 1,2,5,12 are the respective numbers for the skills. choice() is an alternative to randrange() that allows to choose one element randomly inside a list.


Right but f2 has to be defined first, right? While it is defined after f1 I don't know how to reference it? Sorry but I can't figure out what I should do.

edit: I did a workaround by simplifying the code for stats tremendously. Now it gives a totally random skill (or nothing) to any officer with 50 LDR or WAR, a civil skill (or nothing) to those with 70 POL or CHR, a civil skill to officers with 85 POL or CHR, then checks LDR and WAR and uses the same formula for military, then checks for 85 INT and gives a strategy skill. The spread seems OK to me, although I am not sure how "random" it is by doing this, haha.
Gamefaqs: KongZhou
Steam: heinous_won
User avatar
Zyzyfer
Scholar of Shen Zhou
 
Posts: 3093
Joined: Thu May 08, 2008 1:17 pm
Location: South Korea

Re: ROTK11 Random Scenarios

Unread postby Zyzyfer » Thu Jul 16, 2015 4:52 pm

Did I edit my last post too much?
Gamefaqs: KongZhou
Steam: heinous_won
User avatar
Zyzyfer
Scholar of Shen Zhou
 
Posts: 3093
Joined: Thu May 08, 2008 1:17 pm
Location: South Korea

Re: ROTK11 Random Scenarios

Unread postby Zetta » Fri Jul 17, 2015 6:33 pm

Zyzyfer wrote:Did I edit my last post too much?


No it's okay. But I don't really have the time to implement all these changes right now. I've been moving out of my apartment and I'm about to enter the next one, so time is a bit scarce and I have different things to attend to. Might go back at the randomizer during August...
User avatar
Zetta
Initiate
 
Posts: 77
Joined: Fri Feb 20, 2015 11:22 am

PreviousNext

Return to Three Kingdoms Game Editing & Mods

Who is online

Users browsing this forum: No registered users and 1 guest

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