Headlights

An area for discussing new ideas and additions to Oolite.

Moderators: winston, another_commander

User avatar
Galileo
Dangerous
Dangerous
Posts: 103
Joined: Tue Nov 15, 2005 1:55 am
Location: Tasmania, Australia

Headlights

Post 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?
User avatar
aegidian
Master and Commander
Master and Commander
Posts: 1161
Joined: Thu May 20, 2004 10:46 pm
Location: London UK
Contact:

Post 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.
"The planet Rear is scourged by well-intentioned OXZs."

Oolite models and gear? click here!
User avatar
Galileo
Dangerous
Dangerous
Posts: 103
Joined: Tue Nov 15, 2005 1:55 am
Location: Tasmania, Australia

Post 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.
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post 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. :?
User avatar
Wiggy
Deadly
Deadly
Posts: 222
Joined: Fri Jan 21, 2005 1:12 pm
Location: London, Engerland

Post 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....?
You came in that? You're braver than I thought!
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post 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. ;-)
User avatar
Wiggy
Deadly
Deadly
Posts: 222
Joined: Fri Jan 21, 2005 1:12 pm
Location: London, Engerland

Post 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...
You came in that? You're braver than I thought!
User avatar
winston
Pirate
Pirate
Posts: 731
Joined: Mon Sep 27, 2004 10:21 pm
Location: Port St. Mary, Isle of Man
Contact:

Post 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!
dajt
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 364
Joined: Tue Aug 17, 2004 7:05 am
Location: Orange, NSW, Australia

Post 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.
Regards,
David Taylor.
User avatar
EAGLE 5
Competent
Competent
Posts: 37
Joined: Sat Mar 18, 2006 6:11 am
Location: Houston
Contact:

Post 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.
Cmdr. EAGLE 5
Hero for Hire
User avatar
winston
Pirate
Pirate
Posts: 731
Joined: Mon Sep 27, 2004 10:21 pm
Location: Port St. Mary, Isle of Man
Contact:

Post 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!
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post 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.
User avatar
Selezen
---- E L I T E ----
---- E L I T E ----
Posts: 2530
Joined: Tue Mar 29, 2005 9:14 am
Location: Tionisla
Contact:

Post 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?
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

Not at the moment.
oO
Competent
Competent
Posts: 32
Joined: Sat Oct 15, 2005 8:51 pm

Post 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"
Post Reply