Danger from the Deep!

IRIX/Nekoware development, porting and related topics.
Forum rules
Any posts concerning pirated software or offering to buy/sell/trade commercial software are subject to removal.
User avatar
UrbanHero
Posts: 298
Joined: Tue Aug 23, 2005 1:06 am
Location: Leerdam, Holland, formerly Rotterdam, Holland

Danger from the Deep!

Unread postby UrbanHero » Fri Dec 29, 2006 5:56 am

Just hoping to arouse some interest from the programming wizards:

http://www.dangerdeep.net/

Looks pretty cool, may be usable on our precious-but-matured polygonpushers as ships don't require super-high framerates :)
It's done in Scons though, i vaguely remember Jarndyce muttering about that while compiling Blender ;)

*aWOOhaa! aWOOhaa! Dive! Dive!* :D
-= I reject reality, and substitute my own =-

1 Indigo R3k-33 32MB XS24-Z;
1 Indy R5k-180 256MB XZ;
1 Indy R4k-175 64MB XL;
2 Indigo2 R10k-195 512MB MaxImpact;
2 Indigo2 R4k-200 256MB (XL+Extreme);
2 Octane Dual R12K-300 1024MB (MXI+V6).

skip
Posts: 48
Joined: Mon Dec 25, 2006 4:35 am
Location: Hokkaido, Japan

Unread postby skip » Sat Dec 30, 2006 2:56 am

Hi,
It seems like an interesting game. :)
I don't know scons or GL, but I've managed to hack it enough that it compiles (patch below). It doesn't link (errors below) and I somehow think this was a bit too easy (there are lots of warnings too, most of which I disabled). scons does some strange things, but it does finish eventually. Running it a second time (after it fails) shows the command used to link (which needs -lm added to it).
Linking fails with the following symbols undefined: fftw_execute (which is in /usr/nekoware/lib/libfftw* but those don't get linked for some reason), glActiveTexture, fftw_plan_dft_c2r_2d, fftw_destroy_plan, glBindProgramARB, glProgramLocalParameter4fARB, glLockArraysEXT, glUnlockArraysEXT, glClientActiveTexture, glGenProgramsARB, glProgramStringARB, glGetProgramivARB, glDeleteProgramsARB.
That's after adding -lm manually. Anyone know what these symbols are and if they're usable on IRIX? Google didn't seem to be of much help (although I didn't search for all of them). I think the fftw things shouldn't be too hard to fix, but I don't know what to do with the gl ones.
Patch 5329 may be needed (it was for me).

This is also at http://rafb.net/p/RRqjNE41.html but that will expire after 24 hours. That should work if copying the following doesn't apply cleanly.

Code: Select all

diff -ur dangerdeep-0.2.0//SConstruct dangerdeep-current//SConstruct
--- dangerdeep-0.2.0//SConstruct   Fri Oct 13 03:44:44 JST 2006
+++ dangerdeep-current//SConstruct   Sat Dec 30 19:14:41 JST 2006
@@ -118,12 +118,12 @@
 else:
    print "Compiling for Unix/Posix/Linux Environment"
    env = Environment(ENV = os.environ)
-   env.Append(CPPPATH = ['/usr/include/SDL', '/usr/include/GL'])
+   env.Append(CPPPATH = ['/usr/nekoware/include','/usr/nekoware/include/SDL','/usr/include/GL'])
    libpath = ['/usr/X11R6/lib']
    gllibs = ['GL', 'GLU']
    sdllibs = ['SDL', 'SDL_image']
-   ccflags = '-Wall `sdl-config --cflags` `pkg-config --cflags x11`'
-   env.Append(LINKFLAGS = '`pkg-config --libs-only-L x11`')
+   ccflags = '-Wall `sdl-config --cflags`'
+   env.Append(LINKFLAGS = '-lm -L/usr/nekoware/lib -lGL -lGLU -lX11 -lXext')
    if (debug >= 3):
       ccflags += ' -g -pg -O3'   # profiling
    elif (debug == 2):
@@ -139,7 +139,8 @@
    elif (debug == -3):   # special g++4.0+ auto vectorization
       ccflags += ' -g -O3 -march=athlon64 -mfpmath=sse -mmmx -msse -msse2 -m3dnow -ftree-vectorize -ftree-vectorizer-verbose=2'
    else:
-      ccflags += ' -g -O2' # debug symbols will be stripped by the linker for a debian package
+      ccflags += ' -O3 -mips4 -n32 -woff 3649,3625,3201,1209,1174,1201,3554,1171 -I/usr/nekoware/include'
+
    if (useefence >= 1):
       extralibs += ['efence']
       print 'Linking to ElectricFence library!'
@@ -146,17 +147,18 @@
    if (cvedit == 1):
       env.Append(CPPDEFINES = ['CVEDIT'])
    # check for mmx/sse support
-   cpuinfof = open('/proc/cpuinfo', 'r')
-   cpuinfol = cpuinfof.readlines()
+#   cpuinfof = open('/proc/cpuinfo', 'r')
+#   cpuinfol = cpuinfof.readlines()
    mmxsupported = False
    ssesupported = False
-   for i in cpuinfol:
-      if i.startswith('flags'):
-         m = Split(i)
-         if 'mmx' in m:
-            mmxsupported = True
-         if 'sse' in m:
-            ssesupported = True
+#   for i in cpuinfol:
+#      if i.startswith('flags'):
+#         m = Split(i)
+#         if 'mmx' in m:
+#            mmxsupported = True
+#         if 'sse' in m:
+#            ssesupported = True
+   usex86sse = 0
    if (usex86sse == 0) and (mmxsupported and ssesupported):
       usex86sse = 1
    if usex86sse >= 1:
@@ -174,7 +176,7 @@
          print 'Using x86 SSE/MMX optimizations.'
    env.Append(CCFLAGS = ccflags)
    datadir = '/usr/local/share/dangerdeep'
-   build_dir = 'linux'
+   build_dir = 'irix'
    # check for broken libGL, ignore undefined symbols then
    if (os.system('grep glBindProgram /usr/include/GL/gl*.h > /dev/null') == 0):
       gllibdirs = ['/usr/X11R6/lib/', '/usr/lib/', '/usr/local/lib/']
@@ -190,8 +192,8 @@
       if (os.system('grep glBindProgram '+gllibdir+'libGL.so > /dev/null') != 0):
          print 'GL headers declare glBindProgram, but libGL.so has no such symbol! Ignoring all undefined symbols...'
          # I'm not sure which option will hopefully fix the problem... so i use both...
-         env.Append(LINKFLAGS = '--unresolved-symbols=ignore-all')
-         env.Append(LINKFLAGS = '-Xlinker --unresolved-symbols -Xlinker ignore-all')
+#         env.Append(LINKFLAGS = '--unresolved-symbols=ignore-all')
+#         env.Append(LINKFLAGS = '-Xlinker --unresolved-symbols -Xlinker ignore-all')
 
 ###### optionally change install and data dirs
 if ARGUMENTS.get('datadir', 0):
@@ -208,7 +210,7 @@
 
 ################ configure
 conf = Configure(env)
-if (devel == 0):
+if (1 == 0):
    if not conf.CheckLibWithHeader('GL', 'gl.h', 'C'):
       print 'GL library must be installed!'
       Exit(1)
@@ -232,11 +234,11 @@
       Exit(1)
    if conf.CheckLibWithHeader('fftw3f', 'fftw3.h', 'C'):
       print 'fftw3 library supports float type. Using it...'
-      fftwlib = 'fftw3f'
-      conf.env.Append(CPPDEFINES = ['WITH_FLOAT_FFTW'])
+      fftwlib = 'fftw3'
+#      conf.env.Append(CPPDEFINES = ['WITH_FLOAT_FFTW'])
 else:
-   fftwlib = 'fftw3f'
-   conf.env.Append(CPPDEFINES = ['WITH_FLOAT_FFTW'])   # developers always use float...
+   fftwlib = 'fftw3'
+#   conf.env.Append(CPPDEFINES = ['WITH_FLOAT_FFTW'])   # developers always use float...
 env = conf.Finish()
 
 ######################### source file lists
diff -ur dangerdeep-0.2.0//src/bspline.h dangerdeep-current//src/bspline.h
--- dangerdeep-0.2.0//src/bspline.h   Fri Oct 13 03:16:09 JST 2006
+++ dangerdeep-current//src/bspline.h   Sat Dec 30 19:12:34 JST 2006
@@ -26,12 +26,12 @@
 #include <vector>
 #include <cmath>
 
-#if (defined(__APPLE__) && defined(__GNUC__)) || defined(__MACOSX__)
+#if defined(__sgi) || (defined(__APPLE__) && defined(__GNUC__)) || defined(__MACOSX__)
 #include <complex.h>
 #ifndef isfinite
 #define isfinite(x) finite(x)
 #endif
-#elseif defined(WIN32)
+#elif defined(WIN32)
 #ifndef isfinite
 #define isfinite(x) _finite(x)
 #endif
diff -ur dangerdeep-0.2.0//src/coastmap.cpp dangerdeep-current//src/coastmap.cpp
--- dangerdeep-0.2.0//src/coastmap.cpp   Fri Oct 13 03:16:12 JST 2006
+++ dangerdeep-current//src/coastmap.cpp   Sat Dec 30 19:12:34 JST 2006
@@ -38,6 +38,10 @@
 #include <fstream>
 #include <list>
 #include <vector>
+#ifdef __sgi
+extern double round(double);
+#pragma optional round
+#endif
 using namespace std;
 
 
@@ -1190,6 +1194,7 @@
 
       // try to connect segcls that were made from the same global cl
       unsigned erased = 0;
+      vector<coastsegment::segpos>::iterator i1; /* for mipspro */
       for (unsigned i = 0; i < cs.segcls.size(); ++i) {
          coastsegment::segcl& cl0 = cs.segcls[i];
          if (cl0.global_clnr == -1) continue;
@@ -1204,7 +1209,9 @@
                ASSERT(cl0.next == -1, "strange paranoia1 next != -1");
                ASSERT(cl1.next == -1, "strange paranoia2 next != -1");
                //connect the segcls.
-               cl0.points.insert(cl0.points.end(), ++cl1.points.begin(), cl1.points.end());
+               i1 = cl1.points.begin();
+               i1++;
+               cl0.points.insert(cl0.points.end(), i1, cl1.points.end());
 //               cl0.points += cl1.points;
                cl0.endpos = cl1.endpos;
                cl1.global_clnr = -1;   // mark as erased.
diff -ur dangerdeep-0.2.0//src/faulthandler.h dangerdeep-current//src/faulthandler.h
--- dangerdeep-0.2.0//src/faulthandler.h   Fri Oct 13 03:16:09 JST 2006
+++ dangerdeep-current//src/faulthandler.h   Sat Dec 30 19:12:34 JST 2006
@@ -23,7 +23,7 @@
 #ifndef FAULTHANDLER_H
 #define FAULTHANDLER_H
 
-#ifndef WIN32
+#if !defined(WIN32) && !defined(__sgi)
 
 #include <execinfo.h>
 #include <stdio.h>
diff -ur dangerdeep-0.2.0//src/global_data.h dangerdeep-current//src/global_data.h
--- dangerdeep-0.2.0//src/global_data.h   Fri Oct 13 03:16:09 JST 2006
+++ dangerdeep-current//src/global_data.h   Sat Dec 30 19:12:34 JST 2006
@@ -32,7 +32,7 @@
 #include <SDL.h>
 #include <string>
 #include <list>
-#include <cmath>
+#include <math.h>
 #include "objcache.h"
 
 // fixme: remove this ugly crap, move to .cpp
diff -ur dangerdeep-0.2.0//src/make_mesh.cpp dangerdeep-current//src/make_mesh.cpp
--- dangerdeep-0.2.0//src/make_mesh.cpp   Fri Oct 13 03:16:12 JST 2006
+++ dangerdeep-current//src/make_mesh.cpp   Sat Dec 30 19:12:34 JST 2006
@@ -23,12 +23,12 @@
 #include "make_mesh.h"
 #include <cmath>
 
-#if (defined(__APPLE__) && defined(__GNUC__)) || defined(__MACOSX__)
+#if defined(__sgi) || (defined(__APPLE__) && defined(__GNUC__)) || defined(__MACOSX__)
 #include <complex.h>
 #ifndef isfinite
 #define isfinite(x) finite(x)
 #endif
-#elseif defined(WIN32)
+#elif defined(WIN32)
 #ifndef isfinite
 #define isfinite(x) _finite(x)
 #endif
diff -ur dangerdeep-0.2.0//src/model.cpp dangerdeep-current//src/model.cpp
--- dangerdeep-0.2.0//src/model.cpp   Fri Oct 13 03:16:12 JST 2006
+++ dangerdeep-current//src/model.cpp   Sat Dec 30 19:12:34 JST 2006
@@ -28,12 +28,12 @@
 #endif
 
 #include <cmath>
-#if (defined(__APPLE__) && defined(__GNUC__)) || defined(__MACOSX__)
+#if defined(__sgi) || (defined(__APPLE__) && defined(__GNUC__)) || defined(__MACOSX__)
 #include <complex.h>
 #ifndef isfinite
 #define isfinite(x) finite(x)
 #endif
-#elseif defined(WIN32)
+#elif defined(WIN32)
 #ifndef isfinite
 #define isfinite(x) _finite(x)
 #endif
@@ -259,8 +259,8 @@
    meshes[0]->compute_bounds();
    min = meshes[0]->min;
    max = meshes[0]->max;
-
-   for (vector<model::mesh*>::iterator it = ++meshes.begin(); it != meshes.end(); ++it) {
+   vector<model::mesh*>::iterator it = meshes.begin();
+   for (++it; it != meshes.end(); ++it) {
       (*it)->compute_bounds();
       min = (*it)->min.min(min);
       max = (*it)->max.max(max);
@@ -283,7 +283,8 @@
    if (vertices.size() == 0) return;
    min = max = vertices[0];
 
-   for (vector<vector3f>::iterator it2 = ++vertices.begin(); it2 != vertices.end(); ++it2) {
+   vector<vector3f>::iterator it2 = vertices.begin();
+   for (++it2; it2 != vertices.end(); ++it2) {
       min = it2->min(min);
       max = it2->max(max);
    }
diff -ur dangerdeep-0.2.0//src/sonar.h dangerdeep-current//src/sonar.h
--- dangerdeep-0.2.0//src/sonar.h   Fri Oct 13 03:16:09 JST 2006
+++ dangerdeep-current//src/sonar.h   Sat Dec 30 19:12:34 JST 2006
@@ -58,8 +58,11 @@
    // base^dB_val = real noise, dB = 10 * log10(real) -> dB/10 = log10(real)
    // -> 10^(dB/10) = real -> (10^0.1)^dB = real,  10^0.1 = dB_base
    // so dB_base^dB = real
+#ifndef __sgi
    static const double dB_base = 1.25892541179;
-
+#else /* MIPSpro doesn't like initializing the static const */
+   const double dB_base = 1.25892541179;
+#endif
    // limits of frequency bands in Hertz
    static const double frequency_band_lower_limit[NR_OF_FREQUENCY_BANDS];
    static const double frequency_band_upper_limit[NR_OF_FREQUENCY_BANDS];
@@ -79,8 +82,11 @@
    static const double typical_frequency[NR_OF_FREQUENCY_BANDS];
 
    // additional extra noise constant for cavitation, when running at full/flank speed, in dB
+#ifndef __sgi
    static const double cavitation_noise = 2;
-
+#else
+   const double cavitation_noise = 2;
+#endif
    static double dB_to_absolute(double dB) {
       return (dB < 0) ? 0.0 : pow(dB_base, dB);
    }
diff -ur dangerdeep-0.2.0//src/sonar_operator.h dangerdeep-current//src/sonar_operator.h
--- dangerdeep-0.2.0//src/sonar_operator.h   Fri Oct 13 03:16:09 JST 2006
+++ dangerdeep-current//src/sonar_operator.h   Sat Dec 30 19:12:34 JST 2006
@@ -54,11 +54,15 @@
    // fixme: good idea, but a contact is reported many times then while the sub turns, fixme!
    std::map<double, contact> contacts;
    bool active;   // disabled, when user does the work
-
+#ifndef __sgi /* MIPSpro doesn't like initializing static const */
    static const double turn_speed_fast = 6.0;   // degrees per second.
    static const double turn_speed_slow = 2.0;   // degrees per second.
    static const double simulation_step = 0.1;   // in seconds
-
+#else
+   const double turn_speed_fast = 6.0;      // degrees per second.
+   const double turn_speed_slow = 2.0;      // degrees per second.
+   const double simulation_step = 0.1;      // in seconds
+#endif
    double last_simulation_step_time;
 
    angle find_peak_lower_limit, find_peak_upper_limit;
diff -ur dangerdeep-0.2.0//src/system.h dangerdeep-current//src/system.h
--- dangerdeep-0.2.0//src/system.h   Fri Oct 13 03:16:09 JST 2006
+++ dangerdeep-current//src/system.h   Sat Dec 30 19:12:34 JST 2006
@@ -46,12 +46,15 @@
 #endif
 
 // a helpful macro
+#ifndef __sgi /* MIPSpro doesn't like ... in macros */
 #ifdef DEBUG
 #define ASSERT(a,...) {if(!(a)){sys().error(__VA_ARGS__);}}
 #else
 #define ASSERT(a,...)
 #endif
-
+#else
+#define ASSERT
+#endif
 class font;
 class texture;
 
diff -ur dangerdeep-0.2.0//src/tone_reproductor.cpp dangerdeep-current//src/tone_reproductor.cpp
--- dangerdeep-0.2.0//src/tone_reproductor.cpp   Fri Oct 13 03:16:12 JST 2006
+++ dangerdeep-current//src/tone_reproductor.cpp   Sat Dec 30 19:12:34 JST 2006
@@ -21,7 +21,7 @@
 #include "tone_reproductor.h"
 
 #ifndef pow10
-#define pow10(x) pow(10.0, x)
+#define pow10(x) pow((float)10.0, x)
 #endif
 
 // Set some values to prevent bugs in case of bad use
diff -ur dangerdeep-0.2.0//src/water.cpp dangerdeep-current//src/water.cpp
--- dangerdeep-0.2.0//src/water.cpp   Fri Oct 13 03:16:12 JST 2006
+++ dangerdeep-current//src/water.cpp   Sat Dec 30 19:12:34 JST 2006
@@ -1068,7 +1068,7 @@
    const float VIRTUAL_PLANE_HEIGHT = 25.0f;   // fixme experiment, amount of reflection distorsion, 30.0f seems ok, maybe a bit too much
 
    // maximum height of waves (half amplitude)
-   const double WAVE_HEIGHT = std::max(double(curr_wtp->maxh), fabs(curr_wtp->minh));
+   const double WAVE_HEIGHT = std::max(double(curr_wtp->maxh), (double)fabs(curr_wtp->minh));
 
 //   cout << "Wave height is: " << WAVE_HEIGHT << "\n";
 
@@ -1381,7 +1381,7 @@
 
    // compute dynamic normals
    // clear values from last frame (fixme: a plain memset(...,0 ) may be faster, or even mmx memset
-   fill(normals.begin(), normals.end(), vector3f());
+   std::fill(normals.begin(), normals.end(), vector3f());
 
    // compute normals for all faces, add them to vertex normals
    // fixme: angles at vertices are ignored yet

User avatar
lhaza
Posts: 186
Joined: Wed Apr 20, 2005 6:35 pm
Location: Milchstrasse, Kakania
Contact:

Unread postby lhaza » Sat Dec 30, 2006 3:21 am

Linking fails with the following symbols undefined: fftw_execute (which is in /usr/nekoware/lib/libfftw* but those don't get linked for some reason),


dangerdeep 0.2 uses libfftw 3.1 while nekoware is at 3.0.1. This could be the problem here.

Brombear
Posts: 786
Joined: Sun Oct 05, 2003 8:42 am
Location: Frankfurt (Rhein-Main Area) / Germany
Contact:

Unread postby Brombear » Sat Dec 30, 2006 3:43 am

skip wrote:glBindProgramARB, glProgramLocalParameter4fARB, glLockArraysEXT, glUnlockArraysEXT, glClientActiveTexture, glGenProgramsARB, glProgramStringARB, glGetProgramivARB, glDeleteProgramsARB.


These are all calls to OpenGL that deal with newer type of extensions like GLSL etc. If these calls are used directly within the code it is very bad style, typically you query those as function pointers and use them only if they are defined.

Matthias
Life is what happens while we are making other plans

User avatar
squeen
Moderator
Moderator
Posts: 2933
Joined: Fri May 09, 2003 6:10 am
Location: Maryland, USA

Unread postby squeen » Sat Dec 30, 2006 4:38 am

Brombear is right. The game used OpenGL Shading Language with IRIX graphics don't support. You'd have to whack that part of the code (for the water it looks like).

skip
Posts: 48
Joined: Mon Dec 25, 2006 4:35 am
Location: Hokkaido, Japan

Unread postby skip » Sat Dec 30, 2006 5:21 am

lhaza wrote:dangerdeep 0.2 uses libfftw 3.1 while nekoware is at 3.0.1. This could be the problem here.

Thanks - that seems to work okay. Linking to a static libfftw 3.1 fixes the two fftw symbols.

Brombear wrote:These are all calls to OpenGL that deal with newer type of extensions like GLSL etc. If these calls are used directly within the code it is very bad style, typically you query those as function pointers and use them only if they are defined.

squeen wrote:Brombear is right. The game used OpenGL Shading Language with IRIX graphics don't support. You'd have to whack that part of the code (for the water it looks like).

Ah, that's too bad. :( And indeed, none of them are in glGetString(GL_EXTENSIONS). Thanks to both of you - I didn't know anything about GL (but now I know one tiny thing :D ).

skip
Posts: 48
Joined: Mon Dec 25, 2006 4:35 am
Location: Hokkaido, Japan

Unread postby skip » Sat Dec 30, 2006 6:23 am

squeen wrote:You'd have to whack that part of the code (for the water it looks like).

(edited: I fixed the patch so it really does apply cleanly now :oops:)
I #ifdef'ed out all references to the undefined GL symbols, and the game runs now. Sound/title screen/etc seem fine. Viewing vessels works, although some of them are simple white models (the #ifdef probably broke them).
It seems to play missions now, although I don't know how to do anything. :oops:
The new patch (includes the previous ones, so this is the only one needed) is larger. It's at http://www.nekochan.net/wiki/ ... deep.patch which seems to apply cleanly. The link line needs to be manually modified again - I removed the -lfftw3 and added -lm and ../fftw-3.1.2/.libs/libfftw3.a to link a static version of fftw-3.1.2.
Performance is almost passable for me (Fuel/500/V10). The scons file says that it should be linked against an --enable-float build of fftw for performance which I haven't done yet.
I'm really off to bed now, but thanks again. :D
Last edited by skip on Sat Dec 30, 2006 8:27 am, edited 1 time in total.

User avatar
nuclear
Posts: 10
Joined: Tue Dec 26, 2006 8:07 pm

details on the missing functions

Unread postby nuclear » Sat Dec 30, 2006 8:27 am

Let's see what's missing in detail:

glActiveTexture, glClientActiveTexture
These functions select the active texture unit for the multitexturing interface in OpenGL 1.3 IIRC (promoted from extension GL_ARB_multitexture). This is not available in any MIPS-based SGI system, you would have to rewrite the rendering to use multiple passes, one for each texture with the appropriate blending modes between the passes, in order to work correctly (if it's not used exclusively with GLSL programs see bellow).

glLockArraysEXT, glUnlockArraysEXT
This comes from GL_EXT_compiled_vertex_array, which isn't there on my VPro octane2, there is a EXT_vertex_arrays, which could be used instead I guess. Personally I haven't used either one of those, the standard these days is ARB_vertex_buffer_object (which isn't supported either).
If EXT_vertex_arrays proved inadequate or not supported on older sgi systems, you could rewrite the relevant parts to use immediate mode (glBegin/glEnd) but expect a significant performance drop. If the arrays are not modified too much your best bet would be to rewrite the code to use display lists which is a standard OpenGL 1.0 feature.

glBindProgramARB, glProgramLocalParameter4fARB, glGenProgramsARB, glProgramStringARB, glGetProgramivARB, glDeleteProgramsARB
All the above are part of the GLSL (OpenGL Shading Language) interface, as defined through the extensions ARB_shader_objects, ARB_fragment_shader, ARB_vertex_shader. (the actual OpenGL 2.0 interface for these is slightly different and does not include the ARB suffixes of course). There is absolutely no way you can approximate the shader-based rendering in a MIPS-based SGI. Only one common usage of shaders (per-pixel lighting with vertex-interpolated normals) can be done with VPro systems using the SGIX_fragment_lighting extension. But most games which use shaders for per-pixel lighting also generally modify the normals inside the shader or derive them from normal maps, neither of which can be approximated without shaders.

Your best bet is to check out if there are compile or run time switches that disable the use of shaders and multitexturing in the aforementioned game, otherwise you have a lot of rewriting to do :)

skip
Posts: 48
Joined: Mon Dec 25, 2006 4:35 am
Location: Hokkaido, Japan

Re: details on the missing functions

Unread postby skip » Sat Dec 30, 2006 8:40 am

nuclear wrote:Your best bet is to check out if there are compile or run time switches that disable the use of shaders and multitexturing in the aforementioned game, otherwise you have a lot of rewriting to do :)

Wow, thanks for the details. :D Unfortunately I'm really not capable of rewriting the rendering :wink:, but there are a couple of configuration variables that can be changed. I have the following in ~/.dangerdeep/config (created the first time that dangerdeep is run):

Code: Select all

<use_shaders value="false" />
<use_shaders_for_water value="false" />
<usex86sse value="false" />

These are referenced in the code, but I haven't really read enough to make sure they're always used. But, with the patch linked above it seems basically playable. Pounding on the keyboard gets me "Crash dive!" "Engines ahead flank" and the like and then the bridge view becomes dark. 8)

skip
Posts: 48
Joined: Mon Dec 25, 2006 4:35 am
Location: Hokkaido, Japan

Unread postby skip » Sun Dec 31, 2006 3:58 am

(edit: I also put a binary with -O3 -mips4 -n32 at http://skipfiles.googlepages.com/dangerdeep2 as that fixes the issues with other subs/etc. But, it's noticeably slower. So that one works a bit better, but the next one is faster. 6268K)
I compiled a binary using the patch from before with -Ofast=ip27 -mips4 -n32 and put it at http://skipfiles.googlepages.com/dangerdeep if anyone would like to try it. It's 6036K.
It requires SDL, SDL_image, SDL_net, SDL_mixer, libiconv, libpng, libjpeg, libtiff, libz, libvorbisfile, libvorbis and libogg from Nekoware. It also requires the 0.2.0 data files from http://www.dangerdeep.net in the default location (/usr/local/share/dangerdeep). I -think- the binary is sufficient, everything required should be linked statically, but I only have a single machine to test on. :(
Performance is better (than the -O3 build) for me. Some things are broken, but the training missions (in historical missions), and I think all convoy battles with the VIIC (the first) sub seem to basically work. The other subs worked before, but somehow I broke them I guess. Destroyers are rather dangerous, but it's possible to hide. Some ships have become invisible and/or invincible. 8) I'd love to hear if it doesn't work at all, or if it does. Some textures look a bit odd, but morning and evening are pretty.

Anyways, happy New Year everyone (in 3 hours here :) )

User avatar
lhaza
Posts: 186
Joined: Wed Apr 20, 2005 6:35 pm
Location: Milchstrasse, Kakania
Contact:

Unread postby lhaza » Sun Dec 31, 2006 9:59 am

I compiled a binary using the patch from before with -Ofast=ip27 -mips4 -n32 and put it at http://skipfiles.googlepages.com/dangerdeep if anyone would like to try it. It's 6036K.


Hey, thanksalot. It works here on fuel v10. I had no luck with your patch (-lm needs to be in last place, how to do that with scons??).

funny:

Code: Select all

console log: Unable to play WAV file: Couldn't open /usr/local/share/dangerdeep/objects/torpedoes/TI/standard/g7a_torpedo_color.jpg


Happy new year! Still 5hrs here...(central europe).

skip
Posts: 48
Joined: Mon Dec 25, 2006 4:35 am
Location: Hokkaido, Japan

Unread postby skip » Sun Dec 31, 2006 10:27 pm

lhaza wrote:It works here on fuel v10. I had no luck with your patch (-lm needs to be in last place, how to do that with scons??).

I don't know how to use scons, but I run it once, wait for linking to fail, then run it again. The second time it shows the command used to link (with -lm at the start). I copy and paste that, removing -lfftw3 and adding "-lm ../fftw-3.1.2/.libs/libfftw3.a" to the end. I really need to patch SConstruct properly at some point.
I'm really glad to hear that it works. :D
funny:

Code: Select all

console log: Unable to play WAV file: Couldn't open /usr/local/share/dangerdeep/objects/torpedoes/TI/standard/g7a_torpedo_color.jpg


Haha - that is funny. I wonder if it's broken in 0.2.0 in general, or only on IRIX. Thanks for trying it. :)

User avatar
UrbanHero
Posts: 298
Joined: Tue Aug 23, 2005 1:06 am
Location: Leerdam, Holland, formerly Rotterdam, Holland

Unread postby UrbanHero » Wed Jan 03, 2007 10:27 am

Well, this sure generated some interest :D

Performance is almost passable for me (Fuel/500/V10).


Ouch! I was hoping lumbering boats wouldn't tax the system so much; apparently there's a lot of heavy stuff going on behind the scene...my Octane's gonna have a tough time with this :?
-= I reject reality, and substitute my own =-

1 Indigo R3k-33 32MB XS24-Z;
1 Indy R5k-180 256MB XZ;
1 Indy R4k-175 64MB XL;
2 Indigo2 R10k-195 512MB MaxImpact;
2 Indigo2 R4k-200 256MB (XL+Extreme);
2 Octane Dual R12K-300 1024MB (MXI+V6).

User avatar
Alver
Posts: 773
Joined: Wed Dec 07, 2005 4:46 pm
Location: Wetteren, Belgium
Contact:

Unread postby Alver » Wed Jan 03, 2007 12:45 pm

I built dangerdeep on linux a while back. 50% of the game wasn't implemented yet, and the other half crashed if you dared to sneeze. Has it improved since then? I could use another game on my Octane... :)
while (!asleep()) sheep++;

User avatar
fzalfa
Posts: 739
Joined: Sun Jun 19, 2005 11:38 am
Location: avignon ,provence, france
Contact:

Unread postby fzalfa » Wed Jan 03, 2007 1:15 pm

thanks for the work, but both executable crash on my octane2 (r12k and r14k)

i have the main mene, mission choice, but after had loaded the mission, it crash

the message is obscure.... "Caught exception: "

Laurent
SGI or die !!!
:O2: :Octane2: :Octane: :Indigo2IMP: :Indigo2IMP: :Indigo: :Indigo: :Indy: :PI: :Crimson: :PWRSeries: :Onyx: :O2000R:
HP proliant DL 585 Quad Opteron dual core 2.5Ghz 16Gb


Return to “SGI: Development”

Who is online

Users browsing this forum: No registered users and 2 guests