Notes |
|
|
I insist to include this feature. Similair feature is also in H5 I believe. Shading the hexes is just for not having to count them, and I many times in H3 had to count hexes to know to be out of meele fighter range.
|
|
|
(0002407)
|
ench0
|
2012-05-07 16:59
|
|
I added a screenshot. Here's the explanation:
- The currently active unit are my Red Snakes (100). This is indicated by the greenish runic-like aura underneath them.
- My mouse pointer is over the enemy Ghosts (2). Don't mind the ugly mouse pointer, I added it manually for illustration purposes, coz the screenshot does not capture the mouse. As u can see moving the mouse over the enemy units hides the movement shadow of my Snakes and displays a shadow for the ghosts, showing how far the ghosts would move when their turn comes. |
|
|
(0002423)
|
ench0
|
2012-05-14 13:07
|
|
I added a patch which displays a movement shadow when mouse is hovered over a stack. I started a couple battles and it seems to be working as supposed to.
It works WITHOUT hiding the shadow of the active stack so the two may be present on the map at the same (and may even be overlapping). IMO it looks fine for a first-cut of the feature, but adding a couple of different shadow BMPs for the enemy units and for the friendly units would make it look better...
...btw if anyone could point me to where these BMPs are located they could save me some debugging time :) I mean this line in client/BattleInterface/CBattleInterface.cpp:
cellShade = BitmapHandler::loadBitmap("CCELLSHD.BMP"); |
|
|
(0002428)
|
Ivan
|
2012-05-14 16:51
(edited on: 2012-05-14 21:45) |
|
You mean location of bmp files on disk?
Bitmap handler loads them from VCMI/Data/H3Bitmap.lod
You can use MMArchive to extract them: http://wogarchive.ru/file.php?id=119 [^] (Only for Windows, but works in wine)
Some thoughts about patch:
- It should check for if movement shadow enabled in options
- To change transparency without any additional images:
cellShade->format->palette->colors[4].unused = 128;
128 - default, 255 - transparent, 0 - opaque
!!!
- There is crash at the end of battle.
!!!
I'll leave patch to somebody else (Warmonger?) but I like this feature.
|
|
|
(0002475)
|
ench0
|
2012-05-17 16:36
|
|
1. When I tested the patch the game did NOT crash at the end of the battle.
2. On the next day (and on another machine) it DID crash at the end of the battle.
3. Today (tag 2686) vcmi crashes as soon as I try to start a scenario...
Unfortunately I do not remember what I first tested with, I think it was at 2661 or 2663.
There may very well be some problem with my code but I need to be able to start a scenario and enter a battle to debug :) I will be looking into this in the next few days and as soon as there is a working release will try to verify whether my patch is causing any problems at the end of the battle... |
|
|
(0002476)
|
Ivan
|
2012-05-17 16:52
|
|
Hmm... 2686 works fine for me. Can you post stacktrace of crash?
Or at least try with rev. 2684:
svn update -r 2864 |
|
|
|
Implemented patch in r2704. Thanks! |
|
|
(0002529)
|
ench0
|
2012-05-23 13:33
|
|
I finally managed to find some time to look into this today and I saw that Wamonger has taken my patch in as-is, so I guess it was not the cause of the problem? Or at least is not easily reproducible... It certainly is not happening for me today in Revision:2707. |
|
|
(0002579)
|
ench0
|
2012-05-28 08:24
(edited on: 2012-05-28 08:35) |
|
Adding a patch and a BMP hex image to color enemy shadow a bit differently...
The BMP uses color 2 (0-based) from the original palette, hence the name CCELLSH2.BMP. I thought it may be important to preserve the 8.3 filename format...
The patch displays the enemy shadow in a slightly lighter shade than the current unit's shadow. Thus it is easier to see where the two shadows intersect and which is your unit vs. the other unit.
This is not the ideal solution, e.g. it would be much cooler to color the enemy shadow with some reddish color (you know - enemy... red...). However I have nott not looked yet into how exactly the CSDL_Ext::blit8bppAlphaTo24bpp function does its magic so I am not sure how exactly to make it display a red semi-transparent shade...
Nevertheless this is an improvement of my original impl. so please let's take it in for the time being, if there's no objections regarding the code.
|
|
|
(0002580)
|
ench0
|
2012-05-28 08:34
|
|
oh and I need to add a check for what Ivan said:
>>It should check for if movement shadow enabled in options
So I will add one more patch here for this as well. |
|
|
(0002581)
|
Ivan
|
2012-05-28 08:45
|
|
Red (or any other non-gray) may not work. Red can be difficult to see for example on lava or fire fields, green won't work on grass or magic plains.
>> I am not sure how exactly to make it display a red semi-transparent shade...
I am not sure how to do this at all. Check CSDL_Ext::alphaTransform - it will change first 8 colors into semi-transparent colors |
|
|
(0002582)
|
ench0
|
2012-05-28 09:11
|
|
Thanks for the tip Ivan, I look there.
Before doing this I also took a (very quick) look at the CDSL_Ext functions, saw that it is somewhat complex, decided that it's not something I can do in 30 minutes on a Monday morning and instead made the quick fix above :) (using color 2 from the palette). I'll look at this in more detail as soon as I have a little more free time...
In the mean time:
- the uploaded file colorize-enemy-move-shadow.02.patch is an incremental patch to only display the enemy movement shadow when movement and cursor shadows are enabled in the battle interface... |
|
|
(0002584)
|
Tow
|
2012-05-28 22:49
|
|
> I am not sure how to do this at all. Check CSDL_Ext::alphaTransform - it will change first 8 colors into semi-transparent colors
Alpha transform just replaces first 8 colors in palette with transparent (or shady) black. You can't have transparent non-black colors with it.
However if you save 8bpp picture with transparent colors in palette (and not using the first, reserved colors), then it should "just work" with or without any transforms, if blitted with blit8bppAlphaTo24bpp. |
|
|
(0002598)
|
Tow
|
2012-06-01 17:23
|
|
Second patch committed in r2738. |
|
|
(0002691)
|
ench0
|
2012-06-15 12:01
|
|
Um, Tow... part-2 of this feature didn't actually make into the trunk.. sorry may have been my mistake due to not knowing the proper way of submitting patches or maybe I didn't explain it properly..
To get this in, both patch files (colorize-enemy-move-shadow.01.patch and colorize-enemy-move-shadow.02.patch) need to be applied, incrementally. Atm, it seems that only patch 02 has been applied.
And also the BMP file also needs to be added somehow to the resources - something which I also was not sure at all how you do it so I left it for someone more knowledgeable to decide how to go about this. On my machine I just added it to h3bitmap.lod with MMArchive but this is probably not the proper way..
I will wait a few days to see if anyone comments here and then will change status to unresolved again, to draw attention... |
|