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 »

I added export for the ExtStrings used by the InformationDevices stored inside DeusExText.u to fullbatchexport (and noticed that i screwed up the preprocessor so the UExtStringExporterTXT was not build into the last HTK release).

Additionally I created a UExtStringFactoryTXT for importing the these ExtStrings. This has the big advantage that this bypasses all of IONs import code for them, and that way one can easily import 16 byte unicode files. Not sure if there was a way to do it before, but I neither had success using utf8, nor 16 byte unicode encoding in the text files with the #exec ALLDEUSEXTEXT IMPORT command.

I imported this font by using

Code: Select all

#exec new TrueTypeFontFactory Name="RomanCyrillicStd16" FontName="RomanCyrillic Std" Height=16 AntiAlias=0 XPad=2 CharactersPerPage=128 Count=4096
Copied sth. russian and bulgarian out of wikipedia into some 16 bit unicode text file and used this for import:

Code: Select all

#exec new ExtStringFactoryTXT Name="00_Book01" File="..\DeusExText\00_Book01.txt"
Afterwards -- though the font is not really great for ingame use and the license doesn't seem to permit that anyway -- the right characters showed up when frobbing the book in training. :)

I'll add support for it to build commandlet, but well.. I guess I'll have to write a bit of introduction for the build commandlet then...
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 figured out a way to prepare "special" 2x UI scale fonts. Special in terms of, though they have the doubled resolution, you can just use them instead of the old 1x versions and they still consume the right amount of space (e.g. they will appear at the same size as the old 1x font in 2x scale). So for using them one just needs to check UI scaling multiplier and use that Font if the UI Scale is a multiple of 2.

The trick I use is to first load a 1x version of the Font to get the glyph coordinates, and afterwards I replace the FontPage texture with another texture which is double the size, has 0.5 as DrawScale and the same U/V Bits/Size/Clamp set as the original 1x version.

The only downside is that the glpyh size needs to be a multiple of two. So you you can't just make a glyph 1px smaller, just in 2px steps.

Samples:
Image

Image
(TitleFont only)


Another interessting feature to implement for build commandlet would be to be able to import a bitmap based font which can use more then 255 characters. E.g. so you could use one texture for the the Basic Latin, another one for Cyrillic and so on. Especially for the very tiny sized fonts, importing out of a TTF doesn't always work that great.
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 »

Apparently if a TextWindow has no own font set, it uses the Font of the RootWindow (probably of the next parent window with font).

So the SetFont call in Extension.RootWindow.InitWindow sets implicit the Font used for the Version Window at the bottom of the MainMenu.

Code: Select all

	SetFont(Font'TechMedium');
I'll try to figure out whether this happens at window creation or is dynamic.
I demand my DXE User ID back. Launcher for DeusEx, Rune, Nerf, Unreal & Botpack. HX on Mod DB. Revision on Steam.
Cybernetic pig
Illuminati
Posts: 2284
Joined: Thu Mar 08, 2012 3:21 am

Re: Minor things worth mentioning

Post by Cybernetic pig »

Yeah, Font takes on the parent (or maybe root only) window's font by default, and in my experience font style can be changed at any time, not just on window init.

Here's an example: http://i68.tinypic.com/2rzcklh.jpg

The personaInfoWindow there has the textWindow as a child and that text window is using two different fonts. First it draws the first few lines of stats text in the default font style, then it draws the "pedometer" with a different font style. Even with Tick() enabled it updates every frame just fine (necessary so those stats can update in real time).
Hanfling
MJ12
Posts: 406
Joined: Sun Oct 04, 2009 6:54 pm

Re: Minor things worth mentioning

Post by Hanfling »

Thanks for the info.
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 now know why Deus Ex looks like a pile of crap. The two main factors for limiting visuals are on one hand that Deus Ex uses a (compared to Unreal, Nerf, ...) extremely low light level which results in wasting a lot of the close to barely enough available precission of lightmaps for surfaces, so quantization hits very hard and probably becomes the dominant factor for lighting on bsp surfaces. On the other hand zone ambient lighting is usually not used or is at a too low level to become noticable.

That it could have been done times better proof my Unreal screenshots in the first post there: http://www.oldunreal.com/cgi-bin/yabb2/ ... 1459155406

A quick test (in linear rendering) by scaling light brightness by 2-4 yields significant better results in Deus Ex.
I demand my DXE User ID back. Launcher for DeusEx, Rune, Nerf, Unreal & Botpack. HX on Mod DB. Revision on Steam.
User avatar
Jonas
Off Topic Productions
Off Topic Productions
Posts: 14224
Joined: Sat Apr 24, 2004 9:21 pm
Location: Hafnia

Re: Minor things worth mentioning

Post by Jonas »

Got any screenshots?
Jonas Wæver
Chief Poking Manager of TNM

I've made some videogames:
Expeditions: Rome
Expeditions: Viking
Expeditions: Conquistador
Clandestine
Cybernetic pig
Illuminati
Posts: 2284
Joined: Thu Mar 08, 2012 3:21 am

Re: Minor things worth mentioning

Post by Cybernetic pig »

A while back I found that Zone Ambient Lighting even with a value of 1 is too bright, which obviously isn't too good for stealth gameplay. I'm going to do more tests though as it may apply nicely on specific maps/zones.

Another thing is meshes are way too bright, regardless of the surrounding lighting, that they totally stand out and look ugly. I've fixed this and will be posting screenshots for comparison soon. Vanilla never had this problem though so I think it is a modern renderer issue.
Hanfling
MJ12
Posts: 406
Joined: Sun Oct 04, 2009 6:54 pm

Re: Minor things worth mentioning

Post by Hanfling »

Cybernetic pig wrote:A while back I found that Zone Ambient Lighting even with a value of 1 is too bright, which obviously isn't too good for stealth gameplay. I'm going to do more tests though as it may apply nicely on specific maps/zones.
The problem which all hardware render devices carried around was that they compared to SoftDrv didn't use the Brightness setting to multiply the lights, but instead modified the gamma ramp to get some sort of Brightness scaling. This was mostly a technical descission as back in the days you couldn't do much about it, but this skyrockets the ambient lighting and whites out everything. Another issue in the non linear rendering is that the ambient lighting will add the same amount of perceived brightness regardless of the other lights. In linear rendering and a low ambient brightness it will effectivly just affect the really dark areas wheras on the ligthed areas it has less to no perceivable effect how it is correct.
Another thing is meshes are way too bright, regardless of the surrounding lighting, that they totally stand out and look ugly. I've fixed this and will be posting screenshots for comparison soon. Vanilla never had this problem though so I think it is a modern renderer issue.
Mesh lighting is one thing of it's own. First of all mesh lighting treats every light source as LE_None which already on it's own causes quite a missmatch. Whats even worse is that mesh lighting is kind of fucked up itsself. While not exactly implemented like that, the (phong) 'diffuse' term for mesh lighting is basically just a step function. Either full light or none, while the (phong) 'specular' term basically acts as some kind of smoothing overlay.
Jonas wrote:Got any screenshots?
I haven't really any screenshots which would highlight the influence of the precission, it's more of a comparission whats different in Unreal/Nerf and messing around with it and knowing how my rendering now act different.

However for the ambient it is easy to screenshot:
No Ambient: http://coding.hanfling.de/subway_no_ambient.jpg
Small Ambient: http://coding.hanfling.de/subway_small_ambient.jpg
I demand my DXE User ID back. Launcher for DeusEx, Rune, Nerf, Unreal & Botpack. HX on Mod DB. Revision on Steam.
Cybernetic pig
Illuminati
Posts: 2284
Joined: Thu Mar 08, 2012 3:21 am

Re: Minor things worth mentioning

Post by Cybernetic pig »

Regarding mouse 3 & 4 support and HXMenuScreenCustomizeKeys

Code: Select all

var localized S_KeyDisplayItem KeyDisplayNames[128];
var localized string                FunctionText[96];
var string                               MenuValues1[96];
var string                               MenuValues2[96];
var string                               AliasNames[96];
var string                               PendingCommands[100];
How come the arrays have 35+ more elements than vanilla (most are [61])?

You provided this code, I want it. If I just replace vanilla MenuScreenCustomizeKeys with this HX one then I'll have mouse 3 & 4 support?
Problem is I cannot test it (for now) as I don't have such a mouse, so I want to be sure on what to do.

Also is there an accurate way of telling the player is attached to a ladder? Something like bIsClimbing set when the player is on a ladder would be really handy. Current method I'm using to play ladder climbing sounds is sub-optimal, but all the vanilla ladder code is native so I have no better method of checking currently.
The ladder climbing works fine for most ladders as seen here, but it doesn't work too well on the few late game ladders the DX devs made out of multiple brushes with gaps between them (missed by GetWallTexture()).
Hanfling
MJ12
Posts: 406
Joined: Sun Oct 04, 2009 6:54 pm

Re: Minor things worth mentioning

Post by Hanfling »

Cybernetic pig wrote:Regarding mouse 3 & 4 support and HXMenuScreenCustomizeKeys
How come the arrays have 35+ more elements than vanilla (most are [61])?
IIRC I did this change, so we could use the code in Revision too. Biomod/Shifter has some extra commands, but they just increased the count of the array to exactly match how many commands are available as this was required with the old code. I change it, so it could work with an arbitrary number of commands up until the array is full, so it would just be adding another defprop instead of always matching the array to the number of commands. Afaik that was the main reason I posted it.
If I just replace vanilla MenuScreenCustomizeKeys with this HX one then I'll have mouse 3 & 4 support?
Problem is I cannot test it (for now) as I don't have such a mouse, so I want to be sure on what to do.
No you need a ViewportManager or sth. so you actually receive events for these keys. For Revision I added it as part of adding RawInput to WinDrvLite, so grab that out of Revision steam dir if you can, otherwise I can upload it. However there are still certain issues in, like some scaling for UI mouse would be nice as the mouse speed in the UI otherwise depends heavily on the mouse one uses, so no hardcoded scaling value would help. For ingame mouse speed I added some sort of logarithmic mouse speed slider, so one can have low mouse scalings too (0.1 to 10).

Code: Select all

//=============================================================================
// HXMenuChoice_MouseSensitivity
//
// Revision History:
//  * Added range of 0.1-0.9 values in 0.1 steps to selection.
//=============================================================================
class HXMenuChoice_MouseSensitivity extends HXMenuUIChoiceSlider;

// ----------------------------------------------------------------------
// LoadSetting()
// ----------------------------------------------------------------------

function LoadSetting()
{
	local float NewValue;

	SaveValue = Player.MouseSensitivity;

	if ( Player.MouseSensitivity<1.0 )
		NewValue = Player.MouseSensitivity*10.0-1.0;
	else
		NewValue = Player.MouseSensitivity+8.0;
		
	//Log( "LoadSetting() (MouseSensitivity="$Player.MouseSensitivity$",NewValue="$NewValue$")", Class.Name );

	BtnSlider.WinSlider.SetTickPosition( NewValue );
}

// ----------------------------------------------------------------------
// CancelSetting()
// ----------------------------------------------------------------------

function CancelSetting()
{
	//Log( "CancelSetting() (SaveValue=" $ SaveValue $ ")", Class.Name );

	Player.UpdateSensitivity( SaveValue );
}

// ----------------------------------------------------------------------
// ResetToDefault()
// ----------------------------------------------------------------------

function ResetToDefault()
{
	//Log( "CancelSetting() (SaveValue=" $ DefaultValue $ ")", Class.Name );

	Player.UpdateSensitivity( DefaultValue );
	SetValue( 9 );
}

// ----------------------------------------------------------------------
// SetEnumerators()
// ----------------------------------------------------------------------

function SetEnumerators()
{
	local int i;

	// 0.1 to 0.9 in 0.1 steps.
	for ( i=0; i<9; i++ )
		SetEnumeration( i, "0."$(i+1) );

	// 1 to 10 in 1 steps.
	for ( i=9; i<19; i++ )
		SetEnumeration( i, (i-8) );
}

// ----------------------------------------------------------------------
// ScalePositionChanged() 
//
// Update the Mouse Sensitivity value.
// ----------------------------------------------------------------------

event bool ScalePositionChanged( Window Scale, int NewTickPosition, float NewValue, bool bFinal )
{
	local float Value;

	// Don't do anything while initializing as we get several 
	// ScalePositionChanged() events before LoadSetting() is called.
	if ( bInitializing )
		return False;

	if ( NewTickPosition<9 )
		Value = (float(NewTickPosition)+1.0)/10.0;
	else
		Value = float(NewTickPosition)-8.0;

	//Log( "ScalePositionChanged() (NewTickPosition="$NewTickPosition$",Value="$Value$")", Class.Name );

	Player.UpdateSensitivity( Value );
	return False;
}

// ----------------------------------------------------------------------
// ----------------------------------------------------------------------

defaultproperties
{
	NumTicks=19
	StartValue=0.1
	EndValue=10.0
	DefaultValue=1.0
	HelpText="Modifies the mouse sensitivity"
	ActionText="Mouse |&Sensitivity"
}
Also is there an accurate way of telling the player is attached to a ladder? Something like bIsClimbing set when the player is on a ladder would be really handy. Current method I'm using to play ladder climbing sounds is sub-optimal, but all the vanilla ladder code is native so I have no better method of checking currently.
The ladder climbing works fine for most ladders as seen here, but it doesn't work too well on the few late game ladders the DX devs made out of multiple brushes with gaps between them (missed by GetWallTexture()).
The texture trace in vanilla Deus Ex is flawed (as discussed somewhere early in this thread). Simply put, it often returns another coplanar surface instead of the correct one. There are quite a lot of noticable examples in Hong Kong. However I still haven't quite figured out if my texture trace works correctly with mover surfaces. Basically I stopped working on it after I needed some testmap with some movers in, where each surface has an unique textures, maybe some complanar faces on the same mover and in the world outside the mover.

As for everything else related to climbing, I have never touched it, but i'll try to figure out how it is done.

/edit:
event WalkTexture() is called. I guess dx is the only game outside WoT where this is actually hooked in.

This should do the trick, but there might be more direct solutions.

Code: Select all

event WalkTexture( Texture Texture, vector StepLocation, vector StepNormal )
{
	Log( "(Texture="$Texture$")", 'WalkTexture' );

	if ( Texture.Outer!=None && Texture.Outer.Name=='Ladder' )
		bOnLadder = True;
	else
		bOnLadder = False;
}
/edit2:
There is most likely no direct solution or bool which you can query. It happens inside the physics code and no bools are set or anything.
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 »

To clarify things about. With missing precission of the lightmaps I was not refering to the spatial resolution of them, but to the color (depth).
I demand my DXE User ID back. Launcher for DeusEx, Rune, Nerf, Unreal & Botpack. HX on Mod DB. Revision on Steam.
Cybernetic pig
Illuminati
Posts: 2284
Joined: Thu Mar 08, 2012 3:21 am

Re: Minor things worth mentioning

Post by Cybernetic pig »

Hanf: thanks for the info and your ladder code works perfectly.
Hanfling
MJ12
Posts: 406
Joined: Sun Oct 04, 2009 6:54 pm

Re: Minor things worth mentioning

Post by Hanfling »

X-Com: Enforcer unofficial PubSrc initial release: http://coding.hanfling.de/launch/ :)

Oh and, and as this was the thing I wanted to wrap up before I touch ActorX and add support for the Deus Ex James Mesh variance and a couple of other things. So no need to invest time into fixing the more than problematic 3ds2de codebase.

For the future and/or new mesh classes I should probably move towards a FBX workflow though.
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 »

An idea I wanted to snag from Unreal 227 for some time now...
I demand my DXE User ID back. Launcher for DeusEx, Rune, Nerf, Unreal & Botpack. HX on Mod DB. Revision on Steam.
Post Reply