.:: Bots United ::.  
filebase forums discord server github wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps yapb

Go Back   .:: Bots United ::. > Developer's Farm > SDK Programming discussions > Other SDKs
Other SDKs For developments focused around other games

Reply
 
Thread Tools
Re: HL1 For other platforms?
Old
  (#21)
sfx1999
Member
 
sfx1999's Avatar
 
Status: Offline
Posts: 534
Join Date: Jan 2004
Location: Pittsburgh, PA, USA
Default Re: HL1 For other platforms? - 04-09-2005

I thought the palette size was 256*3. If it is 256*2, then the format would be RRRRRGGGGGGBBBBB. That is a little bit more complicated to convert. It would be like this:

red = ((entry >> 9) * 255 / 31;
green = ((entry << 5) >> 10) * 255 / 63;
blue = ((entry << 11) >> 11) * 255 / 31;

BTW, some textures are in WADs. It appears that the ones in WADs have no offset.


sfx1999.postcount++

Last edited by sfx1999; 04-09-2005 at 21:32..
  
Reply With Quote
Re: HL1 For other platforms?
Old
  (#22)
Lazy
Member
 
Lazy's Avatar
 
Status: Offline
Posts: 236
Join Date: Jan 2004
Location: Toronto, Ontario, Canada
Default Re: HL1 For other platforms? - 05-09-2005

I think it means 256 entries of 3 bytes, but thats working now I have a pointer to the palette.
The only problem now is converting it to a bitmap, I have next to no experience with images so this will take me a bit longer to figure out.

I think its something like...
u32 Pixel = SDL_MapRGB( format, palette[ pixel_data[ i ] ], palette[ pixel_data[ i + 1 ] ], palette[ pixel_data[ i + 2 ] ] );

Btw, this is in a seperate app now as I want to make sure it works before trying it in quake.
Unfortunately I get nothing but garbage in the screen.
  
Reply With Quote
Re: HL1 For other platforms?
Old
  (#23)
sfx1999
Member
 
sfx1999's Avatar
 
Status: Offline
Posts: 534
Join Date: Jan 2004
Location: Pittsburgh, PA, USA
Default Re: HL1 For other platforms? - 05-09-2005

Damn it happened again!

Anyway, use the data of a texture to look up an entry in the palette. Make sure you do it three times; one for each color. Then just copy it into wherever it needs to go. Also, make sure that you aren't accidentally mixing up length and width. I've done that before.


sfx1999.postcount++
  
Reply With Quote
Re: HL1 For other platforms?
Old
  (#24)
Lazy
Member
 
Lazy's Avatar
 
Status: Offline
Posts: 236
Join Date: Jan 2004
Location: Toronto, Ontario, Canada
Default Re: HL1 For other platforms? - 05-09-2005

Well, the darkplaces engine supports both half-life BSPs and wad3 files aswell as some pretty nice rendering enhancements like bloom, realtime lighting, ect...
I really should have looked harder to find a pre-made engine to use lol.
  
Reply With Quote
Re: HL1 For other platforms?
Old
  (#25)
Rick
Council Member
 
Rick's Avatar
 
Status: Offline
Posts: 690
Join Date: Dec 2003
Location: Holland
Default Re: HL1 For other platforms? - 12-09-2005

Quote:
Originally Posted by Lazy
Well, the darkplaces engine supports both half-life BSPs and wad3 files aswell as some pretty nice rendering enhancements like bloom, realtime lighting, ect...
I really should have looked harder to find a pre-made engine to use lol.
So...are you going to use that engine?

[edit]
I just tried an esf map with Nexuiz (a game which uses the darkplaces engine) and it worked
Well the skybox was missing, but maybe I had to copy another file.

Last edited by Rick; 12-09-2005 at 17:49..
  
Reply With Quote
Re: HL1 For other platforms?
Old
  (#26)
Lazy
Member
 
Lazy's Avatar
 
Status: Offline
Posts: 236
Join Date: Jan 2004
Location: Toronto, Ontario, Canada
Default Re: HL1 For other platforms? - 12-09-2005

The really big problem which stands in the way of this working is quakec...
Important entities such as multi_manager have custom key/value pairs which get ignored by the engine.
I added in something to call a quakec function when an unrecognized key/value pair was found but I could not figure out how to pass in strings to quakec as parameters to the function.
Also, a HUGE problem is the half-life mdl format which is extremely undocumented and you can't use valve's code in the sdk due to licensing issues.

It was really cool to see a hl map running under the quake engine and even having a healthcharger working but without model support this isn't going anywhere.
  
Reply With Quote
Re: HL1 For other platforms?
Old
  (#27)
sfx1999
Member
 
sfx1999's Avatar
 
Status: Offline
Posts: 534
Join Date: Jan 2004
Location: Pittsburgh, PA, USA
Default Re: HL1 For other platforms? - 12-09-2005

Are you using the stock QuakeC compiler? I think there is a better one out there.


sfx1999.postcount++
  
Reply With Quote
Re: HL1 For other platforms?
Old
  (#28)
Lazy
Member
 
Lazy's Avatar
 
Status: Offline
Posts: 236
Join Date: Jan 2004
Location: Toronto, Ontario, Canada
Default Re: HL1 For other platforms? - 13-09-2005

I can't remember which one I used but it was definately a custom one.
That isn't the problem though, inorder to use something like a multi_manager which has upto 16 custom key/value pairs for the target entity and firing delay you need seperate structures/memory for each type of entity.
As far as I know all you get in quakec is the entvars_t structure unlike hl where you got pvPrivateData for classes, ect...

One idea would be to rip out quakec entirely and put a new native system in place but that makes it really tempting to use the HL system.
All the code is there but is unusable to anything but valve products so you'd have to re-create everything including porting over the basic entities from quakec.

But model support is the real killer here, everything else is possible to re-create.
  
Reply With Quote
Re: HL1 For other platforms?
Old
  (#29)
sfx1999
Member
 
sfx1999's Avatar
 
Status: Offline
Posts: 534
Join Date: Jan 2004
Location: Pittsburgh, PA, USA
Default Re: HL1 For other platforms? - 13-09-2005

The funny thing is, I was planning to convert Quake to use something similar to HL's system. I guess I'll have to do something else now.

Anyway, to figure it out, I would try to look at the lumps and see what looks like this structure, what looks like that structure, and what is it divisible by. Also, check to see if they are valid as floats or not.


sfx1999.postcount++
  
Reply With Quote
Re: HL1 For other platforms?
Old
  (#30)
Lazy
Member
 
Lazy's Avatar
 
Status: Offline
Posts: 236
Join Date: Jan 2004
Location: Toronto, Ontario, Canada
Default Re: HL1 For other platforms? - 19-09-2005

Reverse engineering the half-life model format may be too complicated for me :/

Although, I did just reverse engineer the pak file format from q1/q2.
I know its opensource but I wanted to see how difficult it would be to reverse an entire file format.
It was actually pretty easy and oddly enough, fun.

Code:
const int PAK_IDENTITY = ( int ) ( 'K' << 24 ) + ( 'C' << 16 ) + ( 'A' << 8 ) + ( 'P' );

// Structure containing information about files
// stored in pack files.
typedef struct paklump_s {
   char szFilename[ 56 ];	 // Filename along with path ( ie. "maps/q2dm1.bsp" )
   int iFileoffset;		   // File offset from start of pak
   int iFilesize;			 // Length of file in bytes
} paklump_t;

// Structure defining the identity of the file aswell
// as the lump offsets/sizes.
typedef struct pakheader_s {
   char packIdentify[ 4 ];	// Non null terminated 4 character string which should contain "PACK"
   int iFirstlump;			// Offset to the first lump
int iLumpsize;			 // README!!!! THIS IS THE TOTAL SIZE IN BYTES OF THE LUMP TABLE!
							 // To get number of lumps divide this by sizeof( paklump_t ).
} pakheader_t;
Not sure about endianness though, I guess I'll have to get xcode installed on the mac and try some things.

Last edited by Lazy; 19-09-2005 at 20:25..
  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com