Page 1 of 2

{RELEASE} The VIPER RAIDER, a pirates favorite ?

Posted: Sun Feb 13, 2011 8:30 pm
by dertien
Without further ado, here's the release of a remake from one of Griff's models. Enjoy and test it as you see fit and please give me feedback on bugs should there be any.


*** Z-GrOovY paintshed (Ze Griff's Ooniversal vinYl paintshed) presents ***

Z_GrOovy_Viper_Raider.oxp {1.0} 13-feb-2011 (aka Viper Renegade)


*** Contents ***

The Viper Raider... A pirates favorite ?

"With the rising success of the Viper craft as a workhorse in the police force and its equally prohibitive price and availability on the market, the conception of a similar craft was of course inevitable" the chief of police of Biarge said. A craft sharing distinctive features with the Viper was captured last week by police near the witchpoint of Biarge, a rich industrial world in the southwest of galaxy 1. Preliminary analysis showed that the pilot of the craft; who remains to be found; activated his escape capsule for reasons unclear, leaving his undamaged craft up for grabs. Where the craft was built and by whom it was designed is yet to be determined. The sudden appearance of it though is still shaking the foundations of the more law abiding systems within Biarge's 7 year light radius, and some less scrutinizing folks already pointed the finger at the world of Vebege, an anarchy who's techlevel is adequate for ship construction and design and within 1 jump of Biarge.

The following facts have been released by the local police spokesperson:

It has a reverse-engineered Cobra-Mk3 Powerplant with a different and fuel rich-burn cycle, therefore its nacelles will glow up orange instead of blue. The other fact is that the hull is based on the standard patrol viper with a lowered wing profile.

Since there is a non-disclosure agreement between Viper's builders and their customers, it is unclear at the moment if this craft outperforms its corporate namestake. The tabloids already gave it the ringing name "Viper Renegade" and the trader's league is warning their transport pilots to take on an escort or two extra just in case.

"As a warning to all pilots and not only to traders", the chief said, "the police has released a spec sheet of the Viper Raider, which will give you a good idea of what you're up against should you encounter a pirate flying one of these." "I wouldn't be surprised if these craft were sold through backwater shipyards in anarchy systems either." he added.

- Laser: 1 Slot
- Missile slots: 4
- Maximum energy: 256
- Cargo Capacity: 10 std tons
- Flight Pitch: 2
- Flight Roll: 3.8
- Thrust: 55

I am sure as the story will develop further we will be able to bring you even more facts. This was Hugh Janus live from Biarge.

*** specifics ***

- New Viper variant with different 3d model based on Griff's viper.
- New texture kitbashed from a number of craft in the Griff's all in one oxp
- Different Orange Glow color for the engines. (works only with full shaders on)
- Minor Glitch (a little part of the gun as seen from the top is transparent, It doesnt affect gameplay and its a minute bug)

*** Debugging ? ***

Found something I can fix ? leave me a message on the Oolite BB, and I'll see what I can do.

*** Credits ***
A big thank you to:

- Giles Williams and contributors for Oolite
- Griff for his Viper model and his panels I was allowed to scavenge to make this ship.
- Smivs for his texturing tutorial and his general guidance with Oolite knowledge and config specs.
- All the other enthusiasts on the forum.

*** Dependables/Requirements ***

Has been tested and Works with Oolite 1.74.2 and shaders set to full. For people without shaders, please delete the "Viper_Raider_Engine_NormalMap.png" from the textures folder.

WARNING: Requires "griff_shipset_all_in_1.oxp" which can be found here: http://s248731467.onlinehome.us/griff.html

*** Installation ***

For People playing Oolite with full shader support:

Drag and drop this into your AddOns folder of Oolite in addition to the required oxp's.

For people who have set their Oolite gameplay settings on simple or no shaders, drag and drop the oxp into your AddOns folder in addition to the required oxp's AND delete or rename the file "Viper_Raider_Engine_NormalMap.png" in the texture directory.

*** Legal bollox ***

This oxp is free to use, distribute, edit or alter as you see fit without my permission. It can not be used in any commercial product and cannot be sold. It is free software and should only cost you download time. I am not in any way liable if your break your Oolite installation using this oxp. Use at your own risk. I have successfully tested it and it works 4 me.

Enjoy.

Steve

Screenshots:

Image
Image
Image
Image
Image
Image

Downloads:

http://www.box.net/shared/d8f76j17ba

*** Z-GrOovY paintshed - Showing you new ways on how to be seen ***

Re: {RELEASE} The VIPER RAIDER, a pirates favorite ?

Posted: Sun Feb 13, 2011 8:42 pm
by pagroove
Congratulated on your first own ship! Downloaded it. I like the orange engines :)

Re: {RELEASE} The VIPER RAIDER, a pirates favorite ?

Posted: Sun Feb 13, 2011 9:04 pm
by dertien
Thanks Pagroove, hope you enjoy playing it. I left enough hints where to buy it.

This gave me a good idea of what Wings 3D can do and I found out it is easier to make a model than it is to texture it. Glad I could use Griffs files as a backbone.

You can always get back to me here should you encounter any glitches. Not that I want to burden anyone with gametesting, but if you come across anything please let me know.

Steve

Re: {RELEASE} The VIPER RAIDER, a pirates favorite ?

Posted: Sun Feb 13, 2011 9:09 pm
by Cody
dertien wrote:
Not that I want to burden anyone with gametesting, but if you come across anything please let me know.
Game testing is never a burden... I'm flying test pilot for Smivs atm, and loving every minute.

Re: {RELEASE} The VIPER RAIDER, a pirates favorite ?

Posted: Sun Feb 13, 2011 9:22 pm
by dertien
Been playing for at least an hour now instead of testing, and getting addicted again. As an addiction, this beats smoking....

Re: {RELEASE} The VIPER RAIDER, a pirates favorite ?

Posted: Sun Feb 13, 2011 9:25 pm
by Cody
Oh yes indeed!

Re: {RELEASE} The VIPER RAIDER, a pirates favorite ?

Posted: Sun Feb 13, 2011 9:52 pm
by Smivs
Can't stop either one!
Congrats on the release...looks really nice.

Re: {RELEASE} The VIPER RAIDER, a pirates favorite ?

Posted: Sun Feb 13, 2011 10:52 pm
by Kaks
Very nice! And I can finally see the screenshots too! :)
(For some weird reason I can't see anything hosted on i56.tinypic.com)

One thing though: could you put the readme (and the screenshots directory) just outside the .oxp directory? Mac people won't even know they're there otherwise! :)

Re: {RELEASE} The VIPER RAIDER, a pirates favorite ?

Posted: Mon Feb 14, 2011 12:02 am
by dertien
Kaks wrote:
Very nice! And I can finally see the screenshots too! :)
(For some weird reason I can't see anything hosted on i56.tinypic.com)

One thing though: could you put the readme (and the screenshots directory) just outside the .oxp directory? Mac people won't even know they're there otherwise! :)
No problemo, Kaks. Duly noted, wildo that next time I realease something.

Re: {RELEASE} The VIPER RAIDER, a pirates favorite ?

Posted: Mon May 16, 2011 11:42 am
by maik
Added to the [wiki]OXP List[/wiki]

Re: {RELEASE} The VIPER RAIDER, a pirates favorite ?

Posted: Fri Jun 01, 2012 1:25 am
by Tricky
NPC ships don't have the alertCondition property (only player ships have it) so the pirate version doesn't get spawned.

To this end I have come up with this work-around...

Code: Select all

--- shipdata-orig.plist 2011-02-13 19:59:30.000000000 +0000
+++ shipdata.plist      2012-06-01 02:15:46.044048500 +0100
@@ -199,7 +199,7 @@
        thrust = 55;
        scoop_position = "0.0 -9.57 7.66";
        subentities = (
-                                       "Viper_Raider_Engine 0 0 0 1 0 0 0"
+          "Viper_Raider_Engine_NPC 0 0 0 1 0 0 0"
                                        );
        smooth = "false";

@@ -210,4 +210,38 @@
                weapon_position_forward = "0.0961 0.0 43.4655";
        };

+  "Viper_Raider_Engine_NPC" =
+  {
+    like_ship = "Viper_Raider_Engine";
+
+    shaders =
+    {
+      "Viper_Raider_Engine_Diffuse.png" =
+      {
+        vertex_shader = "griff_normalmap_ships.vertex";
+        fragment_shader = "viper_raider_engine_npc_fix.fragment";
+        textures =
+        (
+          "Viper_Raider_Engine_Diffuse.png",
+          "Viper_Raider_Engine_NormalMap.png",
+          "Viper_Raider_Engine_Effects.png"
+        );
+        uniforms =
+        {
+          uColorMap = { type = texture; value = 0; };
+          uNormalMap = { type = texture; value = 1; };
+          uEffectsMap = { type = texture; value = 2; };
+          uDecalMap = { type = texture; value = 3; };
+          uTime = "universalTime";
+          nearly_dead = "throwingSparks";
+          /* NPC ships don't have "alertCondition" so try to simulate it with the next 3 properties. */
+          hostile_target = "hasHostileTarget";
+          station_aegis = "withinStationAegis";
+          scanned_ships = "numberOfScannedShips";
+          hull_heat_level = "hullHeatLevel";
+          engine_power = "speedFactor";
+        };
+      };
+    };
+  }
 }
Create the directory "Shaders" and add this into it as "viper_raider_engine_npc_fix.fragment"...

Code: Select all

uniform sampler2D    uColorMap;
uniform sampler2D    uNormalMap;
uniform sampler2D    uEffectsMap;
uniform sampler2D    uDecalMap;


varying vec2         vTexCoord;
varying vec3         vEyeVector;   // These are all in tangent space
varying vec3         vLight0Vector;
varying vec3         vLight1Vector;

// Constants
const float KspecExponent = 5.0;
const vec3 kLampColorNoAlert = vec3(0); 
const vec3 kLampColorYellowAlert = vec3(0.9926, 0.9686, 0.7325); 
const vec3 kLampColorRedAlert = vec3(1.0, 0.1, 0.0);
   
// Uniforms from Oolite
   uniform float  uTime;
uniform bool      nearly_dead;
uniform bool      hostile_target;
uniform float     station_aegis;
uniform int       scanned_ships;
   uniform int    damage_amount;
   uniform float  hull_heat_level;
   uniform float  engine_power;
   uniform vec4   PaintColor1; // used with paintmask map to tint diffuse texture
   uniform vec4   PaintColor2; // used with paintmask map to tint diffuse texture
   uniform vec4   Decal1_Scale_and_Position; // position & scale settings for decal 1
   uniform float  Decal1_Rotation;  // rotation settings for decal 1 

// Irregular flickering function
   #ifdef OO_REDUCED_COMPLEXITY 
   #define Pulse(v, ts) ((v) * 0.95) 
   #define Blink_on_off(value) (1.0)
   #else

     float Pulse(float value, float timeScale)
     {
        float t = uTime * timeScale;   

        float s0 = t;
        s0 -= floor(s0);
        float sum = abs( s0 - 0.5);
   
        float s1 = t * 0.7 - 0.05;
        s1 -= floor(s1);
        sum += abs(s1 - 0.5) - 0.25;
   
        float s2 = t * 1.3 - 0.3;
        s2 -= floor(s2);
        sum += abs(s2 - 0.5) - 0.25;
   
        float s3 = t * 5.09 - 0.6;
        s3 -= floor(s3);
        sum += abs(s3 - 0.5) - 0.25;

        return (sum * 0.1 + 0.9) * value;
      }

// Hull Temperate heat glow effect
     vec3 TemperatureGlow(float level) 
     { 
        vec3 result = vec3(0); 
    
        result.r = level; 
        result.g = level * level * level; 
        result.b = max(level - 0.7, 0.0) * 2.0;
        return result;    
     } 
     
// Blink_on_off_function.
   float Blink_on_off(float timeScale)
   {
   float result = step(0.5, sin(uTime * timeScale));
   return 0.5 + result;
   }     
     
// Cyan color exhaust glow effect
   vec3 cyanGlow(float level)
   {
      vec3 result;
      result.rgb = vec3(0.2, 0.7, 0.9) * level * 1.5;
      return result;
   }     
     
// Red/Orange color heated metal effect
   vec3 redGlow(float level)
   {
      vec3 result;
      result.rgb = vec3(1.5, 0.55, 0.2) * level * 1.3;
      return result;
   }
   
#endif

void Light(in vec3 lightVector, in vec3 normal, in vec3 lightColor, in vec3 eyeVector, 
           in float KspecExponent, inout vec3 totalDiffuse, inout vec3 totalSpecular)
{
   lightVector = normalize(lightVector);
   vec3 reflection = normalize(-reflect(lightVector, normal));
   
   totalDiffuse += gl_FrontMaterial.diffuse.rgb * lightColor * max(dot(normal, lightVector), 0.0);
   totalSpecular += lightColor * pow(max(dot(reflection, eyeVector), 0.0), KspecExponent);
}


#define LIGHT(idx, vector) Light(vector, normal, gl_LightSource[idx].diffuse.rgb, eyeVector, KspecExponent, diffuse, specular)

#ifndef OO_REDUCED_COMPLEXITY 
// function to read in the colour map then scale and position the decal map onto it. 
/*
   "the_decaliser" - this function scales & positions the decal image using data passed 
   to it from the main shader
*/  
vec4 the_decaliser(vec4 Your_Decal_Settings, float Your_decal_Rotation) 
{ 
    
// Setup the basic texture co-ords for the decals 
   vec2 decal_TexCoord = vTexCoord; 
    
// Position the decal     
   decal_TexCoord -= vec2(Your_Decal_Settings.s, Your_Decal_Settings.t - (0.5 / Your_Decal_Settings.p)); 

// Orientate & scale the decal  
   float decal_s = sin(Your_decal_Rotation); 
   float decal_c = cos(Your_decal_Rotation); 
   decal_TexCoord *= mat2(decal_c, decal_s, -decal_s, decal_c); 

   decal_TexCoord += vec2(0.5 / Your_Decal_Settings.p); 
   decal_TexCoord *= vec2(Your_Decal_Settings.p, Your_Decal_Settings.p); 
 
// Get texture values. 
   vec4 decal_Tex = texture2D(uDecalMap, decal_TexCoord); 

// Modify the Decals texture co-oords 
   decal_TexCoord.s += 1.0;
   decal_Tex *= step(1.0, decal_TexCoord.s) * 
                step(0.0, decal_TexCoord.t) * 
                step(-2.0, -decal_TexCoord.s) * 
                step(-1.0, -decal_TexCoord.t); 
                 
// Use the Alpha in the decal as a transparency mask so you can 'cutout' your decal from it's background
   float alpha = decal_Tex.a; 
 
// Return the scaled, position & rotated decal, it's mixed into the colour texture further on in the shader . 
   return alpha * decal_Tex;
}        

#endif  

void main()
{
   vec3 eyeVector = normalize(vEyeVector);
   vec2 texCoord = vTexCoord;
   vec3 normal = normalize(texture2D(uNormalMap, vTexCoord).rgb - 0.5); 
   vec3 colorMap = texture2D(uColorMap, texCoord).rgb;
   vec4 effectsMap = texture2D(uEffectsMap, texCoord);
   vec3 diffuse = vec3(0.0), specular = vec3(0);
   float specIntensity = texture2D(uColorMap, texCoord).a;
   float glowMap = texture2D(uNormalMap, texCoord).a;
   vec3  LampColor = vec3(0.9926, 0.9686, 0.7325);
   int alertlevel = 0;


#ifdef OO_LIGHT_0_FIX
   LIGHT(0, normalize(vLight0Vector));
#endif
   LIGHT(1, normalize(vLight1Vector));
   diffuse += gl_FrontMaterial.ambient.rgb * gl_LightModel.ambient.rgb;
 
#ifndef OO_REDUCED_COMPLEXITY 
// Full Shader Mode - Repaint the hull
   colorMap += effectsMap.g * PaintColor1.rgb;
   colorMap += effectsMap.a * PaintColor2.rgb;
   
// Full Shader Mode - Apply the decals
   vec4 decals = the_decaliser(Decal1_Scale_and_Position, Decal1_Rotation); 
// mix the decals into the texture using the decal alpha as a mask
   vec3 color = mix(colorMap, decals.rgb, decals.a) * diffuse; 

// Calculate the lighting for full shader mode
   color += color * specular * specIntensity * 2.5;
#endif

// Calculate the lighting for simple shader mode
#ifdef OO_REDUCED_COMPLEXITY    
   vec3 color = diffuse * colorMap;
   color += colorMap * specular *  specIntensity * 2.5;
// Add in simple shader hull lights
   color += LampColor * glowMap;    
#endif

// these next glow effects are only available in full shader mode   
#ifndef OO_REDUCED_COMPLEXITY 

  if (nearly_dead || hostile_target)
    alertlevel = 3;
  else
  if (scanned_ships > 1 || station_aegis == 0.0)
    alertlevel = 2;
  else
    alertlevel = 1;

// check Alert Level, Adjust Lamp Colour Accordingly
   if (alertlevel > 0) 
      { 
          LampColor = (alertlevel > 2) ? kLampColorRedAlert * max(mod(uTime, 1.5), 0.5): kLampColorYellowAlert; 
      } 
   else 
      { 
          LampColor = kLampColorNoAlert; 
      } 


// Damage Calculator
float tempvar = float(damage_amount); 
float DamageAmount = mod(tempvar, 100.0) / 100.0;

vec3 Lampglow = LampColor * glowMap * Pulse(2.0, 1.0) * (1.0  - DamageAmount);  
vec3 Cyanglow = cyanGlow(effectsMap.b * Pulse(min(engine_power, 1.0), 1.0)); 
vec3 Redglow =  redGlow(effectsMap.r * Pulse(min(engine_power, 1.0), 1.0));

color += mix(Lampglow + Cyanglow + Redglow,  
            Redglow  + 
            Lampglow * Blink_on_off(Pulse(1.0, 0.4)) * 4.0 + 
            Cyanglow * Blink_on_off(Pulse(1.0, 1.0)), max(0.0, DamageAmount - 0.4));
 
// Add the all over hull temperature glow. Full Shader mode only
   float hullHeat = max(hull_heat_level - 0.5, 0.0) * 2.0; 
   hullHeat = Pulse(hullHeat * hullHeat, 0.1); 
   color += TemperatureGlow(hullHeat); 
#endif   
    
   gl_FragColor = vec4(color.rgb, 1.0);
}
Could probably do with some better logic. :lol:

Re: {RELEASE} The VIPER RAIDER, a pirates favorite ?

Posted: Fri Jun 01, 2012 6:09 am
by Thargoid
Just for completeness, stations also have alertLevel (but you are correct that NPC ships don't).

Interesting work-around though, including a couple of bindings that I didn't know about.

Re: {RELEASE} The VIPER RAIDER, a pirates favorite ?

Posted: Fri Jun 01, 2012 7:34 am
by Commander McLane
However, you seem to use an editor that makes garbage out of plists. All these '+' and '-' characters and '---' and '+++' and '@@' lines don't belong in there.

The result is an invalid shipdata.plist that's getting rejected wholesale by Oolite. Thus, no ship at all will appear.

Re: {RELEASE} The VIPER RAIDER, a pirates favorite ?

Posted: Fri Jun 01, 2012 8:09 am
by another_commander
Commander McLane wrote:
However, you seem to use an editor that makes garbage out of plists. All these '+' and '-' characters and '---' and '+++' and '@@' lines don't belong in there.
That's a diff file, not a plist. It's used as input by the patch program for patching files.

Re: {RELEASE} The VIPER RAIDER, a pirates favorite ?

Posted: Fri Jun 01, 2012 8:34 am
by Tricky
Sorry, forgot to mention that it was a diff file used by patch.

Here is an update zip file https://www.box.com/s/f3fb2bd7bb7201aa84c1

It just contains the Shaders directory and the shipdata.plist file. Just place those in the original OXP directory.