Notes |
|
(0000100)
|
Boulie
|
2009-10-13 11:26
(edited on: 2009-10-13 15:33) |
|
chcialem edytowac ze to tyczy archery penalty ale nie wiem jak
EDIT:
@Zamolxis-> Yes, I wanted to edit my added bug to write it refer to archery penalty but I can't or I do not know how can I do it.
|
|
|
(0000101)
|
Zamolxis
|
2009-10-13 15:14
(edited on: 2009-10-13 17:36) |
|
As I think you already guessed correctly in the note above, range penalty is indeed not implemented yet (AFAIK).
EDIT: Report description & severity updated.
|
|
|
(0000947)
|
Boulie
|
2010-06-08 14:04
|
|
So if now we have implemented ranged penalty I need to write few difference between OH3 and VCMI.
1. Range should have 10 hexes not like it is now 8 hexes, damage penalty should start from 11th hex.
2. If we have 2-hex unit to which we aim and her closer hex is in range, there should be no damage penalty on both hexes (10th and 11th) - no broken arrow. Now on further hex is broken arrow, but dmg is shown and dealt ok.
Added new screenshot
PS> Nice that dmg calculation seems to be ok, now. |
|
|
|
Thanks Boulie for the above. I did have a strong feeling the no-penalty range is smaller in VCMI, but I didn't know the actual OH3 values. |
|
|
(0000953)
|
Boulie
|
2010-06-11 12:59
|
|
One more think I didn't noticed before. Range is not a vertical line but radius.
Added one more screenshot. |
|
|
|
Distance penalty has been implemented in 0.81, additionally I've corrected the formula for distance in rev 1658. Please reopen if it's still wrong, I haven't checked it in-game, but the formula seems to be correct. |
|
|
(0001186)
|
Boulie
|
2010-07-27 07:16
|
|
Still wrong. If radius is implemented so the distance is 15 hexes.
Also point 2 from comment 947 isn't implemented.
Added one more screen.
PS> same was in 081b and now is in 081c |
|
|
(0001195)
|
Tow
|
2010-07-27 13:02
|
|
@Boulie
If something that was marked as fixed still doesn't work, please reopen the issue (eg by changing status to feedback). Then we'll be easily able to see that something is wrong.
|
|
|
|
hopefully (again) resolved in rev 1699. Here is the code for determining the penalty:
si8 BattleInfo::hasDistancePenalty( int stackID, int destHex )
{
const CStack * stack = getStack(stackID);
struct HLP
{
static bool lowerAnalyze(const CStack * stack, int hex)
{
int xDst = std::abs(hex % BFIELD_WIDTH - stack->position % BFIELD_WIDTH),
yDst = std::abs(hex / BFIELD_WIDTH - stack->position / BFIELD_WIDTH);
int distance = std::max(xDst, yDst) + std::min(xDst, yDst) - (yDst + 1)/2;
//I hope it's approximately correct
return distance > 10 && !stack->hasBonusOfType(Bonus::NO_DISTANCE_PENALTY);
}
};
const CStack * dstStack = getStackT(destHex, false);
if (dstStack->doubleWide())
return HLP::lowerAnalyze(stack, destHex) && HLP::lowerAnalyze(stack, dstStack->occupiedHex());
else
return HLP::lowerAnalyze(stack, destHex);
}
I'm not sure about it but I'd like to avoid writing BFS. |
|
|
(0001237)
|
Boulie
|
2010-07-29 13:47
|
|
Nice ;) Tomorrow I'm starting learning C++ so I try before final version of VCMI (1.0 ) understand the code you attached ;)
and what is BFS?
this one is the most inspiring
"int distance = std::max(xDst, yDst) + std::min(xDst, yDst) - (yDst + 1)/2;" |
|
|
(0001298)
|
Boulie
|
2010-08-06 14:01
(edited on: 2010-08-06 14:17) |
|
OK! I felt that something wrong is with this formula.
{
int xDst = std::abs(hex % BFIELD_WIDTH - stack->position % BFIELD_WIDTH),
yDst = std::abs(hex / BFIELD_WIDTH - stack->position / BFIELD_WIDTH);
int distance = std::max(xDst, yDst) + std::min(xDst, yDst) - (yDst + 1)/2;
}
Fast learning C++ by doing a lot of tests in VCMI (I think it took me more than 2 hours;) and I have the results.
See attached screenshot .
It is nearly ok but it depends from the row in which shooting stack is.
On the screenshot you have marked which row is wrong for red or blue player.
Also there is example for one of the Blue player's Cyclops. (with exclamation marks). Note that there is 11-hexes radius. In straight line (stack are in the same row) it is ok (broken arrow) but for one rows up and down it is full arrow. Next row is broken, next row is full.but in every row arrow should be broken.
I've added the test map with this creatures. You can try it. Run it in MP and attack Christian (red) vs Sir Mullich (blue).
PS.
Also aiming in the 2 hex stack is wrong. If first hex(head) is 10th (so there is full arrow) also on the 11th hex should full arrow.
I hope it is more less clear - it was hard for me to explain it in English. ;)
If you don't follow my bad English I can write it in Polish.
|
|
|
(0001299)
|
Warmonger
|
2010-08-06 17:32
(edited on: 2010-08-06 17:34) |
|
Why don't you just use formula from creature movement? If a target is 10 tiles away, it's position will be in range of flying creature with speed 10.
|
|
|
(0001300)
|
Boulie
|
2010-08-06 22:27
|
|
Yes Wormonger! You are right! I will use it but I don't know this formula, yet ;)
Ofc a little joke.
@Tow - do it! ;) |
|
|
(0002942)
|
Tow
|
2012-08-28 12:32
|
|
Should be finally fixed in r2853.
I found a new formula and double checked it. |
|