Discussion:
Visualizing history of evolved warrior ! ;) (icon thoughts)
(too old to reply)
Skybuck Flying
2009-02-20 08:25:39 UTC
Permalink
Ok, here my thoughts/icon thoughts/experiences with the warrior icons:

Assigning the "instruction code" to red is no good !

This would create warriors with only a red shade....

I would like instructions to have distinct colors like green blue yellow
etc.

So I'll have to come up with something better...

However it should be a quick function...

So I guess a lookup table or so to quickly get an instruction color would be
nice !

But I also need some kind of formula to apply to maybe instruction modifiers
! ;)

But for now... just getting each instruction clearly visible would already
be highly usefull ! ;)

Dirty question:

How many fucking distrinct different colors are there ?

(My color knowledge is weak ! :))

MUST UPDATE MY COLOR KNOWLEDGE ?! :)

Color newsgroup gonna be included ! ;)

Graphics and color newsgroup added.

Question for you color experts:

Say I need 19 different totally distinct colors out of 16 million (r,g,b)
what would be a good formula for this ?

Bye,
Skybuck.
Skybuck Flying
2009-02-20 09:52:50 UTC
Permalink
Ok some color theory of my own:

First of all there are 3 dimensions so to speak:

The Red, The Green and The Blue.

And thus this basic color space is a cube.

And cube's have 4 points on the bottom and 4 points on the top.

So with a cube it's possible to have 8 totally different colors ?

The number of instruction is about 19 or so...

So I guess getting a good color spread is maybe trying to transform the cube
into some other kind of multi dimensional object but maybe that's a bit hard
to imagine ?

But it does give some clue's to a possible algorithm.

Hmmm... One question one could ask is: How to transform between
dimensions...

Anybody having done graphics knows how to do this:

It's quite simple:

Z * SecondDimensionSize * FirstDimensionSize + Y * FirstDimensionSize + X;

So this can simply be extrapolated to multiple dimensions.

However my base dimension is not 1D... it's actually 3D does this matter ?

No it does not... since a color is simply red, green, blue, or just an
integer.

So it's already doing these kind of transformations.

However how to best divide 19 into X dimensions ?

Hmmm...

Euh dimensions could even have their own size... but for now... let's assume
they are all equal in size.

If I want 19 distrinct colors...

Question is... how many distinct colors are there for 3 dimensions... the
answer was 8 ?

8 corners ?!

Why are there 8 corners ?

Aha !

A single dimension has 2 corners ! (Which is kinda logical... start and end)

So multi dimensions multiple the number of corners !

Therefore a cube has 8 corners:

2 * 2 * 2 = 8 corners !

So the next dimension has 16 corners ! 4D.

So the next dimension has 32 corners ! 5D.

5D will fit the 19.

But lot's of spillage going on ?

Maybe I can multiple the instruction code by something to shift it nicely
onto the corners:

Yeah.

32 corners divided by 19 = 1.6842105263157894736842105263158.

So to "map" each instruction onto it's "corner" simply multiple by that
number.

The funny thing is that the binary code actually describes the corner
coordinates in multi dimensional space ! yeah ! =D

The first bit describes the corner of the first dimension.
The second bit describes the corner of the second dimension.
The third bit describes the corner of the third dimension.
The fourth bit describes the corner of the fourth dimension.
The fith bit describes the corner of the fith dimension !

Awesome I never knew that ! super cool ! ;)

Anyway

Once I have these bits... it should become possible to simply look up the
correct value by doing:

Color[1d][2d][3d][4d][5d]

However... this could just be a lookup table of 0..31.

So now the remaining question is how to map 16 million colors to 5
dimensional space.

16 million colors is 24 bits.

the 5 bits describe the outer most corners...

Interpolating between these bits would give 0....1

So a floating point lies between them.

Now all I have to do is multiple the 5 bits... by x bits to create 24 bits.

24 bits divide by 5 bits = 4.8 "bits".

So each dimension needs to receive 4.8 bits in between.

So that's something like:

1 / 4.8 = 0.20833333333333333333

So if I simply walk across all 16 million colors...

I start with zero... and then I slow add 0.2083333 then if all goes
correctly... it should end up with 16 million colors spread across a color
space of 5D which was kinda spread across 19.

So maybe I took a detour... I already thought about this in the past in a
thread not so long ago. But I am not sure if that theory was correct... but
this once seems nice ?! and correct ?!

Ofcourse I can't walk across 16 million colors that would take ages.

I need a formula... that simply produces 19 distinct colors to start with...

It would also be nice to interpolate between them... for the modifiers...
but then I could just increase the number of distinct colors required. (by
multiplieing codecount * modifiercount)

The big question is do I now have a formula to calculate the correct 24 bit
color ?

I think so:

input can be 0, 1, 2, 3, 4, 5, 6, 7, 8 etc to 19.

This first needs to be converted to 32 by multiplieing it by the number
1.68etc.

This gives the 5 dimensional number which is 5 bits.

This is an coordinate which represents the corner of the multi dimensional
color space.

So now "we" have 5 numbers which is the coordinate:
[5d][4d][3d][2d][1d]

all are 0 or 1.

Now to understand what the 16 million/24 bit value/coordinate is we simply
had to apply the multi dimensional formula:
etc + 2d * DimensionSize * SecondDimensionSize * FirstDimensionSize + 2d
*DimensionSize +FirstDimensionSize + 1d * DimensionSize; (See below how I
came to this improvement: )

So it's quite easy to see what we have to do.

The number of bits required for each dimension was 4.8.

So the first dimension multiplier is: 2^4.8 =
27.857618025475972452360640559352
So the second dimension multiplier is: (2^4.8)^2 =
776.0468820533238181617970182689
So the third dimension multiplier is: (2^4.8)^3 =
21618.817610103099545583648296626
So the fourth dimension multiplier is: (2^4.8)^4 =
602248.76314468548964443852467231
So the fiveth dimension multiplier is: (2^4.8)^5 = 16777216

Another easier way to come to this conclusion/number is as follows:

The original color space was 3 dimensions... each dimension having a range
from 0 to 255... so that's 256 elements.

The linear dimension size is therefore: 256^3.

Now to reverse this is doing: (256^3) ^ (1/3) = ...

1/3 = 1/dimensions

So to understand what the dimension range is for 5d is simply:

^ 1/5

So to redistribute 256^3 "we" simply do:

(256^3) ^ (1/5) = 27.857618025475972452360640559352

Exactly same number which proves my theory I guess ! WIEEEEEEEEEEEEEEEE =D

So now let's see if it hold up:

Suppose the coordinate was 1,1,1,1,1

The linear value should be close to 2^24...

Which is actually proven above.... 1 to 27.857618025475972452360640559352 is
the dimension range.

So this means:
27.85, 27.85, 27.85, 27.85, 27.85

If you multiply these together you ll get 27.85^5 which is close to 2^24.

So now I have a very simply method to convert 0 to 31 to a color space of 5d
which is then mapped to 3d.

So steps are quite simple:

19 * 1.68 to convert to 5d color coordinate.

Which is 0..31...

Then extract every bit... out of those 5 bits... and covert them to the
values above...

Then perform the lineair calculation for the multipliers.

Example in 3D space:

(B * 256 * 256) + (G * 256) + R

So this would be samiliar to:

<- etc (3D * 27.8) * 27.8 * 27.8 + (2D * 27.8) * 27.8 + (1D * 27.8).

And that ladies and gentlemen concludes this Skybuck's multi-dimensional
color space theory ! ;) =D

YEAH =D

Bye,
Skybuck =D
Skybuck Flying
2009-02-20 10:00:12 UTC
Permalink
Post by Skybuck Flying
The Red, The Green and The Blue.
And thus this basic color space is a cube.
And cube's have 4 points on the bottom and 4 points on the top.
So with a cube it's possible to have 8 totally different colors ?
The number of instruction is about 19 or so...
So I guess getting a good color spread is maybe trying to transform the
cube into some other kind of multi dimensional object but maybe that's a
bit hard to imagine ?
But it does give some clue's to a possible algorithm.
Hmmm... One question one could ask is: How to transform between
dimensions...
Z * SecondDimensionSize * FirstDimensionSize + Y * FirstDimensionSize + X;
So this can simply be extrapolated to multiple dimensions.
However my base dimension is not 1D... it's actually 3D does this matter ?
No it does not... since a color is simply red, green, blue, or just an
integer.
So it's already doing these kind of transformations.
However how to best divide 19 into X dimensions ?
Hmmm...
Euh dimensions could even have their own size... but for now... let's
assume they are all equal in size.
If I want 19 distrinct colors...
Question is... how many distinct colors are there for 3 dimensions... the
answer was 8 ?
8 corners ?!
Why are there 8 corners ?
Aha !
A single dimension has 2 corners ! (Which is kinda logical... start and
end)
So multi dimensions multiple the number of corners !
2 * 2 * 2 = 8 corners !
So the next dimension has 16 corners ! 4D.
So the next dimension has 32 corners ! 5D.
5D will fit the 19.
But lot's of spillage going on ?
Maybe I can multiple the instruction code by something to shift it nicely
Yeah.
32 corners divided by 19 = 1.6842105263157894736842105263158.
So to "map" each instruction onto it's "corner" simply multiple by that
number.
The funny thing is that the binary code actually describes the corner
coordinates in multi dimensional space ! yeah ! =D
The first bit describes the corner of the first dimension.
The second bit describes the corner of the second dimension.
The third bit describes the corner of the third dimension.
The fourth bit describes the corner of the fourth dimension.
The fith bit describes the corner of the fith dimension !
Awesome I never knew that ! super cool ! ;)
Anyway
Once I have these bits... it should become possible to simply look up the
Color[1d][2d][3d][4d][5d]
However... this could just be a lookup table of 0..31.
So now the remaining question is how to map 16 million colors to 5
dimensional space.
16 million colors is 24 bits.
the 5 bits describe the outer most corners...
Interpolating between these bits would give 0....1
So a floating point lies between them.
Now all I have to do is multiple the 5 bits... by x bits to create 24
bits.
24 bits divide by 5 bits = 4.8 "bits".
So each dimension needs to receive 4.8 bits in between.
This part/section of the theory is bogus but the rest is correct:

[Bogus/incorrect/bullshit part starts here]
Post by Skybuck Flying
1 / 4.8 = 0.20833333333333333333
So if I simply walk across all 16 million colors...
I start with zero... and then I slow add 0.2083333 then if all goes
correctly... it should end up with 16 million colors spread across a color
space of 5D which was kinda spread across 19.
So maybe I took a detour... I already thought about this in the past in a
thread not so long ago. But I am not sure if that theory was correct...
but this once seems nice ?! and correct ?!
Ofcourse I can't walk across 16 million colors that would take ages.
[Bogus/incorrect/bullshit part ends here]
Post by Skybuck Flying
I need a formula... that simply produces 19 distinct colors to start
with...
It would also be nice to interpolate between them... for the modifiers...
but then I could just increase the number of distinct colors required. (by
multiplieing codecount * modifiercount)
The big question is do I now have a formula to calculate the correct 24
bit color ?
input can be 0, 1, 2, 3, 4, 5, 6, 7, 8 etc to 19.
This first needs to be converted to 32 by multiplieing it by the number
1.68etc.
This gives the 5 dimensional number which is 5 bits.
This is an coordinate which represents the corner of the multi dimensional
color space.
[5d][4d][3d][2d][1d]
all are 0 or 1.
Now to understand what the 16 million/24 bit value/coordinate is we simply
etc + 2d * DimensionSize * SecondDimensionSize * FirstDimensionSize +
2d *DimensionSize +FirstDimensionSize + 1d * DimensionSize; (See below
how I came to this improvement: )
So it's quite easy to see what we have to do.
The number of bits required for each dimension was 4.8.
So the first dimension multiplier is: 2^4.8 =
27.857618025475972452360640559352
So the second dimension multiplier is: (2^4.8)^2 =
776.0468820533238181617970182689
So the third dimension multiplier is: (2^4.8)^3 =
21618.817610103099545583648296626
So the fourth dimension multiplier is: (2^4.8)^4 =
602248.76314468548964443852467231
So the fiveth dimension multiplier is: (2^4.8)^5 = 16777216
The original color space was 3 dimensions... each dimension having a range
from 0 to 255... so that's 256 elements.
The linear dimension size is therefore: 256^3.
Now to reverse this is doing: (256^3) ^ (1/3) = ...
1/3 = 1/dimensions
^ 1/5
(256^3) ^ (1/5) = 27.857618025475972452360640559352
Exactly same number which proves my theory I guess ! WIEEEEEEEEEEEEEEEE =D
Suppose the coordinate was 1,1,1,1,1
The linear value should be close to 2^24...
Which is actually proven above.... 1 to 27.857618025475972452360640559352
is the dimension range.
27.85, 27.85, 27.85, 27.85, 27.85
If you multiply these together you ll get 27.85^5 which is close to 2^24.
So now I have a very simply method to convert 0 to 31 to a color space of
5d which is then mapped to 3d.
19 * 1.68 to convert to 5d color coordinate.
Which is 0..31...
Then extract every bit... out of those 5 bits... and covert them to the
values above...
Then perform the lineair calculation for the multipliers.
(B * 256 * 256) + (G * 256) + R
<- etc (3D * 27.8) * 27.8 * 27.8 + (2D * 27.8) * 27.8 + (1D * 27.8).
And that ladies and gentlemen concludes this Skybuck's multi-dimensional
color space theory ! ;) =D
YEAH =D
Bye,
Skybuck =D
Skybuck Flying
2009-02-20 10:19:55 UTC
Permalink
I am going to make a nice Tclass/algorithm/re-usuable unit out of this...
because it could come in handy some day ! ;)

And ofcourse right now for the core war.

However I want maximum flexibility and maximum speed so it will be something
like this:

First the user specifies the number of distinct colors required.

For example 19 as in the example.

The user could even specify the number of colors available in it's color
space.

Now the first thing I need to know is the dimension required to put those 19
distinct colors into something nice.

This requires mapping them onto corners... they cannot be on the same corner
so they will have to be spread out I guess ! ;)

So this means the number of corners should always be equal or higher to the
number of distinct colors required.

Now to figure out the number of corners required is something like this:

log10(19)/log10(2) = log2(19) = 4.2479

Now simply round this value up: 5.

And there you go ! The number of dimensions required is ceil( log10(distinct
colors required) / log10(2) ).

Or simply: ceil( log2( distrinct colors required ) )

Now to calculate the "map onto corner" multiplier is easy:

^ = to the power.

(2^5 = 32) / 19 = 1.68

so second formula is:

( (2 ^ number of dimensions) / distinct colors) = "map onto corner
multiplier".

So the input range 0 to 18 ? (the -1 could possible correct it ? ;) cool) is
mapped onto the corners like so:

Input * MapOntoCornerMultiplier.

Now the last part of the theory is to calculate the dimension multipliers.

These can be stuffed into a lookup table for quick multiplications for each
dimension.

First to calculate the basic range of each dimension is:

(2^24) ^ (1/5) = DimensionRange.

So the next formula is:

(Real World/Sequential Total Color Range) ^ ( 2 / number of dimensions ) =
DimensionRange.

Finally to calculate the lookup table it's:

DimensionMultiplier[0] = DimensionRange ^ 1
DimensionMultiplier[1] = DimensionRange ^ 2
DimensionMultiplier[2] = DimensionRange ^ 3
DimensionMultiplier[3] = DimensionRange ^ 4
DimensionMultiplier[4] = DimensionRange ^ 5

Now the formula to calculate the dimension coordinate to the real world
sequential color value is:

RealWorldColor =
Corner[4] * DimensionMultiplier[4] +
Corner[3] * DimensionMultiplier[3] +
Corner[2] * DimensionMultiplier[2] +
Corner[1] * DimensionMultiplier[1] +
Corner[0] * DimensionMultiplier[0];

So to make it even more easy a 0..31 table lookup could be made for maximum
speed:
TableLookUp[0] := 0 0 0 0 0;
TableLookUp[1] := 0 0 0 0 1;
TableLookUp[2] := 0 0 0 1 0;
TableLookUp[3] := 0 0 0 1 1;
TableLookUp[4] := 0 0 1 0 0;
TableLookUp[5] := 0 0 1 0 1;
TableLookUp[6] := 0 0 1 1 0;
TableLookUp[7] := 0 0 1 1 1;
TableLookUp[8] := 0 1 0 0 0;
etc


Just multiply each 1 with the corresponding Dimension Multipler and add them
up.

So for example:

TableLookup[7] will be:

TableLookUp[7] :=
0*DimensionMultiplier[4] +
0*DimensionMultiplier[3] +
1*DimensionMultiplier[2] +
1*DimensionMultiplier[1] +
1*DimensionMultiplier[0] +

This way the value 0 to 31 can be lightning fast looked up with just one
lookup !

Very cool ! ;)

Bye,
Skybuck.
Skybuck Flying
2009-02-21 03:45:23 UTC
Permalink
Post by Skybuck Flying
I am going to make a nice Tclass/algorithm/re-usuable unit out of this...
because it could come in handy some day ! ;)
And ofcourse right now for the core war.
However I want maximum flexibility and maximum speed so it will be
First the user specifies the number of distinct colors required.
For example 19 as in the example.
The user could even specify the number of colors available in it's color
space.
Now the first thing I need to know is the dimension required to put those
19 distinct colors into something nice.
This requires mapping them onto corners... they cannot be on the same
corner so they will have to be spread out I guess ! ;)
So this means the number of corners should always be equal or higher to
the number of distinct colors required.
log10(19)/log10(2) = log2(19) = 4.2479
Now simply round this value up: 5.
And there you go ! The number of dimensions required is ceil(
log10(distinct colors required) / log10(2) ).
Or simply: ceil( log2( distrinct colors required ) )
^ = to the power.
(2^5 = 32) / 19 = 1.68
( (2 ^ number of dimensions) / distinct colors) = "map onto corner
multiplier".
So the input range 0 to 18 ? (the -1 could possible correct it ? ;) cool)
Input * MapOntoCornerMultiplier.
Now the last part of the theory is to calculate the dimension multipliers.
These can be stuffed into a lookup table for quick multiplications for
each dimension.
(2^24) ^ (1/5) = DimensionRange.
(Real World/Sequential Total Color Range) ^ ( 2 / number of dimensions ) =
DimensionRange.
^ Little bug here in formula.

Better formula:

Total Colors ^ ( 1 / number of dimensions ) = DimensionRange.
Post by Skybuck Flying
DimensionMultiplier[0] = DimensionRange ^ 1
DimensionMultiplier[1] = DimensionRange ^ 2
DimensionMultiplier[2] = DimensionRange ^ 3
DimensionMultiplier[3] = DimensionRange ^ 4
DimensionMultiplier[4] = DimensionRange ^ 5
Now the formula to calculate the dimension coordinate to the real world
RealWorldColor =
Corner[4] * DimensionMultiplier[4] +
Corner[3] * DimensionMultiplier[3] +
Corner[2] * DimensionMultiplier[2] +
Corner[1] * DimensionMultiplier[1] +
Corner[0] * DimensionMultiplier[0];
So to make it even more easy a 0..31 table lookup could be made for
TableLookUp[0] := 0 0 0 0 0;
TableLookUp[1] := 0 0 0 0 1;
TableLookUp[2] := 0 0 0 1 0;
TableLookUp[3] := 0 0 0 1 1;
TableLookUp[4] := 0 0 1 0 0;
TableLookUp[5] := 0 0 1 0 1;
TableLookUp[6] := 0 0 1 1 0;
TableLookUp[7] := 0 0 1 1 1;
TableLookUp[8] := 0 1 0 0 0;
etc
Just multiply each 1 with the corresponding Dimension Multipler and add
them up.
TableLookUp[7] :=
0*DimensionMultiplier[4] +
0*DimensionMultiplier[3] +
1*DimensionMultiplier[2] +
1*DimensionMultiplier[1] +
1*DimensionMultiplier[0] +
This way the value 0 to 31 can be lightning fast looked up with just one
lookup !
Very cool ! ;)
Bye,
Skybuck.
Skybuck Flying
2009-02-21 04:16:57 UTC
Permalink
Ok,

I tried/tested this theory...

It doesn't work well so apperently somewhere it is flawed ! ;)

Nice try though.

Now we go think up something else...

Maybe in dive into my code archive because I think I had a nice spread
function before but I can't remember if it was for interpolating or
whatever.

It's more fun to think up something new...

So... I try that first.

Bye,
Skybuck.
Skybuck Flying
2009-02-21 04:19:12 UTC
Permalink
Ok,

Maybe the theory could work if we could see in 5D lol :)

But we can't see in 5D colors.

So new idea is as follows:

Assume the colors we can see is a 3 dimensional cube.

The objective is to spread the number of distinct colors required across the
contents of the cube as good as possible so that the distance between all
points is as long as possible.

Bye,
Skybuck.
Skybuck Flying
2009-02-21 04:24:02 UTC
Permalink
Ok,

I just had maybe an easier idea...

If all the colors could be spread around the edge of a circle then... then
it's easy to calculate 19 dots on the circle.

Question is: is it possible to lay all colors on the circle ? So that it
makes a bit of sense ?

Bye,
Skybuck.
Skybuck Flying
2009-02-21 05:03:36 UTC
Permalink
Ok,

I think the eye is simply limited to recgonizing 3 basic colors: Red, Green,
Blue or so ? ;)

Therefore the number of distinct colors has to be spread across a three
dimensional space.

So something simple could be:

19 ^ (1/3)

Then "ceil" this number to give the number of steps per color component.

So this will become "3".

Which will give 3 * 3 * 3 = 27 distinct colors across the color space.

Then simply select 19 out of these.

The first 19 could simply be selected... by maybe we can do slightly better
?

Yeah... maybe try something like this:

27/19 = 1.42

Then when going through the colors simply let anything that spils over 3 go
to the next component and reset the first one and then simply start
again....

Let's see what happens for 19 colors:

First color would be: 1.42, 0, 0
Second color would be: 2.84, 0, 0
Third color would be: 0, 1.26, 0
Fourth color would be: 1.42, 1.26, 0
Fiveth color would be: 2.84, 1.26, 0
Sixth color would be: 0, 2.52, 0
Seventh color would be: 1.42, 2.52, 0
Eighth color would be: 2.84, 0, 0.78
Nineth color would be: 0, 1.26, 0.78
Tenth color would be: 1.42, 1.26, 0.78
Eleventh color would be: 2.84, 1.26, 0.78
Twelveth color would be: 0, 2.52, 0.78
Thirtheenth color would be: 1.42, 2.52, 0.78
Fourthteenth color would be: 2.84, 2.52, 0.78
Fivetheenth color would be: 0, 0, 1.56
Sitxtheenth color would be: 1.42, 0, 1.56
Eightheenth color would be: 2.84, 0, 1.56
Ninetheenth color would be: 0, 1.26, 1.56

Let's compare this to the obvious simple selection:
1st: 1, 0, 0
2st: 2, 0, 0
3st: 3, 0, 0
4st: 0, 1, 0
5st: 1, 1, 0
6st: 2, 1, 0
7st: 3, 1, 0
8st: 0, 2, 0
9st: 1, 2, 0
10st: 2, 2, 0
11st: 3, 2, 0
12st: 0, 3, 0
13st: 1, 3, 0
14st: 2, 3, 0
15st: 3, 3, 0
16st: 0, 0, 1
17st: 1, 0, 1
18st: 2, 0, 1
19st: 3, 0, 1

This would probably be far worse since the blue channel is hardly used.

However I am not completely happy with my first solution... maybe there is
something better but for now I ll post this ;)

Bye,
Skybuck.
Skybuck Flying
2009-02-21 05:56:37 UTC
Permalink
Ok,

Here is an idea:

The cube has a certain volume:

For example:

256 * 256 * 256 = 16777216

Now the idea is to divide this volume equal among the 19 distinct colors
required.

So each color should get the following volume: 16777216 / 19 =
883011.36842105263157894736842105

Now maybe construct balls which are dropped into the cube... the balls will
fill up the cube... and more
or less find there own best distribution fit.

However it would help if these balls could be squashed or whatever.

Another idea could be to connect all points with each other.

this could create shapes, and volumes... then try to maximize the shapes and
volumes...

Anyway I am gonna first try out the minimum distance between the lines in a
solver and see if it can solve it lol :)

Bye,
Skybuck.
Skybuck Flying
2009-02-21 06:00:48 UTC
Permalink
Ok solver is probably impossible since it's lineair and can't calculate
distances or whatever ?

Besides my solving abilities are d.e.a.d :) lol.

Though it is interesting to make a simple distance table like:


color1 color2 color3
color1

color2

color3


and then calculate all dinstances between all colors.

Which could be assigned randomly or so.

The color with the worst distance to somebody else should be selected.

Then maybe try all possibilities or simply some of them and insert it back
into it the best one that was found...

Then recalculate and select the worst distance again and modify etc.

Kinda funny algorithm.

I am gonna try it out :)

Bye,
Skybuck.
Skybuck Flying
2009-02-21 08:36:24 UTC
Permalink
Ok,

I guess this works a little bit.

Currently I just filled random blocks with colors for a demo...

I haven't tried it out yet on the instruction visualizer etc...

Though I don't think it's gonna be that great....

I spent almost a whole day on this or so graphics so addicting :)

TIME TO CUT IT OUT ! ;)

Bye,
Skybuck :)
Skybuck Flying
2009-02-21 09:27:53 UTC
Permalink
Ok,

It's time to make some progress... because I was just staring at the
beautifull colors... being hyponotized ! ;) :)

Now I added some code so it outputs the damn generated colors into a nice
source code form so I can just copy & paste it into other projects as "color
data" so I don't need to generate anything there.

Just a nice lookup table for colors !

Yeah nice progress ! =D

Bye,
Skybuck.
Skybuck Flying
2009-02-21 09:52:57 UTC
Permalink
Ok,

Well after all that effort... I am probably gonna go with just manual colors
! :)

Because I have a certain idea in my head which colors belong to which
instructions ! ;) :)

And I just wanna see it that way ! ;) :)

Bye,
Skybuck.
Skybuck Flying
2009-02-21 10:05:21 UTC
Permalink
Though when the pixels are really small I think the generated colors do look
a bit more distinctive ! ;)

So I could actually use two modes... manual colors and distinctive colors.

Manual colors could be used when the warriors are zoomed in...

Alternatively a legend could be provided ! ;)

Bye,
Skybuck.
Skybuck Flying
2009-02-21 11:57:46 UTC
Permalink
Hmmm...

It's kinda interesting to make the warriors as different as possible in
colors.

Using this information:

color1:
instructions: 18
modifiers: 7
addressinga: 8
addressingb: 8

color2:
valuea: 8000
valueb: 8000

final color: color1 + color2 mod total colors;

A whole lot of different colors can be made.

I'll spare you the formula's because I am kinda lazy/tired at the moment...
and the formula's probably slow anyway.

But it's kinda nice... many different colors... maybe they could be improved
somewhat to be even more precise or so.
it uses the dimensional trick like:
z*x_size*y_size + y*y_size + x; but then replace x with the fields of
color1. Then do same for color 2.

Also multiple color1 components with dimension range... which would be 21:

21*21*21 is close to 9000... which is enough for all instruction
combinations of fields of color1.

However I did not do the same for color2... there it was just 8000 +
8000*b.. so that could be improved further to follow the same dimensional
approach.
Actually that's kinda interesting:

It gives something like:
8000*8000 = 64000000

Then do:

64000000^(1/3) = 400 a perfect match !

So 0..400,0..400,0..400

ofcourse this needs to be rescaled to 0..256

So 255/400 = 0.6375

Now to calculate r,g,b:
r = value div 400*400
value = value mod 400*400;

g = value div 400
value = value mod 400

b = value

Cool.

Bye,
Skybuck.
Skybuck Flying
2009-02-21 14:16:26 UTC
Permalink
One last improvement is to do:

(color1 shr 1 + color2 shr 1) mod 16 million

This gives a nice mix of opcode/modifiers etc and the values:

I like this one a lot too.. it's nice to see every little difference in a
warrior for as far as possible ! ;)

Loading Image...

Bye,
Skybuck.
Skybuck Flying
2009-02-25 04:30:22 UTC
Permalink
This morning I also had another idea for the distinct color generator.

First it could select the worst one and improve it...

If it can't be improved afer some tries then select the second worse one and
try to improve that.

If after many tries no improvement is gained then as a last resort try
random ones to see if that gives improvements... as to overcome local
optima's.

(This post is algorithm specific but ok... ;) it s the algorithm where color
vs color table is used to different color distances etc...)

Ok me in hurry gotta go register for Quake 3 Live etc WIEE ! =D

Bye,
Skybuck.
Olumide
2009-02-25 16:19:17 UTC
Permalink
Skybuck, why not just start a blog? Its the best place for monologues.
Skybuck Flying
2009-02-25 17:34:10 UTC
Permalink
Post by Olumide
Skybuck, why not just start a blog? Its the best place for monologues.
Because the web sux.

I don't wanna deal with html, html bugs, internet explorer/et al bugs, isp
web space shortage, isp web space down time, isp limited web space, ads,
come and go of web hosting companies, dns failure or problems, uploading,
losing logging functionality, losing thread functionality, etc, etc, etc,
etc ;) :)

Bye,
Skybuck.

Loading...