|Anonymous | Login | Signup for a new account||2013-05-19 16:43 CEST|
|Main | My View | View Issues | Change Log | Roadmap|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0000948||VCMI||GUI - Battles||public||2012-05-04 11:38||2012-06-15 14:01|
|Target Version||Fixed in Version||0.89|
|Summary||0000948: Add enemy unit movement shadow (like in King's Bounty - The Legend )|
|Description||In the new King's Bounty (KB - The lgened and KB - Armored Princess) games there is a very neat feature, which I think would be great to add to VCMI.|
In the battle, when you place the mouse over an enemy unit it turns off your current unit movement shadow and displays a shadow for the enemy unit (i.e. tells you how far this enemy unit would move in its turn).
A variant (perhaps slight improvement) of this feature would be to display a movement shadow for the the enemy unit without hiding your current unit's movement shadow. Perhaps display enemy's shadow with a slightly different color (reddish?). This way you could easily see how far you can move your unit without it being reachable by the enemy unit.
|Additional Information||I will see if I can add a KB screen shot here to illustrate this featrue request|
|Tags||No tags attached.|
|Attached Files|| kb-enemy-movmt-shdw-256.bmp [^] (397,870 bytes) 2012-05-07 18:54|
show-enemy-move-shadow.01.patch [^] (1,328 bytes) 2012-05-14 15:01 [Show Content]
CCELLSH2.bmp [^] (3,572 bytes) 2012-05-28 10:25
colorize-enemy-move-shadow.01.patch [^] (2,053 bytes) 2012-05-28 10:25 [Show Content]
colorize-enemy-move-shadow.02.patch [^] (969 bytes) 2012-05-28 11:04 [Show Content]
edited on: 2012-05-04 15:53
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.
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.
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");
edited on: 2012-05-14 23: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.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.
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...
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!|
|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.|
edited on: 2012-05-28 10: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.
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.
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
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...
> 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.
|Second patch committed in r2738.|
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...
|2012-05-04 11:38||ench0||New Issue|
|2012-05-04 15:53||majaczek||Note Added: 0002401|
|2012-05-04 15:53||majaczek||Note Edited: 0002401||View Revisions|
|2012-05-07 18:54||ench0||File Added: kb-enemy-movmt-shdw-256.bmp|
|2012-05-07 18:59||ench0||Note Added: 0002407|
|2012-05-14 15:01||ench0||File Added: show-enemy-move-shadow.01.patch|
|2012-05-14 15:07||ench0||Note Added: 0002423|
|2012-05-14 15:08||ench0||Note Added: 0002424|
|2012-05-14 15:08||ench0||Status||new => feedback|
|2012-05-14 15:51||ench0||Note Edited: 0002424||View Revisions|
|2012-05-14 15:51||ench0||Note Deleted: 0002424|
|2012-05-14 18:51||Ivan||Note Added: 0002428|
|2012-05-14 19:11||Ivan||Note Edited: 0002428||View Revisions|
|2012-05-14 19:13||Ivan||Note Edited: 0002428||View Revisions|
|2012-05-14 23:45||Ivan||Note Edited: 0002428||View Revisions|
|2012-05-17 18:36||ench0||Note Added: 0002475|
|2012-05-17 18:36||ench0||Status||feedback => new|
|2012-05-17 18:52||Ivan||Note Added: 0002476|
|2012-05-22 10:28||Warmonger||Assigned To||=> Warmonger|
|2012-05-22 10:28||Warmonger||Status||new => assigned|
|2012-05-22 12:16||Warmonger||Note Added: 0002518|
|2012-05-22 12:16||Warmonger||Status||assigned => resolved|
|2012-05-22 12:16||Warmonger||Fixed in Version||=> 0.89|
|2012-05-22 12:16||Warmonger||Resolution||open => fixed|
|2012-05-23 15:33||ench0||Note Added: 0002529|
|2012-05-24 17:20||Ivan||Relationship added||related to 0000966|
|2012-05-28 10:24||ench0||Note Added: 0002579|
|2012-05-28 10:24||ench0||Status||resolved => feedback|
|2012-05-28 10:24||ench0||Resolution||fixed => reopened|
|2012-05-28 10:25||ench0||File Added: CCELLSH2.bmp|
|2012-05-28 10:25||ench0||File Added: colorize-enemy-move-shadow.01.patch|
|2012-05-28 10:33||ench0||Note Edited: 0002579||View Revisions|
|2012-05-28 10:34||ench0||Note Added: 0002580|
|2012-05-28 10:34||ench0||Status||feedback => assigned|
|2012-05-28 10:35||ench0||Note Edited: 0002579||View Revisions|
|2012-05-28 10:45||Ivan||Note Added: 0002581|
|2012-05-28 11:04||ench0||File Added: colorize-enemy-move-shadow.02.patch|
|2012-05-28 11:11||ench0||Note Added: 0002582|
|2012-05-29 00:49||Tow||Note Added: 0002584|
|2012-06-01 19:23||Tow||Note Added: 0002598|
|2012-06-01 19:23||Tow||Status||assigned => resolved|
|2012-06-01 19:23||Tow||Resolution||reopened => fixed|
|2012-06-15 14:01||ench0||Note Added: 0002691|
|Copyright © 2000 - 2012 MantisBT Group|