Doom 3 engine release and game code

Discuss programming topics for any language, any source base. If it is programming related but doesn't fit in one of the below categories, it goes here.
revelator
Posts: 2621
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: Doom 3 engine release and game code

Post by revelator »

Major success report :)

I made some thread Lock changes and implemented a port of gnu's atomic intrinsic code to handle various stuff like incrementing pointers.

Doom3 is now so fast it scares even me :shock:

And it runs totally fluid with sikkmods heavies enabled woa :mrgreen:

Atm im using the intrinsics for heap managment.

Code looks like this.

Code: Select all

/*
================================================================================================

	GNU Atomic Intrinsics

================================================================================================
*/

// missing in msvc
#if defined(_MSC_VER)
#pragma intrinsic (_InterlockedExchange)
#pragma intrinsic (_InterlockedExchangeAdd)
#pragma intrinsic (_InterlockedCompareExchange)

ID_FORCE_INLINE int __sync_lock_test_and_set(int *addr, int val)
{
return static_cast< int >(_InterlockedExchange(reinterpret_cast< long * >(addr), static_cast< long >(val)));
}

ID_FORCE_INLINE int __sync_fetch_and_add(int *addr, int val)
{
	return static_cast< int >(_InterlockedExchangeAdd(reinterpret_cast< long * >(addr), static_cast< long >(val)));
}

ID_FORCE_INLINE int __sync_val_compare_and_swap(volatile int *addr, int oldval, int newval)
{
	return static_cast< int >(_InterlockedCompareExchange(reinterpret_cast< volatile long * >(addr), newval, oldval));
}
#endif
Productivity is a state of mind.
revelator
Posts: 2621
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: Doom 3 engine release and game code

Post by revelator »

Major success report :)

I made some thread Lock changes and implemented a port of gnu's atomic intrinsic code to handle various stuff like incrementing pointers.

Doom3 is now so fast it scares even me :shock:

And it runs totally fluid with sikkmods heavies enabled woa :mrgreen:

Atm im using the atomic intrinsics for heap managment and it really helps.

edit: wtf double post :shock:
Productivity is a state of mind.
anonreclaimer
Posts: 21
Joined: Tue Aug 28, 2012 4:36 am

Re: Doom 3 engine release and game code

Post by anonreclaimer »

reckless wrote:Major success report :)

I made some thread Lock changes and implemented a port of gnu's atomic intrinsic code to handle various stuff like incrementing pointers.

Doom3 is now so fast it scares even me :shock:

And it runs totally fluid with sikkmods heavies enabled woa :mrgreen:

Atm im using the intrinsics for heap managment.

Code looks like this.

Code: Select all

/*
================================================================================================

	GNU Atomic Intrinsics

================================================================================================
*/

// missing in msvc
#if defined(_MSC_VER)
#pragma intrinsic (_InterlockedExchange)
#pragma intrinsic (_InterlockedExchangeAdd)
#pragma intrinsic (_InterlockedCompareExchange)

ID_FORCE_INLINE int __sync_lock_test_and_set(int *addr, int val)
{
return static_cast< int >(_InterlockedExchange(reinterpret_cast< long * >(addr), static_cast< long >(val)));
}

ID_FORCE_INLINE int __sync_fetch_and_add(int *addr, int val)
{
	return static_cast< int >(_InterlockedExchangeAdd(reinterpret_cast< long * >(addr), static_cast< long >(val)));
}

ID_FORCE_INLINE int __sync_val_compare_and_swap(volatile int *addr, int oldval, int newval)
{
	return static_cast< int >(_InterlockedCompareExchange(reinterpret_cast< volatile long * >(addr), newval, oldval));
}
#endif
I just tried to run doom 3 it crash on loading the menus.
WHY???
revelator
Posts: 2621
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: Doom 3 engine release and game code

Post by revelator »

try removing Doomconfig.cfg i had the same at times due to changed cvars in the code.

Stray NULL pointer somewhere in the Vanilla cvar code seems to be the cause.
Productivity is a state of mind.
revelator
Posts: 2621
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: Doom 3 engine release and game code

Post by revelator »

Productivity is a state of mind.
qbism
Posts: 1236
Joined: Thu Nov 04, 2004 5:51 am
Contact:

Re: Doom 3 engine release and game code

Post by qbism »

ATI Mobility was crashing out on menus until checked "Disable Catalyst AI".
Some Sikkmod effects were weird until disabling downsize options in config. Although a big fps hit, soft shadows look awesome.
Image
revelator
Posts: 2621
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: Doom 3 engine release and game code

Post by revelator »

Anyone noticed something strange in ressurection of evil ?

Muzzleflashes on my rocketlauncher bfg and the hellorb are White Blocks on my rig :S strangely enough even the original exe does it, same with the original game dll.

Funny enough every other mod Works fine.
Productivity is a state of mind.
revelator
Posts: 2621
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: Doom 3 engine release and game code

Post by revelator »

Ok the decal weirdness was a corrupt save it seems :S .

Not much to report else, but i updated all the 3'rd party libraries like curl openal ogg vorbis and jpeg to the latest versions and added my ports of the TGA2 code to it.
Took a bit of the speed unfortunatly but Theres a Price to pay for the detail its now capable off :) not much though it dropped about 5-10 fps in the timedemo ingame its still at max 60.

i also removed the c sources from it (ogg vorbis curl) and defult to linking to there compiled libraries to avoid the extern C crap.

Jpeg is now version 9.
ogg is version 1.3.1.
vorbis is 1.3.3.
curl is version 7.32.
OpenAL is latest from openalsoft.

id's roq renderer Works fine so why they decided to ditch it in favor of a propriarity codec in BFG is beyond me :?: maybe better compression hmm, but then why not use xvid or theora ??? or even matroska which can provide a rather heavy compression using the opensource version of the x264 codec without quality loss.

Actually stumbled upon a bug also which manifested itself after fixing another bug :lol: the code for getting weapon decl's goes bonkers when you enter the hell level because the game removes all your weapons
it returns an empty string crashing the client. id had a check somewhere else in the code that compared two different enums for the same decl which returned an invalid value fixing that one brought it up so i removed the Error in the check and simply returned a 0 if the decl was empty. To be sure i checked the BFG code and they had done the exact same thing so i guess my fix was correct :)

But im off for some days im getting operated Again :S seems the stupid bastards WHO removed my gallbladder forgot some stones in there after all :evil: been in pain hell the last 3 days and my mood is not the greatest.
Productivity is a state of mind.
frag.machine
Posts: 2126
Joined: Sat Nov 25, 2006 1:49 pm

Re: Doom 3 engine release and game code

Post by frag.machine »

Ouch man, sorry to hear about that. :(
Here hoping everything goes well this time and you recover fast :)
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC :) (LordHavoc)
revelator
Posts: 2621
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: Doom 3 engine release and game code

Post by revelator »

Heavy morphine ingestations else i would not have been able to even sit here and post (damn im a goddamn narcotic now i get enough to knock out an elephant 120 mg contalgin :shock: ) but yeah i hope this takes care of it, atleast this time they should be able to crack the bastards with ultrasound and not open me up with four drillpoints in the stomach :evil:
Productivity is a state of mind.
anonreclaimer
Posts: 21
Joined: Tue Aug 28, 2012 4:36 am

Re: Doom 3 engine release and game code

Post by anonreclaimer »

reckless wrote:Ok the decal weirdness was a corrupt save it seems :S .

Not much to report else, but i updated all the 3'rd party libraries like curl openal ogg vorbis and jpeg to the latest versions and added my ports of the TGA2 code to it.
Took a bit of the speed unfortunatly but Theres a Price to pay for the detail its now capable off :) not much though it dropped about 5-10 fps in the timedemo ingame its still at max 60.

i also removed the c sources from it (ogg vorbis curl) and defult to linking to there compiled libraries to avoid the extern C crap.

Jpeg is now version 9.
ogg is version 1.3.1.
vorbis is 1.3.3.
curl is version 7.32.
OpenAL is latest from openalsoft.

id's roq renderer Works fine so why they decided to ditch it in favor of a propriarity codec in BFG is beyond me :?: maybe better compression hmm, but then why not use xvid or theora ??? or even matroska which can provide a rather heavy compression using the opensource version of the x264 codec without quality loss.

Actually stumbled upon a bug also which manifested itself after fixing another bug :lol: the code for getting weapon decl's goes bonkers when you enter the hell level because the game removes all your weapons
it returns an empty string crashing the client. id had a check somewhere else in the code that compared two different enums for the same decl which returned an invalid value fixing that one brought it up so i removed the Error in the check and simply returned a 0 if the decl was empty. To be sure i checked the BFG code and they had done the exact same thing so i guess my fix was correct :)

But im off for some days im getting operated Again :S seems the stupid bastards WHO removed my gallbladder forgot some stones in there after all :evil: been in pain hell the last 3 days and my mood is not the greatest.
Hmm good I have also updated the librarys too but don't you think you should get rid of oggvorbis and replace it with libopus?
Also I would like to see your new jpeg loader for the life of me I couldn't update it and I found a bug in the last one that would crash the editor with one of my textures?
One more thing what is difference in doom 3 and bfg texture quality.
I hope you get better soon.
revelator
Posts: 2621
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: Doom 3 engine release and game code

Post by revelator »

Dont know libopus but ill have a look :).

The jpeg code was posted earlier in this thread together with the TGA2 loader.

Not much difference tbh the TGA code in BFG is the exact same as Vanilla and has the same bugs with some textures (some models go Black. not refering to the ASE model bug ;) ).
The TGA2 upgrade can handle pretty much any tga format and it does not need the hack for flipping the images the old code used :)

The jpeg code was from iodoom3 ported to C++ at the time it used jpeg 8.0b i have updated the jpeg library to 9.0 latest.

I hear a rumour that BFG does not use the TGA code at all though and that it uses a newer format but looking at the source i Wonder where cause for the death of me i cant see this code.
Productivity is a state of mind.
anonreclaimer
Posts: 21
Joined: Tue Aug 28, 2012 4:36 am

Re: Doom 3 engine release and game code

Post by anonreclaimer »

reckless wrote:Dont know libopus but ill have a look :).

The jpeg code was posted earlier in this thread together with the TGA2 loader.

Not much difference tbh the TGA code in BFG is the exact same as Vanilla and has the same bugs with some textures (some models go Black. not refering to the ASE model bug ;) ).
The TGA2 upgrade can handle pretty much any tga format and it does not need the hack for flipping the images the old code used :)

The jpeg code was from iodoom3 ported to C++ at the time it used jpeg 8.0b i have updated the jpeg library to 9.0 latest.

I hear a rumour that BFG does not use the TGA code at all though and that it uses a newer format but looking at the source i Wonder where cause for the death of me i cant see this code.
I put in your changes awhlie back they did help but you also made changes to other parts of the render for the textures.

BFG is able to import port tga and jpeg then turns them in to binary image right?

if you don't mind me asking but why are you working with doom 3?
revelator
Posts: 2621
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: Doom 3 engine release and game code

Post by revelator »

Only because Doom3's cinematic code needs jpeg for the huff encoding :)
and a few Things changed in the newer jpeg library so the old macros didnt Work the same as before. Example old one had GLOBAL void new one uses GLOBAL(void) etc.

Just like to improve on it no other reason besides sharpening my sklls in C++ :) before Doom3 i only coded in C.
Productivity is a state of mind.
revelator
Posts: 2621
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: Doom 3 engine release and game code

Post by revelator »

Not sure about turning the images into binary resources allthough i noticed that a few Things where but so far i havent seen any code that suggest it might.
BFG does not use megatextures which are in binary.
Productivity is a state of mind.
Post Reply