Page 1 of 2

Question ? Changing space color to dark blue

Posted: Fri Feb 07, 2014 5:28 pm
by dertien
Just wondering if it were possible to change the space color from black to dark blue (frontier like) in Oolite 1.77.1 and Trunk (1.79). I would like to have an Oolite with a more frontier feel instead of the stock pitch black.

Can someone tell me how ?

Thanks

Dertien

Re: Question ? Changing space color to dark blue

Posted: Sat Feb 08, 2014 8:22 am
by Pleb
https://bb.oolite.space/viewtopic.php?f=6&t=13174

I posted this ages ago as a suggestion for changing the colour of space but nobody seemed interested so I haven't ever gone back to it. The only drawback with this I found was when going in and out of an atmosphere, it goes from black to blue and then blue to black. As soon as you clear the atmosphere the colour would jump back to red or blue again. Probably would need a bit more work to get it right...

Image

Re: Question ? Changing space color to dark blue

Posted: Sat Feb 08, 2014 9:03 am
by cim
Pleb wrote:
Probably would need a bit more work to get it right...
Three things other than the planetary one (which can be partially fixed by blending against the background colour in OOPlanetEntity's update function, though depending on the background colour that might look rather odd).
- a stylistic one: we have [OOColor colorWithDescription] which can parse just about anything into a colour. Have a look at how it's used for e.g. star and nebula colours.
- a stylistic one: rather than replicating the same code, add a [UNIVERSE setDefaultSkyColor] method.
- a gameplay one: the degree of atmospheric heating experienced is tied to the alpha channel of the background sky. So if you make the sky anything other than black and hit the torus drive? Boom! Customisation of sky colour would need that to be separated out (which would be fairly easy and also have other uses)

Re: Question ? Changing space color to dark blue

Posted: Sat Feb 08, 2014 2:04 pm
by dertien
Yes, exactly what I was looking for, thank you very much !

Re: Question ? Changing space color to dark blue

Posted: Sat Feb 08, 2014 4:54 pm
by dertien
@Pleb

Okay, this worked out fine thanks:
The line numbers were as to be expected no longer correct, but they are easy to find.

Image

However, for future reference, I got an error when applying the last change to the Universe.m file. following your instructions. I just omitted the last change

The error when compiling:

Code: Select all

 Compiling file src/Core/Universe.m ...
src/Core/Universe.m:9285:4: warning: data definition has no type or storage clas
s [enabled by default]
src/Core/Universe.m:9285:4: warning: type defaults to 'int' in declaration of 's
kyClearColor' [enabled by default]
src/Core/Universe.m:9285:24: error: 'systeminfo' undeclared here (not in a funct
ion)
src/Core/Universe.m:9286:4: warning: data definition has no type or storage clas
s [enabled by default]
src/Core/Universe.m:9286:4: warning: type defaults to 'int' in declaration of 's
kyClearColor' [enabled by default]
src/Core/Universe.m:9286:4: error: conflicting types for 'skyClearColor'
src/Core/Universe.m:9285:4: note: previous definition of 'skyClearColor' was her
e
src/Core/Universe.m:9287:4: warning: data definition has no type or storage clas
s [enabled by default]
src/Core/Universe.m:9287:4: warning: type defaults to 'int' in declaration of 's
kyClearColor' [enabled by default]
src/Core/Universe.m:9287:4: error: conflicting types for 'skyClearColor'
src/Core/Universe.m:9285:4: note: previous definition of 'skyClearColor' was her
e
src/Core/Universe.m:9288:4: warning: data definition has no type or storage clas
s [enabled by default]
src/Core/Universe.m:9288:4: warning: type defaults to 'int' in declaration of 's
kyClearColor' [enabled by default]
src/Core/Universe.m:9288:4: error: conflicting types for 'skyClearColor'
src/Core/Universe.m:9285:4: note: previous definition of 'skyClearColor' was her
e
make[3]: *** [obj.win.spk/oolite.obj/Universe.m.o] Error 1
make[2]: *** [internal-objc_program-all_] Error 2
make[1]: *** [oolite.all.objc-program.variables] Error 2
make: *** [internal-all] Error 2

So if anyone wants to do this on their own again, you might want to delete the part in your original post that says:
Now go down to about line 9071 and insert the following code:
Code:
// Define space background color or set to black as default:
skyClearColor[0] = [systeminfo oo_floatForKey:@"space_color_red" defaultValue:0.0];
skyClearColor[1] = [systeminfo oo_floatForKey:@"space_color_green" defaultValue:0.0];
skyClearColor[2] = [systeminfo oo_floatForKey:@"space_color_blue" defaultValue:0.0];
skyClearColor[3] = [systeminfo oo_floatForKey:@"space_color_alpha" defaultValue:0.0];

It would be a plus to have this in the next release, as a standard, so it would not be necessary to have people create their own builds just for this. If no changes are made to the planetinfo.plist, it stays black anyhow.

Re: Question ? Changing space color to dark blue

Posted: Sat Feb 08, 2014 5:04 pm
by Pleb
I did this a while ago so that last bit may not be relevant anymore. As cim stated it needs a bit of work doing to it for it to be completely usable but I'm sure it wouldn't be too hard.

Re: Question ? Changing space color to dark blue

Posted: Sat Feb 08, 2014 8:49 pm
by Griff
wow that looks great, i'm a fan of blue space too, it really makes the ships pop out from the background so would really love it as an option in oolite in some future build.

Re: Question ? Changing space color to dark blue

Posted: Sat Feb 08, 2014 9:37 pm
by Diogenese Senna
I'd like to see that as well.

Re: Question ? Changing space color to dark blue

Posted: Sat Feb 08, 2014 9:57 pm
by dertien
Just as a teaser, here's a screenshot with the BBS Krait

Image

@Cim, And I did hit the torus drive, but fortunately, no BOOM; should I fly somewhere more specific in order to see the boom ? Tried it with and without external heat shielding installed.

Re: Question ? Changing space color to dark blue

Posted: Sun Feb 09, 2014 2:29 pm
by cim
dertien wrote:
@Cim, And I did hit the torus drive, but fortunately, no BOOM; should I fly somewhere more specific in order to see the boom ? Tried it with and without external heat shielding installed.
Ah, looking at the way Pleb is setting the colour, it's not also setting the atmospheric heating levels. So you should be safe for now.

Re: Question ? Changing space color to dark blue

Posted: Sun Feb 09, 2014 8:04 pm
by dertien
I am really glad for that, since I like blue flavored space better than the stock one, especially since some of the ships are randomly colored black with the shader the BBS ship pack uses, which doesn't marry too well with black space.

Re: Question ? Changing space color to dark blue

Posted: Sun Feb 09, 2014 8:24 pm
by Diogenese Senna
So, is it possible in an OXP, that's the question, and will one of the ever amazing OXP creators (a little flattery goes a long way) create such a thing.

Re: Question ? Changing space color to dark blue

Posted: Sun Feb 09, 2014 8:27 pm
by Pleb
No at present it's just an incomplete coding amendment I wrote. You can modify the source and recompile the game so that you can recreate this, but it does need some tinkering to iron out the bugs...

Re: Question ? Changing space color to dark blue

Posted: Sun Feb 09, 2014 8:29 pm
by Diogenese Senna
Pleb wrote:
No at present it's just an incomplete coding amendment I wrote. You can modify the source and recompile the game so that you can recreate this, but it does need some tinkering to iron out the bugs...
Dagnabbit!!!! :cry:

Re: Question ? Changing space color to dark blue

Posted: Mon Feb 10, 2014 4:46 am
by Diogenese Senna
Blue Is Best
:D :D :D

I have to agree with the idea that putting it in as an In Game option might just be a very good idea.
(Can't just just tell that I was very tired when writing the previous sentence) :D