Jump to content
The Dark Mod Forums

Recommended Posts

Posted (edited)

Most Mods get loaded as soon as the mission start and the lack of caching is sometimes annoying. How come images from Mods don't pass the below filter? I would like to understand how this works.

I have tried all sort of tricks and nothing worked and I don't want to end up spawning hidden dummy objects all over the place 🫤

/renderer/resources/Image_load.cpp

void idImageAsset::ActuallyLoadImage( void ) {
	if ( session->IsFrontend() && !(residency & IR_CPU) ) {
		common->Printf( "Trying to load image %s from frontend, deferring...\n", imgName.c_str() );
		return;
	}

	// load the image from disk
	R_LoadImageData( *this );
	R_UploadImageData( *this );
}
Edited by snatcher

TDM_Modpack_Thumb_50.png

Posted

I think this happens when script code causes a new image to be loaded. The script (I think) is running in the front end code so the load has to be deferred. However, I don't understand why this should cause a problem at all - the point at which images are actually loaded shouldn't be noticeable by the player.

Posted

Normally, all images are preloaded before the game starts.
In this cases images are loaded faster, and there is mostly one thread so the issue does not exist.

All the game code runs on frontend thread, it cannot interact with OpenGL.
Hence it cannot upload images to GPU.
So if an image is created during gameplay, its loading is simply suppressed at that moment.

The image is uploaded only when backend tries to render something using it.
So if you spawn a new entity behind closed door, I guess its images won't get loading until you open the door and pass through all the culling checks.
Of course, the loading might also cause a stutter.

Perhaps today we can simply delete the message.

Posted

It was my fault at the very beginning but later I started following these guidelines: Precaching (def files).

When I debug my mods (decl_show 1) I notice nothing unusual except for the images:

parsing material path/to/image
Trying to load image path/to/image from frontend, deferring...
0x0 path/to/image

Whatever it is, when image X is required by the game for the first time it can cause a stutter.

I say "can" because sometimes theĀ stutter happens and sometime it doesn't OR sometimes I notice it and sometimes I don't.

TDM_Modpack_Thumb_50.png

Posted
21 minutes ago, snatcher said:

It was my fault at the very beginning but later I started following these guidelines: Precaching (def files).

Yes, it seems that preloading is how Doom 3 engine was supposed to work.

Quote

Whatever it is, when image X is required by the game for the first time it can cause a stutter.

I say "can" because sometimes theĀ stutter happens and sometime it doesn't OR sometimes I notice it and sometimes I don't.

I guess it depends on how much/big stuff you get at once.

If it is a small TGA file already in OS disk cache, then it might get loaded in <1 ms and you won't notice.
But if you load some large model and many images, then the total latency can be noticeable.

But there is even worse scenario, and I guess it was typical at the time of Doom 3.
Imagine that a player has TDM on HDD and cold-boots the game. The pk4 files are not in OS disk cache yet, so the dynamic image load triggers a request to HDD. And the game waits until HDD responds, which is about 10 ms today.

Posted

Yes, the same applies to all files.

Perhaps it we shuffle the assets across pk4 based on extension, we can preload pk4 files with small stuff. But models, sounds, and images are the heavy type of assets, so we should not preload them completely.

In case of sounds, I'm not sure slow runtime load will cause a stutter.
Maybe the sound will just start playing later.

Posted (edited)
16 minutes ago, stgatilov said:

In case of sounds, I'm not sure slow runtime load will cause a stutter.
Maybe the sound will just start playing later.

Hmm not sure. I sometimes notice custom in-game dialogues cause a stutter. Audio file? Subtitles? Both? Don't know.

16 minutes ago, stgatilov said:

Perhaps it we shuffle the assets across pk4 based on extension, we can preload pk4 files with small stuff. But models, sounds, and images are the heavy type of assets, so we should not preload them completely.

No need to do anything for me. I did my best to have the smallest footprint (while retaining quality) in all fronts.

Thanks!

Edited by snatcher

TDM_Modpack_Thumb_50.png

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • STiFU

      I finished DOOM - The Dark Ages the other day. It is a decent shooter, but not as great as its predecessors, especially because of the soundtrack.
      · 5 replies
    • JackFarmer

      What do you know about a 40 degree day?
      @demagogue
      · 4 replies
    • jivo

      I just uploaded a new version of the Visible Player Hands mod. It's been updated for TDM 2.13 and has new animations. Check out the post if you're interested!
      · 0 replies
    • datiswous

      I moved from Manjaro Linux (rolling release) to Linux Mint (LTS). One of the reasons was that I found the updates a bit too often and long. But now on Mint I get updates every day, although they're usually small updates.
      · 8 replies
    • JackFarmer

      "Hidden Hands: Vitalic Fever" - new update available including subtitles & compressed briefing video (thanks to @datiswous) and several fixes.
      · 0 replies
×
×
  • Create New...