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

0 Members and 1 Guest are viewing this topic.

bitterman

  • Sr. Member
  • ****
  • Posts: 382
  • Karma: +9/-5
  • Doom Newbie
    • View Profile
Migration from D3 to BFG (simple way to track game resources)
« on: February 09, 2016, 07:19:20 AM »
Is there a simple way to track which game resources are called by the idTech4 engine (especially at startup)?

May be some kind of logs/console commands?

I'm trying now to solve the problem "a minimal set of own resources" for BFG (without any vanilla code - for great GPL'tice).

P.S. A minimal assets for D3 give me a crash into D3BFG/RBDOOM.
« Last Edit: February 10, 2016, 09:35:29 PM by bitterman »

bitterman

  • Sr. Member
  • ****
  • Posts: 382
  • Karma: +9/-5
  • Doom Newbie
    • View Profile
Re: A simple way to track game resources?
« Reply #1 on: February 10, 2016, 07:32:55 AM »
Seems like "+set logFile 1" is working at the moment.

Now I see a strange things with r_showTris.
Hmm, seems like they changed a relative part of render code...

related thread about D3:
http://idtechforums.fuzzylogicinc.com/index.php?topic=236.msg2070#msg2070
« Last Edit: February 10, 2016, 07:37:41 AM by bitterman »

The Happy Friar

  • Happy Happy Joy Joy
  • Administrator
  • Hero Member
  • *****
  • Posts: 1,031
  • Karma: +46/-4
  • Semi-Newbie.
    • View Profile
    • EarthQuake
Re: A simple way to track game resources?
« Reply #2 on: February 10, 2016, 09:54:44 AM »
motorsep's gotten D3BFG code running with non-BFG assets, maybe he'll post the min required stuff.  :)

I do know the BFG will crash much easier then stock D3 in relation to assets & it won't put out a useful error message when related to assets part of the time.

motorsep

  • Hero Member
  • *****
  • Posts: 1,099
  • Karma: +78/-134
  • Artist
    • View Profile
    • Kot in Action Creative Artel
Re: A simple way to track game resources?
« Reply #3 on: February 10, 2016, 03:40:10 PM »
All I did was ran engine in debug with no assets and watched what crashed it, one by one adding missing assets.

Somewhere in the framework/ folder (common.cpp or something else), there is basically a list of assets that get loaded on start up. That's something to start with.

bitterman

  • Sr. Member
  • ****
  • Posts: 382
  • Karma: +9/-5
  • Doom Newbie
    • View Profile
Migration from D3 to BFG (simple way to track game resources)
« Reply #4 on: February 10, 2016, 09:26:25 PM »
Yes, thanks.

Well, I've got a totally black window with working console and huge wall of warnings.

It's works even without any swf stuff (main menu, hud, pause etc.).

But now a problem is to see anything ingame.

There is a similar problem:
http://idtechforums.fuzzylogicinc.com/index.php?topic=335.msg3504#msg3504

Any map which loaded by map/testmap is still black.

This is really scare:)


P.S. There is a problem with r_showTris in original BFG:



« Last Edit: February 10, 2016, 09:40:37 PM by bitterman »

The Happy Friar

  • Happy Happy Joy Joy
  • Administrator
  • Hero Member
  • *****
  • Posts: 1,031
  • Karma: +46/-4
  • Semi-Newbie.
    • View Profile
    • EarthQuake
Re: Migration from D3 to BFG (simple way to track game resources)
« Reply #5 on: February 10, 2016, 10:33:05 PM »
Are your assets binarized?

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 #6 on: February 10, 2016, 11:41:42 PM »
No.

Do you think the problem is in that?
« Last Edit: February 10, 2016, 11:44:18 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 #7 on: February 11, 2016, 09:20:18 AM »
No.

Do you think the problem is in that?

Your assets should be binarized automatically on map load. If they don't get binarized, something is wrong.

The list of assets in C++ code gets binarized first. Those are a must have assets. Then you load a box map and see the warnings. Better run it with +set com_smp 0 to turn off threading to see _all_ prints in the console. Add each asset that is being asked for in those warnings/errors.

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 #8 on: February 12, 2016, 12:52:06 AM »
Let's refine:

1. Get the source code (D3BFG/RBDOOM) and compile it (as debug).

2. Create 'base' folder into appropriate folder (eg. Win32/Debug/base).

3. Put into 'base' our own folders (af, def, script, maps, newfonts etc.) and default.cfg.
At this moment custom game resources are not binarized, map created in D3 Editor/Radiant, and original game resources are not present.

4. Run .exe.

After that I have a black app window with working console.

5. Type 'map game/testmap.map' (also try 'dmap game/testmap.map').

After that I have a black app window. Console still working.

Quote
Your assets should be binarized automatically on map load. If they don't get binarized, something is wrong.

This moment is not clear.
What about fs_bulidresources, buildGame, fs_loadPriority etc.?
No need to use it in this case?

Will testmap.resources be created automatically (via 'map' command) in maps/game/?
« Last Edit: February 12, 2016, 04:50:38 AM by bitterman »

The Happy Friar

  • Happy Happy Joy Joy
  • Administrator
  • Hero Member
  • *****
  • Posts: 1,031
  • Karma: +46/-4
  • Semi-Newbie.
    • View Profile
    • EarthQuake
Re: Migration from D3 to BFG (simple way to track game resources)
« Reply #9 on: February 12, 2016, 07:28:50 AM »
.resources is the id tech 5 "pak" file, that's done manually (I think).  The binarizied stuff goes in to to the base/generated folder & follows the folder structure of the assets.  IE textures/wall/wall.tga should be in generated/textures/wall/wall.bsomething.  Something is different based on what's binarized.

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 #10 on: February 12, 2016, 10:24:18 AM »

This moment is not clear.
What about fs_bulidresources, buildGame, fs_loadPriority etc.?
No need to use it in this case?

No, those are to make .resources (pk4-like files for idTech 5)

Will testmap.resources be created automatically (via 'map' command) in maps/game/?

No, it won't. You don't need .resources at all.

What engine should do is load all assets pertaining to the map when you loading that map, binarize them and save them into base/generated/

Btw, you don't need to put base/ next to you binary in Win32/Debug/

Use +set fs_basepath X:\games\my_doom3bfg_mod\ for your debug cmd line in MSVC to point debug .exe to your base\  (base\ would be located in X:\games\my_doom3bfg_mod\ )

X:\games\my_doom3bfg_mod\ can be anything/anywhere

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 #11 on: February 13, 2016, 04:43:26 AM »
Sorry, guys, my fault.
.resources like .pk4.
binary like .bimage.

Yes, and thanks for basepath.

update:

« Last Edit: February 13, 2016, 07:33:51 AM by bitterman »

The Happy Friar

  • Happy Happy Joy Joy
  • Administrator
  • Hero Member
  • *****
  • Posts: 1,031
  • Karma: +46/-4
  • Semi-Newbie.
    • View Profile
    • EarthQuake
Re: Migration from D3 to BFG (simple way to track game resources)
« Reply #12 on: February 13, 2016, 08:00:04 AM »
You could enable the tris view by default & call it an "Art style".  :)

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 #13 on: February 14, 2016, 10:18:43 AM »
Showtris always remind me Braben's Elite-like style.

Moreover it would be solve texture problems :-)

update:

Some troubles with new fonts. As I see tool for D3 fonts is not work at now.

What is idFont for Rage? Can't find any link. It's from ID ftp?

Update:

Ok, it's from rage toolkit.
Is idfont.exe from this package available?
« Last Edit: February 15, 2016, 10:33:18 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 #14 on: February 17, 2016, 12:38:49 AM »
Code: [Select]
const char * DEFAULT_FONT = "Arial_Narrow";

static const float old_scale2 = 0.6f;
static const float old_scale1 = 0.3f;

Code: [Select]
struct glyphInfo_t {
byte width; // width of glyph in pixels
byte height; // height of glyph in pixels
char top; // distance in pixels from the base line to the top of the glyph
char left; // distance in pixels from the pen to the left edge of the glyph
byte xSkip; // x adjustment after rendering this glyph
uint16 s; // x offset in image where glyph starts (in pixels)
uint16 t; // y offset in image where glyph starts (in pixels)
};

Which of these values are used by default in BFG-version?

48.dat - is it 48x48px per symbol?

What size of fontimage.tga is needed? It is power of two texture?