Minor things worth mentioning

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

Re: Minor things worth mentioning

Post by Hanfling »

Found another weired thing: Windows are ticked before the Engine class is (which ticks Level, which ticks all Actors, etc.). And flipping the Tick order seems to solve this annoying issue of ViewportWindows are sometimes (or at least sometimes noticable) rawn without their overlay when toggling them on/off for a frame or so.

Nothing otherwise happening in Tick below UGameEngine, so for experimenting with, one just flips the order and be done.

Code: Select all

void URevGameEngine::Tick( FLOAT DeltaSeconds )
{
	guard(URevGameEngine::Tick);

#if 0 // Try ticking Windows before Engine. (Doesn't crash, but leave it out for now).
	UGameEngine::Tick( DeltaSeconds );
	XRootWindow::TickWindows( DeltaSeconds );
#else
	// Super.
	Super::Tick( DeltaSeconds );
#endif

	// Tick GamePlatform.
	TickGamePlatform( DeltaSeconds );
	unguard;
}
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: Minor things worth mentioning

Post by Hanfling »

Code: Select all

SET RootWindow bShowStats 1
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: Minor things worth mentioning

Post by Hanfling »

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: Minor things worth mentioning

Post by Hanfling »

For rendering the 'Menu' windows after ScreenFlash.

Code: Select all

// Extension.PlayerPawnExt
simulated event PostRenderFlash( Canvas Canvas )
{
	// Allow windows to be rendered after Flash.
	if ( !bool(RootWindow) || !RootWindow.RenderWindowsAfterFlash() ) // Actually no much of a point in calling it without RootWindow. --han
		PostRenderWindows( Canvas );

	Super.PostRenderFlash( Canvas );
}
simulated event PostRender( Canvas Canvas)
{
	// Allow windows to be rendered after Flash.
	if ( bool(RootWindow) && RootWindow.RenderWindowsAfterFlash() )
		PostRenderWindows( Canvas );

	Super.PostRender( Canvas );
}

// Extension.RootWindow
function bool RenderWindowsAfterFlash()
{
	return false;
}

// DeusEx.DeusRootWindow
function bool RenderWindowsAfterFlash()
{
	return WinCount>0 && WinStack[0].IsA('MenuUIMenuWindow');
}
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: Minor things worth mentioning

Post by Hanfling »

The story why there are no savegame snapshots for OpenGLDrv:

Basically Sweeney, when creating the first UOpenGLRenderDevice (version) sort of managed to dublicate the Viewport variable off URenderDevice, so that was set by the UOpenGLRenderDevice, not the one on the URenderDevice. Afterwards everyone just copied that all along.

Deus Ex snapshot functionality in the end uses GRenderDevice->Viewport, which will never get set for OpenGLDrv because of that dublicated variable and thus Rootwindw can't figure out Viewport size and does nothing.
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: Minor things worth mentioning

Post by Hanfling »

I demand my DXE User ID back. Launcher for DeusEx, Rune, Nerf, Unreal & Botpack. HX on Mod DB. Revision on Steam.
User avatar
Andrievskaya Veronika
UNATCO
Posts: 151
Joined: Wed Mar 21, 2007 5:36 am
Location: Somewhere in Russia
Contact:

Re: Minor things worth mentioning

Post by Andrievskaya Veronika »

Cargo_ROMM
Hanfling
MJ12
Posts: 406
Joined: Sun Oct 04, 2009 6:54 pm

Re: Minor things worth mentioning

Post by Hanfling »

Added more shots, but now put them on a page, rather than update the zip file. I now added cargo03, and sRGB (as some sort of default if no convertion happens).

http://coding.hanfling.de/Cargo/

Convertion to Apple RGB is done absolute colormetric, in case of ROMM I used Photoshop (with afaik) the same setting. However ROMM uses the D50 illuminant instead of the D65 as the other two are using, so there is plenty of room for experimenting with other whitepoint adaption schemes.
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: Minor things worth mentioning

Post by Hanfling »

Ever wondered what this:
Warning: Type mismatch in Region of GameReplicationInfo: file 10, class 2
Warning: Skipping 6 bytes of type 10
is all about? I have before, but now I got it:

The 10 and 2 are Name indices, looking them up in UnNames.h yields:

Code: Select all

REGISTER_NAME(   2, IntProperty      )
REGISTER_NAME(  10, StructProperty   )
And Region is literally the name of the Property, so looking that up:

Code: Select all

// Actor.uc:
var const PointRegion     Region;        // Region this actor is in.

// GameReplicationInfo.uc:
var() globalconfig int 		 Region;		// Region of the game server.
I demand my DXE User ID back. Launcher for DeusEx, Rune, Nerf, Unreal & Botpack. HX on Mod DB. Revision on Steam.
User avatar
Andrievskaya Veronika
UNATCO
Posts: 151
Joined: Wed Mar 21, 2007 5:36 am
Location: Somewhere in Russia
Contact:

Re: Minor things worth mentioning

Post by Andrievskaya Veronika »

The ROMM version looks more colorful than others, so i would prefer it.
Hanfling
MJ12
Posts: 406
Joined: Sun Oct 04, 2009 6:54 pm

Re: Minor things worth mentioning

Post by Hanfling »

Code: Select all

x/min(1,x) = max(1,x)
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: Minor things worth mentioning

Post by Hanfling »

AllActor iterators silenty sets BaseClass=Actor if you pass BaseClass=None.

So always check if your BaseClass is not None if you store it inside a variable before calling AllActors (or similiar iterators).

I wasn't aware of this behaviour before and had some innocent looking dynamicload class and iterate over and destroy all those actors code, which in the end resulted in networking turned bad. And yes it took me 'some' time to trace down this issue..
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: Minor things worth mentioning

Post by Hanfling »

Code: Select all

// ----------------------------------------------------------------------
// VDiskRand2D()
//
// Random point on Disk in xy-plane.
// http://mathworld.wolfram.com/DiskPointPicking.html
//
// Could be optimized.
// ----------------------------------------------------------------------

simulated final static function Vector VDiskRand2D( float DiskRadius )
{
	local float  Radius, Angle;
	local Vector Point;

	Radius = Sqrt(FRand())*DiskRadius;
	Angle  = FRand()*2.0*PI;

	Point.X = Radius*Cos(Angle);
	Point.Y = Radius*Sin(Angle);

	return Point;
}
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: Minor things worth mentioning

Post by Hanfling »

Code: Select all

//
// sp##v could get invalid by property object unloading, while dll is never released,
// so the static sp##v can become a dangling pointer.
//
// So for now, try to save RepIndex directly. which should be constant.
//
// Also note, that the initialization time for the static variables are compiler
// dependend, so other compiles unlike MSVC6 may initialize them at dll load time
// before the property may be correctly loaded.
//
//#define DOREP(c,v) \
//	if( NEQ(v,((A##c*)Recent)->v,Map) ) \
//	{ \
//		static UProperty* sp##v = FindObjectChecked<UProperty>(A##c::StaticClass(),TEXT(#v)); \
//		*Ptr++ = sp##v->RepIndex; \
//	}
//
//#define DOREPARRAY(c,v) \
//	{static UProperty* sp##v = FindObjectChecked<UProperty>(A##c::StaticClass(),TEXT(#v)); \
//	for( INT i=0; i<ARRAY_COUNT(v); i++ ) \
//		if( NEQ(v[i],((A##c*)Recent)->v[i],Map) ) \
//				*Ptr++ = sp##v->RepIndex+i;}
//
//#define DOREPARRAYINDEX(c,v,i) \
//	{static UProperty* sp##v = FindObjectChecked<UProperty>(A##c::StaticClass(),TEXT(#v)); \
//	if( NEQ(v[i],((A##c*)Recent)->v[i],Map) ) \
//			*Ptr++ = sp##v->RepIndex+i;}
//

#define DOREP(c,v) \
	static INT s##c##v##RepIndex = FindObjectChecked<UProperty>(A##c::StaticClass(),TEXT(#v))->RepIndex; \
	if( NEQ(v,((A##c*)Recent)->v,Map) ) \
		*Ptr++ = s##c##v##RepIndex;

#define DOREPARRAY(c,v) \
	static INT s##c##v##RepIndex = FindObjectChecked<UProperty>(A##c::StaticClass(),TEXT(#v))->RepIndex; \
	for( INT i=0; i<ARRAY_COUNT(v); i++ ) \
		if( NEQ(v[i],((A##c*)Recent)->v[i],Map) ) \
				*Ptr++ = s##c##v##RepIndex+i;

#define DOREPARRAYINDEX(c,v,i) \
	static INT s##c##v##i##RepIndex = FindObjectChecked<UProperty>(A##c::StaticClass(),TEXT(#v))->RepIndex+i; \
	if( NEQ(v[i],((A##c*)Recent)->v[i],Map) ) \
		*Ptr++ = s##c##v##i##RepIndex;
Found a potential use after free hazard for the nativereplication stuff. So you should at lesat use the above updated macros.
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: Minor things worth mentioning

Post by Hanfling »

New Launch/LCC release over at:

https://coding.hanfling.de/launch/
I demand my DXE User ID back. Launcher for DeusEx, Rune, Nerf, Unreal & Botpack. HX on Mod DB. Revision on Steam.
Post Reply