Page 1 of 1

[Native] Collection of Bugs in DeusExHeader files

Posted: Sun Jun 08, 2014 6:36 pm
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

Re: [Native] Collection of Bugs in DeusExHeader files

Posted: Fri Aug 08, 2014 10:11 pm
by Hanfling
Turns out first error was because I fired up a new Project and did not set struct alignment to 4.

Re: [Native] Collection of Bugs in DeusExHeader files

Posted: Mon Aug 11, 2014 6:45 pm
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

Re: [Native] Collection of Bugs in DeusExHeader files

Posted: Fri Sep 19, 2014 5:44 pm
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_

Re: [Native] Collection of Bugs in DeusExHeader files

Posted: Fri Sep 19, 2014 8:21 pm
by bjorn98009_91
That's a lot of missing variables. ^^

Re: [Native] Collection of Bugs in DeusExHeader files

Posted: Sat Sep 20, 2014 4:49 am
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.

Re: [Native] Collection of Bugs in DeusExHeader files

Posted: Sat Sep 20, 2014 8:32 pm
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];

Re: [Native] Collection of Bugs in DeusExHeader files

Posted: Wed Sep 24, 2014 6:50 am
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++;
	}

Re: [Native] Collection of Bugs in DeusExHeader files

Posted: Sat Oct 04, 2014 11:28 pm
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.

Re: [Native] Collection of Bugs in DeusExHeader files

Posted: Sun Oct 05, 2014 1:35 pm
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?

Re: [Native] Collection of Bugs in DeusExHeader files

Posted: Sun Oct 05, 2014 2:10 pm
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.

Re: [Native] Collection of Bugs in DeusExHeader files

Posted: Sun Oct 05, 2014 2:28 pm
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.

Re: [Native] Collection of Bugs in DeusExHeader files

Posted: Fri Oct 10, 2014 9:45 am
by Fritz
Is this useful to fix some stuff ingame?

Re: [Native] Collection of Bugs in DeusExHeader files

Posted: Fri Oct 10, 2014 10:55 am
by Hanfling
Fritz wrote:Is this useful to fix some stuff ingame?
No.

Re: [Native] Collection of Bugs in DeusExHeader files

Posted: Fri Oct 17, 2014 10:02 am
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.