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»
bloodsucker
bloodsucker


Legendary Hero
posted February 23, 2014 02:55 PM

ME: It would be mainly a trivia for newcomers? I guess so.

Or maybe not.

It's is said in the Tribute document that: "Clones are immune to the retaliatory damage of Fire Shield."
Base your tactic on this information and think that computer will have to move one unit to dispel the SA clone that attacked the magogs on an Inferno battle with efreets present and see what happens.

Who knows how many HP's a SA ressurects?


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


Admirable
Omnipresent Hero
Wog refugee
posted December 14, 2014 11:53 PM
Edited by Salamandre at 00:04, 15 Dec 2014.

Is there a precise formula about neutrals split, and does it depends also on map location and size?

I would like to make a wog mod showing the exact forces and split you will fight, depending on the way you also modify your split, sorta dynamic infos on right-click. Is it possible to come with an accurate result or there is still some randomness, and also how to determine if a stack will have upgrades?

From opening post manual:

The number of stacks you will face depends on the strength of your army and the tile the battle takes place:
Army’s strength compared to enemy Enemy stacks in battle based on tile type (this would need more explanation?)
0 – 50%        7  
50 – 67         7
67 – 100% 6
100 – 150% 5
150 – 200% 4
> 200%         3

Any know what stats are used to calculate strength?


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


Known Hero
posted December 15, 2014 09:26 AM
Edited by kicferk at 09:29, 15 Dec 2014.

To start with, calculating army strength.

From Tribute to Strategies:

Hero strength = sqrt([(1 + 0,05 * Attack) * (1 + 0,05 * Defense)])
Army strength = sum of all creatures' AI values in hero's army
Total army strength = round down (Hero power * Army power)

Now, to explain the "tile dependancy" thing.

Whether the stack will have an upgrade or not depends on its coordinates on the map. I am pretty sure I have seen a non-trivially looking map with tiles of "upgraded" and non-upgraded creatures. It is likely to differ for different map sizes. If it is of any help, it looked like the formula for it was of the form:

distance = round down (sqrt((x0-x)^2 + (y0-y)^2))
where x,y are coordinates of monsters and x0,y0 are coordinates of some point outside the grid, with x0,y0<0.
If distance is odd, it has upgrade, if even it does not.
Note that it is only a sketch and speculation on my part.

Whether a stack will have an upgrade seem to depend solely on that. Which brings me to last thing. What you have there with percentages and number of stacks is valid, but it is only a part of truth. There are 3 cases.
                case1     case2     case3
0 –   50%         7         7         6
50 –  67           7         ...
67 –  100%       6         ...
100 – 150%       5         ...
150 – 200%       4         ...
> 200%          3         2         1

I can't remember or find the ones inbetween, but the point is, I don't know of any factor determining which case it is. But, the "caseness" of a stack does not change throughout the game. Meaning that if you attack with a single pixie and see 6 stacks, you can be sure that you will get 1 stack if you attack with 10k azure dragons.

Because of problematic determination of both exact number of stacks and whether there will be any upgraded creatures in fight, I think you would need to simulate a battle with neutrals to get what you want. Say, silently teleporting a hero with huge army, making him attack, before battle starts get all stacks, and numbers, then flee. Or doing the same on the first day for every fixed monster on the map and store it in some kind of a database. The latter would probably require to use some kind of file outside of game to store the data you received, or to use a lot of variables. In any case, if there was upgraded stack in there, remember to increase numbers of monsters by number of upgraded ones, as they will disappear.

Cheers

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


Admirable
Omnipresent Hero
Wog refugee
posted December 15, 2014 10:49 AM

Thanks. The last solution is not good as would require an immense work around and game-play time. But if tiles having upgrades are always the same (supposing there is a given pattern) I can use erm to isolate them.

One thing is not clear. You say total army strength is Hero power * Army power. Does this mean hero strength * army strength or power is a new variable here?


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


Promising
Legendary Hero
fallen artist
posted December 15, 2014 11:02 AM

Quote:
Whether the stack will have an upgrade or not depends on its coordinates on the map. I am pretty sure I have seen a non-trivially looking map with tiles of "upgraded" and non-upgraded creatures. It is likely to differ for different map sizes. If it is of any help, it looked like the formula for it was of the form:

distance = round down (sqrt((x0-x)^2 + (y0-y)^2))
where x,y are coordinates of monsters and x0,y0 are coordinates of some point outside the grid, with x0,y0<0.
If distance is odd, it has upgrade, if even it does not.
Note that it is only a sketch and speculation on my part

Thanks, will need to implement this.
Quote:
Whether a stack will have an upgrade seem to depend solely on that. Which brings me to last thing. What you have there with percentages and number of stacks is valid, but it is only a part of truth. There are 3 cases.
               case1     case2     case3
0 –   50%         7         7         6
50 –  67           7         ...
67 –  100%       6         ...
100 – 150%       5         ...
150 – 200%       4         ...
> 200%         3         2         1

I can't remember or find the ones inbetween, but the point is, I don't know of any factor determining which case it is

Aww, that's bad. Because currently only 1st case is implemented in VCMI :/
____________
The future of Heroes 3 is here!

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


Known Hero
posted December 15, 2014 12:01 PM
Edited by kicferk at 12:05, 15 Dec 2014.

Salamandre said:

One thing is not clear. You say total army strength is Hero power * Army power. Does this mean hero strength * army strength or power is a new variable here?




Well, I copied it from the tribute, it should be hero strength * army strength to avoid confusion. In original "diplomacy internals" it was written "power", but there was no clearly defined way of calculating base army power, so I guess that is why the name is different

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


Admirable
Omnipresent Hero
Wog refugee
posted December 15, 2014 12:15 PM

ok thanks. I will start some tests, as erm has also fight value, adventure map value, then AI value, need to see which of them applies.

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


Known Hero
posted December 15, 2014 12:31 PM
Edited by kicferk at 12:32, 15 Dec 2014.

Ok, found splitting in Tribute:
page 36

Army's strength compared to enemy Enemy stacks in battle based on tile type
0 - 50%     7 7 6
50 - 67%    7 6 5
67 - 100%  6 5 4
100 - 150% 5 4 3
150 - 200% 4 3 2
> 200%     3 2 1

AI values are on page 25.
Cheers

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


Responsible
Supreme Hero
posted December 15, 2014 03:18 PM

In regard to upgraded stacks, you can use this info. If you need the exact coefficients for bigger maps, I'll provide them.

The splitting problem also can be solved in a similar fashion, if you wish.

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


Known Hero
posted December 15, 2014 03:57 PM
Edited by kicferk at 16:16, 15 Dec 2014.

That was a picture I referred to, but it looked different in my memories Anyway, it means that the formula I wrote upwards does not make sense, sorry

Also, Warmonger, AlexSP provided a formula you can use in one of his posts there. I doubt it was the source idea, I would be guessing that they used coefficients in form of fractions with primes in denominators, but it seems to be good enough estimate

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


Responsible
Supreme Hero
posted December 15, 2014 04:31 PM
Edited by AlexSpl at 22:41, 15 Dec 2014.

No, they used a RNG with a seed based upon coordinates.

Here are the exact coefficients:

a = 196143423 / 65536
b = 928924629 / 65536
c = 348991063 / 65536
d = 2148842073 / 65536

You can also use the condition in the following form:

(((a*x + b*y + c*z + d) >> 0x10) & 0x7fff) % 100 < 50.

Here you should use nominators only, though. For example, a = 196143423, and so on.

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


Responsible
Supreme Hero
posted December 15, 2014 05:08 PM
Edited by AlexSpl at 17:18, 15 Dec 2014.

Quote:
As you have "& 0x7fff" operation here, you may not even care for high words of operands when multiplying. Thus, you can simplify coefficients a little:

instead of

a = 0x0BB0E93F
b = 0x375E43D5
c = 0x14CD2E57
d = 0x8014BA59

you can use

a = 0x0E93F = 59711
b = 0x43D5 = 17365
c = 0x2E57 = 11863
d = 0x0BA59 = 47705

You can simplify it even further if you want, but I think 4 bytes have enough room even for the largest product possible.


Oh, I'm sorry. I've missed the ">> 0x10" part, so the above calculations won't be valid.

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


Responsible
Supreme Hero
posted December 15, 2014 05:27 PM
Edited by AlexSpl at 22:26, 15 Dec 2014.

So, you have to stick with floating point numbers unless you allow overflows use 64 bit integers.

* * *

However, you can use even 32 bit integers, provided you allowed overflows, due to the "& 7fff" operation.

See this:

64 bit integers
0x1234567890ABCDEF >> 0x10 = 0x1234567890AB
0x1234567890AB & 0x7FFF <=> 0x90AB & 0x7FFF

32 bit integers
0x90ABCDEF >> 0x10 = 0x90AB

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


Admirable
Omnipresent Hero
Wog refugee
posted December 15, 2014 08:09 PM

Is this algorithm translatable in erm so I can design a accurate model for, no matter the size of the map? Because right now I am really lost, I appreciate the exhaustive information but my maths are nowhere near understanding that...
____________
Era II mods and utilities

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


Responsible
Supreme Hero
posted December 15, 2014 09:46 PM

Can you operate with floating point numbers in ERM?

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


Admirable
Omnipresent Hero
Wog refugee
posted December 15, 2014 09:56 PM
Edited by Salamandre at 22:07, 15 Dec 2014.

ok, this is complete unknown concept to me, and while I browse google to see what's about, I will just paste what erm says (probably you mean non integers?):


All numeric variables are integer variables and have a range of -2147483647...+2147483647
e1..e100 Function floating point variables
e-1..e-100 Trigger local floating point variables
'f'..'t' Standard variables ('quick variables')
v1..v1000 Standard variables
w1..w100 Hero variables
w101..w200 Hero variables
x1..x16 Function parameters
y1..y100 Function local variables
y-1..y-100 Trigger-based local integer variables
z1..z1000 String variables
z-1..z-10 Function local string variables

and:

Convert a string to an integer or floating point value
  @ is any integer (f...t,v#,w#,x#,y#) or floating point (e) variable.
  z$ - a var that is a source; may be standard, local or extended z
Comments:
You may use a ...e... syntax (engineering fl.p. format).
If value may not be converted it is set to 0.
Leading or trailing space characters are ignored.
Example:

ZVSE
!!VRz1:S^123^;
!!VRv1:Vz1; v1 = 123
!!VRz1:S^+123^;
!!VRv1:Vz1; v1 = 123
!!VRz1:S^-123^;
!!VRv1:Vz1;v1 = -123
!!VRz1:S^.325^;
!!VRe1:Vz1;e1 = 0.325
!!VRz1:S^-1.25e+1^;
!!VRe1:Vz1;e1 = -12.5 (-1.25 * 10^1)

However I NEVER saw this syntax used in any mod. Would be interesting to try.

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


Responsible
Supreme Hero
posted December 15, 2014 10:15 PM
Edited by AlexSpl at 22:17, 15 Dec 2014.

Well, can you calculate in ERM:

a) [3.99] = 3 (integer part of a number);
b) 22 mod 7 = 1 (remainder, or modulo)?

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


Admirable
Omnipresent Hero
Wog refugee
posted December 15, 2014 10:27 PM

Remainder yes, for example we have this:

!!VRy2:Sc%7; [Get day of the week]

For integer, I am not sure we can write in erm such numbers as 3.99. They are automatically rounded if they are the result of arithmetic operations, but I see no way to write them down.
____________
Era II mods and utilities

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


Responsible
Supreme Hero
posted December 15, 2014 10:32 PM
Edited by AlexSpl at 22:32, 15 Dec 2014.

Can you, say, show in a dialogue the following product:

1/4 * 1/5?

(1/20 = 0.05)

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


Admirable
Omnipresent Hero
Wog refugee
posted December 15, 2014 10:34 PM

No, because at first I can't write in erm non integers values. They are rounded down if the result of integers operations, but game will not recognize for example:

!!VRv1:S1.5;set v1 to 1,5 value
____________
Era II mods and utilities

 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.0983 seconds