Minor things worth mentioning
Re: Minor things worth mentioning
I managed to make a map:
http://coding.hanfling.de/HanMadeAMap.jpg
http://coding.hanfling.de/HanMadeAMap.jpg
Re: Minor things worth mentioning
What this code does, in particular?Hanfling wrote:While working on improving my bitmap font exporter I ended up writing this line:Code: Select all
guard(HandleTTF);
Re: Minor things worth mentioning
Remember the callstack trace when a crash/voluntary app error occurs, like (when you enter DEBUG GPF):
The guard[Slow] and corrosponding unguard[Slow|f] macros are responsible for this. And the HandleTTF guard block is around a detection of an imported TTF font and putting out an unsupported image in this case on my bitmap font exporter (which reconstruct those lines seperating the glyphs for import).
The pun is that in DeusEx's Engine\Classes\Canvas.uc is this line:
Which samples the HandleGothic BT TTF font into an imported font.
Code: Select all
Critical: UEngine::Exec
Critical: UGameEngine::Exec
Critical: DDeusExGameEngine::Exec
Critical: UHXGameEngine::Exec
Critical: UPlayer::Exec
Critical: UViewport::Exec
Critical: UWindowsViewportLite::Exec
Critical: UObject::ProcessEvent
Critical: (HXConsole Transient.HXConsole0, Function Engine.Console.Typing.KeyEvent)
Critical: UEngine::InputEvent
Critical: UWindowsViewportLite::CauseInputEvent
Critical: KeyDown
Critical: UWindowsViewportLite::ViewportWndProc
Critical: (Message=WM_KEYDOWN,wParam=13,lParam=1835009)
Critical: WWindow::StaticProc
Critical: (Message=WM_KEYDOWN)
Critical: LaunchMainLoop
The pun is that in DeusEx's Engine\Classes\Canvas.uc is this line:
Code: Select all
#exec new TrueTypeFontFactory Name="LargeFont" FontName="HandelGothic BT" Height=32 AntiAlias=1 XPad=2 CharactersPerPage=64
Re: Minor things worth mentioning
Neat, thanks for your detailed explanation! I am happy to see there are improvements for localisation-related things in Deus Ex. One thing I was wondering about is DropShadowX/Y parameters does not seem to be implemented for TrueTypeFontFactory, thus one cannot recreate {FONTNAME}_DS Fonts.
Drawing font-sets with realistic dropshadow is extremely hard and tedious to do, how developers did that with that broken parameter is a mystery. Wish I could write proper code so I could help. I am very excited about your QtConEdit too.
Drawing font-sets with realistic dropshadow is extremely hard and tedious to do, how developers did that with that broken parameter is a mystery. Wish I could write proper code so I could help. I am very excited about your QtConEdit too.
Re: Minor things worth mentioning
I never heard about this option.Bird wrote:Neat, thanks for your detailed explanation! I am happy to see there are improvements for localisation-related things in Deus Ex. One thing I was wondering about is DropShadowX/Y parameters does not seem to be implemented for TrueTypeFontFactory, thus one cannot recreate {FONTNAME}_DS Fonts.
I used this code for some tests with removing the flash fog when traveling and displaying a small half-life style loading messages with a drop shadow by rendering the same font two times.
Code: Select all
class RevConsole extends Console;
var(ActionMessage) bool bOldActionMessages; /** Use ugly old style action messages. */
var(ActionMessage) bool bShadeActionMessages; /** Whether to draw a fake font shadow for action messages. */
var(ActionMessage) Color ActionColor; /** Color of action messages. */
var(ActionMessage) Color ActionShadeColor; /** Shadow color of fake font shadow for action messages. */
var(ActionMessage) Font ActionFont; /** Font used for action messages. */
/** Renders the level action like LOADING or PRECACHING on screen. */
function DrawLevelAction( canvas C )
{
local string BigMessage;
// DEUS_EX AJY - don't want to print any text
// if the game is paused because we're in a menu
if (Viewport.Actor.bShowMenu )
{
BigMessage = "";
return;
}
if ( (Viewport.Actor.Level.Pauser != "") && (Viewport.Actor.Level.LevelAction == LEVACT_None) )
{
if ( bOldActionMessages )
{
C.Font = C.BigFont;
C.Style = 1;
C.DrawColor.R = 255;
C.DrawColor.G = 255;
C.DrawColor.B = 255;
BigMessage = PausedMessage; // Add pauser name?
PrintActionMessage(C, BigMessage);
}
else
PrintShadedActionMessage( C, BigMessage );
return;
}
else if ( Viewport.Actor.Level.LevelAction==LEVACT_Loading )
BigMessage = LoadingMessage;
else if ( Viewport.Actor.Level.LevelAction==LEVACT_Saving )
BigMessage = SavingMessage;
else if ( Viewport.Actor.Level.LevelAction==LEVACT_Connecting )
BigMessage = ConnectingMessage;
else if ( Viewport.Actor.Level.LevelAction==LEVACT_Precaching )
BigMessage = PrecachingMessage;
if ( BigMessage != "" )
{
if ( bOldActionMessages )
{
C.Style = 3;
C.DrawColor.R = 0;
C.DrawColor.G = 0;
C.DrawColor.B = 255;
C.Font = C.LargeFont;
PrintActionMessage(C, BigMessage);
}
else
PrintShadedActionMessage( C, BigMessage );
}
}
/** Helper for DrawLevelAction(), Location of action message is set here. */
function PrintActionMessage( Canvas C, string BigMessage )
{
local float XL, YL;
C.bCenter = False;
C.StrLen( BigMessage, XL, YL );
//C.SetPos( FrameX/2 - XL/2, FrameY/2 - YL/2 );
// REV_HAN: Move this slightly over crosshair.
// Probably 16-24 is better for 1x, but would conflict on 2x.
C.SetPos( FrameX/2 - XL/2, FrameY/2 - YL/2 - 32);
C.DrawText( BigMessage, False );
}
/** Helper for DrawLevelAction() with shading support, Location of action message is set here. */
function PrintShadedActionMessage( Canvas C, string BigMessage )
{
local float X, Y, XL, YL;
// All style related properties here.
C.Style = 1;
C.Font = ActionFont;
C.bCenter = False;
C.StrLen( BigMessage, XL, YL );
// Move this slightly over crosshair. Probably 16-24 is better for 1x, but would conflict on 2x.
X = FrameX/2 - XL/2;
Y = FrameY/2 - YL/2 - 32;
// Draw fake shadow first.
if ( bShadeActionMessages )
{
C.DrawColor = ActionShadeColor;
C.SetPos( X+1, Y+1 );
C.DrawText( BigMessage, False );
}
// Draw action message.
C.DrawColor = ActionColor;
C.SetPos( X, Y );
C.DrawText( BigMessage, False );
}
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
defaultproperties
{
bShadeActionMessages=False
bOldActionMessages=True
ActionColor=(R=127,G=127,B=127)
ActionShadeColor=(R=0,G=0,B=0)
ActionFont=Font'Engine.SmallFont'
}
Re: Minor things worth mentioning
DropShadow stuff: https://wiki.beyondunreal.com/Legacy:Tr ... ontFactory
Long ago, I was working on some code-improvements to get that dropshadow effect in-game. Just copy and compile. Works best with newly-imported TTF.
Long ago, I was working on some code-improvements to get that dropshadow effect in-game. Just copy and compile. Works best with newly-imported TTF.
- Attachments
-
- backport_shadow.zip
- DropShadow ramblings.
- (15.5 KiB) Downloaded 626 times
Re: Minor things worth mentioning
Well the Wiki entry clearly says only UT2003.
If you can get me the exact calculations UT2003 uses for the offset, e.g. how DropShadowX/Y relates to the offset itsself, I'll try to make a subclass of the existing truetype font factory and do the shadow adding as a post process step as i can easily use the XPad/YPad options to get more space for the shadow itsself on the texture.
/edit:
At the same time i should add an option for premultiplying alpha, as the PF_Highlighted rendering mode used for antialiased TTF fonts is pre multiplied alpha blending, while the font textures themself seem to be non premultiplied alpha, though this can be an issue when the texture is not stored in an sRGB format, which in turn would require a dependency on my renderdevice. Maybe I add an sRGB option too.
/edit2:
Looks like they use a Compress option and passing the texture format id, that looks resonble. I want to add code for this anyway to HTK, so this perfectly fits in.
If you can get me the exact calculations UT2003 uses for the offset, e.g. how DropShadowX/Y relates to the offset itsself, I'll try to make a subclass of the existing truetype font factory and do the shadow adding as a post process step as i can easily use the XPad/YPad options to get more space for the shadow itsself on the texture.
/edit:
At the same time i should add an option for premultiplying alpha, as the PF_Highlighted rendering mode used for antialiased TTF fonts is pre multiplied alpha blending, while the font textures themself seem to be non premultiplied alpha, though this can be an issue when the texture is not stored in an sRGB format, which in turn would require a dependency on my renderdevice. Maybe I add an sRGB option too.
/edit2:
Looks like they use a Compress option and passing the texture format id, that looks resonble. I want to add code for this anyway to HTK, so this perfectly fits in.
Re: Minor things worth mentioning
Some interessting read:
http://www.oldunreal.com/cgi-bin/yabb2/ ... 1459155406
http://www.oldunreal.com/cgi-bin/yabb2/ ... 1459155406
Re: Minor things worth mentioning
So we had yesterday a discussion about the PSX2 version of Deus Ex.
Some findings:
The *.RAW files are loading screens stored as raw 640x480 24bpp data. You can use IrfanViews open raw option to view those.
The *.PSS files are videos with MPEG2 video and PS2 PCM data. You can play them back with the proper codecs installed on your system.
For the music files one should try out ea's sx.exe and see if one can convert those with it (left in release version of Brother Bear), or maybe find some codec/converter/program which can handle them.
Now to the fun part. The game data is apparently stored in three *.UMD files, while one of those (the most interessting one) is somehow hidden or sth.
These *.UMD files contain the unreal packages, and are "arc" files. There is some FFileManagerArc.h header in ut432pubsrc. The code is enough to know how to extract them (I just wrote some commandlet for HTK to do it). To my huge suprise these packages seem to be at least partially binary compatible with the PC version of Deus Ex. DeusExUIDynamic.u contains the datavault images and some ui screens and can just be extracted with batchexport. The DeusExTextData.u assumes the ExtString class to be in DeusExText package instead of beeing in Extension package. I made up some new DeusExText.dll with some basic implementation of ExtString (just implementing Serialize() should be enough). Afterward I just used my HTK ExtString exporter code to export it. Apparently not much has changed compared to DeusExText, though they have some tags for keycodes and logins inside the text files. Seems like a nice idea to copy for making the login stuff a bit more automatic (for controller support). Fun fact: The quotes file seems to be in spanish in the english version. Some further packages failed to load due to unsatisfied dependencies, so adding these and trying to load the packages again might for. The level files have the extension *.lin and crash upon load, haven't yet checked into this in detail yet though.
Some findings:
The *.RAW files are loading screens stored as raw 640x480 24bpp data. You can use IrfanViews open raw option to view those.
The *.PSS files are videos with MPEG2 video and PS2 PCM data. You can play them back with the proper codecs installed on your system.
For the music files one should try out ea's sx.exe and see if one can convert those with it (left in release version of Brother Bear), or maybe find some codec/converter/program which can handle them.
Now to the fun part. The game data is apparently stored in three *.UMD files, while one of those (the most interessting one) is somehow hidden or sth.
These *.UMD files contain the unreal packages, and are "arc" files. There is some FFileManagerArc.h header in ut432pubsrc. The code is enough to know how to extract them (I just wrote some commandlet for HTK to do it). To my huge suprise these packages seem to be at least partially binary compatible with the PC version of Deus Ex. DeusExUIDynamic.u contains the datavault images and some ui screens and can just be extracted with batchexport. The DeusExTextData.u assumes the ExtString class to be in DeusExText package instead of beeing in Extension package. I made up some new DeusExText.dll with some basic implementation of ExtString (just implementing Serialize() should be enough). Afterward I just used my HTK ExtString exporter code to export it. Apparently not much has changed compared to DeusExText, though they have some tags for keycodes and logins inside the text files. Seems like a nice idea to copy for making the login stuff a bit more automatic (for controller support). Fun fact: The quotes file seems to be in spanish in the english version. Some further packages failed to load due to unsatisfied dependencies, so adding these and trying to load the packages again might for. The level files have the extension *.lin and crash upon load, haven't yet checked into this in detail yet though.
Re: Minor things worth mentioning
Interesting stuff! I used to have a Spanish version of Deus Ex (had no chance to look at the files back then).
I wonder if conversation audio files would be the same 8000 Hz quality MP3's as on the PC version.
This was exciting to read, thanks for posting it.
I wonder if conversation audio files would be the same 8000 Hz quality MP3's as on the PC version.
This was exciting to read, thanks for posting it.
Re: Minor things worth mentioning
New HTK build. Changes include, but are not limited too:
UnArcCommandlet
Extract those PSX2LINS.UMD/PSX2SHIP.UMD of the PSX2 version of Deus Ex.
FullBatchExportCommandlet
Extracts what it can out of package and places the contents into the appropreciate directory structure for build commandlet.
FontExporter
Reconstructs the source texture of bitmap fonts (NOT TTF!). As far as I can tell this works perfectly for Nerf and Deus Ex. After import you get exact the same result as it was before (so no screwups with characters in the CP850 to Latin1 range anymore).
FontPageDiffCommandlet
Compares the glypth texture coordinates of two fonts. I created this to make sure the FontExporter works correct as this can be used to make sure the font ended up as before after reimport.
http://coding.hanfling.de/launch/releas ... 160618.zip
UnArcCommandlet
Extract those PSX2LINS.UMD/PSX2SHIP.UMD of the PSX2 version of Deus Ex.
FullBatchExportCommandlet
Extracts what it can out of package and places the contents into the appropreciate directory structure for build commandlet.
FontExporter
Reconstructs the source texture of bitmap fonts (NOT TTF!). As far as I can tell this works perfectly for Nerf and Deus Ex. After import you get exact the same result as it was before (so no screwups with characters in the CP850 to Latin1 range anymore).
FontPageDiffCommandlet
Compares the glypth texture coordinates of two fonts. I created this to make sure the FontExporter works correct as this can be used to make sure the font ended up as before after reimport.
http://coding.hanfling.de/launch/releas ... 160618.zip
Last edited by Hanfling on Mon Jun 20, 2016 5:59 pm, edited 1 time in total.
- Andrievskaya Veronika
- UNATCO
- Posts: 151
- Joined: Wed Mar 21, 2007 5:36 am
- Location: Somewhere in Russia
- Contact:
Re: Minor things worth mentioning
The link is brokenHanfling wrote: http://coding.hanfling.de/HTK-20160618.zip
Re: Minor things worth mentioning
That sounds fantastic. I need to get FontExporter a spin when I have the chance.
Re: Minor things worth mentioning
Fixed it now.Andrievskaya Veronika wrote:The link is broken
Maybe worth to mention, if you use batchexport commandlet, you need some ucc executable which autoloads UExporters by int entries. The LCC inside my Launch release does that, links should be above. If you use the HTK fullbatchallexport commandlet it gets autoloaded as the native dll gets bounds, so it's not needed for the fullbatchexport commandlet.