A Powerslave / Exhumed Map and Game FAQ

User avatar
Corvin
Posts: 208
Joined: Fri May 20, 2016 1:10 pm
Location: R.T.C.M.
Contact:

Re: A Powerslave / Exhumed Map and Game FAQ

Postby Corvin » Mon Oct 29, 2018 3:03 am

The radarang is what possible was messing up the parallaxed skybox, according to JF.

On another note, (too lazy to look up if this was posted already) but JF mentioned when making a new map:
"If you’re working on a map from scratch, you can set the map format for saving in the console (Numlock) with “mapversion 6”. Saving will preserve the version that was loaded."
-=CHE@TER=-
Posts: 48
Joined: Thu Dec 14, 2017 11:54 am

Re: A Powerslave / Exhumed Map and Game FAQ

Postby -=CHE@TER=- » Mon Oct 29, 2018 1:17 pm

Corvin wrote:The radarang is what possible was messing up the parallaxed skybox, according to JF.
Actually, as you see the whole "TABLES.DAT" file format are different from the ones in Duke3D. I've compared contents of the tables and apart from the mentioned radarang[] array everything else is the same. I'm also did a converter from older "TABLES.DAT" and "PALETTE.DAT" to newer to work with the jfBuild (2005 year version). One thing that I probably can't convert are "LOOKUP.DAT" file since Exhumed / PowerSlave didn't have one and using this code instead:

Code: Select all

#define MAX_RMP 12
static char *GradList[MAX_RMP] = {
  "normal.rmp",
  "nodim.rmp",
  "torch.rmp",
  "notorch.rmp",
  "brite.rmp",
  "redbrite.rmp",
  "grnbrite.rmp",
  /* here we go again, copy-pasted code?.. */
  "normal.rmp",
  "nodim.rmp",
  "torch.rmp",
  "notorch.rmp",
  "brite.rmp"
};

int LoadPaletteLookups(void) {
int fil, i;
  /* who knows why they frees only the first pointer? */
  free(*palookup);
  *palookup = NULL;
  /* why this initialized there? */
  numpalookups = 64;
  for (i = 0; i < MAX_RMP; i++) {
    fil = kopen4load(GradList[i], 1);
    /* yeah, right, this should be (fil == -1)
       probably leftover from fopen() code? */
    if (!fil) {
      printf("Error reading palette lookup '%s'\n", GradList[i]);
      return(0);
    }
    makepalookup(i, 0, 0, 0, 0, 0);
    kread(fil, palookup[i], 16384);
    kclose(fil);
    origpalookup[i] = palookup[i];
  }
  return(1);
}


The problem is that all *.RMP files are already converted with makepalookup() to 16384 arrays but Duke3D "LOOKUP.DAT" loader code expects 256-bytes arrays to convert. I don't understand how I can convert them back to make Duke3D compatible "LOOKUP.DAT" file for using with already existing level editing tools.
By the way, I add the "PALETTE.DAT" loader code to my last message.
User avatar
jonof
Posts: 7
Joined: Wed Oct 24, 2018 6:57 am

Re: A Powerslave / Exhumed Map and Game FAQ

Postby jonof » Sat Nov 03, 2018 12:22 am

Hi folks. Before I provide a new executable, I want to change how the editor prompts for loading and saving from the local filesystem, specifically by opening a native file chooser. I had brought across a change from JFDuke/SW to use a private profile directory, which moves build.cfg into a better place (the updated tables.dat is now redundant), but it means your maps will also default to loading from that inconvenient place. Watch this space.^W^W^W

Give this version a try some time: http://static.jonof.id.au/tmp/exhumed-editor-7415031.zip
You can put build.exe wherever you wish, but it still needs the modified palette.dat file, so it would still be smart to keep it separate from the game. The config file will be created in C:\Users\xxx\AppData\Roaming\KenBuild, which will also be the default location for map files.
User avatar
Corvin
Posts: 208
Joined: Fri May 20, 2016 1:10 pm
Location: R.T.C.M.
Contact:

Re: A Powerslave / Exhumed Map and Game FAQ

Postby Corvin » Sat Nov 03, 2018 5:18 pm

Wouldn't it be better just to have your build.cfg and map files local to the game. As in a portable folder?

Like
PWRSLAVE\KenBuild
or
EXHUMED\KenBuild

It would be simpler on my system, plus simpler for navigation.
-=CHE@TER=-
Posts: 48
Joined: Thu Dec 14, 2017 11:54 am

Re: A Powerslave / Exhumed Map and Game FAQ

Postby -=CHE@TER=- » Sat Nov 03, 2018 5:36 pm

Tried "build-32.exe" and it didn't work - says incorrect file format. After I looked inside PE header I noticed, that this was Vista (6) executable. Changed to XP (5). Still no luck - "This application must be run under Windows Vista or newer.". Hack this check too and finally run it. Select windowed mode 640x480 8 bit, got error 127: "Can't fetch WGL function: The specified procedure could not be found." Sorry, I guess I stuck with the older version from 2005 - it works just fine for me.
By the way, converted palette didn't work with the 2005 version correcly (that's why I try to convert "LOOKUP.DAT" too) - I got blue sky and some other minor glitches. So the palette is not everything you need to be able to edit older maps properly. I guess there are too much changes in Exhumed / PowerSlave code compared to other older Build engine games?
I attached to this post converted Exhumed / PowerSlave palette where color index 0 changed to 0x010101 from 0xFFFFFF because otherwise you didn't see build text in 3D mode (white on white). Also "PAL_CONV.C" soruce code if someone need it:

Code: Select all

#include <dir.h>
#include <stdio.h>
#include <malloc.h>
#include <string.h>

#define OLD_NUMPALOOKUPS 32

#pragma pack(push, 1)
typedef struct {
  char palette[768];
  char lookups[OLD_NUMPALOOKUPS][256];
  char transluc[32640];
} old_pdat;

typedef struct {
  char palette[768];
  short numpalookups;
  char lookups[OLD_NUMPALOOKUPS][256];
  char transluc[65536];
} new_pdat;
#pragma pack(pop)

static old_pdat old_pal;
static new_pdat new_pal;

int main(void) {
FILE *fl;
int i, j, k;
  /* init data */
  memset(&old_pal, 0, sizeof(old_pal));
  memset(&new_pal, 0, sizeof(new_pal));
  /* load game palette file */
  fl = fopen("PALETTE.DAT", "rb");
  if (!fl) { return(1); }
  fread(&old_pal, sizeof(old_pal), 1, fl);
  fclose(fl);
  /* copy palette as is */
  memcpy(new_pal.palette, old_pal.palette, 768);
  /* fix for Build text background (white on white) */
  new_pal.palette[0] = 1;
  new_pal.palette[1] = 1;
  new_pal.palette[2] = 1;
  /* copy lookups table */
  new_pal.numpalookups = OLD_NUMPALOOKUPS;
  memcpy(new_pal.lookups, old_pal.lookups, OLD_NUMPALOOKUPS * 256);
  /* transluc table */
  k = 0;
  for (i = 0; i < 255; i++) {
    /* kread(fil, &new_pal.transluc[257 * i + 1], 255 - i); */
    memcpy(&new_pal.transluc[257 * i + 1], &old_pal.transluc[k], 255 - i);
    k += 255 - i;
    for (j = i + 1; j < 256; j++) {
      new_pal.transluc[256 * j + i] = new_pal.transluc[256 * i + j];
    }
  }
  for (j = 0; j < 256; j++) {
    new_pal.transluc[257 * j] = j;
  }

  mkdir("datadone");
  /* save converted palette */
  fl = fopen("datadone/PALETTE.DAT", "wb");
  if (!fl) { return(1); }
  fwrite(&new_pal, sizeof(new_pal), 1, fl);
  fclose(fl);

  return(0);
}
Attachments
exps_pal.zip
(36.35 KiB) Downloaded 20 times
User avatar
jonof
Posts: 7
Joined: Wed Oct 24, 2018 6:57 am

Re: A Powerslave / Exhumed Map and Game FAQ

Postby jonof » Sat Nov 03, 2018 10:08 pm

Corvin wrote:Wouldn't it be better just to have your build.cfg and map files local to the game. As in a portable folder?

Forgot to mention: if you prefer that behaviour, you can get it by creating a file named "user_profiles_disabled" (no extension, contents irrelevant) in the same directory as build.exe.
I may also have put debug builds into that ZIP, so I'll recompile and update it later today (my time).
User avatar
jonof
Posts: 7
Joined: Wed Oct 24, 2018 6:57 am

Re: A Powerslave / Exhumed Map and Game FAQ

Postby jonof » Sun Nov 04, 2018 2:40 am

After I looked inside PE header I noticed, that this was Vista (6) executable. ... got error 127: "Can't fetch WGL function: The specified procedure could not be found."

For my reference, what video card and driver version are you using? I've figured out how to make Visual C++ 2015 build an XP-compatible executable, and relaxed the version check in the code such that Build now runs again on my old WinXP partition, but the machine has a GeForce 560 Ti in it so it has no problem with OpenGL 2.1.
-=CHE@TER=-
Posts: 48
Joined: Thu Dec 14, 2017 11:54 am

Re: A Powerslave / Exhumed Map and Game FAQ

Postby -=CHE@TER=- » Sun Nov 04, 2018 5:17 pm

jonof wrote:For my reference, what video card and driver version are you using?
Thanks for looking into this!
I have RIVA TNT2 and I doubt it has any OpenGL 2.x features since it's only DX6 compatible card (according to Wikipedia), but GTA Vice City (IIRC, it's DX9 game? at least it requires DX9 to run) works fine.
User avatar
jonof
Posts: 7
Joined: Wed Oct 24, 2018 6:57 am

Re: A Powerslave / Exhumed Map and Game FAQ

Postby jonof » Mon Nov 05, 2018 9:53 am

-=CHE@TER=- wrote:I have RIVA TNT2

Ahh, yes, fixed-function. Purely for the comedy value, I should fish out my RIVA TNT and backport the new GLSL version of JFBuild to plug in fixed-function again...

Anyway, if you're happy with an 8-bit software-only version, I have fixed the fault that gave you the "WGL functions not found" error.
-=CHE@TER=-
Posts: 48
Joined: Thu Dec 14, 2017 11:54 am

Re: A Powerslave / Exhumed Map and Game FAQ

Postby -=CHE@TER=- » Mon Nov 05, 2018 2:16 pm

jonof wrote:Anyway, if you're happy with an 8-bit software-only version, I have fixed the fault that gave you the "WGL functions not found" error.
Yes, I will be more than happy with that and I think it's nice to have some fallback code in case of any issues with the new renderer anyway. Thanks!

Return to “Powerslave / Exhumed”

Who is online

Users browsing this forum: No registered users and 1 guest