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.

bitterman

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.

bitterman

#1
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

The Happy Friar

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

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

#4
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:




The Happy Friar


bitterman

No.

Do you think the problem is in that?

motorsep

Quote from: bitterman on February 10, 2016, 11:41:42 PM
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

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.

QuoteYour 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/?

The Happy Friar

.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

Quote from: bitterman on February 12, 2016, 12:52:06 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)

Quote from: bitterman on February 12, 2016, 12:52:06 AM
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

Sorry, guys, my fault.
.resources like .pk4.
binary like .bimage.

Yes, and thanks for basepath.

update:


The Happy Friar

You could enable the tris view by default & call it an "Art style".  :)

bitterman

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?

bitterman

const char * DEFAULT_FONT = "Arial_Narrow";

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


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?