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: Sun, 15 Jul 2007 21:15:25 -0400

On 7/15/07, Kai Antweiler <address@hidden> wrote:
> 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.

You should not assume that you can reproduce everything.  I believe
you have a good feeling for software design, but there are issues that
you won't have enough knowledge about.  You are probably smarter than
I was when I was your age, and canadian schools might be better than
the german school I went to, but I'm sure that you lack basic
knowledge in mathematics and computer science.
Some algorithms don't need pre-knowledge even where they are smart.  You
can learn a lot from those and do a good job.
Some algorithms need more math you learn in schools and some need more
computer science.  You will not learn much from those and the effort will
not be worth it - now.
When I read "old minimap code does high quality downscaling."
I guess that algorithm will not be good for you.

Computer science is in my opinion one of the most useful university
subjects.  If you as a teenager expect to understand anything that
a PhD like Steph wrote, then this is a delusion.


You probably know that I'm very much in favor of rewriting glob2 code.
But when you rewrite things only as a learning experience, you unnecessarily
destroy work that Steph or Nuage spent a lot of time writing and are
probably very proud of.
If you really only want to learn, you don't need to upload this kind
of code and everybody will be happy.
> 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.

You exchanged the downscaling code, didn't you?
ps:
Algorithms are somewhat different from other parts of the code.
e.g: Magic numbers don't have to be bad.  In a multi-developer-project
someone might want to change a constant.  Changing that constant might
destroy the algorithm especially if it is numerical.  It is good that
that developer
has to think about the algorithm, when he tries to change that constant.

In this case I'm not talking about magic numbers with respect to the algorithm. I'm talking about ones with respect to the positioning, the globalContainer->gfx->getW()-128+13 and such.

--
Kai Antweiler

Well anyhow I suppose I wasn't much able to think yesturday. I came to realize today that the system, for every pixel, evaluates all map-positions represented between that pixel, the one to its right, one below it, and one down-right. On a normal 128x128 map, this is most often 4 points but can be 9 points occassionally. If it finds a unit or building, it uses its assocciatted color. Otherwise, it averages the colors for the terrain/ressources, giving spots under FOW 3/5 brightness.

I'm sorry to bother people with questioning.

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

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