News:

MegaGlests' game mods menu let's you install many new mods. Even more are available on the MegaGlest Wiki and the Mods forum.

Main Menu

[fixed]v3.11-beta2.0: colorpicking order of dead units is wrong

Started by ctz, 2 January 2015, 17:14:18

ctz

The order of colorpicking is sometimes wrong.  It is most noticeable when you are in a battle that produces lots of dead units and you want to select/target a live unit; it seems that for colorpicking, dead units are drawn above live ones.

I can't reliably reproduce the screenshot-during-selection bug/feature, but I got screenshots anyway:
https://imgur.com/a/EIUtG

The archmages are standing on top of a pile of dead daemons, but they are below the daemons for colorpicking, making them difficult to select.

This may be related to what will pointed out in https://forum.megaglest.org/index.php?topic=9308.msg89443#msg89443 .

titi_son

this would be easy to fix:
just add
if(colorPickingSelection && unit->getCurrSkill()->getClass()==scDie) {
continue;
}

in renderer.cpp Renderer::renderUnitsFast ( line 7731 ).

[spoiler=Git diff]
--- a/source/glest_game/graphics/renderer.cpp
+++ b/source/glest_game/graphics/renderer.cpp
@@ -7728,6 +7728,10 @@ vector<Unit *> Renderer::renderUnitsFast(bool renderingShadows, bool colorPickin
                                        visibleUnitIndex < (int)qCache.visibleQuadUnitList.size(); ++visibleUnitIndex) {
                                Unit *unit = qCache.visibleQuadUnitList[visibleUnitIndex];

+                               if(colorPickingSelection && unit->getCurrSkill()->getClass()==scDie) {
+                                       continue;
+                               }
+
                                if(renderOnlyBuildings==true && unit->getType()->hasSkillClass(scMove)){
                                        continue;
                                }
[/spoiler]

But we seriously need something to render the units in the right order...
My first Tilseset: SPRING :) (included in Megaglest )


Secret Hint: To play online join the IRC #megaglest-lobby on freenode which is the lobby chat ingame. So you can chat with or wait for people in the lobby without running megaglest all the time.

titi

Something very similar to this is in git now. Sadly its not the reason for colorpicking trouble. But I changed something in another branch where I am able to use depth buffer now for colorpicking too. By this the units are rendered in the right order and maybe it fixes more of our selection problems.



Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios