[Native] Collection of Bugs in DeusExHeader files

A refuge for those migrating from the fallen DXEditing.com and a place for general discussion relating to Deus Ex editing (coding, mapping, etc).
Post Reply
Hanfling
MJ12
Posts: 406
Joined: Sun Oct 04, 2009 6:54 pm

[Native] Collection of Bugs in DeusExHeader files

Post by Hanfling »

Okay. This is the second time i encounter missmatching native header files in the DeusExSDK.
Does anyone know others?

DeusEx/Inc/DeusExClasses.h:

Code: Select all

  class AInventory* ClientinHandPending;
  class AInventory* LastinHand; // MISSING
I demand my DXE User ID back. Launcher for DeusEx, Rune, Nerf, Unreal & Botpack. HX on Mod DB. Revision on Steam.
Hanfling
MJ12
Posts: 406
Joined: Sun Oct 04, 2009 6:54 pm

Re: [Native] Collection of Bugs in DeusExHeader files

Post by Hanfling »

Turns out first error was because I fired up a new Project and did not set struct alignment to 4.
I demand my DXE User ID back. Launcher for DeusEx, Rune, Nerf, Unreal & Botpack. HX on Mod DB. Revision on Steam.
User avatar
bjorn98009_91
Silhouette
Posts: 688
Joined: Thu May 08, 2008 8:17 am
Location: Hufvudstaden, Sweden
Contact:

Re: [Native] Collection of Bugs in DeusExHeader files

Post by bjorn98009_91 »

Hmm, don't think a lot of people have done a lot of native coding for the game. Not that much would require much use of the header files anyway. Perhaps you can keep track of what you find that needs correcting so I can update my library of headers to be correct. Working on creating as a complete source for this game as possible, extracting assets and code for the .u files and gathering headers and stuff. If I were to get the original source that would be even better :D
Last edited by bjorn98009_91 on Sat Oct 04, 2014 11:13 pm, edited 2 times in total.
Producer and Quality Assurance Manager for Deus Ex: Revision.
Hanfling
MJ12
Posts: 406
Joined: Sun Oct 04, 2009 6:54 pm

Re: [Native] Collection of Bugs in DeusExHeader files

Post by Hanfling »

ConSys\Inc\ConCamera.h is totally fucked up

Code: Select all

// ----------------------------------------------------------------------
//  File Name   :  ConCamera.h
//  Programmer  :  Albert Yarusso (ay)
//  Description :  Header for Conversation Camera class
//
// ----------------------------------------------------------------------
//  Copyright ©1998 ION Storm Austin.  This software is a trade secret.
// ----------------------------------------------------------------------

#ifndef _CONCAMERA_H_
#define _CONCAMERA_H_

// ----------------------------------------------------------------------
// DConCamera Class
// 
// This class is used to pass camera information to 
// DeusExPlayer::PlayerCalcView() during conversations to position the
// camera in different locations.
// ----------------------------------------------------------------------

class CONSYS_API DConCamera : public DConObject
{
	DECLARE_CLASS(DConCamera, DConObject, 0)

public:
	class AActor* cameraActor;			// Actor who owns this event
	BYTE  cameraPosition;				// Predefined camera position
	BYTE  cameraType;					// Camera Type for current event
	BYTE  cameraMode;					// Current camera display mode

	class DConLight* conLightSpeaker;		// Used to light actor's faces (WAS MISSING)
	class DConLight* conLightSpeakingTo;	// Used to light actor's faces (WAS MISSING)

	FVector cameraOffset;				// Camera offset, for CT_Actor mode
	FRotator rotation;					// Camera Rotation
	
	FLOAT cosAngle; // (WAS MISSING)
	INT firstActorRotation; // (WAS MISSING)
	INT setActorCount; // (WAS MISSING)
	BITFIELD bCameraLocationSaved:1; // (WAS MISSING)

	// Camera Fallback Positions (for when camera view obstructed)
	BYTE cameraFallbackPositions[9]; //ECameraPositions (WAS MISSING)
	BYTE cameraHeightPositions[9]; //ECameraPositions (WAS MISSING)

	INT currentFallback; // (WAS MISSING)
	UBOOL bUsingFallback; // (WAS MISSING)

	// Used for CT_Speakers mode
	FLOAT heightModifer;				// Height Modifier
	FLOAT centerModifier;				// Center Point modifier
	FLOAT distanceMultiplier;			// Distance Multiplier

	FLOAT heightFallbackTrigger; // (WAS MISSING)

	// Actors associated with camera placement
	class AActor* firstActor;			
	class AActor* secondActor;

	// These variable are used to prevent camera angle changes when the 
	// actors change.
	class AActor* lastFirstActor;
	class AActor* lastSecondActor;
	BITFIELD ignoreSetActors:1;
	
	// Used for Camera debugging
	BITFIELD bDebug:1;
	FVector LastLocation;
	FRotator LastRotation;
	BITFIELD bInteractiveCamera:1;

	// Constructor
	DConCamera();
};

#endif // _CONCAMERA_H_
I demand my DXE User ID back. Launcher for DeusEx, Rune, Nerf, Unreal & Botpack. HX on Mod DB. Revision on Steam.
User avatar
bjorn98009_91
Silhouette
Posts: 688
Joined: Thu May 08, 2008 8:17 am
Location: Hufvudstaden, Sweden
Contact:

Re: [Native] Collection of Bugs in DeusExHeader files

Post by bjorn98009_91 »

That's a lot of missing variables. ^^
Producer and Quality Assurance Manager for Deus Ex: Revision.
Hanfling
MJ12
Posts: 406
Joined: Sun Oct 04, 2009 6:54 pm

Re: [Native] Collection of Bugs in DeusExHeader files

Post by Hanfling »

I now started adding VERIFY_CLASS_OFFSET / VERIFY_CLASS_SIZE macros for my own native classes inside the HXGameEngine::LoadMap() function, since i sometimes miss to match the *.h to the *.uc file.

Note for mod authors:

Code: Select all

ULevel* UMyGameEngine::LoadMap( const FURL& URL, UPendingLevel* Pending, const TMap<FString,FString>* TravelInfo, FString& Error )
{
  ULevel* Level = Super::LoadMap( URL, Pending, TravelInfo, Error );

  guard( VerifyClasses );
  VERIFY_CLASS_OFFSET( A, Actor, Owner );
  VERIFY_CLASS_OFFSET( A, Actor, TimerCounter );
  VERIFY_CLASS_OFFSET( A, PlayerPawn, Player );
  VERIFY_CLASS_OFFSET( A, PlayerPawn, MaxStepHeight );
  unguard;

  return Level;
}
Despite the vanilla GameEngine does it in this place i guess it might not be the best place to put this, although it will automatically crash the game if these don't match, so you are forced to sync the headers/uc. However it'll protect you from very strange and hard to spot errors.
I demand my DXE User ID back. Launcher for DeusEx, Rune, Nerf, Unreal & Botpack. HX on Mod DB. Revision on Steam.
Hanfling
MJ12
Posts: 406
Joined: Sun Oct 04, 2009 6:54 pm

Re: [Native] Collection of Bugs in DeusExHeader files

Post by Hanfling »

And again..

IpDrv/Classes/Src/IpDrvPrivate.h in FResolveInfo:

Code: Select all

	// Wrong:
	//TCHAR   HostName[256];
	//TCHAR   Error[256];
	// Right:
	TCHAR   HostName[512];
	TCHAR   Error[512];
I demand my DXE User ID back. Launcher for DeusEx, Rune, Nerf, Unreal & Botpack. HX on Mod DB. Revision on Steam.
Hanfling
MJ12
Posts: 406
Joined: Sun Oct 04, 2009 6:54 pm

Re: [Native] Collection of Bugs in DeusExHeader files

Post by Hanfling »

Don't know if it really matters these days, but in IpDrv\Inc\GameSpyClasses.h they left the gs key for unreal/ut in, but stripped the key deusex uses. For gs keys see http://aluigi.altervista.org/papers/gslist.cfg

Add this entry to GenerateSecretKey:

Code: Select all

	else if( !appStrcmp(GameName, TEXT("deusex")) )
	{
		*key = 'A';
		key++;
		*key = 'v';
		key++;
		*key = '3';
		key++;
		*key = 'M';
		key++;
		*key = '9';
		key++;
		*key = '9';
		key++;
	}
I demand my DXE User ID back. Launcher for DeusEx, Rune, Nerf, Unreal & Botpack. HX on Mod DB. Revision on Steam.
User avatar
bjorn98009_91
Silhouette
Posts: 688
Joined: Thu May 08, 2008 8:17 am
Location: Hufvudstaden, Sweden
Contact:

Re: [Native] Collection of Bugs in DeusExHeader files

Post by bjorn98009_91 »

Took the liberty to set up a Google Code SVN for this to collect all changes in one place. Implemented your fixes here: https://code.google.com/p/deus-ex-heade ... detail?r=5

Contact me and I'll add you as a collaborator.
Producer and Quality Assurance Manager for Deus Ex: Revision.
Hanfling
MJ12
Posts: 406
Joined: Sun Oct 04, 2009 6:54 pm

Re: [Native] Collection of Bugs in DeusExHeader files

Post by Hanfling »

bjorn98009_91 wrote:Took the liberty to set up a Google Code SVN for this to collect all changes in one place.
Nice!
Contact me and I'll add you as a collaborator.
What do you need? Email/googleaccount?
Last edited by Hanfling on Sun Jan 18, 2015 11:22 am, edited 1 time in total.
I demand my DXE User ID back. Launcher for DeusEx, Rune, Nerf, Unreal & Botpack. HX on Mod DB. Revision on Steam.
User avatar
bjorn98009_91
Silhouette
Posts: 688
Joined: Thu May 08, 2008 8:17 am
Location: Hufvudstaden, Sweden
Contact:

Re: [Native] Collection of Bugs in DeusExHeader files

Post by bjorn98009_91 »

Are you OK with me selecting the GNU GPL v3 license? Sorry that I didn't ask you prior to creating the project.

I'll need an email associated with a Google account.
Last edited by bjorn98009_91 on Sun Jan 18, 2015 11:24 am, edited 1 time in total.
Producer and Quality Assurance Manager for Deus Ex: Revision.
Hanfling
MJ12
Posts: 406
Joined: Sun Oct 04, 2009 6:54 pm

Re: [Native] Collection of Bugs in DeusExHeader files

Post by Hanfling »

Okay, as for the license, i don't care, but you should use LGPL not GPL for these headers if you want a gpl license. However i'm not sure under which license you could actually put these headers.
I demand my DXE User ID back. Launcher for DeusEx, Rune, Nerf, Unreal & Botpack. HX on Mod DB. Revision on Steam.
Fritz
Thug
Posts: 21
Joined: Thu Jun 07, 2012 3:41 pm
Location: Saratov, Russia
Contact:

Re: [Native] Collection of Bugs in DeusExHeader files

Post by Fritz »

Is this useful to fix some stuff ingame?
Hanfling
MJ12
Posts: 406
Joined: Sun Oct 04, 2009 6:54 pm

Re: [Native] Collection of Bugs in DeusExHeader files

Post by Hanfling »

Fritz wrote:Is this useful to fix some stuff ingame?
No.
I demand my DXE User ID back. Launcher for DeusEx, Rune, Nerf, Unreal & Botpack. HX on Mod DB. Revision on Steam.
Hanfling
MJ12
Posts: 406
Joined: Sun Oct 04, 2009 6:54 pm

Re: [Native] Collection of Bugs in DeusExHeader files

Post by Hanfling »

Some really bad news about DConCamera. Actually the game was compiled with this faulty header file, and even worse Conversation.CreateConCamera() actually allocates an object which is to small, so the camera can overwrite other areas in the memory!

However as Conversation.CreateConCamera() just creates a new Object this can be replaced by unrealscript code which should create an object of the right size. However i have not checked this how UC new work, so i guess i have to take a look at it.

As for just using uc code. This snipped is out of HX:

Code: Select all

// ----------------------------------------------------------------------
// CreateConCamera()
// ----------------------------------------------------------------------

function ConCamera CreateConCamera( Conversation con )
{
	local HXConCamera TmpCam;

	TmpCam = new( con,'',RF_Public ) class'HXConCamera';
	TmpCam.player = HXHuman(player);

	return TmpCam;
}
Also the player class was 4 bytes wrong. However i'm not sure if this is a problem as it was sublassed and spawned by uc anyway.
I demand my DXE User ID back. Launcher for DeusEx, Rune, Nerf, Unreal & Botpack. HX on Mod DB. Revision on Steam.
Post Reply