Migration from D3 to BFG (simple way to track game resources)

Started by bitterman, February 09, 2016, 07:19:20 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

motorsep

RAGE SDK has font tool that generates .dat and .tga from ttf fonts. BFG has exactly the same font system as RAGE.

bitterman

Quote from: motorsep on February 17, 2016, 07:38:53 AM
RAGE SDK has font tool that generates .dat and .tga from ttf fonts. BFG has exactly the same font system as RAGE.

Yes, just a small thing the size of about 35 Gb (and need to buy a game?).

Thanks, motorsep, but let's try something else :)

Where should I place 48.tga to get the 48_...bimage?
And what about alpha-channel in .tga?

Thanks.

motorsep

Quote from: bitterman on February 17, 2016, 09:21:54 PM
Yes, just a small thing the size of about 35 Gb (and need to buy a game?).

Sure, it's probably on sale for $5 or going to be on sale for $5.

Do you have Doom 3 BFG (it was on sale many times already too)?

bitterman

Wow, it was too fast! :))

Yes, I have D3BFG from Steam and D3 in jewel.

35 Gb it's too much anyway.

Now I have some .dat but when I try to replace it via fs_game it's works incorrect.

I think it's because .dat is custom and .tga is still original:

basedev\generated\images\newfonts\arial_narrow\48#__0400.bimage

Now I looking for my fontimage.tga -> 48#__0400.bimage.

motorsep

.dat has glyphs' info and their location on the .tga canvas. So yeah, they need to match. Same deal as in old Doom 3, except in idTech 5 utf-8 is supported and everything is on one .tga canvas.

bitterman

/*
==============================
idFont::LoadFont
==============================
*/
bool idFont::LoadFont() {
idStr fontName = va( "newfonts/%s/48.dat", GetName() );
idFile * fd = fileSystem->OpenFileRead( fontName );

        .....

idStr fontTextureName = fontName;
>>> fontTextureName.SetFileExtension( "tga" ); <<<

fontInfo->material = declManager->FindMaterial( fontTextureName );
fontInfo->material->SetSort( SS_GUI );


Hmm, ".tga"? Not ".bimage"?

And why "FindMaterial"? I see no decls for fonts in .mtr.

idStr fontTextureName = fontName ="newfonts/%s/48.tga"?

FindMaterial( "newfonts/%s/48.tga" )?

update:

related link (about old fonts and q3font):
http://wiki.thedarkmod.com/index.php?title=Font_Conversion_%26_Repair

As I think q3font is useless for new BFG fonts because .dat format was revised.

Is there a simple way to browse (e.g. after fix) .bimage files in an external viewer?

bitterman


motorsep

Engine makes .bimage from TGAs. You don't even need to be bothered with base/generated/ folder because engine has it all done automatically. All you need to worry about is getting correct source assets (assets in the formats old Doom 3 uses).

Is there any good anonymous file sharing service where someone maybe uploaded RAGE font tool ? ;)

bitterman

It's funny to use source, gimp, blender, other GPL-stuff and this uploaded tool.

But it's interesting how it looks. Maybe someone have an screenshots with idfont.exe.

update:

It's close.

motorsep

Quote from: bitterman on February 18, 2016, 10:34:49 AM
It's funny to use source, gimp, blender, other GPL-stuff and this uploaded tool.

Not an issue when using it for free modding.

Quote from: bitterman on February 18, 2016, 10:34:49 AM
But it's interesting how it looks. Maybe someone have an screenshots with idfont.exe.

Cmd line tool, like many small utils that ever came from idSoftware.

bitterman

Look at screen above :-)

bitterman

Few notes about changes between D3 and D3BFG:

- work with game resources (loading order, binarize, packs) - critical;

- guis: a set of swf menus (shell, intro, pause, dialog etc.) and swf hud - critical;

- fonts: new .dat format - critical;

- added few new materials whiсh hardcoded by engine (eg. for ps3, xbox360) - non critical;

- scripts: added weapon_flashligth & weapon_flashligth_new - non critical;

The list is not complete.

bitterman

I think the most difficult SWF is dialog.bswf. An impressive Action Script code.

Not sure about D3 but in BFG a GDM (game dialog messages) is a complex layer of interaction between C++ code and SWF (GUI).

And it uses SetGlobal/GetGlobal (swf variables as I think).

That theoretically allows to  jump on any (not hard-coded) menu handlers. E.g. not only CAMPAIGN -> NEW GAME -> GAME TYPE -> ... but in any sequence.

****************update:

After extract resources I see in /basedev/renderprogs next folders:

cgb (Cg NVIDIA?)
gl (with old or revised D3 .vfp files)
glsl
hlsl

Questions:

1. In what format I must create own shaders for BFG?
Anybody got an working GLSL/HLSL shaders?

2. How to use non-ARB shaders?
I can't see any new vertexProgram/fragmentProgram (glsl,hlsl,cg) into .mtr (except .vfp).

*******************

Hmm, as I see in RenderProgs_GLSL.cpp .cg (and perhaps .hlsl) was converted by engine.

GLuint idRenderProgManager::LoadGLSLShader( GLenum target, const char * name, idList<int> & uniforms ) {

idStr inFile;
idStr outFileHLSL;
idStr outFileGLSL;
idStr outFileUniforms;
inFile.Format( "renderprogs\\%s", name );
inFile.StripFileExtension();
outFileHLSL.Format( "renderprogs\\glsl\\%s", name );
outFileHLSL.StripFileExtension();
outFileGLSL.Format( "renderprogs\\glsl\\%s", name );
outFileGLSL.StripFileExtension();
outFileUniforms.Format( "renderprogs\\glsl\\%s", name );
outFileUniforms.StripFileExtension();
if ( target == GL_FRAGMENT_SHADER ) {
inFile += ".pixel";
outFileHLSL += "_fragment.hlsl";
outFileGLSL += "_fragment.glsl";
outFileUniforms += "_fragment.uniforms";
} else {
inFile += ".vertex";
outFileHLSL += "_vertex.hlsl";
outFileGLSL += "_vertex.glsl";
outFileUniforms += "_vertex.uniforms";
}


Still not clear.


bitterman

What does it mean?

idLib::Printf( "While linking GLSL program %d with vertexShader %s and fragmentShader %s\n"

Why GLSL are linked with ARB?

Is only GLSL-progs not enough to work with BFG?

And if game resources are still covered by EULA then why shader asset (base/renderprogs/) come with GPL code?

***************** update *****************

There is related info about shaders "RBDoom 3 engine (shader programs)":

http://idtechforums.fuzzylogicinc.com/index.php?topic=204.msg1745#msg1745