Page 1 of 2

Headlights

Posted: Mon Mar 20, 2006 1:10 pm
by Galileo
Headlights would be really handy for collecting loot in systems with low ambient light and when the sun is blocked by the planet. It would also be handy for docking sometimes. Anyone agree?

Posted: Mon Mar 20, 2006 1:16 pm
by aegidian
Mmm. It's certainly possible (and relatively easy to code).

How about a forward spotlight, emerging from a point near the main forward weapon, available as an upgrade (EQ_SPOTLIGHT) for a few hundred credits.

Harder to code (given the limited number of dynamic lights OpenGL can offer) would be NPC ships with spotlights... but I could think about it.

Posted: Mon Mar 20, 2006 1:41 pm
by Galileo
aegidian wrote:
How about a forward spotlight, emerging from a point near the main forward weapon, available as an upgrade (EQ_SPOTLIGHT) for a few hundred credits.
That'd be great! Exactly what I was thinking!

aegidian wrote:
Harder to code (given the limited number of dynamic lights OpenGL can offer) would be NPC ships with spotlights... but I could think about it.
It would definitely look cool but whether or not your time could be spent elsewhere is another question. :wink: Either way I'd be happy with just the first option.

Posted: Mon Mar 20, 2006 2:31 pm
by JensAyton
The good news is, OpenGL has support for a spotlight lighting model.

The bad news is, it looks crap on low-poly models (since lighting is per-vertex).

The usual solution is to use a projected light-map texture. This’d be a big, big change to the rendering model, though. :?

Posted: Mon Mar 20, 2006 3:16 pm
by Wiggy
lighting is pervertex.
Is that some new space-age material with a wipe-clean finish...?

On a more serious note, you're going to need a pretty strong torch bulb to illuminate space!

Should I mention the IR goggles again....?

Posted: Mon Mar 20, 2006 3:33 pm
by JensAyton
Wiggy wrote:
Ahruman wrote:
lighting is pervertex.
Is that some new space-age material with a wipe-clean finish...?
You’ve got a pervertex sense of humour.
Wiggy wrote:
On a more serious note, you're going to need a pretty strong torch bulb to illuminate space!
Technically, it doesn’t need to be as strong as in air for any given range.
Wiggy wrote:
Should I mention the IR goggles again....?
Thermal would be a lot of work. Light-amplification would probably be easier… but would be better done after we’ve got glare effects. ;-)

Posted: Mon Mar 20, 2006 4:08 pm
by Wiggy
Thermal would be a lot of work. Light-amplification would probably be easier… but would be better done after we’ve got glare effects. ;-)
Yes, obviously thermal imaging would be a bit radical.
The idea was more along the lines of 'false colour', like <real world> images of deep space.

System too dark? Just re-calibrate your sensors to a different waveband.

Someone first mentioned it harking back to Predator 2, when they lock him in a fridge so his IR sensors don't work. The creature then switches to UV or similar. And then the killing begins...

Posted: Mon Mar 20, 2006 5:29 pm
by winston
When my hand heals a bit and it's not quite as uncomfortable to type as it is now, I was thinking of looking at doing an Advanced Naval Targeting System - which can highlight all targets in range (much like the scanner targeting enhancement does for a single target). I did start looking at the HUD code last week to see what was happening. Only believe that I'm doing it though when you see a branch appear in SVN - I'm notoriously unreliable!

Posted: Mon Mar 20, 2006 8:25 pm
by dajt
I'd love to have headlights - I've often wished for them when cleaning up after a run-in with a few pirates.

Posted: Mon Mar 20, 2006 10:38 pm
by EAGLE 5
Hey hedlights is a cool idea! after all what did Han Solo do immediately after entering the Aster...erm Big Worm? he switched on the Headlights! It would really be funny if some craft have flip up headlights too but that's probably a lot more code and polygons then necessary.

I do agree that the ambient lighting in the game is often way too dark. Most of the time when you're dealing with a pesky pirate in some dark colored ship especially if powered off you really can't tell anything till you crash into it. Some kind of light or advanced imaging system (maybe even with zoom?) would probably help here.

Posted: Mon Mar 20, 2006 11:15 pm
by winston
Space is dark, the ambient lighting should be low (I find it too bright - I'm using the new changes so I can make it lower - the planets look way better that way). Ship's technology should compensate for the darkness of space - not making space blue like FE2 or FFE!

Posted: Tue Mar 21, 2006 10:33 am
by JensAyton
I think the ambient lighting is too bright. What is too dark is the texturing on some ships… you just can’t get a black surface that’s anywhere near totally absorbent, i.e. as dark as space. A “black” ship should turn up as medium grey on the lighted side and dark grey on the dark side (the jabberwocky and bandersnatch are about right). Specular lighting would help make the sunny side show up better, though.

Posted: Tue Mar 21, 2006 1:30 pm
by Selezen
Does Oolite handle specular mapping? And the sort of texture that makes it possible to create a texture of lights that will still be glowing even if there's no ambient light?

Posted: Tue Mar 21, 2006 3:06 pm
by JensAyton
Not at the moment.

Posted: Fri Mar 24, 2006 1:58 am
by oO
winston wrote:
When my hand heals a bit and it's not quite as uncomfortable to type as it is now, I was thinking of looking at doing an Advanced Naval Targeting System - which can highlight all targets in range (much like the scanner targeting enhancement does for a single target). I did start looking at the HUD code last week to see what was happening. Only believe that I'm doing it though when you see a branch appear in SVN - I'm notoriously unreliable!
I had a look too, this simple patch (against linux SVN rev361) highlights all non-active targets with the targetting reticle in dark yellow (It's always active, it lacks the code to be an item and all that stuff). :

Code: Select all

Index: src/Core/HeadUpDisplay.m
===================================================================
--- src/Core/HeadUpDisplay.m    (revision 361)
+++ src/Core/HeadUpDisplay.m    (working copy)
@@ -56,6 +56,7 @@
 GLfloat red_color[4] =         {1.0, 0.0, 0.0, 1.0};
 GLfloat redplus_color[4] =  {1.0, 0.0, 0.5, 1.0};
 GLfloat yellow_color[4] =   {1.0, 1.0, 0.0, 1.0};
+GLfloat darkyellow_color[4] =   {0.75, 0.75, 0.0, 1.0};
 GLfloat green_color[4] =       {0.0, 1.0, 0.0, 1.0};
 GLfloat darkgreen_color[4] ={0.0, 0.75, 0.0, 1.0};
 GLfloat blue_color[4] =                {0.0, 0.0, 1.0, 1.0};
@@ -486,6 +487,12 @@
                                                        foundHostiles = YES;
                                                break;
                                }
+                               // adds reticles to all stuff inside max_scanner_range2
+                               // if advanced_scanner_item is present...
+                               if ((drawthing->isShip) && (drawthing->zero_distance <= max_scanner_range2))
+                               {
+                                       hudDrawReticleOnTarget(drawthing, player, z1);
+                               }
                                // exit if it's off-scanner
                                if (drawthing->zero_distance > max_zoomed_range2)
                                        continue;
@@ -1973,7 +1980,12 @@
        //rotate to face player1
        glMultMatrixf(back_mat);
        // draw the reticle
-       glColor4fv(green_color);
+       if (target == [player1 getPrimaryTarget])
+       {
+               glColor4fv(green_color);
+       } else { //use (different || darker) colour if ! target
+               glColor4fv(darkyellow_color);
+       }
        glBegin(GL_LINES);
                glVertex2f(rs0,rs2);    glVertex2f(rs0,rs0);
                glVertex2f(rs0,rs0);    glVertex2f(rs2,rs0);
Also i thought about a "special" scanner for pirates, an X-ray scanner which would show what's inside the cargo containers (showing the info in that reticle thing) BUT since it works with X-rays it would have a 10% chance of detonating radioactive containers, doing a splash damage (player included) like a mine or something destroying adjacent containers in the proccess. Fun eh? :P

It could be useful in addition to the AdvNavTarSys, allowing you to go pick the precious cargo if you're in a hurry.

About the light, i think there's no need to look very fancy, a simple GL spotlight with attenuation and wide angle (so that you can spot cargo containers at 1-2km range) should be ok, but i found no way to code it properly :\ (it seemed to light planets in the inverse direction when i pumped up the wattage, bah i have no idea).

The shop could look like:
1.000 - Spotlight - "A simple 100.000 watts bulb"
5.000 - X-Ray Container Scanner - "Useful for choosing what to scoop"
30.000 - Advanced Naval Targetting System - "The ultimate targetting computer"