glob2-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [glob2-devel] Minimap algorithm


From: Bradley Arsenault
Subject: Re: [glob2-devel] Minimap algorithm
Date: Sat, 14 Jul 2007 23:17:43 -0400

On 7/13/07, Stéphane Magnenat <address@hidden> wrote:
Why did you rewrote this algorithm, that was fine and nice? I see no good
reason why you have redone it. The line update did not disturbed that much
and the minimap was over-cute.

I'm somewhat angry, and frustrated. You are not really helping by undoing work
of others that have spent hours polishing fine working code.

And to answer your question, yes, the old minimap code does high quality
downscaling.

Steph

The idea is not to rewrite the minimap, merely to move it elsewhere and reorganize it. It uses the same logic, same colors, and I started by copying the old algorithm to the new source file.

I then moved on to remove the calls to Utilities::computeMinimapData (since if Minimap is a class now, it should be all in one). Then I tried to seperate the logic portion from the drawing portion, so that both sides would be decoupled and easier to maintain. I finalized on a system that gave a color for each point on the map ahead of time, since, by the original logic, each place on the map is one color, the system just mixed between them in an intersting mechanism to give each pixel its color.

I wasn't too sure about how the mixing itself worked, so I tried interpolation, whiching is something I knew how to do, producing noticably worse results. I came here to see how the original algorithm worked, so that I can properly re-implement it with logic and render still seperated.

===

For me, its not about rewriting bad code, and I'm certainly not trying to undo others work. I came here, to find out just how the others did it, so that I can reproduce their good results.

My venture, in this case, is to centralfy Minimap. It consisted of a draw function in Game, a computeMinimapData function in Utilities, code in GameGUI for converting between a mouse-click cordinate on the minimap to a Map cordinate (which is also copied in the MapEditor), plus all of the magic numbers related to positioning the minimap, and its borders, on the screen.

The combination of logic and rendering is less of an issue, and If no one will tell me how the old system works I will ultimitly revert to using it. I still think, though, that seperating the logic for a positions minimap value (if enemy unit on point x, it will be colored with the enemy unit color), and how its rendered (enemy unit color is this, and it will go here on ths creen) would go a short distance to make minimap more maintainable.

--
Really. I'm not lieing. Bradley Arsenault.
reply via email to

[Prev in Thread] Current Thread [Next in Thread]