Jump to content
CasperVg

Advanced Lot Plop - new GUIs with DLLs

156 posts in this topic Last Reply

Highlighted Posts

Posted:
Last Online:  
 
26 minutes ago, 11241036 said:

I gave the mod a new try with version 1.0.3, but I still can't get the Advanced LotPlop window to open in-game. The log file, however, has changed:


[2025-11-01 00:15:45.308] [SC4AdvancedLotPlop] [info] SC4AdvancedLotPlop logger initialized
[2025-11-01 00:15:45.308] [SC4AdvancedLotPlop] [info] Logging to file: C:\Users\Samuel\Documents\SimCity 4\SC4AdvancedLotPlop.log
[2025-11-01 00:15:45.308] [SC4AdvancedLotPlop] [info] SC4AdvancedLotPlop v0.1.3
[2025-11-01 00:29:38.071] [SC4AdvancedLotPlop] [info] PostAppInit: Initializing AdvancedLotPlopDllDirector
[2025-11-01 00:32:42.973] [SC4AdvancedLotPlop] [info] Got game window from framework: 0xB046A
[2025-11-01 00:32:42.975] [SC4AdvancedLotPlop] [info] D3D11Hook: Initializing with game window: 0xB046A
[2025-11-01 00:32:42.975] [SC4AdvancedLotPlop] [info] D3D11Hook: Installing Present hook...
[2025-11-01 00:32:43.016] [SC4AdvancedLotPlop] [info] D3D11Hook: Temporary device created (FeatureLevel: 0xB000)
[2025-11-01 00:32:43.016] [SC4AdvancedLotPlop] [info] D3D11Hook: Found Present at 0x6F2A0950
[2025-11-01 00:32:43.019] [SC4AdvancedLotPlop] [info] D3D11Hook: Present hook installed successfully
[2025-11-01 00:32:43.019] [SC4AdvancedLotPlop] [info] D3D11Hook: Window procedure hook installed successfully
[2025-11-01 00:32:43.019] [SC4AdvancedLotPlop] [info] D3D11Hook: Original WndProc: 0xFFFF0259
[2025-11-01 00:32:43.019] [SC4AdvancedLotPlop] [info] D3D11Hook initialized successfully

 

That sounds promising. Could you explain this a bit more in detail, please? Which files exactly did you move into the main documents folder?

Everything in the entire folder, copy and paste to main plugin directory 

Share this post


Link to post
Share on other sites
Posted:
Last Online:  
 

Well, sorry to crash the party, but I can't get this mod to work. I've tried everything, changing some settings in DgVoodoo 2, moving the files into the Plugins root folder, even installing them into a completely empty Plugins folder to check if anything is interfering. Nothing. Whenever I'm pressing O in-game, nothing happens.


11241036 Lotting/Modding Thread - Support for all of my uploaded plugins

Visit my CJ Maxiland, where I'm taking on an enlarged version of Timbuktu!

 

Share this post


Link to post
Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     
    13 hours ago, 11241036 said:

    Well, sorry to crash the party, but I can't get this mod to work. I've tried everything, changing some settings in DgVoodoo 2, moving the files into the Plugins root folder, even installing them into a completely empty Plugins folder to check if anything is interfering. Nothing. Whenever I'm pressing O in-game, nothing happens.

    From your log files earlier, it appears that the PresentHook is not being executed, as the log files should contain something like the following after "D3D11Hook initialized successfully" normally.

    [2025-11-03 06:12:49.288] [SC4AdvancedLotPlop] [info] D3D11Hook: Captured real game device: 0x4182744
    [2025-11-03 06:12:49.288] [SC4AdvancedLotPlop] [info] D3D11Hook: Captured immediate context: 0x426A030
    [2025-11-03 06:12:49.288] [SC4AdvancedLotPlop] [info] D3D11Hook: Captured swap chain: 0xE41E68

    @11241036Can you share screenshots of the three tabs in the dgVoodooCpl application, which should be located in your <MyProgramFiles>/SimCity 4/Apps directory? Also, which version of SC4 are you using? The digital download edition from Steam/GoG/EA?

    As for the KEYCFG file, my recommendation would be not to merge it. The KEYCFG of this DLL uses a separate KEYCFG file on purpose, with its own TGI so that it doesn't interfere with any other KEYCFG files from the base game or other DLLs. So best to leave it alone. It may work when merged with other KEYCFG entries, but I haven't tested that.

    For reference, here is how these screens look for me:

    image.png.33613f9d6daae4e6aa28ba852a8c5956.pngimage.png.b1e54186628d64b8b4414e543c24b8a0.pngimage.png.d8dd6020fbdbe657f7ff3105df300e69.png

    • Like 1

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    15 hours ago, CasperVg said:

    From your log files earlier, it appears that the PresentHook is not being executed, as the log files should contain something like the following after "D3D11Hook initialized successfully" normally.

    
    [2025-11-03 06:12:49.288] [SC4AdvancedLotPlop] [info] D3D11Hook: Captured real game device: 0x4182744
    [2025-11-03 06:12:49.288] [SC4AdvancedLotPlop] [info] D3D11Hook: Captured immediate context: 0x426A030
    [2025-11-03 06:12:49.288] [SC4AdvancedLotPlop] [info] D3D11Hook: Captured swap chain: 0xE41E68

    @11241036Can you share screenshots of the three tabs in the dgVoodooCpl application, which should be located in your <MyProgramFiles>/SimCity 4/Apps directory? Also, which version of SC4 are you using? The digital download edition from Steam/GoG/EA?

    As for the KEYCFG file, my recommendation would be not to merge it. The KEYCFG of this DLL uses a separate KEYCFG file on purpose, with its own TGI so that it doesn't interfere with any other KEYCFG files from the base game or other DLLs. So best to leave it alone. It may work when merged with other KEYCFG entries, but I haven't tested that.

    For reference, here is how these screens look for me:

    These are the settings in the application:

    image.jpeg.77228aaa7e5f10d932d3aaf5a57bd862.jpeg

    I also tried to change them to your settings. Again, no success. I bought my digital version from Amazon.


    11241036 Lotting/Modding Thread - Support for all of my uploaded plugins

    Visit my CJ Maxiland, where I'm taking on an enlarged version of Timbuktu!

     

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    16 minutes ago, 11241036 said:

    I also tried to change them to your settings. Again, no success. I bought my digital version from Amazon.

    The thing that jumps out to me is your dgvoodoo install path. Dgvoodoo needs to be installed in the Apps folder in the installation directory (next to SimCity 4.exe), or it won't work.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    I realized that too, just a few minutes ago, and edited my post above, as well as the installation path. I can't tell if it works now, as I'm only getting a few dancing squares instead of a loading screen, forcing me to force-quit the game.

    Edit: For some reason, the edit didn't get saved. I already tried changing the installation path to the one you told, but unfortunately, I'm only getting a few weird squares instead of a loading screen. The game didn't even let me make a screenshot. Sorry for the trouble.

    Edit2: I forgot to mention, if that is important, I only have a maximum of 8 GB. However, right after starting to load the game, there's the dgVoodoo logo appearing at the bottom right of my screen. Seems to represent progress. Maybe something's wrong with my hardware. I already tried to find a new driver for my Intel processor, by following the instructions that come with dgVoodoo, but it told me that there's no new driver available. My system is 9 years old - perhaps it's time to buy a new one.


    11241036 Lotting/Modding Thread - Support for all of my uploaded plugins

    Visit my CJ Maxiland, where I'm taking on an enlarged version of Timbuktu!

     

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    6 hours ago, 11241036 said:

    I forgot to mention, if that is important, I only have a maximum of 8 GB. However, right after starting to load the game, there's the dgVoodoo logo appearing at the bottom right of my screen. Seems to represent progress. Maybe something's wrong with my hardware. I already tried to find a new driver for my Intel processor, by following the instructions that come with dgVoodoo, but it told me that there's no new driver available. My system is 9 years old - perhaps it's time to buy a new one.

    That means, at least, that dgvoodoo2 is loading.  There's an option to remove the watermark - it's turned on by default in order to verify that dgvoodoo2 loaded.  Under the DirectX tab, at the bottom - uncheck the option to show the watermark.

    Can you run Simcity4 just fine with it on?  Did you try the lot plop?  

    @CasperVg - I have a feature request I hope you'll consider.  Is there a way, in the search, to not only search the Exemplar property description but also the actual filename or location in the Plugins folder?  I don't know if others do this (especially with sc4pac), but I've organized my plugins folder by Author.  So every creator has a subfolder in my Plugins.  It'd make it really easy to find a particular author's buildings if the search also let you search actual folders/file names.  Maybe an checkbox option to do that, so the default would still be searching the exemplars and you could check the box to do a more traditional file/folder search?

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     
    8 hours ago, 11241036 said:

    I realized that too, just a few minutes ago, and edited my post above, as well as the installation path. I can't tell if it works now, as I'm only getting a few dancing squares instead of a loading screen, forcing me to force-quit the game.

    Edit: For some reason, the edit didn't get saved. I already tried changing the installation path to the one you told, but unfortunately, I'm only getting a few weird squares instead of a loading screen. The game didn't even let me make a screenshot. Sorry for the trouble.

    Edit2: I forgot to mention, if that is important, I only have a maximum of 8 GB. However, right after starting to load the game, there's the dgVoodoo logo appearing at the bottom right of my screen. Seems to represent progress. Maybe something's wrong with my hardware. I already tried to find a new driver for my Intel processor, by following the instructions that come with dgVoodoo, but it told me that there's no new driver available. My system is 9 years old - perhaps it's time to buy a new one.

    Make sure that you have also moved all the dll-files that dgvoodoo2 comes with to the directory where SimCity4.exe is located, and that you have applied the 4GB patch to your SC4 executable.

    2 hours ago, Kel9509 said:

    @CasperVg - I have a feature request I hope you'll consider.  Is there a way, in the search, to not only search the Exemplar property description but also the actual filename or location in the Plugins folder?  I don't know if others do this (especially with sc4pac), but I've organized my plugins folder by Author.  So every creator has a subfolder in my Plugins.  It'd make it really easy to find a particular author's buildings if the search also let you search actual folders/file names.  Maybe an checkbox option to do that, so the default would still be searching the exemplars and you could check the box to do a more traditional file/folder search?

    Not easily I'm afraid. The game retrieves all the .dat/.SC4Model/.SC4Desc/.SC4Lot files from the Plugins directory at load time and I query the game's methods that allow me to look for exemplars, but that data no longer contains any information on the original files or directory that they came from. Maybe this would be possible if the sc4-resource-loading-hooks DLL patched a new property into each exemplar with the path it was loaded from, @Null 45?

    2 hours ago, papiouuu said:

    Feature request as well…

    ability to create submenus for u favs 

    I think that could be possible, at least for favorited lots that are actually ploppable. Will take a look into it

    • Like 3

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    16 hours ago, CasperVg said:

    Make sure that you have also moved all the dll-files that dgvoodoo2 comes with to the directory where SimCity4.exe is located, and that you have applied the 4GB patch to your SC4 executable.

    Not easily I'm afraid. The game retrieves all the .dat/.SC4Model/.SC4Desc/.SC4Lot files from the Plugins directory at load time and I query the game's methods that allow me to look for exemplars, but that data no longer contains any information on the original files or directory that they came from. Maybe this would be possible if the sc4-resource-loading-hooks DLL patched a new property into each exemplar with the path it was loaded from, @Null 45?

    I think that could be possible, at least for favorited lots that are actually ploppable. Will take a look into it

    This time, I've made that sure. Also, I've been applying the 4 GB patch to SC4 long ago. Sorry for my stupid mistake before, but now I've put all files in the installation folder, or into the Apps subfolder. I'm pretty sure that I didn't make any mistake.

    But I stumbled upon this thread where @Dragonstar was talking about their experience with 6 different DirectX wrappers. They mentioned that they got some graphical glitches with dgVoodoo. Admittedly, that was in 2020, but in case that is of any importance, here is the link:

     


    11241036 Lotting/Modding Thread - Support for all of my uploaded plugins

    Visit my CJ Maxiland, where I'm taking on an enlarged version of Timbuktu!

     

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    17 hours ago, CasperVg said:

    Not easily I'm afraid. The game retrieves all the .dat/.SC4Model/.SC4Desc/.SC4Lot files from the Plugins directory at load time and I query the game's methods that allow me to look for exemplars, but that data no longer contains any information on the original files or directory that they came from. Maybe this would be possible if the sc4-resource-loading-hooks DLL patched a new property into each exemplar with the path it was loaded from, @Null 45?

    Thanks, I figured it was all very difficult if you're working within the confines of what SimCity knows.  The only other way is if the GUI has some kind of external call outside of the game, like a file browser or something.  

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    22 hours ago, CasperVg said:

    Maybe this would be possible if the sc4-resource-loading-hooks DLL patched a new property into each exemplar with the path it was loaded from, @Null 45?

    That is a bunch of extra work for every exemplar the game loads, and it would just be duplicating something a DLL can do by itself.

    The process of fetching the file path from an exemplar (or any other DBPF resource) is somewhat convoluted. I implemented something similar in the query UI hooks DLL to optionally log the file path of a queried building. The steps are as follows:

    1. Get the TGI (cGZPersistResourceKey) of the object of interest.
      • The code I linked to above demonstrates this process for cISC4BuildingOccupant.
      • For property holders and most other resource types, this can be done by requesting a cIGZPersistResource pointer through QueryInterface and calling its GetKey method.
    2. Use the TGI to request the matching cIGZPersistDBSegment from the resource manager.
    3. Grab the file path using cIGZPersistDBSegment::GetPath.
      • Note that user plugins are often bundled into a class derived from cIGZPersitDBSegmentMultiPackedFile, which adds a layer of indirection.
      • My GetResourceFilePath method (called by the code I linked to above) handles both steps 2 and 3.

    Here is an example that gets the path of a property holder:

    Spoiler
    
    bool GetResourceFilePath(const cGZPersistResourceKey& key, cIGZString& path)
    {
        bool result = false;
    
        cIGZPersistResourceManagerPtr pResMan;
    
        if (pResMan)
        {
            cRZAutoRefCount<cIGZPersistDBSegment> pSegment;
    
            if (pResMan->FindDBSegment(key, pSegment.AsPPObj()))
            {
                cRZAutoRefCount<cIGZPersistDBSegmentMultiPackedFiles> pMultiPackedFile;
    
                if (pSegment->QueryInterface(GZIID_cIGZPersistDBSegmentMultiPackedFiles, pMultiPackedFile.AsPPVoid()))
                {
                    // cIGZPersistDBSegmentMultiPackedFiles is a collection of DAT files in a specific folder
                    // and its sub-folders.
                    // Call its FindDBSegment method to get the actual file.
    
                    cRZAutoRefCount<cIGZPersistDBSegment> pMultiPackedSegment;
    
                    if (pMultiPackedFile->FindDBSegment(key, pMultiPackedSegment.AsPPObj()))
                    {
                        pMultiPackedSegment->GetPath(path);
                        result = true;
                    }
                }
                else
                {
                    pSegment->GetPath(path);
                    result = true;
                }
            }
        }
    
        return result;
    }
    
    bool GetPropertyHolderFilePath(cISCPropertyHolder* pPropertyHolder, cIGZString& path)
    {
        bool result = false;
    
        if (pPropertyHolder)
        {
            cRZAutoRefCount<cIGZPersistResource> pPersistResource;
    
            if (pPropertyHolder->QueryInterface(GZIID_cIGZPersistResource, pPersistResource.AsPPVoid()))
            {
                cGZPersistResourceKey key;
    
                pPersistResource->GetKey(key);
    
                result = GetResourceFilePath(key, path);
            }
        }
      
        return result;
    }

     

     

    • Like 3

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    Whoa! I've been saying, and thinking to myself, that SimCity 4 could really use Find It! Yes, I've been saying it. I've been saying it to my best friend. But I've also been thinking it when running the lotPlop cheat! For those unfamiliar, Find It! is a mod for Cities: Skylines and Cities: Skylines II that allows one to find any asset loaded into either game. Thank you for your work on this!

    • Like 4

    Fun fact: Buffalo sauce contains the entire DNA sequence of buffalo, so you can clone buffalo while eating buffalo wings with buffalo sauce at Buffalo Wild Wings in Buffalo, New York. I've never tried it, though.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    On 2-11-2025 at 8:50 AM, CasperVg said:

    It's very rough around the edges still, but I've been working to try and see if I could make a similar prop selector that would enable you to use any prop as if it were flora (i.e. prop it anywhere in the city):

    Untitled.jpg.916ab08cf2d7c8e85dc48224b380b0b5.jpg

    Video here: 

    https://streamable.com/5noo7w

     

    This would be an awesome Christmass gift! Definitely the mod of the year, it's incredible how fast you can search with this. Deep respect for the creator.

    • Like 1

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    On 11/4/2025 at 2:44 PM, 11241036 said:

    This time, I've made that sure. Also, I've been applying the 4 GB patch to SC4 long ago. Sorry for my stupid mistake before, but now I've put all files in the installation folder, or into the Apps subfolder. I'm pretty sure that I didn't make any mistake.

    But I stumbled upon this thread where @Dragonstar was talking about their experience with 6 different DirectX wrappers. They mentioned that they got some graphical glitches with dgVoodoo. Admittedly, that was in 2020, but in case that is of any importance, here is the link:

     

    Hi everyone,

    Just wanted to check if the issue here had progressed at all. I seem to be having the same issue. DgVoodoo2 appears to be set up correctly and is in the correct file directory, but the advancedlotplop cheat only executes, it doesn't actually open up the UI for me.

    Thanks

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    6 hours ago, ncamferdam said:

    Hi everyone,

    Just wanted to check if the issue here had progressed at all. I seem to be having the same issue. DgVoodoo2 appears to be set up correctly and is in the correct file directory, but the advancedlotplop cheat only executes, it doesn't actually open up the UI for me.

    Thanks

    Do you get the DgVoodoo2 mark(logo) in game?

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    9 hours ago, Ernestmaxis said:

    Do you get the DgVoodoo2 mark(logo) in game?

    Hmm… maybe I’m not. Where does it appear in-game after loading?

    EDIT: Ok, update. I downloaded the most recent version of DgVoodoo2 and I'm now seeing the logo in the bottom corner of the game. Unfortunately the UI is still not appearing for me.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    2 hours ago, ncamferdam said:

    Hmm… maybe I’m not. Where does it appear in-game after loading?

    EDIT: Ok, update. I downloaded the most recent version of DgVoodoo2 and I'm now seeing the logo in the bottom corner of the game. Unfortunately the UI is still not appearing for me.

    Output api: direct 3d (level 11)?

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    My sincere compliments for creating the Advance Lot Pop, a brilliant tool that is a game changer for SimCity 4.
    It is truly impressive how much work and dedication went into this, and I greatly appreciate you making this tool available. 

    However, I am encountering something that I cannot figure out myself. I am trying to understand how the mod recognizes and processes the PNG files. I have compared several files to try to figure out the logic, but I cannot see exactly how it works. How does the tool determines which PNG files are used or recognized?
    I created each file with the SC4 lot icon creator (so files are the same).

    Once again, thank you so much for all your work and for taking the time to share this with the community!
    Hopefully, there will be a similar tool for props in the future, it is insanly usefull.

    • Like 2

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    I've been making good progress on reimplementing the lot plop / prop paint dialogs with the new DX7 ImGui hooks. Some drawbacks have shown up though because the DX7 community backend is not as advanced.. such as this. So I'm doing debugging to try and see what can be done 

     

    Untitled.jpg

    • Like 4

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    Dear Casper,

    System:
    Windows 11 Pro
    SimCity 4 Deluxe (patched) v1.1.641.0

    Renderer setup:
    dgVoodoo2 enabled (see attached screenshot)
    Output API: DirectX 11

    Result:
    No ImGui demo windows appear in-game.

    Verification:
    Using Process Explorer, I verified that
    sc4-imgui-service.dll and SC4ImGuiDemo.dll are not loaded at all by SimCity 4 (they do not appear in the module list).

    SimCity 4 starts and runs normally (no crash), but the DLLs appear to be silently ignored.
    This seems to occur before any rendering stage, as the DLLs never get loaded into the process.
    Tested only with dgVoodoo2 (DX11 output). Other dgVoodoo output modes do not work with SC4 on my system.

    As I understand it, ImGui windows are expected to appear automatically once the DLL is loaded correctly.
    There is no shortcut key or manual trigger required, similar to how the LotPlop UI works?

    image.png.77df09c20d546622ab38d4928997ac45.png

     

     

    • Like 1

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     
    On 1/7/2026 at 2:24 PM, Ernestmaxis said:

    Dear Casper,

    System:
    Windows 11 Pro
    SimCity 4 Deluxe (patched) v1.1.641.0

    Renderer setup:
    dgVoodoo2 enabled (see attached screenshot)
    Output API: DirectX 11

    Result:
    No ImGui demo windows appear in-game.

    Verification:
    Using Process Explorer, I verified that
    sc4-imgui-service.dll and SC4ImGuiDemo.dll are not loaded at all by SimCity 4 (they do not appear in the module list).

    SimCity 4 starts and runs normally (no crash), but the DLLs appear to be silently ignored.
    This seems to occur before any rendering stage, as the DLLs never get loaded into the process.
    Tested only with dgVoodoo2 (DX11 output). Other dgVoodoo output modes do not work with SC4 on my system.

    As I understand it, ImGui windows are expected to appear automatically once the DLL is loaded correctly.
    There is no shortcut key or manual trigger required, similar to how the LotPlop UI works?

    image.png.77df09c20d546622ab38d4928997ac45.png

     

     

    Make sure that the imgui.dll is placed in the Apps/ directory alongside SimCity 4.exe. If it is not there the other DLLs will indeed fail to load as they will not find the necessary imgui runtime dependencies 

    • Like 1
    • Thanks 1

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

     

    2 hours ago, CasperVg said:

    Make sure that the imgui.dll is placed in the Apps/ directory alongside SimCity 4.exe. If it is not there the other DLLs will indeed fail to load as they will not find the necessary imgui runtime dependencies 

    Thanks, that was the missing piece, also hope that others will test if necessary.

    Here are my results:

    After placing imgui.dll in the Apps/ directory next to SimCity 4.exe, the ImGui demo windows now appear correctly and the ImGui-related DLLs are loaded as expected (confirmed via Process Explorer).

    Current behavior:

    • ImGui initializes correctly and demo windows appear before loading a city.

    • On the first city load, SC4 sometimes crashes with an access violation inside D3DImm.dll, originating from
      ImGui_ImplDX7_RenderDrawData().

    • On the second and subsequent city loads, the city loads successfully and ImGui continues to function normally.

    This looks like a DX7 device reset / surface reinitialization timing issue during city load.

    Additionally:

    • After Alt-Tabbing out of the game and returning, ImGui no longer renders.

    • This appears to be another device-lost / device-reset case, similar to the city load transition, where ImGui’s render state is not reinitialized.

    • Tested ~30 minutes without Alt-Tab or focus changes.
      No CTDs occurred. This further suggests the crashes are strictly related to DX7 device loss / reset events.

    Let me know if you want me to test any additional builds or add logging around device reset handling.

    • Like 1

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     
    On 09/01/2026 at 2:18 PM, Ernestmaxis said:

     

    Thanks, that was the missing piece, also hope that others will test if necessary.

    Here are my results:

    After placing imgui.dll in the Apps/ directory next to SimCity 4.exe, the ImGui demo windows now appear correctly and the ImGui-related DLLs are loaded as expected (confirmed via Process Explorer).

    Current behavior:

    • ImGui initializes correctly and demo windows appear before loading a city.

    • On the first city load, SC4 sometimes crashes with an access violation inside D3DImm.dll, originating from
      ImGui_ImplDX7_RenderDrawData().

    • On the second and subsequent city loads, the city loads successfully and ImGui continues to function normally.

    This looks like a DX7 device reset / surface reinitialization timing issue during city load.

    Additionally:

    • After Alt-Tabbing out of the game and returning, ImGui no longer renders.

    • This appears to be another device-lost / device-reset case, similar to the city load transition, where ImGui’s render state is not reinitialized.

    • Tested ~30 minutes without Alt-Tab or focus changes.
      No CTDs occurred. This further suggests the crashes are strictly related to DX7 device loss / reset events.

    Let me know if you want me to test any additional builds or add logging around device reset handling.

    Thanks for the extensive test and to let me know that it is at least working to some degree. Some of the issues you mentioned have been improved upon in some new releases in the meantime. Maybe give it another go? Thanks!!

    • Like 1
    • Yes 1

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    Thanks again for the update — we tested the new release v0.0.5 of the sc4-imgui backend.

    Improvements are clearly noticeable compared to earlier versions.
    Gameplay is now stable as long as no focus change occurs, which is a big step forward.

    Reproducible issue (still present):

    I can now reproduce the crash 100% reliably.

    • Start SC4 → ImGui visible

    • Alt-Tab within ~1 minute → immediate CTD

    The crash is always an ACCESS_VIOLATION inside D3DImm.dll, originating from
    ImGui_ImplDX7_RenderDrawData().

    This confirms the issue is triggered specifically by device loss on focus change.
    Without Alt-Tab, gameplay remains stable.

    This appears to require explicit DX7 device-lost / surface reinitialization handling for ImGui.

    Thanks a lot for the work you’re putting into this! 
    Hopefully this will enable some really amazing UI improvements and tools for the community once the last DX7 edge cases are ironed out.

    Let me know if further testing is useful.
    Hopefully I am also the first one to test the prop painter;)

     

    • Like 1

    Share this post


    Link to post
    Share on other sites

    Sign In or register to comment...

    To comment in reply, you must be a community member

    Sign In  

    Already have an account? Sign in here.

    Sign In Now

    Create an Account  

    Sign up to join our friendly community. It's easy!  

    Register a New Account


    ×

    Thank You for the Continued Support!

    Simtropolis depends on donations to fund site maintenance costs.
    Without your support, we just would not be in our 24th year online!  You really help make this a great community. *:thumb:

    But we still need your support to stay online. If you're able to, please consider a donation to help us stay up and running. This helps sustain a platform where we can share our community creations for years to come.

    Make a Donation, Get a Gift!

    Expand your city with the best from the Simtropolis Exchange.
    Make a Donation and get one or all three discs today!

    STEX Collections

    By way of a "Thank You" gift, we'd like to send you our STEX Collector's DVD. It's some of the best buildings, lots, maps and mods collected for you over the years. Check out the STEX Collections for more info.

    Each donation helps keep Simtropolis online, open and free!

    Thank you for reading and enjoy the site!

    More About STEX Collections