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: Tribute to Strategists
Thread: Tribute to Strategists This thread is 20 pages long: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 · «PREV / NEXT»
Salamandre
Salamandre


Admirable
Omnipresent Hero
Wog refugee
posted December 16, 2014 08:18 PM

I used this to get how more % our army is powerful:

;v7 our army AI value
;y9 neutrals army value

!!VRy10:Sv7*100:y9; set y10 to v7, multiply by 100 then divide by y9. Am I on the right way at least?
____________
Era II mods and utilities

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


Responsible
Supreme Hero
posted December 16, 2014 08:21 PM

You may not even care about how powerful is your army. Just look at this simple maths:

a/b = c/d is equivalent to a*d = b*c.

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


Admirable
Omnipresent Hero
Wog refugee
posted December 16, 2014 08:24 PM
Edited by Salamandre at 20:24, 16 Dec 2014.

Now even more confused. I started my script to match the doc file which says to find neutrals then our army AI values. Then set the percentage. Your first example on previous page uses maths operations i can't use in erm so I have to stick to this:

0 – 50%        7  
50 – 67%         7
67 – 100%       6
100 – 150%       5
150 – 200%       4
> 200%           3
____________
Era II mods and utilities

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


Responsible
Supreme Hero
posted December 16, 2014 08:28 PM
Edited by AlexSpl at 20:31, 16 Dec 2014.

For example,

V1 = Army_Power
V2 = Neutrals_Power

then

Quote:
k < 0.5 then 7 stacks
0.5 <= k < 0.67 then 6 stacks
...



is equivalent to

V1/V2 < 1/2 then 7 stacks
1/2 <= V1/V2 < 67/100 then 6 stacks,
...

or

2*V1 < 1*V2 then 7 stacks,
1*V2 <= 2*V1 and 100*V1 < 67*V2 then 6 stacks,
and so on ...

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


Admirable
Omnipresent Hero
Wog refugee
posted December 16, 2014 08:33 PM
Edited by Salamandre at 20:33, 16 Dec 2014.

Detailed results, attacking 44 golems with 88:


____________
Era II mods and utilities

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


Responsible
Supreme Hero
posted December 16, 2014 08:37 PM

R4 = 41 tells you only that Deviation = 0. First, you should find the basic splitting.

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


Promising
Legendary Hero
fallen artist
posted December 16, 2014 08:37 PM

Quote:
The Splitting Problem

1. Find both Army_Power and Neutrals_Power. They are just the sum of AI values of all creatures in the corresponding armies. A powerful hero at your side doesn't change anything.

2. Find k = Army_Power / Neutrals_Power.

3. Determine the basic splitting:

k < 0.5 then 7 stacks
0.5 <= k < 0.67 then 6 stacks
0.67 <= k < 1 then 5 stacks
1 <= k < 1.5 then 4 stacks
1.5 <= k < 2 then 3 stacks
k >= 2 then 2 stacks

Note:
Here all the floating point numbers are of double precision, or type; sizeof(double) = 8 bytes.

4. Find the actual splitting:

1. R1 = a*x + b*y + c*z + d
2. R2 = R1 / 65536 (integer division here!)
3. R3 = R2 % 32768
3a. If R3 < 0 then R3 = R3 + 32767
4. R4 = R3 % 100 + 1

Where:
a = 1550811371
b = -935900487
c = 1943276003
d = -1120346418

Then,
if R4 <= 20 decrease the number of stacks by 1
if R4 >= 80 increase the number of stacks by 1 unless you have already 7.

Awesome, now we know everything.

Still, it looks like very elaborate way to solve a simple problem
____________
The future of Heroes 3 is here!

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


Admirable
Omnipresent Hero
Wog refugee
posted December 16, 2014 08:38 PM
Edited by Salamandre at 20:41, 16 Dec 2014.

The basic splitting is 4 because of 200% power difference, according to document. Maybe he missed >=200, because I get 3 stacks.

@Edit: no, actually I get 2 stacks when attacking, wtf
____________
Era II mods and utilities

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


Known Hero
posted December 16, 2014 08:40 PM
Edited by kicferk at 20:42, 16 Dec 2014.

You got 3 stacks in game? That would hurt...
Try with 89, I hope you get 2 stacks.

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


Responsible
Supreme Hero
posted December 16, 2014 08:41 PM
Edited by AlexSpl at 20:42, 16 Dec 2014.

Quote:
The basic splitting is 3 because of 200% power difference.

According to my table, the basic splitting is 2 when k >= 200%. How many stacks do you see?

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


Admirable
Omnipresent Hero
Wog refugee
posted December 16, 2014 08:41 PM
Edited by Salamandre at 20:43, 16 Dec 2014.

2, edited. What is the accurate table, please give me so I can add the calculations.
____________
Era II mods and utilities

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


Responsible
Supreme Hero
posted December 16, 2014 08:43 PM

Quote:
Still, it looks like very elaborate way to solve a simple problem

That's the reality when you have to deal with RNGs

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


Admirable
Omnipresent Hero
Wog refugee
posted December 16, 2014 08:46 PM

k < 0.5 then 7 stacks
0.5 <= k < 0.67 then 6 stacks
0.67 <= k < 1 then 5 stacks
1 <= k < 1.5 then 4 stacks
1.5 <= k < 2 then 3 stacks
k >= 2 then 2 stacks

ok got it. Now going to write the thing.
____________
Era II mods and utilities

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


Admirable
Omnipresent Hero
Wog refugee
posted December 16, 2014 08:55 PM
Edited by Salamandre at 20:59, 16 Dec 2014.

Looks like is working well, here is for test. I recommend Trainer mod for fast army modifications:

ZVSE
;right click on any monster to see its split.

!?CM0;
!!CM:P?y2/?y3/?y4; get location of click
!!OBy2/y3/y4:T?y5 U?y6;
!!FU&y5<>54:E;
!!MOy2/y3/y4:G?y7;
!!MA:Iy6/?y8;
!!VRy9:Sy7*y8; get AI value for stack
!!OW:A-1/?y1;
!!FU&y1<0:E;
!!VRv7:S0; initialize v7
!!DO135892/0/6/1:Py1;
!!VRy10:Sv7*100:y9;
!!VRy11:S1550811371;
!!VRy12:S-935900487;
!!VRy13:S1943276003;
!!VRy14:S-1120346418;
!!VRy15:Sy11*y2;
!!VRy16:Sy12*y3;
!!VRy17:Sy13*y4;
!!VRy18:Sy15+y16+y17+y14;
!!VRy19:Sy18:65536;
!!VRy20:Sy19%32768;
!!VRy20&y20<0:+32767;
!!VRy21:Sy20%100+1;
!!VRy22&y10<50:S7;
!!VRy22&y10>=50/y10<67:S6; [read table]
!!VRy22&y10>=67/y10<100:S5;
!!VRy22&y10>=100/y10<150:S4;
!!VRy22&y10>=150/y10<200:S3;
!!VRy22&y10>=200:S2;
!!VRy22&y21<=20:-1; [R4 final corrections]
!!VRy22&y21>=80:+1;
!!IF:Q1/21/y6/4^%Y22 stacks^;
!!CM:R0;

!?FU135892;
!!HEx1:C0/x16/?y1/?y2;
!!FU&y1<0:E;
!!MA:Iy1/?y3; get AI value
!!VRy4:Sy2*y3;
!!VRv7:+y4;
____________
Era II mods and utilities

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


Responsible
Supreme Hero
posted December 16, 2014 09:12 PM
Edited by AlexSpl at 21:13, 16 Dec 2014.

Also, take care of the following cases:

1. You have 7 stacks according to the table, still you have to add 1 stack due to Deviation, just don't.

2. You have less creatures than stacks in the actual splitting. For example, 3 orcs cannot divide themselves to fit 7 stacks

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


Admirable
Omnipresent Hero
Wog refugee
posted December 16, 2014 09:22 PM
Edited by Salamandre at 21:22, 16 Dec 2014.

Yeah I forgot, will add those checks for final, thanks.

The first case needs only one fix, but the second is a bit longer to do.
____________
Era II mods and utilities

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


Responsible
Supreme Hero
posted December 16, 2014 09:25 PM

Why, just compare the number of neutrals with the number of stacks. If less, #stacks = #neutrals.

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


Admirable
Omnipresent Hero
Wog refugee
posted December 16, 2014 09:38 PM
Edited by Salamandre at 21:46, 16 Dec 2014.

Sorry just being lazy, it was longer because I have to type a line instead of one character, both fixed.

ZVSE
;right click on monsters stack to get split

!?CM0;
!!CM:P?y2/?y3/?y4; get location of click
!!OBy2/y3/y4:T?y5 U?y6;
!!FU&y5<>54:E;
!!MOy2/y3/y4:G?y7;
!!MA:Iy6/?y8;
!!VRy9:Sy7*y8; get AI value for stack
!!OW:A-1/?y1;
!!FU&y1<0:E;
!!VRv7:S0; initialize v7
!!DO135892/0/6/1:Py1;
!!VRy10:Sv7*100:y9;
!!VRy11:S1550811371;
!!VRy12:S-935900487;
!!VRy13:S1943276003;
!!VRy14:S-1120346418;
!!VRy15:Sy11*y2;
!!VRy16:Sy12*y3;
!!VRy17:Sy13*y4;
!!VRy18:Sy15+y16+y17+y14;
!!VRy19:Sy18:65536;
!!VRy20:Sy19%32768;
!!VRy20&y20<0:+32767;
!!VRy21:Sy20%100+1;
!!VRy22&y10<50:S7;
!!VRy22&y10>=50/y10<67:S6;[read table]
!!VRy22&y10>=67/y10<100:S5;
!!VRy22&y10>=100/y10<150:S4;
!!VRy22&y10>=150/y10<200:S3;
!!VRy22&y10>=200:S2;
!!VRy22&y21<=20:-1; [R4 correction]
!!VRy22&y21>=80/y22<7:+1; [if less than 7, add 1]
!!VRy23:Sy7-y22; [subtract splits # from neutral #]
!!VRy22&y23<0:Sy7; [set splits # to monster # if result <0 ]
!!IF:Q1/21/y6/4^%Y22 stacks^;
!!CM:R0;

!?FU135892;
!!HEx1:C0/x16/?y1/?y2;
!!FU&y1<0:E;
!!MA:Iy1/?y3; get AI value
!!VRy4:Sy2*y3;
!!VRv7:+y4;
____________
Era II mods and utilities

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


Admirable
Omnipresent Hero
Wog refugee
posted December 17, 2014 08:37 PM

ok, here is a draft of how it will look when right-click on monsters. it shows the number of stacks, it shows if there is upgraded stack, green number is total number of monsters, right number (1-10) is about monster stack's aggression (1/compliant, 10/savage).

I have no idea what other infos to add, anyway, both # infos are disabled by default, must configure ini file to show them because I consider cheat.

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


Responsible
Supreme Hero
posted December 17, 2014 08:44 PM

It seems you have misplaced Grand Elves. They should be in the middle - [N/2], where N - number of stacks.

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

Page compiled in 0.1555 seconds