Jump to content
The Dark Mod Forums

[2.10] Beta testing new Main Menu GUI


stgatilov

Recommended Posts

Known general issues:

  1. When clicking "Restart" in settings, the game does not land back to the same settings.
  2. In mission failed screen, the list of objectives does not show status of objectives properly.

Missions to be checked and fixed:

A) Overriding some mainmenu_*.gui which should not be overriden:

B| Videos controlled by SDK (both briefing and debriefing):

C) Custom title:

 

  • Like 4
Link to comment
Share on other sites

On 6/6/2021 at 9:32 AM, stgatilov said:

C) Custom title:

  • hareinthesnare
  • marshofrahena

Just a thought: Wouldn't it be better for readability if the words in the name are seperated with unserscores? So for example marsh_of_rahena . Is there a naming rule for the mission folder, or is this completely up to the modder?

Another thing: I think it would be nice if there is also a config file where in the player can do modifications to the gui of their own installation. I'm talking about things that don't intervene (too much) with mission specific modifications, like font size or background transparency. For example, personally I have changed a core file to change transparency of install_splash.tga from 0.2 to 0.3 .

Link to comment
Share on other sites

30 minutes ago, datiswous said:

Just a thought: Wouldn't it be better for readability if the words in the name are seperated with unserscores? So for example marsh_of_rahena . Is there a naming rule for the mission folder, or is this completely up to the modder?

This is so-called "internal name", it matches the name of the subdirectory in fms directory.
I'm writing it because it is the easiest for me to obtain with search scripts.

Quote

Another thing: I think it would be nice if there is also a config file where in the player can do modifications to the gui of their own installation. I'm talking about things that don't intervene (too much) with mission specific modifications, like font size or background transparency. For example, personally I have changed a core file to change transparency of install_splash.tga from 0.2 to 0.3 .

Hah!
There are mission authors who want to do font changes too. And backgrounds are de-facto controlled by mission authors.
I'm afraid there is no way to "not intervene with mission modifications".

In principle, you can unpack the guis directory and edit the files. Of course, if developers change these files, then you can get into trouble after update.
Another approach is to expose something via cvar, but I think it is worth doing only if many people want it (yeah, it is fragile!)

 

Link to comment
Share on other sites

8 minutes ago, stgatilov said:

In principle, you can unpack the guis directory and edit the files.

Well that's what I do now. I thought a cleaner way to force certain gui settings would've been nice, but then I just do it manually (after each version update).

Link to comment
Share on other sites

Let's start with a hard example: "Volta 2: Cauldron".
I'm afraid I need help from @kingsal here.

There is a ton of changes and overrides in GUI files when I compare to 2.09, but the only difference that I can spot is the background.
Also parchments are changed for objectives, but I think it is done directly by overriding images, no .gui files involved. It looks very weird of course, since some objectives parchment has new default style, some has old default style ("dirty" parchment), and some have customized parchment.

I have added a "fixed" version, but I only removed all forbidden file overrides, and added the following to "mainmenu_custom_defs.gui":

//stgatilov: disable briefing state after video
#define ENABLE_MAINMENU_BRIEFING 0

//stgatilov: display custom background everywhere
#define MM_BACKGROUNDS_MAINMENU_NOTINGAME   BackgroundCauldron
#define MM_BACKGROUNDS_EXTRAMENU_NOTINGAME  BackgroundCauldron
#define MM_BACKGROUNDS_MAINMENU_INGAME      BackgroundCauldron
#define MM_BACKGROUNDS_EXTRAMENU_INGAME     BackgroundCauldron
#define MM_BACKGROUNDS_BRIEFING             BackgroundCauldron
#define MM_BACKGROUNDS_DIFFSELECT           BackgroundCauldron
#define MM_BACKGROUNDS_SHOP                 BackgroundCauldron

Of course, I defined "BackgroundCauldron" in "mainmenu_background_custom.gui" too.

P.S. I also wonder if I should support something like MM_BACKGROUNDS_ALL, which would automatically override all backgrounds. Although failure and success screens are not changed here... so I guess it would be hard to decide what "ALL" should mean.

Link to comment
Share on other sites

So I released this mission right around when I started tinkering with .GUI files, so its probably a mess. 
 

1 hour ago, stgatilov said:

Also parchments are changed for objectives, but I think it is done directly by overriding images, no .gui files involved.

Yes, this and I think volta 1 both have a custom objective screens + guis. These can go for now. I think we can keep the dds file overrides as those shouldnt interfere.  Down the road, I'd like to revisit the objective pages for the core, we can fit more objectives on that page and clean it up a bit. 

 As long as the custom MM_backgrounds, the briefings, MM audio, and custom loading screen stay. I am happy. Many missions use custom loading screens GUIs so those we need to keep.  I might have forgotten that in my list of requests, sorry.
  

  • Like 1
Link to comment
Share on other sites

 

9 hours ago, kingsal said:

Yes, this and I think volta 1 both have a custom objective screens + guis. These can go for now. I think we can keep the dds file overrides as those shouldnt interfere.  Down the road, I'd like to revisit the objective pages for the core, we can fit more objectives on that page and clean it up a bit.

Yes, texture overrides don't should not be a problem, here at least.

As for objectives, I think they need major refactoring in TDM core game. As I wrote once, there are 4 instances of objectives list, and some of them are copy/pasted, some have name collisions.

Quote

Many missions use custom loading screens GUIs so those we need to keep.

I guess I forgot to mention it: of course mission loading GUI is fully defined by FM --- nothing changes here.

  • Like 1
Link to comment
Share on other sites

The next case is Score to Settle FM by @Springheel.
This one does not override anything inappropriate, but it uses debriefing (controlled by SDK), which I'd like to get rid of.

This case is rather strange, because I had problems checking its behavior. I used "tdm_end_mission" command to quickly win, and tested 2.09, then 2.06, then 2.05. The debriefing simply did not trigger for me in 2.09 and 2.06, but it triggered in 2.05 --- however, it was without sound (main menu music kicked in immediately). Then I retried 2.09 and debriefing worked this time, but again with main menu music. I assume that the intent is to play debriefing video with its sound.
I guess this story confirms the idea that rarely used stuff breaks without anyone noticing it sooner or later 😞

In this FM, I have only added the following defines in mainmenu_custom_defs.gui:

//stgatilov #5323: enable and configure debriefing video
#define ENABLE_MAINMENU_DEBRIEFING_VIDEO 1
#define MM_DEBRIEFING_VIDEO_MATERIAL_1 "video/tdm_final_vid"
#define MM_DEBRIEFING_VIDEO_LENGTH_1 43000
#define MM_DEBRIEFING_VIDEO_SOUND_CMD "music tdm_video_finalroq_1;"

This does not affect its behavior in 2.09 and earlier, but fully fixes the debriefing in the test version of TDM.

  • Like 2
Link to comment
Share on other sites

Quote

I guess this story confirms the idea that rarely used stuff breaks without anyone noticing it sooner or later

Yes, it seems so.  Thanks for fixing it.

Link to comment
Share on other sites

Next case is March of Rahena by @ERH+.
Again, no bad overrides here, but I'd like to remove "custom title" feature, which is used here to replace background.
As far as I remember, @ERH+ agreed to change the way how background looks.

Here are my changes:

  1. Added mainmenu_background_custom.gui with one background layer for the actual image.
  2. Commented using #if 0 the group of defines related to custom title.
  3. Added the code to override background in main menu:
#define MM_BACKGROUNDS_MAINMENU_NOTINGAME 		BackgroundCustomRahena
#define MM_BACKGROUNDS_EXTRAMENU_NOTINGAME 		BackgroundCustomRahena
#define MM_BACKGROUNDS_MAINMENU_INGAME 			BackgroundCustomRahena
#define MM_BACKGROUNDS_EXTRAMENU_INGAME 		BackgroundCustomRahena

Since custom briefing uses default TDM backgrounds in this FM, I did not override background for DIFF_SELECT state: it uses TDM's default too.

Link to comment
Share on other sites

The next one is "Accountant 1" by @Goldwell.
It was overriding some things in order to change background and to hide briefing.

I have removed the overriding files, and added the following to "mainmenu_custom_defs.gui":

//stgatilov #5323: disable briefing state
#define ENABLE_MAINMENU_BRIEFING 0

//stgatilov #5323: override background everywhere
#define MM_BACKGROUNDS_MAINMENU_NOTINGAME	BackgroundCustomAccountantGears
#define MM_BACKGROUNDS_EXTRAMENU_NOTINGAME	BackgroundCustomAccountantGears
#define MM_BACKGROUNDS_MAINMENU_INGAME		BackgroundCustomAccountantGears
#define MM_BACKGROUNDS_EXTRAMENU_INGAME		BackgroundCustomAccountantGears
#define MM_BACKGROUNDS_BRIEFING				BackgroundCustomAccountantGears
#define MM_BACKGROUNDS_DIFFSELECT			BackgroundCustomAccountantGears
#define MM_BACKGROUNDS_SHOP					BackgroundCustomAccountantGears

Then added "mainmenu_background_custom.gui" with animated background image.

  • Like 1
Link to comment
Share on other sites

Tried fixing campaign: No Honor Among Thieves by @Goldchocobo, @Mortem Desino and @Bikerdude.
I wonder if any of the original authors is reachable today.

This campaign has its own briefing video for each of the three missions.
Previously it was done via the "controlled by SDK method", which I'd like to remove.
So I had to provide old-style defines instead.

Here are my changes in "mainmenu_custom_defs.gui":

// stgatilov 5323: use old-style briefing video system instead
//#define BRIEFING_VIDEO_CONTROLLED_BY_SDK 1

#if MM_CURRENTMISSION == 1
	#define MM_BRIEFING_VIDEO_MATERIAL_1 "video/nhat_briefing_video_politics"
	#define MM_BRIEFING_VIDEO_LENGTH_1 121509
	#define MM_BRIEFING_VIDEO_SOUND_CMD "music video/nhat_briefing_politics;"
#elif MM_CURRENTMISSION == 2
	#define MM_BRIEFING_VIDEO_MATERIAL_1 "video/nhat_briefing_video_anoott"
	#define MM_BRIEFING_VIDEO_LENGTH_1 34205
	#define MM_BRIEFING_VIDEO_SOUND_CMD "music video/nhat_briefing_anoott;"
#elif MM_CURRENTMISSION == 3
	#define MM_BRIEFING_VIDEO_MATERIAL_1 "video/nhat_briefing_video_forest"
	#define MM_BRIEFING_VIDEO_LENGTH_1 34600
	#define MM_BRIEFING_VIDEO_SOUND_CMD "music video/nhat_briefing_forest;"
#endif

Also I commented out the MM_BRIEFING_VIDEO_MATERIAL_X, MM_BRIEFING_VIDEO_LENGTH_X and MM_BRIEFING_VIDEO_SOUND_CMD defines in the rest of the file.

It works for me now.
Unfortunately, the briefing won't work in 2.09 and earlier versions: it simple displays black screen, waiting for player to click mouse button.

Link to comment
Share on other sites

On 6/12/2021 at 3:21 AM, stgatilov said:

The next one is "Accountant 1" by @Goldwell.
It was overriding some things in order to change background and to hide briefing.

I have removed the overriding files, and added the following to "mainmenu_custom_defs.gui":


//stgatilov #5323: disable briefing state
#define ENABLE_MAINMENU_BRIEFING 0

//stgatilov #5323: override background everywhere
#define MM_BACKGROUNDS_MAINMENU_NOTINGAME	BackgroundCustomAccountantGears
#define MM_BACKGROUNDS_EXTRAMENU_NOTINGAME	BackgroundCustomAccountantGears
#define MM_BACKGROUNDS_MAINMENU_INGAME		BackgroundCustomAccountantGears
#define MM_BACKGROUNDS_EXTRAMENU_INGAME		BackgroundCustomAccountantGears
#define MM_BACKGROUNDS_BRIEFING				BackgroundCustomAccountantGears
#define MM_BACKGROUNDS_DIFFSELECT			BackgroundCustomAccountantGears
#define MM_BACKGROUNDS_SHOP					BackgroundCustomAccountantGears

Then added "mainmenu_background_custom.gui" with animated background image.

 

Thank you!

 

Has that been uploaded to the official mirrors? Because i'd like to replicate what you've done here with my future missions.

Link to comment
Share on other sites

1 hour ago, Goldwell said:

Has that been uploaded to the official mirrors? Because i'd like to replicate what you've done here with my future missions.

If I upload it now, then players will play your mission without custom background and with empty briefing until February.
Read the original post, it describes where the missions are and when will they be published properly.

Link to comment
Share on other sites

  • 2 weeks later...

Some experiences I made trying to replace the stock background with a custom background image for the first time:

  • It seems there are 2 ways to achieve this: making custom background window defs (line 61) or applying custom title graphics (line 300).
    • I found the background windowDefs method first since it's higher up, so tried that first.
      • This method is more complex, considering the setup that's required outside of the custom_defs file, so it should probably be shown after the custom_title method.
      • There was also trial and error with modifying the windowDefs, so it'd be useful if the GUIs automatically reloaded themselves when you switch between states, if performance allows, so that it gets easier to try out changes without restarting TDM.
    • Then I tried the custom_title method, which is much simpler but has some downsides:
      • The menu parchment gets replaced too - can't see a way to change only the background, which is what I think most people who would use this simpler method want.
      • When the player clicks into another menu, i.e. Options, the background is the default one again.
Link to comment
Share on other sites

11 hours ago, Dragofer said:

Then I tried the custom_title method, which is much simpler but has some downsides:

  • The menu parchment gets replaced too - can't see a way to change only the background, which is what I think most people who would use this simpler method want.
  • When the player clicks into another menu, i.e. Options, the background is the default one again.

It is deprecated, and will be removed soon.

Quote

I found the background windowDefs method first since it's higher up, so tried that first.
This method is more complex, considering the setup that's required outside of the custom_defs file, so it should probably be shown after the custom_title method.

It is more complex because it is more flexible.

Quote

There was also trial and error with modifying the windowDefs, so it'd be useful if the GUIs automatically reloaded themselves when you switch between states, if performance allows, so that it gets easier to try out changes without restarting TDM.

What about reloadGUI console command?

Link to comment
Share on other sites

Repacked Hidden Hands: Initiation by @JackFarmer.

This one overrode background.
So I added custom background in
mainmenu_background_custom.gui and put the following into mainmenu_custom_defs.gui:

//stgatilov #5323: customize background in main menu the new way
#define MM_BACKGROUNDS_MAINMENU_NOTINGAME	BackgroundCustomHHI
#define MM_BACKGROUNDS_EXTRAMENU_NOTINGAME	BackgroundCustomHHI
#define MM_BACKGROUNDS_MAINMENU_INGAME		BackgroundCustomHHI
#define MM_BACKGROUNDS_EXTRAMENU_INGAME		BackgroundCustomHHI
#define MM_BACKGROUNDS_BRIEFING				BackgroundCustomHHI
#define MM_BACKGROUNDS_DIFFSELECT			BackgroundCustomHHI
#define MM_BACKGROUNDS_SHOP					BackgroundCustomHHI

The behavior is now the same as it was (although I find it strange that background changes to default one for briefing, but then changes back for difficulty selection).
The updated FM works properly in 2.09, except that custom menu background is gone.

Link to comment
Share on other sites

Tried to repack "A house of Locked Secrets" by @Moonbo
This one is perfectly valid again, just it seems to use "briefing video controlled by SDK", since it is a campaign.
Also, it has a very important debriefing video.

First of all, mainmenu_custom_defs.gui starts with three letters "bri", which should be syntax error, affecting the rest of the file in unpredictable way.
I have removed these letters.
 

Then I commented out the "controlled by SDK" thing:

//stgatilov #5323: use default way of setting up videos
//#define BRIEFING_VIDEO_CONTROLLED_BY_SDK 1    //activated for campaign

Then enabled debriefing state for second mission (it is disabled by default):

#define ENABLE_MAINMENU_BRIEFING_VIDEO 1
//stgatilov #5323: enable debriefing video after second mission
#if MM_CURRENTMISSION == 2
#define ENABLE_MAINMENU_DEBRIEFING_VIDEO 1
#endif

Finally, I provided debriefing information for second mission (similar to how we do it for briefing videos in non-campaigns):

//stgatilov #5323: set up debriefing video after second mission
#if MM_CURRENTMISSION == 2
#define MM_DEBRIEFING_VIDEO_MATERIAL_1 "House_Credits"
#define MM_DEBRIEFING_VIDEO_SOUND_CMD "music House_Credits;"
#define MM_DEBRIEFING_VIDEO_LENGTH_1 71000
#endif


Now everything works as before with new TDM build (also music in debriefing is now fixed).

In 2.09, the updated FM works fine, except that debriefing/credits video is skipped.

Link to comment
Share on other sites

3 hours ago, stgatilov said:

It is deprecated, and will be removed soon.

This would be a shame, I think the GUI customisation system would profit from a simple & easy way to just drop in a custom background image that instantly replaces all of the stock menu effects in one go.

The new menu customisation system looks like it's very powerful for advanced effects and complete control, but could be tricky for a mapper who's not familiar with the GUI system and only wants to make a simple change like this. In this case he'd have to find out that you can't use a custom background image directly but need to make a GUI material with an appropriate blend mode (ok, seems this is not the case, but it seemed necessary after inspecting the stock menu), a GUI window containing this material with an appropriate rect size, and replace all the stock windows of every state with this new window. I think this is a system for advanced users.

Link to comment
Share on other sites

58 minutes ago, Dragofer said:

This would be a shame, I think the GUI customisation system would profit from a simple & easy way to just drop in a custom background image that instantly replaces all of the stock menu effects in one go.

All effects?

I thought about having single macro like MM_BACKGROUNDS_ALL instead of many individual ones, but should it replace background on success and failure screens too?

And if not, then how should it be called to avoid confusion?
Maybe something like MM_BACKGROUNDS_META_ALLBEFOREGAME ?

Quote

The new menu customisation system looks like it's very powerful for advanced effects and complete control, but could be tricky for a mapper who's not familiar with the GUI system and only wants to make a simple change like this. In this case he'd have to find out that you can't use a custom background image directly but need to make a GUI material with an appropriate blend mode (ok, seems this is not the case, but it seemed necessary after inspecting the stock menu), a GUI window containing this material with an appropriate rect size, and replace all the stock windows of every state with this new window. I think this is a system for advanced users.

Material is not required, you can reference texture directly (as usual).

File mainmenu_background_custom.gui already contains a stub of GUI window:

Spoiler


/* =============================================================================================
 *
 * This file is included into The Dark Mod's Main Menu GUI.
 *
 * Mission Authors: You CAN safely edit and include in your PK4. 
 *
 * When this file is included in your PK4 as "guis/mainmenu_background_custom.gui", it will
 * override the standard TDM file with the same name and the definitions within.
 *
 * stgatilov: You can add mission-specific background layers here.
 * See mainmenu_background.gui for examples of background layers used in core game.
 * Make sure to use macro BACKGROUND_DEFAULT_BEHAVIOR or maintain the same naming convention and behavior.
 * Note that relative order of layers cannot be changed.
 *
 * ============================================================================================= */


/**
 * Example: custom background texture
 * Uncomment it, rename, adjust to your needs (or just delete).
 */
#if 0
windowDef BackgroundCustomTexture
{
	rect		0, 0, 640, 480
	background	"guis/assets/custom_background"

	BACKGROUND_DEFAULT_BEHAVIOR(BackgroundCustomTexture)
}
#endif

 

 

Link to comment
Share on other sites

38 minutes ago, stgatilov said:

All effects?

I thought about having single macro like MM_BACKGROUNDS_ALL instead of many individual ones, but should it replace background on success and failure screens too?

And if not, then how should it be called to avoid confusion?
Maybe something like MM_BACKGROUNDS_META_ALLBEFOREGAME ?

I think the most common usage would be:

- custom background for the main menu (pregame and ingame) and its submenus: Load/Save, Settings, Select Mission.

- stock background for everything else: TDM credits, anything after Start Mission (briefing, objectives, shop), success/failure screens and so on

The 2nd macro could assign the custom background image to everything.

Also, I think the parchment overlays should be kept by default. If a mapper is engaged enough to draw a new menu box they'd probably want to use the more advanced method.

51 minutes ago, stgatilov said:

File mainmenu_background_custom.gui already contains a stub of GUI window:

Ah right, my TDM install's gui .pk4 doesn't contain this file so I was deriving it from mainmenu_background.gui

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  »  DeTeEff

      I've updated the articles for your FMs and your author category at the wiki. Your newer nickname (DeTeEff) now comes first, and the one in parentheses is your older nickname (Fieldmedic). Just to avoid confusing people who played your FMs years ago and remember your older nickname. I've added a wiki article for your latest FM, Who Watches the Watcher?, as part of my current updating efforts. Unless I overlooked something, you have five different FMs so far.
      · 0 replies
    • 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.
      · 4 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
×
×
  • Create New...