FAQ  •  Register  •  Login

Jedi Outcast/Academy source code releases

Moderator: Inside3D Admins

<<

leileilol

Posts: 2783

Joined: Fri Oct 15, 2004 3:23 am

Post Thu Apr 04, 2013 6:01 pm

Jedi Outcast/Academy source code releases

i should not be here
<<

leileilol

Posts: 2783

Joined: Fri Oct 15, 2004 3:23 am

Post Thu Apr 04, 2013 6:37 pm

Re: Jedi Outcast/Academy source code releases

Where the hell did that Ghoul2 thing come from!?









So....... did anyone get this compiled yet?

Some interesting ideas to do with the source:
  • Port tr_flares to Q3
  • Attempt to get GAMECUBE compiling working (a bit shocked the console versions' stuff is in this tree)
  • Port the environment map calculation code to Q3 (it's a little different)
  • Port Jedi Academy's dynamic light code to Q3 (lighting up dark areas is the important part of it)
  • A media project that has nothing to do with Star Wars in any way, probably going to be stiff players shooting lasers in box maps at best, only maintaining compatibility with mod codebases and player animations (every saber anim would be a poke... in every stance), disregarding map textures and other stuff, with a lack of sense of direction to shut up warnings.
  • Port ICARUS to ioSTVEF to get Elite Force's single player working
i should not be here
<<

Knightmare

Posts: 56

Joined: Thu Feb 09, 2012 1:55 am

Post Fri Apr 05, 2013 4:42 am

Re: Jedi Outcast/Academy source code releases

It also contains what appears to be the source for the random map generator used in SOF2 (under code/rmg). Maybe that could be gotten working- its implementation did use a lot of scripts in SOF2.

More ideas:
  • (OpenJK) Implement native widescreen/surround support with properly scaled FOV and anamorphic screen coord scaling (avoid stretched menus/HUD).
  • Implement its BSP format in Q3 and/or Q2 (it has the lightstyles from Q1 and Q2 that were removed for Q3).
<<

leileilol

Posts: 2783

Joined: Fri Oct 15, 2004 3:23 am

Post Fri Apr 05, 2013 8:47 pm

Re: Jedi Outcast/Academy source code releases

Turns out there was a mistake in the source upload. There were no project files, and the JediOutcast code seemed to be JediAcademy code. I was puzzled on why there's HDR bloom in the Jedi Outcast tree


I'm compiling Jedi Outcast now, unfortunately there's an error with the shadercommands typedef in tr_local.h


EDIT: Apparently compiles with Visual C++ 6 SP5 without problems
Image
i should not be here
<<

scar3crow

User avatar

Inside3D Staff

Posts: 1036

Joined: Tue Jan 18, 2005 8:54 pm

Location: Alabama

Post Sat Apr 06, 2013 7:44 pm

Re: Jedi Outcast/Academy source code releases

Rich, who worked on these projects, is up to lots of good with it.

http://sourceforge.net/u/richwhitehouse ... ba44/tree/
...and all around me was the chaos of battle and the reek of running blood.... and for the first time in my life I knew true happiness.
<<

Rich

Posts: 35

Joined: Tue Nov 02, 2010 3:46 am

Post Sat Apr 06, 2013 7:57 pm

Re: Jedi Outcast/Academy source code releases

Here's a tag for Visual Studio 2010 solution+projects with all of the errors/warnings fixed for JAMP:
https://sourceforge.net/u/richwhitehous ... d1e1/tree/

I'd recommend starting from that instead of going back to old versions of MSVC. It also makes more sense for longterm projects to go with JAMP and not JK2 or JASP, JA can be adapted to run JK2 mods and load any content that JK2 can, but backporting JA changes to the JK2 codebase would be a lot more work. JAMP also partially runs JK2 as a coop game already, but people tell me that was broken a bit before it went to retail. Now's a good time to fix that!

I'm going to start working on some crazy threading stuff in my fork and making it run superfast on modern machines, since I feel the highest priority thing here is to have 500 Reborn onscreen at once. Then I'm going to make saber collisions nicer and smoother even at low server framerates (because I was retarded when I was working on that initially), then I'll probably start cleaning stuff up and restructuring the rendering backend to not be horrible. Feel free to let me know if you'd like to work on the fork with me and I'll give you write access.

Edit: Oh, and if you copied the code straight out before last night (as I see in the OpenJK repository) instead of forking, you'll need to remove the bink stuff and feelit libs to avoid legal issues. We had to struggle with Git last night to remove evidence of their existence.
<<

leileilol

Posts: 2783

Joined: Fri Oct 15, 2004 3:23 am

Post Sat Apr 06, 2013 10:28 pm

Re: Jedi Outcast/Academy source code releases

One thing i've noticed missing is 'fontgen'. I can't find a way to generate new font textures with corresponding fontdat files.

I actually have a stubby placeholder-filled media project in progress, which will have its fate decided whether I can make a working player skeleton and basic animation set with it from scratch (which probably can't guarantee compatibilty with existing _humanoid meshes). To get the engine not to crash i've had to make a few blank strings files and a blank gfx2.shader.

Making efx files is sort of fun. I'm going to make everything bleed, attempt atlasing (putting 4 particle textures on one texture sheet and tcMod scale in their stages to select which), and blending cap fallbacks for ragepro (prefer additive/alphatest) and pcx2/mystique (prefer alpha).
i should not be here
<<

Rich

Posts: 35

Joined: Tue Nov 02, 2010 3:46 am

Post Sun Apr 07, 2013 2:34 pm

Re: Jedi Outcast/Academy source code releases

I'll see if James still has fontgen code/binary anywhere. I'd be surprised if a binary wasn't included in the JK2 and/or JA SDK though.
<<

thelolotov

Posts: 1

Joined: Sun Apr 07, 2013 10:49 pm

Post Thu Apr 11, 2013 4:00 pm

Re: Jedi Outcast/Academy source code releases

Knightmare wrote:It also contains what appears to be the source for the random map generator used in SOF2 (under code/rmg). Maybe that could be gotten working- its implementation did use a lot of scripts in SOF2.

More ideas:
  • (OpenJK) Implement native widescreen/surround support with properly scaled FOV and anamorphic screen coord scaling (avoid stretched menus/HUD).
  • Implement its BSP format in Q3 and/or Q2 (it has the lightstyles from Q1 and Q2 that were removed for Q3).

Throwing my hat in the ring here, native widescreen/surround/triplehead/eyefinity support would be absolutely incredible. I've submitted a feature request here: https://github.com/Razish/OpenJK/issues/36

So go there and make it known or help, if you can!
<<

Knightmare

Posts: 56

Joined: Thu Feb 09, 2012 1:55 am

Post Fri Apr 12, 2013 1:20 am

Re: Jedi Outcast/Academy source code releases

I've already done native widescreen in my RtCW SP 1.42 unofficial patch, it would probably just be a copy/paste of those changes into the JA source tree. A wide range of resolutions are natively supported, even the new 2560x1080 21:9 ultra-wide aspect. This source can be downloaded here: http://www.markshan.com/knightmare/down ... 42b-src.7z

Here are my vidmodes:
  Code:
vidmode_t r_vidModes[] =
{
   { "Mode  0: 320x240",         320,    240,    1 },
   { "Mode  1: 400x300",         400,    300,    1 },
   { "Mode  2: 512x384",         512,    384,    1 },
   { "Mode  3: 640x480",         640,    480,    1 },
   { "Mode  4: 800x600",         800,    600,    1 },
   { "Mode  5: 960x720",         960,    720,    1 },
   { "Mode  6: 1024x768",        1024,   768,    1 },
   { "Mode  7: 1152x864",        1152,   864,    1 },
   { "Mode  8: 1280x960",        1280,   960,    1 },    // Knightmare   added
   { "Mode  9: 1280x1024",       1280,   1024,   1 },
   { "Mode 10: 1400x1050",       1400,   1050,   1 },    // Knightmare   added
   { "Mode 11: 1600x1200",       1600,   1200,   1 },
   { "Mode 12: 1920x1440",         1920,   1440,   1 },    // Knightmare   added
   { "Mode 13: 2048x1536",       2048,   1536,   1 },
   { "Mode 14: 800x480 (wide)",  800,    480,     1 },    // Knightmare   added
   { "Mode 15: 856x480 (wide)",  856,    480,    1 },
   { "Mode 16: 1024x600 (wide)", 1024,   600,    1 },    // Knightmare   added
   { "Mode 17: 1280x720 (wide)", 1280,   720,    1 },    // Knightmare   added
   { "Mode 18: 1280x768 (wide)", 1280,   768,    1 },    // Knightmare   added
   { "Mode 19: 1280x800 (wide)", 1280,   800,    1 },    // Knightmare   added
   { "Mode 20: 1360x768 (wide)", 1360,   768,     1 },    // Knightmare   added
   { "Mode 21: 1366x768 (wide)", 1366,   768,     1 },    // Knightmare   added
   { "Mode 22: 1440x900 (wide)", 1440,   900,     1 },    // Knightmare   added
   { "Mode 23: 1600x900 (wide)", 1600,   900,    1 },    // Knightmare   added
   { "Mode 24: 1600x1024 (wide)", 1600,  1024,   1 },    // Knightmare   added
   { "Mode 25: 1680x1050 (wide)", 1680,  1050,   1 },    // Knightmare   added
   { "Mode 26: 1920x1080 (wide)", 1920,  1080,   1 },    // Knightmare   added
   { "Mode 27: 1920x1200 (wide)", 1920,  1200,   1 },    //----(SA)   added
   { "Mode 28: 2560x1080 (ultra-wide)", 2560,  1080,   1 },    // Knightmare   added
   { "Mode 29: 2560x1440 (wide)", 2560,  1440,   1 },    // Knightmare   added
   { "Mode 30: 2560x1600 (wide)", 2560,  1600,   1 }     // Knightmare   added
};


The largest change is an overhaul of the AdjustFrom640 function (RtCW has 4 redundant versions of this that had to be changed) to take an enumerated alignment type parameter that determines if an object is centered, aligned to the center top, bottom right, stretched, etc. All menu items are centered by default, and an "scrAlign" attribute can be added to menu scripts to set the alignment (good thing the menu files are included with the GPLed source). The alignment parameter had to be added to lots of 2D drawing functions.

Add to tr_types.h:
  Code:
// Knightmare- screen item alignment types
typedef enum
{
   ALIGN_STRETCH,
   ALIGN_CENTER,
   ALIGN_LETTERBOX,
   ALIGN_TOP,
   ALIGN_BOTTOM,
   ALIGN_RIGHT,
   ALIGN_LEFT,
   ALIGN_TOPRIGHT,
   ALIGN_TOPLEFT,
   ALIGN_BOTTOMRIGHT,
   ALIGN_BOTTOMLEFT,
   ALIGN_TOP_STRETCH,
   ALIGN_BOTTOM_STRETCH
} scralign_t;


Here's my modified SCR_AdjustFrom640 in cl_scrn.c:
  Code:
void SCR_AdjustFrom640( float *x, float *y, float *w, float *h, scralign_t align ) {
   float   xscale, yscale, avgscale, vertscale;   // Knightmare added
   float   tmp_x, tmp_y, tmp_w, tmp_h;            // Knightmare added

   // scale for screen sizes
   xscale = cls.glconfig.vidWidth / 640.0;
   yscale = cls.glconfig.vidHeight / 480.0;
   avgscale = min (xscale, yscale);

   // hack for 4:3 modes
   if ( !(xscale > yscale) && align != ALIGN_LETTERBOX)
      align = ALIGN_STRETCH;

   // Knightmare- added anamorphic code
   switch (align)
   {
   case ALIGN_CENTER:
      if (x) {
      tmp_x = *x;
         *x = (tmp_x - (0.5 * SCREEN_WIDTH)) * avgscale + (0.5 * cls.glconfig.vidWidth);
      }
      if (y) {
         tmp_y = *y;
         *y = (tmp_y - (0.5 * SCREEN_HEIGHT)) * avgscale + (0.5 * cls.glconfig.vidHeight);
      }
      if (w)
         *w *= avgscale;
      if (h)
         *h *= avgscale;
      break;
   case ALIGN_LETTERBOX:
      // special case: video mode (eyefinity?) is wider than object
      if ( w != NULL && h != NULL && ((float)cls.glconfig.vidWidth / (float)cls.glconfig.vidHeight > *w / *h) ) {
         tmp_h = *h;
         vertscale = cls.glconfig.vidHeight / tmp_h;
         if (x != NULL && w != NULL) {
            tmp_x = *x;
            tmp_w = *w;
            *x = tmp_x * xscale - (0.5 * (tmp_w * vertscale - tmp_w * xscale));
         }
         if (y)
            *y = 0;
         if (w)
            *w *= vertscale;
         if (h)
            *h *= vertscale;
      }
      else {
         if (x)
            *x *= xscale;
         if (y != NULL && h != NULL)  {
            tmp_y = *y;
            tmp_h = *h;
            *y = tmp_y * yscale - (0.5 * (tmp_h * xscale - tmp_h * yscale));
         }
         if (w)
            *w *= xscale;
         if (h)
            *h *= xscale;
      }
      break;
   case ALIGN_TOP:
      if (w)
         *w *= avgscale;
      if (h)
         *h *= avgscale;
      if (x) {
         tmp_x = *x;
         *x = (tmp_x - (0.5 * SCREEN_WIDTH)) * avgscale + (0.5 * cls.glconfig.vidWidth);
      }
      if (y)
         *y *= avgscale;
      break;
   case ALIGN_BOTTOM:
      if (w)
         *w *= avgscale;
      if (h)
         *h *= avgscale;
      if (x) {
         tmp_x = *x;
         *x = (tmp_x - (0.5 * SCREEN_WIDTH)) * avgscale + (0.5 * cls.glconfig.vidWidth);
      }
      if (y) {
         tmp_y = *y;
         *y = (tmp_y - SCREEN_HEIGHT) * avgscale + cls.glconfig.vidHeight;
      }
      break;
   case ALIGN_RIGHT:
      if (w)
         *w *= avgscale;
      if (h)
         *h *= avgscale;
      if (x) {
         tmp_x = *x;
         *x = (tmp_x - SCREEN_WIDTH) * avgscale + cls.glconfig.vidWidth;
      }
      if (y) {
         tmp_y = *y;
         *y = (tmp_y - (0.5 * SCREEN_HEIGHT)) * avgscale + (0.5 * cls.glconfig.vidHeight);
      }
      break;
   case ALIGN_LEFT:
      if (w)
         *w *= avgscale;
      if (h)
         *h *= avgscale;
      if (x)
         *x *= avgscale;
      if (y) {
         tmp_y = *y;
         *y = (tmp_y - (0.5 * SCREEN_HEIGHT)) * avgscale + (0.5 * cls.glconfig.vidHeight);
      }
      break;
   case ALIGN_TOPRIGHT:
      if (w)
         *w *= avgscale;
      if (h)
         *h *= avgscale;
      if (x) {
         tmp_x = *x;
         *x = (tmp_x - SCREEN_WIDTH) * avgscale + cls.glconfig.vidWidth;
      }
      if (y)
         *y *= avgscale;
      break;
   case ALIGN_TOPLEFT:
      if (w)
         *w *= avgscale;
      if (h)
         *h *= avgscale;
      if (x)
         *x *= avgscale;
      if (y)
         *y *= avgscale;
      break;
   case ALIGN_BOTTOMRIGHT:
      if (w)
         *w *= avgscale;
      if (h)
         *h *= avgscale;
      if (x) {
         tmp_x = *x;
         *x = (tmp_x - SCREEN_WIDTH) * avgscale + cls.glconfig.vidWidth;
      }
      if (y) {
         tmp_y = *y;
         *y = (tmp_y - SCREEN_HEIGHT) * avgscale + cls.glconfig.vidHeight;
      }
      break;
   case ALIGN_BOTTOMLEFT:
      if (w)
         *w *= avgscale;
      if (h)
         *h *= avgscale;
      if (x)
         *x *= avgscale;
      if (y) {
         tmp_y = *y;
         *y = (tmp_y - SCREEN_HEIGHT) * avgscale + cls.glconfig.vidHeight;
      }
      break;
   case ALIGN_TOP_STRETCH:
      if (w)
         *w *= xscale;
      if (h)
         *h *= avgscale;
      if (x)
         *x *= xscale;
      if (y)
         *y *= avgscale;
      break;
   case ALIGN_BOTTOM_STRETCH:
      if (w)
         *w *= xscale;
      if (h)
         *h *= avgscale;
      if (x)
         *x *= xscale;
      if (y) {
         tmp_y = *y;
         *y = (tmp_y - SCREEN_HEIGHT) * avgscale + cls.glconfig.vidHeight;
      }
      break;
   case ALIGN_STRETCH:
   default:
      if (x)
         *x *= xscale;
      if (y)
         *y *= yscale;
      if (w)
         *w *= xscale;
      if (h)
         *h *= yscale;
      break;
   }
}


FOV also needs to be scaled up for wider aspects.
Added define near the top of cg_view.c:
  Code:
#define STANDARD_ASPECT_RATIO ((float)640/(float)480)   // Knightmare added


Here's the addition needed in CG_CalcFOV:
  Code:
   // Knightmare- adjust fov_x for wide screen aspect
   if (cg_widescreen_fov.value)
   {
      float aspectRatio = (float)cg.refdef.width/(float)cg.refdef.height;
      if (aspectRatio > STANDARD_ASPECT_RATIO)
         fov_x = RAD2DEG( 2 * atan( (aspectRatio / STANDARD_ASPECT_RATIO) * tan(DEG2RAD(fov_x) * 0.5) ) );
      fov_x = min(fov_x, 160);
   }
   // end Knightmare
   
   x = cg.refdef.width / tan( fov_x / 360 * M_PI );
   fov_y = atan2( cg.refdef.height, x );
   fov_y = fov_y * 360 / M_PI;


Also, SCR_DrawScreenField is bugged in widescreen modes. The code that's supposed to clear the sides of pillarboxed cinematics ends up drawing over them, so just comment this out:
  Code:
   // wide aspect ratio screens need to have the sides cleared
   // unless they are displaying game renderings
#ifndef _XBOX
   // Xbox no want this
   if ( cls.state != CA_ACTIVE ) {
      if ( cls.glconfig.vidWidth * 480 > cls.glconfig.vidHeight * 640 ) {
         re.SetColor( g_color_table[0] );
         re.DrawStretchPic( 0, 0, cls.glconfig.vidWidth, cls.glconfig.vidHeight, 0, 0, 0, 0, 0 );
         re.SetColor( NULL );
      }
   }
#endif


Instead, CIN_DrawCinematic in cl_cin.cpp needs to be changed to do pillarboxing:
  Code:
void CIN_DrawCinematic( int handle ) {
   float   barheight, barwidth, vw, vh;   // Knightmare added
   .
   .
   .
   x = cinTable[handle].xpos;
   y = cinTable[handle].ypos;
   w = cinTable[handle].width;
   h = cinTable[handle].height;
   
   // Knightmare- use letterbox scaling if specified
   if ( cinTable[handle].letterBox )
      SCR_AdjustFrom640( &x, &y, &w, &h, ALIGN_LETTERBOX );
   else
      SCR_AdjustFrom640( &x, &y, &w, &h, ALIGN_CENTER );

   vw = (float)cls.glconfig.vidWidth;
   vh = (float)cls.glconfig.vidHeight;
   .
   .
   .
   // Knightmare- add pillarbox bars when needed
   barwidth = 0.5 * (vw - w);
   barheight = vh;
   if (barwidth > 0) {
      re.SetColor( &colorBlack[0] );
      re.DrawStretchPic( 0, 0, barwidth, barheight, 0, 0, 0, 0, cls.whiteShader );
      re.DrawStretchPic( vw - barwidth - 1, 0, barwidth + 1, barheight, 0, 0, 0, 0, cls.whiteShader );
   }
   // end Knightmare

   if ( cinTable[handle].dirty && ( cinTable[handle].CIN_WIDTH != cinTable[handle].drawX || cinTable[handle].CIN_HEIGHT != cinTable[handle].drawY ) ) {
      .
      .
      .
      .
   }
   .
   .
}
<<

leileilol

Posts: 2783

Joined: Fri Oct 15, 2004 3:23 am

Post Fri Apr 12, 2013 2:29 am

Re: Jedi Outcast/Academy source code releases

Knightmare wrote:(good thing the menu files are included with the GPLed source)

The menu scripts are not included for me.
i should not be here
<<

Knightmare

Posts: 56

Joined: Thu Feb 09, 2012 1:55 am

Post Fri Apr 12, 2013 2:58 am

Re: Jedi Outcast/Academy source code releases

The zip I downloaded has them under base/ui.

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 0 guests

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.
Icons provided by Aha Soft