Expansion mod

Please post here for questions and discussion about scenario, art and sound modding and the game editor for Distant Worlds.

Moderators: Icemania, elliotg

Post Reply
Alvek
Posts: 198
Joined: Fri Mar 24, 2023 9:47 pm
Location: Kyiv

Expansion mod

Post by Alvek »

As DW:U no longer get new updates, I decided to fix some things, add something new or QoL features.
This mod integrates "Bacon mod" by RogerBacon.

I got permission to share deobfuscated DW:U code so that more people can create mod or contribute to my mod.

New repository, .net 7. Work in progress to allow scalable UI, different platforms, etc - https://github.com/DW-UX/DistantWorldsExpanded

Current working repositories for EM mod. Net 4.8, circular dependency, pain in ass to work with:
https://github.com/Alvek/DistantWorlds.Types
https://github.com/Alvek/DistantWorlds
https://github.com/Alvek/BaconDistantWorlds
https://github.com/Alvek/ExpansionMod
https://github.com/Alvek/ExpansionMod.Controls
https://github.com/Alvek/ExpansionMod.Objects

Maybe someone will join on a development of DW:U in general or just change something for themself.

Next update plans:
Ship design window:
1.Button to auto add missing components to finish design (reactor, engines, bridge, role dependent)
2.Total energy needed for cruise + all weapons

Planned:
Spy escape spy mission
Spy prison
Message filter improvement (more options on what messages ignored)
Resizable forms
Font size options
Minor ship design builder automation to help the player
Fix long help page opening

Long term plans:
New save format to speed up game save\load (on my machine saving take 10+ minutes with max size and star count)
New weapon types
New terrestrial\celestial facilities
Some sort of system jump gate and long range portals
New ship\base roles
Mod API


Done:
In-game hotkeys remapping (open menu -> options, "Hotkeys" button. Startup menu does not support hotkeys for now)
x32/x64 exe
UPS (Updates per second - game performance counter)
Various bug fixed in BaconMod
Improvement to resource filtering in Resource planner
Energy collection calculation at current point via pop-up menu
Repair priority


Load times on my PC with large graphic\content mod and clean game:

DWUR:
EM - ~30s
BM - ~220s
orig - ~240s

No mods:
EM - ~16-18
BM - ~52
Orig - ~47

Installation:
1.Unblock zip after download (file properties -> button or checkbox) or don't use Windows built-in unpacking as it preserves alternate stream which block game from loading dll
2.Copy "Full" folder to game root folder

Updating to newer version of EM:
1.Copy all files from "Full" folder if you don't care about losing your settings
Or
2.Follow latest update instructions on changes in files to preserve your settings.


Known issues:
1)Start new game, exit to main menu and start again -> game crashes, bug inherited from BaconMod
2)After Alt+Tab first hotkey combination ignored
3)On steam streaming (maybe other too) DW:U doesn't show UI on remote host. Player Lee iRaynor found this solution: use xsplit broadcaster, and need to run in "Screen capture" mode to see the entire UI. -- seems to fix it


More description about changes or features in "Expansion mod description.pdf" in mod zip file.

Discord link, if anyone have questions about mod
https://discord.gg/wJRcHWJaKG

All versions change-log:
https://docs.google.com/document/d/1v5K ... drive_link

Latest version:

[17.02.2024]
Version 1.10.01
https://drive.google.com/file/d/1T8jxLv ... drive_link
Password: 1234
Removed limit on various txt files: raceFamilies.txt, plagues.txt, governments.txt, facilities.txt, resources.txt, components.txt, research.txt, fighters.txt.
Removed game protection, should help with anti-viruses.
Replaced pop-up message box mod version with loading screen text EM mod version.

If anyone have problem with false positive detection on send me message with info about your AV so I can send them false positive report.
Last edited by Alvek on Sat Oct 19, 2024 1:38 pm, edited 46 times in total.
Alvek
Posts: 198
Joined: Fri Mar 24, 2023 9:47 pm
Location: Kyiv

Re: Expansion mod

Post by Alvek »

Version 1.01
https://drive.google.com/file/d/1hVM8ic ... share_link
Added x64 support, now exe use AnyCPU and should be usable on both platforms.
Fixed bug that crashed game in Version 1.0
Added new menu in Alt+Shift+RMB BaconMod list to check energy collection by EnergyCollector component in this coordinates (for now only for tier one component with energy collection of 24 units)
Additional changes:
New steam wrapper Facepunch.Steamworks.Win.dll (x86\64 folder), I struggled to port old DW_Steam.dll and decided to change wrapper altogether.
New steam_api.dll + steam_api64.dll for Facepunch.Steamworks.Win.dll (source 2.3.2 release version)
Graphics from Microsoft.XNA no longer supported and don't have x64 version, so I swapped it for MonoGame.
Sound from Microsoft.DirectX.DirectSound swapped with SlimDX.dll (x86\64 folder)
Last edited by Alvek on Thu Apr 20, 2023 3:11 pm, edited 1 time in total.
User avatar
Retreat1970
Posts: 1125
Joined: Wed Nov 06, 2013 11:09 am
Location: Wisconsin

Re: Expansion mod

Post by Retreat1970 »

Any issues with using the exe with RetreatUE? I haven't played in a long time and I might test this out.

Edit: I tried your exe and it won't run. I tried bacon's and it won't run anymore either. Original runs. This happened before with bacon but I can't remember if it was anti virus problem or something else. A windows update in the past stopped bacon from working until he fixed it. Maybe that's happening again (i'm running 11). IDK I don't have the brain power anymore to troubleshoot.
Alvek
Posts: 198
Joined: Fri Mar 24, 2023 9:47 pm
Location: Kyiv

Re: Expansion mod

Post by Alvek »

Retreat1970 wrote: Thu Apr 20, 2023 1:03 am Any issues with using the exe with RetreatUE? I haven't played in a long time and I might test this out.

Edit: I tried your exe and it won't run. I tried bacon's and it won't run anymore either. Original runs. This happened before with bacon but I can't remember if it was anti virus problem or something else. A windows update in the past stopped bacon from working until he fixed it. Maybe that's happening again (i'm running 11). IDK I don't have the brain power anymore to troubleshoot.
Check h:\My Documents\my games\Distant Worlds Universe\DW_CrashDump.txt
Error should be there

Haven't tested with RetreatUE yet. This mod should be compatible with all mod that BaconMod was.
For now I am struggling with multi threading to improve performance

Virus total desided that exe is malware, looks like same problem that BaconMod had (at least ESET-NOD32 detect what protection program build exe). I don't think i can do something about it without removing protection devs used.
User avatar
Retreat1970
Posts: 1125
Joined: Wed Nov 06, 2013 11:09 am
Location: Wisconsin

Re: Expansion mod

Post by Retreat1970 »

There's an issue with your steamapi.dll that prevents the game from starting. I replaced with the original and it fired up.
Alvek
Posts: 198
Joined: Fri Mar 24, 2023 9:47 pm
Location: Kyiv

Re: Expansion mod

Post by Alvek »

New steam_api.dll(or steam_api64.dll for x64 OS) needed for my mod, BaconMod and original can use old one.
I can add option to disable using steam at all to avoid any problems with steam.

Reuploaded 1.01 version to fix message box at game start
User avatar
Retreat1970
Posts: 1125
Joined: Wed Nov 06, 2013 11:09 am
Location: Wisconsin

Re: Expansion mod

Post by Retreat1970 »

This is what I get:

System.IO.FileLoadException: Could not load file or assembly 'Facepunch.Steamworks.Win64, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
File name: 'Facepunch.Steamworks.Win64, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' ---> System.NotSupportedException: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information.
at System.Reflection.RuntimeAssembly.nLoadFile(String path, Evidence evidence)
at System.Reflection.Assembly.LoadFile(String path)
at System.AppDomain.OnAssemblyResolveEvent(RuntimeAssembly assembly, String assemblyFullName)
at DistantWorlds.Types.SteamAPI.Initialize(String crashLogPath)
at DistantWorlds.Main..ctor(Int32 width, Int32 height, Boolean windowedMode, KeyMapper keyMapper)
at DistantWorlds.Start.cMuXzKteVu(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.SetVisibleCore(Boolean value)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at Class5.smethod_0()




Further info follows:

System.NotSupportedException: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information.
at System.Reflection.RuntimeAssembly.nLoadFile(String path, Evidence evidence)
at System.Reflection.Assembly.LoadFile(String path)
at System.AppDomain.OnAssemblyResolveEvent(RuntimeAssembly assembly, String assemblyFullName)
Alvek
Posts: 198
Joined: Fri Mar 24, 2023 9:47 pm
Location: Kyiv

Re: Expansion mod

Post by Alvek »

Check if you have Unlock button like this on x64\Facepunch.Steamworks.Win64.dll
Windows could add this property to dll and exe to mark that they was downloaded and have low trust.
If you have "Unlock button" I will look into how to fix this via code.
User avatar
Retreat1970
Posts: 1125
Joined: Wed Nov 06, 2013 11:09 am
Location: Wisconsin

Re: Expansion mod

Post by Retreat1970 »

Yes the unlock box is there.
Alvek
Posts: 198
Joined: Fri Mar 24, 2023 9:47 pm
Location: Kyiv

Re: Expansion mod

Post by Alvek »

There is way to "fix" low trust problem, but it is ugly and I prefer to add mention of "Unlock zip" after download in Installation description.
The problem is that windows add alternate stream to every downloaded file to mark them as insecure. Also lots of programs ignore this stream unzip files without it, but Windows preserve them after unzipping.
User avatar
Retreat1970
Posts: 1125
Joined: Wed Nov 06, 2013 11:09 am
Location: Wisconsin

Re: Expansion mod

Post by Retreat1970 »

I don't know if it matters, but it still wouldn't run after I unlocked it. Just info.
Alvek
Posts: 198
Joined: Fri Mar 24, 2023 9:47 pm
Location: Kyiv

Re: Expansion mod

Post by Alvek »

Same error?
User avatar
Retreat1970
Posts: 1125
Joined: Wed Nov 06, 2013 11:09 am
Location: Wisconsin

Re: Expansion mod

Post by Retreat1970 »

Distant Worlds - Crash Dump - 1.9.5.12

2:09:34 PM Friday, April 21, 2023


System.IO.FileLoadException: Could not load file or assembly 'SlimDX, Version=4.0.13.43, Culture=neutral, PublicKeyToken=b1b0c32fd1ffe4f9' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
File name: 'SlimDX, Version=4.0.13.43, Culture=neutral, PublicKeyToken=b1b0c32fd1ffe4f9' ---> System.NotSupportedException: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information.
at System.Reflection.RuntimeAssembly.nLoadFile(String path, Evidence evidence)
at System.Reflection.Assembly.LoadFile(String path)
at System.AppDomain.OnAssemblyResolveEvent(RuntimeAssembly assembly, String assemblyFullName)
at DistantWorlds.Main.method_74(Int32 int_64, Int32 int_65, Boolean bool_28)
at DistantWorlds.Main..ctor(Int32 width, Int32 height, Boolean windowedMode, KeyMapper keyMapper)
at DistantWorlds.Start.cMuXzKteVu(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.SetVisibleCore(Boolean value)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at Class5.smethod_0()




Further info follows:

System.NotSupportedException: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information.
at System.Reflection.RuntimeAssembly.nLoadFile(String path, Evidence evidence)
at System.Reflection.Assembly.LoadFile(String path)
at System.AppDomain.OnAssemblyResolveEvent(RuntimeAssembly assembly, String assemblyFullName)
Alvek
Posts: 198
Joined: Fri Mar 24, 2023 9:47 pm
Location: Kyiv

Re: Expansion mod

Post by Alvek »

Unlock whole zip file, unpack it and overwrite all files on copy
User avatar
Retreat1970
Posts: 1125
Joined: Wed Nov 06, 2013 11:09 am
Location: Wisconsin

Re: Expansion mod

Post by Retreat1970 »

Worked.
Alvek
Posts: 198
Joined: Fri Mar 24, 2023 9:47 pm
Location: Kyiv

Re: Expansion mod

Post by Alvek »

Yay, let me know if you have any ideas for QoL features to add
User avatar
CaesarAug
Posts: 431
Joined: Tue Jun 23, 2015 4:54 am

Re: Expansion mod

Post by CaesarAug »

Just curious if the Expansion mod could correct the slight visual glitch that has appeared in-game since patch 1.9.5.8 onward: in the ship design screen, just above the “fleet targeting” line, there is another line which is labelled “targeting”, in addition to their respective values expressed in percentages.

I don’t mean the actual text entry which can be easily changed.

I’m referring to the top half or so of that “targeting” line: it is cut off and not visible, and about the top half of the % value is likewise cut off. You can still make it out but it is clearly an odd visual glitch.

Since you are tinkering, perhaps you can figure out what’s wrong and correct it… many thanks! :mrgreen:
Alvek
Posts: 198
Joined: Fri Mar 24, 2023 9:47 pm
Location: Kyiv

Re: Expansion mod

Post by Alvek »

CaesarAug wrote: Wed May 17, 2023 12:01 pm Just curious if the Expansion mod could correct the slight visual glitch that has appeared in-game since patch 1.9.5.8 onward: in the ship design screen, just above the “fleet targeting” line, there is another line which is labelled “targeting”, in addition to their respective values expressed in percentages.

I don’t mean the actual text entry which can be easily changed.

I’m referring to the top half or so of that “targeting” line: it is cut off and not visible, and about the top half of the % value is likewise cut off. You can still make it out but it is clearly an odd visual glitch.

Since you are tinkering, perhaps you can figure out what’s wrong and correct it… many thanks! :mrgreen:
Added to fix list. Controls design awful and making major changes without rewriting whole forms bit hard.
For now I need to change a lot of internal code for in-game hotkeys changing, preparation for modding API and so on. So next version got delayed.
User avatar
CaesarAug
Posts: 431
Joined: Tue Jun 23, 2015 4:54 am

Re: Expansion mod

Post by CaesarAug »

Oh wow, how cool is that!!! Good luck! And many, many thanks!
User avatar
Retreat1970
Posts: 1125
Joined: Wed Nov 06, 2013 11:09 am
Location: Wisconsin

Re: Expansion mod

Post by Retreat1970 »

@alvek

Can you verify weapons are sounding on your end? I am getting no weapon sounds in 1.01 but when I revert back to 1.82 I do.

Also the issue I have with a shipset not loading as described in the refreshed mod thread seems to also be a problem with 1.01 and not 1.82.

Great work btw I like the load time reduction and the general quicker feel to large games.
Post Reply

Return to “Design and Modding”