Heroes of Might and Magic Community
visiting hero! Register | Today's Posts | Games | Search! | FAQ/Rules | AvatarList | MemberList | Profile


Age of Heroes Headlines:  
5 Oct 2016: Heroes VII development comes to an end.. - read more
6 Aug 2016: Troubled Heroes VII Expansion Release - read more
26 Apr 2016: Heroes VII XPack - Trial by Fire - Coming out in June! - read more
17 Apr 2016: Global Alternative Creatures MOD for H7 after 1.8 Patch! - read more
7 Mar 2016: Romero launches a Piano Sonata Album Kickstarter! - read more
19 Feb 2016: Heroes 5.5 RC6, Heroes VII patch 1.7 are out! - read more
13 Jan 2016: Horn of the Abyss 1.4 Available for Download! - read more
17 Dec 2015: Heroes 5.5 update, 1.6 out for H7 - read more
23 Nov 2015: H7 1.4 & 1.5 patches Released - read more
31 Oct 2015: First H7 patches are out, End of DoC development - read more
5 Oct 2016: Heroes VII development comes to an end.. - read more
[X] Remove Ads
LOGIN:     Username:     Password:         [ Register ]
HOMM1: info forum | HOMM2: info forum | HOMM3: info mods forum | HOMM4: info CTG forum | HOMM5: info mods forum | MMH6: wiki forum | MMH7: wiki forum
Heroes Community > Library of Enlightenment > Thread: On the internals of offered skills when leveling-up a hero.
Thread: On the internals of offered skills when leveling-up a hero. This thread is 17 pages long: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 · «PREV / NEXT»
dimis
dimis


Responsible
Supreme Hero
Digitally signed by FoG
posted September 10, 2009 01:19 AM
Edited by dimis at 03:07, 11 Sep 2009.

Recap and Questions

Edited Out: I had a recap and some questions here initially.
This post will appear updated later on, when I finish writing the code.
____________
The empty set

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
AlexSpl
AlexSpl


Responsible
Supreme Hero
posted September 10, 2009 08:33 AM
Edited by AlexSpl at 09:06, 10 Sep 2009.

2dimis: Thank you for the corrections. Done.

Would it be helpful if I describe the whole process of getting secondary skills by giving an example? I mean, if I show all the random numbers and computations based on them during level-up process?


 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
dimis
dimis


Responsible
Supreme Hero
Digitally signed by FoG
posted September 10, 2009 09:09 AM
Edited by dimis at 09:17, 10 Sep 2009.

My second and last question is on my last IM. If you answer that, no need to write anything else at this point. Thanks

Once I finish with the implementation we can probably compare the databases for crag-hack (the one that you have and the one I will generate) with a script and be 101% sure that everything matches.

Thanks again for all the work and answering so fast. Really appreciated.
____________
The empty set

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
pei
pei


Famous Hero
Fresh Air.
posted September 10, 2009 06:38 PM

I wonder if (once this is finished) it could be possible to implement something similar in a genethic algorithm so to determine the best configuration for a hero´s secondary skills.
I mean, assigning some weights to each skill and making the algorithm run on each available hero taking on consideration the skills the hero already begins with, the ones he cant have and all.
What i wonder is if C.Hack is the one that would stand out.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
dimis
dimis


Responsible
Supreme Hero
Digitally signed by FoG
posted September 10, 2009 07:19 PM

Ok, first things first.
So here is a little problem pei: How do you define "best" skills ? There are lots of discussions around this forum for this particular question.
____________
The empty set

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
pei
pei


Famous Hero
Fresh Air.
posted September 10, 2009 08:11 PM

Taking a sample form the population. If people made their choice then these decitions can be gathered so as to serve the analysis.Then the study could focus in weighting the choices of a sample taken from the forum members choice. Once u decide how big this sample is going to be then the skills pop up by their own. Weights could be determined by the presence or order of the skills in members preferences.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
dimis
dimis


Responsible
Supreme Hero
Digitally signed by FoG
posted September 10, 2009 10:12 PM

I probably don't get what you want to do. Best with respect to what ?
How do you define best ? If we can not define best, then how can we look for that best thing ?
____________
The empty set

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
dimis
dimis


Responsible
Supreme Hero
Digitally signed by FoG
posted September 11, 2009 02:24 AM
Edited by dimis at 06:23, 15 Sep 2009.

fun

Ok, I am still debugging, but I can not resist and post something.

I can replicate the results for Crag Hack between level 1 to level 2 offers.

Moreover, I made a similar test with Damacon this time to see what's going on between level 1 to level 2 offers. Here we are:

26 - TACTICS    
22 - LEADERSHIP  
19 - ARTILLERY, LOGISTICS  
18 - ARMORER    
16 - BALLISTICS  
15 - ARCHERY    
14 - RESISTANCE  
12 - PATHFINDING
11 - SCOUTING    
10 - ESTATES, LEARNING    
8 - DIPLOMACY, EARTH MAGIC, MYSTICISM, NAVIGATION
6 - EAGLE EYE, WISDOM
5 - FIRE MAGIC, SORCERY
2 - FIRST AID, INTELLIGENCE, LUCK, SCHOLAR    
1 - AIR MAGIC  
0 - NULL SKILL, NECROMANCY, OFFENSE, WATER MAGIC

Regarding evaluation of specific policies under the new setup, refer to post "skills" below.

Thanks for sharing Alex, once again.
____________
The empty set

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
pei
pei


Famous Hero
Fresh Air.
posted September 11, 2009 08:10 PM

Ok, perhaps i have problems explaining myself as im argentinian. Here it goes, hope i do not mistake:

If there is a post where several memebers have given their definition on which are the best skills then, selecting a X NUMBER of replys to the post u can get X definitions of the best skills. Then, some skills of that sample we have collected will be prefered more than others. So, this sample only gives u a way to define BEST as more prefered by HC members.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
dimis
dimis


Responsible
Supreme Hero
Digitally signed by FoG
posted September 13, 2009 05:32 AM

Pei, there are many problems, and that's what I am trying to say by winking above

First of all, your initial suggestion does not say anything about members' opinion. So, BEST has to be defined regardless of what I believe, of what you believe, of what angelito believes, and so on ... I am trying to say here that BEST has to be objective; not subjective on somebody's belief.

Of course the second suggestion is interesting especially if you divide the population in two parts; those who have played at least 5-10 games online and those who haven't. Then, make 2 samples from those populations and see the differences. This would be interesting just for the fun. I don't see anything else there apart from fun though. And I can ask another question here. What about the order of the skills ? Clearly not all permutations are equivalent.



Anyway, back to the problem of skill trees, leveling-up, probabilities, and so on, well, I had to move to another apartment on Friday, so I ended up spending these last two days by moving and organizing stuff. I will try to post something tomorrow and we will see where we stand.
____________
The empty set

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
dimis
dimis


Responsible
Supreme Hero
Digitally signed by FoG
posted September 14, 2009 08:48 PM bonus applied by angelito on 15 Sep 2009.
Edited by dimis at 08:10, 17 Sep 2009.

skills: Evaluation of user's policy based on skill trees and biased randomness

Here we will have another tool that computes probabilities of certain skills to occur under specific policies. The tool is based largely on the source code for internals_mc modified by the changes proposed by Alex in page 12 of this thread. Hopefully soon enough we will include extra capabilities such as viewing certain skill trees. More about that on a subsequent edit of this post.


Skill Trees and Biased Randomness

We have 255 different ways of setting up a seed which determines the random sequences that are encountered during level-up. As in the past, we will call these ways, as skill-trees because of the different skill trees that they induce.

Let's have a look on what is happening during level-up (in the order presented; otherwise we have different sequences of random numbers and hence different skill-trees):

[I stick on the notation introduced by Alex in page 12 regarding the names of variables]

Step 1: The first variable that is updated is the one that stores the level of the hero; in particular it is increased by 1.

Step 2: Initialize the so-called seed for the random numbers that will appear during this level-up. This is performed with the function initialize_seed shown below:

In other words, we can initialize the seed in 255 (1-255) different ways which is the argument that the function accepts.

Step 3: Set an intermediate variable SEC. This is performed with the function set_sec shown below:

If you are interested in primary skill advancing, this is it; just read the post by Alex in page 12 now to see how these are determined per hero class. For now, I will skip this explanation because it is irrelevant to secondary skills for which we are primarily interested in atm. However, the call set_sec() has to be performed because it is part of the level-up process and the variable SEC has to be set for subsequent computations.

Random Number Generation: Now we finished with the initialization phase and we are about to generate skill offers. It is crucial to introduce here the function that will return a "random" number when we request it. It is the following (Get_Random_Number):

Note, that in line 5 we make another call to set_sec defined above; I will comment on this one right-away.

Step 4: We are now ready to request the first random number (if needed) in order to determine a skill that will be offered (either as an upgrade or as a new skill). Before we make a call to the above function Get_Random_Number we have to reset (not initialize; that has a different argument! check!) the seed. For this purpose we use the function set_seed:

In particular, we re-set the seed by passing as parameter to the function the value of SEC which was computed in step 3 above (and this is why even we might not care about primary skills, we still have to go through the initialization steps 1-3). If I am unclear, in this step we perform the call


Step 5: We get a "random" number and store its value in variable Q by calling the function Get_Random_Number defined above; i.e.


Basically, this is the difficult part.

Step 6: We now have to set Q in-range. We perform the command

Typically, weight above is the weight of the participating skills in the skill offer. If these are skills that can be upgraded, then weight is the sum of weights for skills that can be upgraded. If these are skills that will appear as new, then weight is the sum of weights for skills that may appear as new.

From now on we just subtract the weights from Q in the order the skills are stored in the game, and once Q becomes <= 0, then this skill will be returned.

If we need another random number in order to determine the slot on the right (because the slot on the left is determined first), then we repeat steps 4-6 above (so, we reset the seed once again). Of course on a subsequent level-up we start again from step 1.

Perhaps you can find some more help about the process by reading the functions that perform the computation of skills that are offered, named Roll_Dice_for_new_skill, Roll_Dice_for_new_magic_skill, Roll_Dice_for_magic_skill_upgrade, and Roll_Dice_for_skill_upgrade found in the file mighty_classes.cpp in the source code (which is provided with a link below). For convenience, one of those functions is here.


Exceptions when Generating Random Numbers

(1) Now an interesting read is section 2.2.1 (page 6) of the On the offered skills in Heroes of Might and Magic III (appeared in The Librarys Heroes III Tribute Thread) which is based on the work of Ecoris [digging deeper - the very nature of the algorithm, second post].

In other words, steps 5, and 6 (it doesn't matter if you perform step 4 or not) above take place, only if the weight has value at least 2. This was verified independently by AlexSpl.

(2) The above weight does not reflect sum of weights only in one case: when the hero has to be offered as an upgrade a Magic School. In this case, the weight used above for the computation of Q is the amount of Magic Schools that are available for upgrade. So, if there is only one Magic School available for upgrade, which has to appear due to Magic exception, then weight = 1, and exception 1 above holds! ==> We do NOT make a call for a random number. That skill is automatically returned.


I believe this is all. Regarding the values that appear as probabilities, I simply enumerate the trees in which a specific skill appears when we follow a specific policy and then I divide that number by 255.





Source Code and Executable:

Source code (21,947 bytes)
Executable (32,768 bytes)


Supported Algorithms

ANSA or AR: These two identifiers indicate the "Always Right" strategy, i.e. always choose the Right offer when advancing a hero. In cases where there is only one option, then obviously that one option is selected.

AL: This is the "Always Left" policy, i.e. the symmetric policy than that defined above.

ALTP: This is the "Always Left-Then Preference" policy, i.e. whenever there is a skill for upgrade, the hero upgrades that skill, but if two new skills are offered, then the hero selects the one that prefers the most. The filename that is read in order to determine user's preference is called altp_prefs.txt.
Note also that heroes that start with 2 skills always choose the left offer until both of them are at expert level (i.e. in this case the preferences don't count). If you feel that this should change, just let me know with a post of yours here on thread.

SPOU: This is the "Seek Preference-Otherwise Upgrade" policy. User's preferences are read from file spou_prefs.txt. The idea is to get ANY of the top 8 skills whenever these are offered, otherwise upgrade any existing skills. When two skills are presented for upgrade the one with higher preference is picked first. However, there are cases where the hero can be really unfortunate and be offered two skills for upgrade and none is on top 8 list. In this case the one with the higher preference is selected. However, now the hero has virtually one "unwanted" skill, hence next time he has to decide for getting a skill, he will search ONLY in top 7 list. Similarly, with 2 unwanted skills, a new skill is selected if and only if this appears in top 6 list, and so on ...

FRANK: This is "Frank's Skill Selection" policy slightly modified from the one presented in the thread [HOMM3 Tactics, page 1, 5th post]. In short, it is similar to ALTP above, with the difference, that once one hero has only 1 upgrade left, then he considers of picking a new skill instead of upgrading the existing one (if the skill is sufficiently interesting for the hero). Otherwise he upgrades the existing skills. So, it is different from the policy Frank suggests in the sense that Logistics and Earth Magic are not treated in a special form as he states. User's preferences on skills are read from file frank_prefs.txt.


Printing Methods

DEPRECATED, NEAT, FANCY

By default FANCY method is used.


Command Line Arguments

On command line the program expects 3 or 4 arguments.
1st: The hero class.
2nd: The hero name.
3rd: The policy followed by user.
4th (Optional): The output method for the results. If not specified, FANCY is used by default.
You can get a detailed help on command line by giving:
Quote:
skills -help



Sample Execution

The execution is similar to the internals_mc.exe found in page 8. What we really leave on the side compared to internals_mc is the number of episodes, since here the evaluation will take place on all 255 different skill trees. For completeness, I will give the following example. The rest are similar.

Assume you want to experiment with Crag-Hack in "frank" policy. Then it suffices to execute the following:
Quote:
skills barbarian crag_hack frank
Of course, do not forget to have the "frank_prefs.txt" file in the same directory. In case frank_prefs.txt has structure as in this file, the results should be similar to these:
Quote:
> skills barbarian crag_hack frank
CRAG_HACK
~~~~~~~~~
AIR MAGIC    |========================================>  82.75 %
ARCHERY      |========>  18.43 %
ARMORER      |=========================>  52.55 %
ARTILLERY    |===========>  24.71 %
BALLISTICS   |=========>  19.61 %
DIPLOMACY    |>  2.75 %
EAGLE EYE    |=>  3.92 %
EARTH MAGIC  |===========================================>  88.24 %
ESTATES      |==>  5.88 %
FIRE MAGIC   |===================>  40.39 %
FIRST AID    |>  0.78 %
INTELLIGENCE |>  2.75 %
LEADERSHIP   |==============>  30.20 %
LEARNING     |==>  6.27 %
LOGISTICS    |====================================>  73.33 %
LUCK         |====>  9.80 %
MYSTICISM    |>  2.35 %
NAVIGATION   |>  2.75 %
NECROMANCY   |  0.00 %
OFFENSE      |=================================================>  100.00 %
PATHFINDING  |============================>  58.82 %
RESISTANCE   |========================>  49.41 %
SCHOLAR      |>  0.39 %
SCOUTING     |>  0.39 %
SORCERY      |  0.00 %
TACTICS      |===================================>  72.55 %
WATER MAGIC  |  0.00 %
WISDOM       |========================>  50.98 %

Duration     : 0.005637 seconds.



User Preference Files: Structure and Examples

The structure is very simple actually. All you need to do is place on separate lines different skills (any combination of lower case and upper case letters is allowed). Each line should begin with a letter (i.e. the first letter of the skill that is represented in this line) and should finish as soon as the name of the skill finishes.
The higher you put a skill in your file, the higher preference it gets. The parser reads the 28 first lines from the preference files in order to induce ordering. Valid names for skills:

AIR_MAGIC, ARCHERY, ARMORER, ARTILLERY, BALLISTICS, DIPLOMACY, EAGLE_EYE, EARTH MAGIC, ESTATES, FIRE_MAGIC, FIRST_AID, INTELLIGENCE, LEADERSHIP, LEARNING, LOGISTICS, LUCK, MYSTICISM, NAVIGATION, NECROMANCY, OFFENSE, PATHFINDING, RESISTANCE, SCHOLAR, SCOUTING, SORCERY, TACTICS, WATER_MAGIC, WISDOM

Sample files (same contents on both):
altp_prefs.txt
spou_prefs.txt
frank_prefs.txt


Other command-line options

You can also execute the program with the following options:

-version Presents current version. Sample execution:
Quote:
skills.exe -version

-about Presents an "about" message. Sample execution:
Quote:
skills.exe -about



Anyway,
Have FUN!





Home Log

Version 1.0

Home Generated: September 14, 2007.

Version 2.0
Released : September 16, 2008.
I have to add information here regarding changes.




COMMENTS:

(1) Ideas for better names on policies (even if these have already been implemented) are more than welcome.
(2) Finally, any other idea for something to be implemented is again very welcome. Example: When reading the file with preferences, if it does not contain in top 8 list one of hero's initial skills, you are directed to edit the file and place the skill in the appropriate position in top 8 list. Do you have any propositions for automatic fix-up on file so that you don't need to edit it (i.e. place the skill in appropriate position within the file)? I didn't find some time to think about this problem so far.





TO-DO LIST:

(1) Extend code so as to include magic heroes; not only mighty as it is now.
(2) Allow a skill viewer based on skill tree number.
(3) Implement the policies that are screaming for years now ...





Results

In the past we have created tables with probabilities of certain skills to occur during leveling-up. I am referring to ANSA (AR) and Always Left (AL) tables that were created in the past.

Now, let's see the real picture.
Final version of ANSA (AR) table for mighty heroes; ansa_probs.txt, ansa_probs.xls.
Final version of Always Left (AL) table for mighty heroes; al_probs.txt, al_probs.xls.


Error Tables

Two more tables can be and have been generated. I am referring to the error tables between the theoretical values and the real values that are experienced in practice.
ANSA (AR) Error
Always Left (AL) Error

Reading the Error Tables

I will stick on the ANSA (AR) Error Table above, since the format of both tables is the same. There are 74x28 entries corresponding to the error

real value - theoretical value

between the two tables.

For example, Fafner, in the ANSA (AR) Error Table has the value -5.41 in his Air Magic Entry. This is justified by observing the other two tables, real values for ANSA (AR) and theoretical values for ANSA (AR) and subtracting in this order.

Extra columns: There are three more columns on the right hand side titled MINIMUM, MAXIMUM, and SUM OF ABS (which you should read as "Sum of Absolute Values").

Hence, under MINIMUM we can view the minimum value that appears on each row (i.e. each hero). Under MAXIMUM we can view the maximum value that appears on each row (i.e. each hero). Under SUM OF ABS we can view the sum of the absolute values that appear on each row (i.e. each hero). Hence, by dividing this number by 28 (which is the total number of skills) we get the average discrepancy between the theoretical and real values for probabilities of each skill for each hero. For example, again for Fafner, this entry is 45.58 yielding an average of 45.58/28 = about = 1.628% for each skill.

For each hero class, there are some entries colored red or blue. The red entries represent the maximum absolute values for each hero class in each column. In other words, they indicate the worst scenario for each hero class between the theoretical predictions and the real values for the probabilities of skills under the specific policy. The blue color is used only on the last column to indicate the hero that was closest to the theoretical predictions among all heroes in each class. Note that this coloring is consistent with the coloring in the first column with hero names so that someone can pinpoint those heroes quickly. As a final note, the names of heroes that behave best or worst among all mighty heroes, are written in bold. Hence, KORBAC is not only the hero that behaves best in his class, but also, he is the one among all mighty heroes who behaves the best. Similarly, FIONA is the hero that behaves the worst not only in her class, but also, she is the one among all mighty heroes who behaves the worst.

Extra rows: There are three more rows on the lower part of the table titled MINIMUM, MAXIMUM, and SUM OF ABS, like the columns mentioned above.

This time, under MINIMUM we can view the minimum value that appears on each column (i.e. each skill). Under MAXIMUM we can view the maximum value that appears on each column (i.e. each skill). Under SUM OF ABS we can view the sum of the absolute values that appear on each column (i.e. each skill). In all three cases we take into account all mighty heroes.

Hence, by dividing the SUM OF ABS number by 74 (which is the total number of mighty heroes presented; Uland is at the moment excluded for other reasons) we get the average discrepancy between the theoretical and real values for probabilities per each mighty hero for each skill. For example, Air Magic has SUM OF ABS 101.91. We get 101.91/74 = about = 1.377% per hero entry.

Again, there is some extra coloring on the entries shown in these rows. With red we have the worst scenario for each row, and with blue we have the best (non-zero) value per row. So, the worst, positive discrepancy on the entire table is 8.55 which is obtained for Resistance and Gelu. The worst negative discrepancy, is -7.71 for Scouting and Clancy. The skill that behaves the worst when following ANSA (AR) with mighty heroes is Archery with SUM OF ABS 161.57 yielding 161.57/74 = about = 2.183% per hero entry. On the other hand, regarding best performance, we have something interesting. All these values are obtained for Scholar. Hence, for all mighty heroes, the probability of acquiring Scholar while following ANSA is within [-2.9, +2.75] of its theoretical values. Overall we have 79.59/74 = about = 1.076% discrepancy for Scholar from its theoretical value per hero entry {while following ANSA (AR)}.

Read similarly the Always Left (AL) Error Table.



Open Document Spreadsheet format for the above data:

ANSA (AR) ods file
Always Left (AL) ods file
____________
The empty set

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
pei
pei


Famous Hero
Fresh Air.
posted September 15, 2009 03:05 AM

Not all permutations are permitted so it could be more like an algorithm with a validating code.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
AlexSpl
AlexSpl


Responsible
Supreme Hero
posted September 15, 2009 08:13 AM

2dimisReally nice job! Could you please briefly explain how those values (probabilities) have been obtained?

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
dimis
dimis


Responsible
Supreme Hero
Digitally signed by FoG
posted September 15, 2009 08:17 AM
Edited by dimis at 08:23, 15 Sep 2009.

yes. I will try to edit the post later today. I am just working on another thing in parallel; that's why it is taking me so much time. Check again in 2-3 hours.

edit: btw, can you verify the results for damacon above (level 1 --> level 2), or do you have results only for crag_hack?

edit 2: yeah, and another factor that is stalling me is that I am also performing a major clean-up on the code, since this will be used from now on.
____________
The empty set

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
AlexSpl
AlexSpl


Responsible
Supreme Hero
posted September 15, 2009 08:32 AM

Quote:
btw, can you verify the results for damacon above (level 1 --> level 2), or do you have results only for crag_hack?

Certainly I can and will do it soon (maybe tomorrow).

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
dimis
dimis


Responsible
Supreme Hero
Digitally signed by FoG
posted September 15, 2009 08:35 AM
Edited by dimis at 10:13, 15 Sep 2009.

Ok guys, I think I wrote what I wanted to write. Most likely I left something outside.

All comments are welcome, and it would be nice if the above were verified by Alex.

Till the next time ...
____________
The empty set

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
AlexSpl
AlexSpl


Responsible
Supreme Hero
posted September 15, 2009 01:09 PM
Edited by AlexSpl at 13:40, 15 Sep 2009.

2dimis: Just saw the sources. Seems to be OK but still several tests wouldn't be worthless. Thanks again for all the work done.

In order to check skills.exe's outputs I'll make some test by myself (Tazar, Crag Hack and Ivor) and compare with your results. Then at least me who will be convinced of correctness of output data.

By the way, I think it's a good idea to store skill weights in a single text document so that anyone can edit them if needed.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
dimis
dimis


Responsible
Supreme Hero
Digitally signed by FoG
posted September 16, 2009 03:36 AM

Alright. Let's see what the verdict of comparing two programs will be and if I have to change the source code.

Just a note here: I do NOT treat (yet) inconsistent heroes w.r.t. the original version of the game. So, for example, testing Crag_Hack, by adding simply Necromancy as one of his starting skills will not work, because that skill comes with weight 0. Hence, there is another edit required in the weight table, so that Necromancy gets weight 1 upon such a change. This might be supported in some future version, but this is way ahead ...

Regarding the editing of weights with a text file, I have been thinking about that too. However ... now I am the bad guy , and I do not plan to give such an option soon, mainly because this will be another boost to TE, and frankly I believe that people should play the game mainly with only this extra option. So, if I can press matters in any way for that precious button, I will certainly do. I don't like TE more than the Complete version mainly because it is (was?) not stable. But even if I leave stability issues on the side, I might still like Complete more.

I also started writing a skill-tree viewer, but I have to leave it on the side too. There are so many other things that are pressing. I will add that capability to the "skills" above by the end of the year.

That's all from my side for now. Let's see how the comparison will go.

Thanks again Alex for all the help.
____________
The empty set

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
dimis
dimis


Responsible
Supreme Hero
Digitally signed by FoG
posted September 16, 2009 07:56 AM
Edited by dimis at 12:29, 16 Sep 2009.

Ok, so most likely I haven't understood something from your post then.
We will find it. We will create some mess in the thread, but I hope in the end we will clean up.

First of all I will change the printing method so that we can compare the values in the order you generate the log from LMOracle and then let's pinpoint the differences on AR. Hopefully, it will only be 1 skill tree where they differ and we will find the bug.

Of course I will generate the logs you want. But this might take a day.

I will post again soon.

The other thing is that I am also playing with overflows ...




Let's investigate the AR first and we will find the rest. I will give you source code and exe once I can generate output similar to what you want.

Meanwhile, let's see where we differ:
gunnar:~/Desktop/skills_modified$ ./skills barbarian crag_hack ar neat
CRAG_HACK
~~~~~~~~~
PATHFINDING :  97/255 =  38.0392 %
ARCHERY     :  75/255 =  29.4118 %
LOGISTICS   :  93/255 =  36.4706 %
SCOUTING    :  94/255 =  36.8627 %
DIPLOMACY   :  16/255 =   6.2745 %
NAVIGATION  :  29/255 =  11.3725 %
LEADERSHIP  :  63/255 =  24.7059 %
WISDOM      : 255/255 = 100.0000 %
MYSTICISM   :  49/255 =  19.2157 %
LUCK        :  51/255 =  20.0000 %
BALLISTICS  : 108/255 =  42.3529 %
EAGLE EYE   :  24/255 =   9.4118 %
NECROMANCY  :   0/255 =   0.0000 %
ESTATES     :  28/255 =  10.9804 %
FIRE MAGIC  :  89/255 =  34.9020 %
AIR MAGIC   : 106/255 =  41.5686 %
WATER MAGIC :   0/255 =   0.0000 %
EARTH MAGIC : 123/255 =  48.2353 %
SCHOLAR     :  18/255 =   7.0588 %
TACTICS     : 110/255 =  43.1373 %
ARTILLERY   : 106/255 =  41.5686 %
LEARNING    :  47/255 =  18.4314 %
OFFENSE     : 255/255 = 100.0000 %
ARMORER     :  79/255 =  30.9804 %
INTELLIGENCE:  14/255 =   5.4902 %
SORCERY     :  16/255 =   6.2745 %
RESISTANCE  :  79/255 =  30.9804 %
FIRST AID   :  16/255 =   6.2745 %

Earth was found on the following skill-trees:
1 4 5 6 7 8 9 11 12 13 16 17 18 19 21 22 23 24 29 30 35 36 41 42 47 48 53 54 59 60 62 65 66 70 71 72 77 78 83 84 89 95 96 100 101 102 107 108 113 114 115 118 119 120 124 125 126 130 132 134 136 137 138 140 142 143 144 148 149 154 155 161 162 164 165 166 167 170 172 173 177 178 179 184 185 186 187 190 191 192 196 197 200 202 203 208 209 212 214 215 216 220 221 223 224 226 227 228 230 232 237 238 239 240 241 243 244 245 249 250 251 253 255
Logistics was found on the following skill-trees:
3 10 11 12 15 16 17 19 20 23 25 30 31 33 35 39 40 42 45 46 47 48 50 52 54 55 57 59 64 68 71 72 73 84 85 90 92 94 98 99 101 104 105 111 113 114 119 121 123 129 132 134 135 136 138 139 141 150 154 155 160 165 167 169 174 179 180 181 182 183 186 191 193 194 196 198 201 203 205 206 208 213 214 216 217 218 223 224 229 236 244 246 247
gunnar:~/Desktop/skills_modified$


Give me the (hopefully ) two trees where we differ and let's analyze these.




LOG FILES FOR AR
Detailed
Short (only the skills that actually gain "1" appear)

LOG FILES FOR AL
Detailed
Short (only the skills that actually gain "1" appear)

Rebooting, compiling, uploading source and exe, and I will give you links.

Source code for skills_modified: here
Executable for skills_modified: here

Use the "neat" method like you used in the past.
Now the program creates 2 files in the directory of the program. These are the two logs above.




I can verify the level 1 -> level 2 offers for Tazar and Ivor. Moreover, here is Orrin:

ORRIN (Level 2 skills)
PATHFINDING :  10/255 =   3.9216%
ARCHERY     :   0/255 =   0.0000%
LOGISTICS   :  14/255 =   5.4902%
SCOUTING    :  11/255 =   4.3137%
DIPLOMACY   :  10/255 =   3.9216%
NAVIGATION  :  20/255 =   7.8431%
LEADERSHIP  :   0/255 =   0.0000%
WISDOM      :   7/255 =   2.7451%
MYSTICISM   :   4/255 =   1.5686%
LUCK        :   8/255 =   3.1373%
BALLISTICS  :  19/255 =   7.4510%
EAGLE EYE   :   6/255 =   2.3529%
NECROMANCY  :   0/255 =   0.0000%
ESTATES     :  16/255 =   6.2745%
FIRE MAGIC  :   3/255 =   1.1765%
AIR MAGIC   :   7/255 =   2.7451%
WATER MAGIC :  11/255 =   4.3137%
EARTH MAGIC :   6/255 =   2.3529%
SCHOLAR     :   2/255 =   0.7843%
TACTICS     :  18/255 =   7.0588%
ARTILLERY   :  14/255 =   5.4902%
LEARNING    :  10/255 =   3.9216%
OFFENSE     :  21/255 =   8.2353%
ARMORER     :  13/255 =   5.0980%
INTELLIGENCE:   2/255 =   0.7843%
SORCERY     :   3/255 =   1.1765%
RESISTANCE  :  14/255 =   5.4902%
FIRST AID   :   6/255 =   2.3529%
$


It seems that normal level-ups work right. So, the problem is when we treat one of the exceptions or a coincidence of exceptions. Give me the trees where we differ in AR and see where we stand.






Ok, we differ on skill tree 75 when following AL.
I will investigate that tree.

I tried to do the computations by hand, but I can not get either the skills where I think the problem is but neither any of your skills for the 75th tree. I guess somebody is tired

Anyway, let's see the critical tree #75 for Crag Hack when following AL:

As a reminder, from the log above I have:
Skill Tree #75

SCOUTING    : 1/255 = 0.3922%
LEADERSHIP  : 1/255 = 0.3922%
WISDOM      : 1/255 = 0.3922%
FIRE MAGIC  : 1/255 = 0.3922%
AIR MAGIC   : 1/255 = 0.3922%
ARTILLERY   : 1/255 = 0.3922%
LEARNING    : 1/255 = 0.3922%
OFFENSE     : 1/255 = 0.3922%


Let's see now the process I have:

$ ./tree
Current Level: 2
left     : OFFENSE    
right    : BALLISTICS  
choice   : OFFENSE    
Current Level: 3
left     : LEADERSHIP  
right    : RESISTANCE  
choice   : LEADERSHIP  
Current Level: 4
left     : LEADERSHIP  
right    : AIR MAGIC  
choice   : LEADERSHIP  
Current Level: 5
left     : LEADERSHIP  
right    : BALLISTICS  
choice   : LEADERSHIP  
Current Level: 6
left     : WISDOM      
right    : PATHFINDING
choice   : WISDOM      
Current Level: 7
left     : WISDOM      
right    : ARCHERY    
choice   : WISDOM      
Current Level: 8
left     : WISDOM      
right    : FIRE MAGIC  
choice   : WISDOM      
Current Level: 9
left     : SCOUTING    
right    : INTELLIGENCE
choice   : SCOUTING    
Current Level: 10
left     : SCOUTING    
right    : ARMORER    
choice   : SCOUTING    
Current Level: 11
left     : SCOUTING    
right    : LEARNING    
choice   : SCOUTING    
Current Level: 12
left     : FIRE MAGIC  
right    : AIR MAGIC  
choice   : FIRE MAGIC  
Current Level: 13
left     : FIRE MAGIC  
right    : TACTICS    
choice   : FIRE MAGIC  
Current Level: 14
left     : FIRE MAGIC  
right    : LOGISTICS  
choice   : FIRE MAGIC  
Current Level: 15
left     : LEARNING    
right    : EAGLE EYE  
choice   : LEARNING    
Current Level: 16
left     : LEARNING    
right    : PATHFINDING
choice   : LEARNING    
Current Level: 17
left     : LEARNING    
right    : ARCHERY    
choice   : LEARNING    
Current Level: 18
left     : AIR MAGIC  
right    : PATHFINDING
choice   : AIR MAGIC  
Current Level: 19
left     : AIR MAGIC  
right    : BALLISTICS  
choice   : AIR MAGIC  
Current Level: 20
left     : AIR MAGIC  
right    : SORCERY    
choice   : AIR MAGIC  
Current Level: 21
left     : ARTILLERY  
right    : LOGISTICS  
choice   : ARTILLERY  
Current Level: 22
left     : ARTILLERY  
right    : NULL SKILL  
choice   : ARTILLERY  
Current Level: 23
left     : ARTILLERY  
right    : NULL SKILL  
choice   : ARTILLERY


Up to and including level 14, the skills we suggest for that level are the same.
So, I suspect that we differ for level 15 offer which is

<Learning, Eagle Eye>

for me. I will do the computations again (by hand) to verify that this is correct. I did it once (by hand) but I got Navigation lol


EDIT: Yeah, I verified everything by hand, and Learning is computed correctly on the left because the computations that take place are
1) seed = 15,125,999
2) sec = 3,237,162,954,998
3) seed is set now to 3,052,581,110 (since we keep last 4 bytes from the above)
4) sec = (binary) = 0110 1000 0011 0001 = 0x6831 = 26,673
5) Q = 26,673 ==> Q = (Q % 85) + 1 ==> Q = 69
6) Subtract weights in the order they appear on game ==> Learning is the winner.
I don't understand if we agree on the previous 14 levels, why we do not agree here.
____________
The empty set

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
AlexSpl
AlexSpl


Responsible
Supreme Hero
posted September 16, 2009 12:25 PM

Quote:
Current Level: 4
left     : LEADERSHIP  
right    : AIR MAGIC  
choice   : LEADERSHIP  
Current Level: 5
left     : LEADERSHIP  
right    : BALLISTICS  
choice   : LEADERSHIP  
Current Level: 6
left     : WISDOM      
right    : PATHFINDING
choice   : WISDOM      
Current Level: 7
left     : WISDOM      
right    : ARCHERY    
choice   : WISDOM



Level 7 should be as below (verified on a real save from a random map):

Current Level: 7
left     : WISDOM      
right    : AIR MAGIC
choice   : WISDOM

I don't have LMOracle (edited version) near me now so I won't be able to find out more on the problem till tomorrow

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Jump To: « Prev Thread . . . Next Thread » This thread is 17 pages long: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 · «PREV / NEXT»
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.1932 seconds