Jump to content
The Dark Mod Forums

[Bug] Player Message stale first frame


Daft Mugi

Recommended Posts

@duzenko I'm not sure if you've worked on the notes that appear in the upper-left corner before. The notes seem to have a similar behavior as this x-ray fade in issue that you just fixed.

Is that something you could look at next?

It's especially reproducible during the training mission, since there are many notes that show in that mission. When the note fades in, it will sometimes be at 100% opacity on its first frame and then fade in from a low (maybe 0%) opacity to 100% opacity. Visually, it looks like it blinks, disappears, and then slowly fades in.

https://bugs.thedarkmod.com/view.php?id=6117

Edited by Daft Mugi
  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

It's the atdm:gui_message entity with gui tdm_message.gui . The strange thing in the training mission is that the issue doesn't happen with the messages in the starter room. Only the later ones. It also doesn't happen in the archery range. At least in my tests.

Could also have something to do with the trigger maybe?

Edited by datiswous
Link to comment
Share on other sites

  • 2 weeks later...

@Daft Mugi In case it's not always reproducible could you add a getviewpos in the training mission where the text is about to show?

I have been rather busy lately IRL, e.g. this weekend I want to go looking for a used microwave, before that I was traveling, and before that I had some delivery business to attend to. Which is why it's going slow.

Link to comment
Share on other sites

@duzenkoThese 3 messages did it for me, but they don't show up in the video. I'm assuming that's because it's doing it for only 1 frame out of 240fps, and the video is only recording at 60 fps, so chances of catching it are low.

 

 

 

Now I haven't tried at 60 fps, that might be worth looking into.

EDIT: So what's happening is that the message shows fully for 1 frame or a few, then disappears, then fades in over a second.

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

@duzenko No worries about being busy with real life stuff. I hope you found a microwave you liked.

I've included a series of images that show the bug. I used my phone to record my monitor using 60 fps video capture and the game is running at 60 fps.

The series of images shows that the previous message displays at 100% opacity and disappears. Then, the current message fades in over time.

This was recorded on the training mission.

]getviewpos
1427 -359.26 560.25   3.3 176.1 0.0

Though, it is noticeable with most (or all) messages in that mission and other missions.

@AluminumHaste Thank you for looking into this as well.

message-blink.webp

Edited by Daft Mugi
Link to comment
Share on other sites

Another way to see this bug is to use the stealth stat mod that shows the stats as a message. I've seen this bug a lot in Klatremus' walkthrough YouTube videos where he used that particular mod. These days Klatremus uses a different stealth stat mod that replaces the loot stat instead.

I've attached a series of screenshots from one of Klatremus' videos. It shows a blank message at 100% opacity and disappears. Then, the stealth stat message fades in.

To see it yourself, you can step frame by frame on YouTube by first pausing and then using the "." key to step forwards (and the "," key to step backwards). The video link starts at 1:15:56 and the message appears during 1:15:57.

 

 

 

message-blink-stealth-stat.webp

Edited by Daft Mugi
  • Thanks 1
Link to comment
Share on other sites

On 11/6/2022 at 2:46 AM, duzenko said:

I can't repeat this on my end.

If I "Start This Mission" and "setviewpos", message #2 fades in ok without issue.

However, if I "Start This Mission" and traverse to that position, message #2 fade in has the issue. After seeing message #1, shooting a rope arrow, and climbing it, a save can be made. Then, that save can be loaded to reproduce the issue again and again.

 

// Message #1

Look up for the wooden beam that sticks out.
Shoot a rope arrow into it, jump on the rope,
climb up, and jump off the rope to detach yourself.

 

// Message #2

Jump onto the rope. Stay near its bottom end.
Tap 'Attack' to swing. Repeat as the rope goes
through its mid point to make it swing more.
Then jump over the canal on the far swing.

 

Edited by Daft Mugi
Link to comment
Share on other sites

I've had this issue for years, never really bothered me.

I get this on my Radeon 6800XT, as well as my on my wife's computer with the Nvidia GTX1080ti.

We're both running high FPS on this map, but this happens even with FPS capped at 60fps.

Recorded these videos from my Samsung Galaxy S21.

Slow Mo

 

 

Super Slow Mo

 

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

  • 4 weeks later...

I worked on this today, but I haven't been able to track down the problem yet. :(

I found that the previous message or info about the previous message is not cleared from memory completely.

Interesting results happen if:

  1. Trigger message.
  2. Wait for message to fade out.
  3. Save game.
  4. Edit "tdm_message.gui" and change "rect" to something else, such as "100,100,206,160".
  5. Load game.
  6. Trigger next message. (The previous message parchment will blink for a single frame at the previous "tdm_message.gui" "rect" value. The next message parchment will fade in at the current "rect" value.)

(See attached screenshot.)

It seems the messages are not being removed from memory after fade out.

@duzenko @Obsttorte Any ideas? Are scripts completely controlling this feature? If not, where in the game code is it handled?

The following shows the code change made to "guis/tdm_message.gui" for this example to expose part of the issue.

 // A GUI for showing little messages to the player, used f.i. by the training map:

 windowDef parchment
 {
-    rect        0,-10,206,160
+    rect        100,100,206,160
     nocursor  1
     background  "guis/assets/mainmenu/oldparchment_backdrop3"
     matcolor  0,0,0,0

 

message-example-1.webp

Edited by Daft Mugi
  • Like 1
Link to comment
Share on other sites

  • Daft Mugi changed the title to [Bug] Player Message stale first frame

It appears as gui duplication caused by the standard def "atdm:gui_message".

At the same time, it calls a script function "tdm_gui_message::showMessage" and triggers redraw of "guis/tdm_message.gui" linked via its "gui" property.

The glitch seems to go away when I comment out line 59 in tdm_message.def

    // "gui"                    "guis/tdm_message.gui"

@nbohr1more @stgatilov who can advise on this?

  • Like 1
Link to comment
Share on other sites

8 hours ago, duzenko said:

At the same time, it calls a script function "tdm_gui_message::showMessage" and triggers redraw of "guis/tdm_message.gui" linked via its "gui" property.

The glitch seems to go away when I comment out line 59 in tdm_message.def

    // "gui"                    "guis/tdm_message.gui"

@nbohr1more @stgatilov who can advise on this?

I think "gui" spawnarg is used for customizing the message .gui file:

	string gui_name = getKey("gui");
	if (gui_name == "")
	{
		gui_name = "guis/tdm_message.gui";		// the default value
	}
	gui = $player1.createOverlay(gui_name, 10);

You can delete the line, but if someone uses the customization, it won't help them.

What's the duplication exactly?
Does the engine handle "gui" spawnarg automatically?

Link to comment
Share on other sites

1 hour ago, stgatilov said:

I think "gui" spawnarg is used for customizing the message .gui file:

	string gui_name = getKey("gui");
	if (gui_name == "")
	{
		gui_name = "guis/tdm_message.gui";		// the default value
	}
	gui = $player1.createOverlay(gui_name, 10);

You can delete the line, but if someone uses the customization, it won't help them.

 

Well, this is TDM-era script, and the trigger C++ must predate that

Quote

What's the duplication exactly?
Does the engine handle "gui" spawnarg automatically?

On triggers it displays the (separate) message GUI immediately (idEntity::ActivateTargets). Not sure why it's not visible after the first frame - that code makes me sleep 😕

Link to comment
Share on other sites

I'm afraid it is not a proper fix: it will only help for "default" messages.

There are ton of missions which use "atdm:gui_message" with custom "gui" set, you fix will do nothing for them.
For instance:

// entity 1769
{
"classname" "atdm:gui_message"
"name" "message_citywatch_gate1"
"angle" "-90.000000"
"delay" "0"
"force" "1"
"gui" "guis/volta_sign_small.gui"
"lines" "2"
"origin" "345.751 1089.88 213"
"show" "1"
"text" "Finnley Murray"
}

Just ask almost any mapper around.

Here is e.g. a list of missions which all probably suffer from the problem:

"gui" "guis/tdm_message_no_art.gui"
   hazard/hazard.pk4 -> maps/hazard_night.map
   northdale2/northdale2.pk4 -> maps/m2.map
   sirt/sirt.pk4 -> maps/sirt.map
   ac1/ac1.pk4 -> maps/ac1.map
   painterswife/painterswife.pk4 -> maps/city.map
   ac2/ac2.pk4 -> maps/ac2_autosave.map
   itb/itb.pk4 -> maps/itb.map
   nobleaffairs/nobleaffairs.pk4 -> maps/noble_affairs.map
   northdale1/northdale1.pk4 -> maps/m1.map
   ws1_north/ws1_north.pk4 -> maps/ws1_north.map
   away0/away0.pk4 -> maps/away0.map
   ac2/ac2.pk4 -> maps/ac2.map
   ws5_commerce/ws5_commerce.pk4 -> maps/ws5_commerce.map
   snowed_inn/snowed_inn.pk4 -> maps/snowed_inn.map
   airpocket/airpocket.pk4 -> maps/airpocket.map

And that is just one particular value of "gui" spawnarg on messages, there are many others.

 

Link to comment
Share on other sites

8 hours ago, stgatilov said:

I'm afraid it is not a proper fix: it will only help for "default" messages.

There are ton of missions which use "atdm:gui_message" with custom "gui" set, you fix will do nothing for them.
For instance:

// entity 1769
{
"classname" "atdm:gui_message"
"name" "message_citywatch_gate1"
"angle" "-90.000000"
"delay" "0"
"force" "1"
"gui" "guis/volta_sign_small.gui"
"lines" "2"
"origin" "345.751 1089.88 213"
"show" "1"
"text" "Finnley Murray"
}

Just ask almost any mapper around.

Here is e.g. a list of missions which all probably suffer from the problem:

"gui" "guis/tdm_message_no_art.gui"
   hazard/hazard.pk4 -> maps/hazard_night.map
   northdale2/northdale2.pk4 -> maps/m2.map
   sirt/sirt.pk4 -> maps/sirt.map
   ac1/ac1.pk4 -> maps/ac1.map
   painterswife/painterswife.pk4 -> maps/city.map
   ac2/ac2.pk4 -> maps/ac2_autosave.map
   itb/itb.pk4 -> maps/itb.map
   nobleaffairs/nobleaffairs.pk4 -> maps/noble_affairs.map
   northdale1/northdale1.pk4 -> maps/m1.map
   ws1_north/ws1_north.pk4 -> maps/ws1_north.map
   away0/away0.pk4 -> maps/away0.map
   ac2/ac2.pk4 -> maps/ac2.map
   ws5_commerce/ws5_commerce.pk4 -> maps/ws5_commerce.map
   snowed_inn/snowed_inn.pk4 -> maps/snowed_inn.map
   airpocket/airpocket.pk4 -> maps/airpocket.map

And that is just one particular value of "gui" spawnarg on messages, there are many others.

 

You're right of course, but what would be the final solution? The gui code confuses me.

Simplest way might be to use a different spawnarg (other than "gui") to pass gui name to the standard script. But we'd have to fix it on each mission level - too much stress.

Then we could add more hacks to the gui code, such as ignore standard "gui" for "some" entities - but what would be the filtering criteria?

Link to comment
Share on other sites

So there's this:

  • When reproducing this bug, it seems there are always multiple messages involved. The first message in the training mission isn't affected, so it suggests the bug begins with the 2nd message. Also supported by the fact that if you view the 2nd message first it's fine, too.
  • This comment in tdm_gui_message::showMessage() seems to be aware of a flickering issue due to "multi-trigger" and therefore checks whether a gui has already been created for that particular message entity. However, the value of the float variable "gui" is unique to each message entity, so the check doesn't work if a different message entity has created a gui.

image.png

So a possible attempt at a solution could be to turn the gui handle into a global variable shared between all message entities (I renamed it to dragofer_gui to ensure there are no conflicts with other scriptobjects that have some kind of "gui" variable):

tdm_message.script

Would be nice if someone who can reproduce the bug can try whether this makes any difference.

In this implementation it will not show the next message overlay if the old message overlay is still present. If this approach works we might consider destroying the existing message overlay.

  • Like 1
Link to comment
Share on other sites

After some further research, it really seems to be caused by the inbuilt trigger behaviour for any entity that has a "gui" spawnarg. I created a random func_static, gave it a valid "gui" spawnarg and triggered it twice which resulted in flashing a blank parchment for a frame (after some reloading). So it's unlikely the fault is with the scriptobject..

The question is: does any entity in any map rely on this inbuilt "gui" behaviour? If no we can just remove TriggerGUIs from idEntity::Activate. Do we have a way to extract all entities from all released maps that have a "gui" spawnarg?

Edit: extracted all existing "gui" spawnargs from released maps, removed duplicates and removed those that contain words like "message", "map", "text" etc. in order to look for potential non-message GUIs. I looked up the remaining 32 entries in their respective maps to check what kind of entities they're given to with the following results:

Spoiler
gui found in entity class
guis/code1.gui at1_lucy/maps/lucy.map atdm:secret_messages
guis/cuckolds_pages.gui at1_lucy/maps/lucy.map atdm:moveable_custom_item
guis/le_guin_pages1.gui at1_lucy/maps/lucy.map atdm:map_of
guis/cutscene_video_nsfw.gui away0/maps/away0.map atdm:gui_message
guis/cutscene_video_sfw.gui away0/maps/away0.map atdm:gui_message
guis/final_cutscene_replacement_slide.gui away0/maps/away0.map atdm:gui_message
guis/first_cutscene_replacement_slide.gui away0/maps/away0.map atdm:gui_message
guis/success_cutscene_video.gui away0/maps/away0.map atdm:gui_message
guis/memory_sketch.gui black_mage/maps/tbm.map atdm:static_custom_item
guis/lookbehind.gui blackgrove/maps/manor.map atdm:mover_door
guis/nameplates.gui braeden_church/maps/braeden_church.map func_static
guis/rooms.gui braeden_church/maps/braeden_church.map func_static
guis/sewer/deplankkseal.gui dufford/maps/dufford.map func_static
guis/FirstFloor.gui fever/maps/fever.map atdm:map_of
guis/SecondFloor.gui fever/maps/fever.map atdm:map_of
guis/abOutpostClock.gui flakebridge/maps/aboutpostii.map func_static
guis/abOutpostDoorNo.gui flakebridge/maps/aboutpostii.map func_static
guis/abOutpostGraveName.gui flakebridge/maps/aboutpostii.map func_static
guis/waterworks.gui good/maps/good.map func_static
guis/debrief.gui hareinthesnare/maps/man2.map atdm:gui_message
guis/frobscreenread.gui iris/maps/iris.map atdm:gui_message
guis/welli_memento.gui iris/maps/iris.map atdm:gui_message
guis/sotha_pagan_mage.gui mandrasola/maps/mandrasola.map func_static
guis/finale.gui nowandthen/maps/nowandthen.map atdm:gui_message
guis/manor1.gui pearlsnswine/maps/pearls8.map atdm:map_of
guis/manor2.gui pearlsnswine/maps/pearls8.map atdm:map_of
guis/black_fade.gui reap/maps/reap.map atdm:gui_message
guis/epilogue.gui reap/maps/reap.map atdm:gui_message
guis/ice_fade.gui reap/maps/reap.map atdm:gui_message
guis/john01.gui samhain/maps/samhain.map func_static
guis/degrenefelds.gui transaction/maps/transaction.map func_static
guis/key_bindings.gui volta1_3/maps/snapshots/volta_v1.map.0.map shopitem_map_of

Turns out that quite a few of these entities (i.e. the func_statics) rely on TriggerCall being part of the base idEntity::Activate method in order to call up their GUIs. So it's not some forgotten legacy code we can remove.

We could add a custom spawnarg to the entityDef for atdm:gui_message to disable this behaviour for them - no FM overrides this entityDef, btw, so it'll apply to all FMs - but it won't fix other entities that call GUIs and don't have this spawnarg.

  • Like 1
Link to comment
Share on other sites

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

    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 0 replies
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
    • OrbWeaver

      I like the new frob highlight but it would nice if it was less "flickery" while moving over objects (especially barred metal doors).
      · 4 replies
    • nbohr1more

      Please vote in the 15th Anniversary Contest Theme Poll
       
      · 0 replies
×
×
  • Create New...