Author Topic: Migration from D3 to BFG (simple way to track game resources)  (Read 10372 times)

0 Members and 1 Guest are viewing this topic.

motorsep

  • Hero Member
  • *****
  • Posts: 1,099
  • Karma: +78/-134
  • Artist
    • View Profile
    • Kot in Action Creative Artel
Re: Migration from D3 to BFG (simple way to track game resources)
« Reply #15 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.

bitterman

  • Sr. Member
  • ****
  • Posts: 382
  • Karma: +9/-5
  • Doom Newbie
    • View Profile
Re: Migration from D3 to BFG (simple way to track game resources)
« Reply #16 on: February 17, 2016, 09:21:54 PM »
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

  • Hero Member
  • *****
  • Posts: 1,099
  • Karma: +78/-134
  • Artist
    • View Profile
    • Kot in Action Creative Artel
Re: Migration from D3 to BFG (simple way to track game resources)
« Reply #17 on: February 17, 2016, 09:41:48 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

  • Sr. Member
  • ****
  • Posts: 382
  • Karma: +9/-5
  • Doom Newbie
    • View Profile
Re: Migration from D3 to BFG (simple way to track game resources)
« Reply #18 on: February 17, 2016, 09:52:58 PM »
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:

Code: [Select]
basedev\generated\images\newfonts\arial_narrow\48#__0400.bimage
Now I looking for my fontimage.tga -> 48#__0400.bimage.
« Last Edit: February 17, 2016, 09:55:45 PM by bitterman »

motorsep

  • Hero Member
  • *****
  • Posts: 1,099
  • Karma: +78/-134
  • Artist
    • View Profile
    • Kot in Action Creative Artel
Re: Migration from D3 to BFG (simple way to track game resources)
« Reply #19 on: February 17, 2016, 10:58:38 PM »
.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

  • Sr. Member
  • ****
  • Posts: 382
  • Karma: +9/-5
  • Doom Newbie
    • View Profile
Re: Migration from D3 to BFG (simple way to track game resources)
« Reply #20 on: February 17, 2016, 11:20:35 PM »
Code: [Select]
/*
==============================
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?
« Last Edit: February 18, 2016, 07:09:19 AM by bitterman »

bitterman

  • Sr. Member
  • ****
  • Posts: 382
  • Karma: +9/-5
  • Doom Newbie
    • View Profile
Re: Migration from D3 to BFG (simple way to track game resources)
« Reply #21 on: February 18, 2016, 07:39:24 AM »
motorsep, can you test this one on D3BFG/RB, please?

motorsep

  • Hero Member
  • *****
  • Posts: 1,099
  • Karma: +78/-134
  • Artist
    • View Profile
    • Kot in Action Creative Artel
Re: Migration from D3 to BFG (simple way to track game resources)
« Reply #22 on: February 18, 2016, 09:38:42 AM »
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

  • Sr. Member
  • ****
  • Posts: 382
  • Karma: +9/-5
  • Doom Newbie
    • View Profile
Re: Migration from D3 to BFG (simple way to track game resources)
« Reply #23 on: February 18, 2016, 10:34:49 AM »
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.
« Last Edit: February 18, 2016, 10:53:16 AM by bitterman »

motorsep

  • Hero Member
  • *****
  • Posts: 1,099
  • Karma: +78/-134
  • Artist
    • View Profile
    • Kot in Action Creative Artel
Re: Migration from D3 to BFG (simple way to track game resources)
« Reply #24 on: February 18, 2016, 10:45:59 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.

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

  • Sr. Member
  • ****
  • Posts: 382
  • Karma: +9/-5
  • Doom Newbie
    • View Profile
Re: Migration from D3 to BFG (simple way to track game resources)
« Reply #25 on: February 18, 2016, 10:55:10 AM »
Look at screen above :-)
« Last Edit: February 18, 2016, 10:57:04 AM by bitterman »

bitterman

  • Sr. Member
  • ****
  • Posts: 382
  • Karma: +9/-5
  • Doom Newbie
    • View Profile
Re: Migration from D3 to BFG (simple way to track game resources)
« Reply #26 on: February 18, 2016, 10:20:57 PM »
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

  • Sr. Member
  • ****
  • Posts: 382
  • Karma: +9/-5
  • Doom Newbie
    • View Profile
Re: Migration from D3 to BFG (simple way to track game resources)
« Reply #27 on: February 24, 2016, 12:19:18 AM »
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.

Code: [Select]
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.

« Last Edit: February 25, 2016, 06:48:37 AM by bitterman »

bitterman

  • Sr. Member
  • ****
  • Posts: 382
  • Karma: +9/-5
  • Doom Newbie
    • View Profile
Re: Migration from D3 to BFG (simple way to track game resources)
« Reply #28 on: February 26, 2016, 01:31:30 AM »
What does it mean?

Code: [Select]
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

« Last Edit: March 19, 2016, 12:48:14 PM by bitterman »