ianpatt / sfse Goto Github PK
View Code? Open in Web Editor NEWStarfield Script Extender
License: Other
Starfield Script Extender
License: Other
Hi all, thanks for your great work!
I was digging around at a particular objective (speeding up a specific anim), and stumbled across someone who managed to achieve it in Skyrim via SKSE; https://github.com/adamhynek/instant_equip_vr/blob/master/src/main.cpp
Now obviously the code-bases are different (both engine and the Script Extender), but I noticed a bunch of things that the author used that are not in SFSE, e.g. PapyrusEvent etc.
Totally understand if not, but I was just curious about the appetite/plans for adding more functionality to SFSE that exists in previous extenders. I get the impression some under-the-hood changes in Starfield haven't gone over well with modders, so it's all good if so, just figured I'd ask. If there are strong reasons to not add anything else, then forgive my ignorance and disregard my next paragraph.
If there is appetite for improving it, I'm an experienced C++ engineer in the games industry, and I'd be happy to try to help (selfishly, as there's some functionality I'd like to have). If you're open to taking on these kinds of contributions, any info about how you guys tend to go about exposing things would be appreciated - in my professional work I've never had to reverse engineer or do this kind of trickery, but I am happy to learn :) Especially if there's some rote work that's holding the project back from exposing more functionality, but harder stuff is good too.
Thanks!
Antivirus program:
sfse_0_1_1/sfse_loader.exe trojan cryptinject!msr
Is that save or is that a real trojan?
ISSUE
Launching the game with sfse_loader.exe causes micro-stuttering in the game, it's not constant but it is frequent. The micro-stutter is more noticeable using steam's proton 9.0-1 and Experimental, it's less noticeable with GE-Proton9-6. If I launch the game normally it's smooth.
SYSTEM INFO
Linux Mint 21.3, Kernel Version: 6.5.0-35-generic
Intel i7-11700K
32GB DDR4 at 3200
RX 6950 XT, Mesa 24.1.0 - kisak-mesa PPA
2TB NVMe Gen4x4 SSD
Steam Beta Branch: Steam Beta Update
Steam Version: 1717294964
Steam Client Build Date: Sat, Jun 1 5:52 PM UTC -05:00
Steam Web Build Date: Fri, May 31 9:51 PM UTC -05:00
Steam API Version: SteamClient021
Steam Proton 9.0-1
Steam Proton Experimental
GE-Proton9-6
LAUNCH OPTIONS USED
bash -c 'exec "${@/Starfield.exe/sfse_loader.exe}" ' gamemoderun %command%
the bash -c 'exec "${@/Starfield.exe/sfse_loader.exe}" ' portion let's sfse launch using the game shortcut in steam
The micro-stutter is not game breaking, but it is a minor visual bother. Just hoping there's a simple tweak to make it smooth, like the script extender is in other games.
i am running on a steam deck on linux and i placed the files where the description said to on nexus https://www.nexusmods.com/starfield/mods/106
but i keep getting an error saying it could not find starfield.exe
https://ibb.co/CzxfhGg
https://ibb.co/TcTPppn
these are to show the file path my steam deck downloads the game to automatically and to show that the files are together, im not sure how to edit the sfse to have the correct path, is there a way to do that on my end or would somone else have to fix it
I have multiple MSVS versions installed, and following instructions provided:
cmake -B sfse/build -S sfse
cmake --build sfse/build --config Release
didn't work, compilation failed due to numerous errors like this:
sfse/GameFormComponents.h(29,48): error C2429: language feature 'terse static assert' requires compiler flag '/std:c++17'
which indicates that it needs newer MSVS than it picked up. I checked, and the generator it picked up by default was "Visual Studio 16 2019".
So the solution is either specify the minimum C++ dialect, or just specify what generator to use in the readme, for example by clarifying the commands to be
cmake -B sfse/build -S sfse -G "Visual Studio 17 2022"
cmake --build sfse/build --config Release
This way it worked for me with multiple MSVS installed.
v1.10.31 just released.
Nice work on SFSE btw ;)
Please clarify version compatibility. Previously Microsoft Store applications used to be encrypted which made script extenders impossible, but file access has been opened up lately.
Are script extenders still impossible on Microsoft Store/Game Pass, or is it possible with Starfield?
Can it be supported, i.e. is any potential current lack of support for Game Pass due to workflow reasons and not technical reasons?
SFSE does not launch properly through Vortex for me, when Starfield is installed on an external SSD.
I have sfse_loader.exe
at D:\SteamLibrary\steamapps\common\Starfield
, and it's a symlink to:
C:\Users\rayga\AppData\Roaming\Vortex\starfield\mods\SFSE-106-0-1-2-1694730447\sfse_loader.exe
I've tried setting Start In:
to D:\SteamLibrary\steamapps\common\Starfield
but it doesn't work.
I get an error popup: Couldn't find Starfield.exe
SFSE loader: initialize (version = 0.1.2 010701D0 2023-09-23 21:06:31, os = 6.2 (9200))
config path = C:\Users\rayga\AppData\Roaming\Vortex\starfield\mods\SFSE-106-0-1-2-1694730447\Data\SFSE\sfse.ini
procPath = C:\Users\rayga\AppData\Roaming\Vortex\starfield\mods\SFSE-106-0-1-2-1694730447\Starfield.exe
However, if I run sfse_loader.exe from a shell in D:\SteamLibrary\steamapps\common\Starfield
, then it launches fine and prints:
D:\SteamLibrary\steamapps\common\Starfield>sfse_loader.exe
SFSE loader: initialize (version = 0.1.2 010701D0 2023-09-23 19:54:45, os = 6.2 (9200))
config path = D:\SteamLibrary\steamapps\common\Starfield\Data\SFSE\sfse.ini
procPath = D:\SteamLibrary\steamapps\common\Starfield\Starfield.exe
launching: Starfield.exe (D:\SteamLibrary\steamapps\common\Starfield\Starfield.exe)
By using the -altexe
flag, I can get a little further, but it doesn't find the rest of the mods:
I'm assuming this is due to the working path used by the loader library, and it incorrectly using AppData\Roaming\Vortex
I'd imagine it's related to:
Lines 87 to 88 in 8c4af40
I went to pull master to update my plugins but the commit isn't on a branch so....
I might be able to work around it by checking out the tag but I assume this is an unintentional oversight.
Description:
When using the provided CMake command after having installed the latest version available for CMake, it errors.
Reproduction:
cmake -B sfse/build -S sfse
cmake -B sfse/build -S sfse
CMake Error at CMakeLists.txt:7 (project):
Running
'nmake' '-?'
failed with:
The system cannot find the file specified
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
Expected: No error
So, this might be a dumb question in the end. But how are you supposed to use the new Logger? In SKSE it was an interface right? If I also intend to use the static functions, how is it - supposed - to work?
Because when I just call DebugLog::openRelative in my SFSEPlugin_Load method and call one of the message methods afterwards, I wont get any log written because I would need to flush.
However, if I actually call DebugLog::flush() the plugin would fail to load for whatever reason.
What I wrote:
DebugLog::openRelative(CSIDL_MYDOCUMENTS, "\\My Games\\" SAVE_FOLDER_NAME "\\SFSE\\Logs\\sfse-plugin-weaponfov.txt");
_MESSAGE("WeaponFoVPlugin loaded");
DebugLog::flush();
Will end in an exception when the plugin is being loaded. I have yet to debug what exactly the exception is tho. But maybe Im doing something fundamentally wrong in the first place.
I also tried making an own instance from the DebugLog class, something like:
DebugLog* logger = new DebugLog();
logger->openRelative(CSIDL_MYDOCUMENTS, "\\My Games\\" SAVE_FOLDER_NAME "\\SFSE\\Logs\\sfse-plugin-weaponfov.txt");
However, I also run into failures when trying to flush that one.
Im pretty newbish with C++ in general, but would appreciate any help to get me to the right direction.
One more question: Is there some kind of Discord/Slack group that you maintain, or some kind of community Discord around the development of Script Extender Plugins?
main.cpp:SetupModMenu:246> ImGuiInjector Version: 1.2.12
main.cpp:SetupModMenu:253> Settings Loaded
main.cpp:SetupModMenu:267> Hook GetRawInputData: 00007FFA4441DE40
main.cpp:SetupModMenu:276> Hook ClipCursor: 00007FFA4441D770
main.cpp:SetupModMenu:282> Hook CreateDXGIFactory2: 00007FFA0CBB43E0
main.cpp:SetupModMenu:289> ImGui one time init completed!
main.cpp:SetupModMenu:293> RegisterInternalPlugin
main.cpp:SetupModMenu:297> Console setup
main.cpp:operator ():312> SFSE PostPostLoad callback message dispatched
main.cpp:FAKE_CreateDXGIFactory2:193> Factory: 000001D7C3F6A450
main.cpp:FAKE_CreateDXGIFactory2:223> Hooked CreateSwapChainForHwnd
main.cpp:FAKE_CreateDXGIFactory2:193> Factory: 000001D7C3F6C8E0
main.cpp:FAKE_CreateDXGIFactory2:193> Factory: 000001D7BF564CA0
main.cpp:FAKE_CreateSwapChainForHwnd:153> Factory: 000001D7C3F6C8E0, Device: 000001E37747D7B0, HWND: 0000000000321292, SwapChain: 000001E3F728E970, Owner: 00000021AA7FE8D8, Ret: 0
main.cpp:FAKE_CreateSwapChainForHwnd:161> Queues[1] = { 000001E37747D7B0, 000001E3F728E970 }
!!! ASSERTION FAILURE !!!
In file 'hook_api.cpp'
In function 'HookFunction'
On line '17'
Message: ' false && "minhook failed to hook function"'
Above is from debuglog.txt
Seems to be SFSE itself get it with only it an no other plugins (Not even address lib or plugins enabler) sometimes is every 5 launches or so but today its 100% which finally allowed me to trace down the source the message box that pops up has no title or anything and just this below in the body
!!! ASSERTION FAILURE !!!
In file 'hook_api.cpp'
In function 'HookFunction'
On line '17'
Message: ' false && "minhook failed to hook function"'
Do you plan to add a Task interface like in SKSE?
I recognize that you're not too keen on Game Pass / Xbox App support due to the limitations of the UWP sandbox.
I did a little experiment.
It turns out that in a Starfield install in the Xbox app, you can rename Starfield.exe
. This actually surprised me.
I renamed Starfield.exe
to Starfield.real.exe
and I wrote a thin wrapper exe to stand-in for Starfield.exe
that spawns sfse_loader.exe -altexe Starfield.real.exe
from within the UWP sandbox.
It... shockingly, worked. And logs got created just fine.
Documents\My Games\Starfield\SFSE\Logs\skse_loader.txt
SFSE loader: initialize (version = 0.1.0 01070170 2023-09-07 22:13:32, os = 6.2 (9200))
config path = C:\Program Files\WindowsApps\BethesdaSoftworks.ProjectGold_1.7.23.0_x64__3275kfvn8vcwc\Data\SFSE\sfse.ini
launching alternate exe (Starfield.real.exe)
procPath = Starfield.real.exe
launching: Starfield.exe (Starfield.real.exe)
dwSignature = FEEF04BD
dwStrucVersion = 00010000
dwFileVersionMS = 00010007
dwFileVersionLS = 00170000
dwProductVersionMS = 00010007
dwProductVersionLS = 00170000
dwFileFlagsMask = 00000017
dwFileFlags = 00000000
dwFileOS = 00000004
dwFileType = 00000001
dwFileSubtype = 00000000
dwFileDateMS = 00000000
dwFileDateLS = 00000000
productVersionStr = 1.7.23.0
version = 0001000700170000
product name = Starfield
normal exe
dll = C:\Program Files\WindowsApps\BethesdaSoftworks.ProjectGold_1.7.23.0_x64__3275kfvn8vcwc\\sfse_1_7_23.dll
main thread id = 4036
hookBase = 00000247FD7F0000
loadLibraryAAddr = 00007FFBDC1D0C70
getProcAddressAddr = 00007FFBDC1CB650
hook thread complete
launching
Documents\My Games\Starfield\SFSE\Logs\sfse.txt
SFSE runtime: initialize (version = 0.1.0 01070170 2023-09-07 22:13:32, os = 6.2 (9200))
imagebase = 00007FFBAFCF0000
reloc mgr imagebase = 00007FF740D20000
plugin directory = C:\Program Files\WindowsApps\BethesdaSoftworks.ProjectGold_1.7.23.0_x64__3275kfvn8vcwc\Data\SFSE\Plugins\
scanning plugin directory C:\Program Files\WindowsApps\BethesdaSoftworks.ProjectGold_1.7.23.0_x64__3275kfvn8vcwc\Data\SFSE\Plugins\
preinit complete
dispatch message (0) to plugin listeners
no listeners registered
dispatch message (1) to plugin listeners
no listeners registered
init complete
Obviously this will break once build-specific stuff is added to SFSE.
But this does mean sfse_loader.exe
can function within the UWP sandbox just fine. So if you're willing to support the UWP build of Starfield or accept contributions of the necessary information, it could happen.
Specifically here:
This is of course largely irrelevant. However I wanted to say: Thanks for all your hard work over the years. I look forward to SFSE.
SFSE will not boot for the latest game runtime via Steam
This is not meant to complain, just to put it on your guys' radar :) love your work!! Cheers
Any possibility of switching the license only on the bits of code required to be updated with a new patch ?
To something less restrictive so people could do the version updates for you ?
How complicated is the up date process ?
Hello,
Maybe this is more obvious to those who come from older Bethesda games, but is there any documentation for those of us who want to write plugins using SFSE, any API docs on what we can twiddle with etc?
They just released 1.10.32, probably to fix the glaring issues with 10.31.
SFSE 0.1.3 has caused the return of this issue... @ianpatt
Hello,
Starfield Steam version.
Placed the .exe and the .dll in the Starfield root folder ( where starfield.exe is ).
Launched the game through the sfse_loader.exe but the game doesn't load.
The small cmd box appears but then it disappears without starting the game
What am I doing wrong ?
Firstly, thank you for your efforts with all of the BSW titles!
Reviewing the readme file it is referenced to '1. Copy the dll and exe files into your Starfield folder.' I am not finding these files anywhere within the SFSE repository.
Please help an old boomer/mechanical engineer wrap his head around Git and some software step I must be missing.
Cheers
Hello there, my mod uses pattern scan to find the right address to patch. So far the pattern worked over all updates and if it stops working, nothing will be patched, no harm done.
https://github.com/igromanru/SF-Zero-Weight/blob/main/Plugin/src/main.cpp#L47
Therefore it would be very appreciated, if SFSE would start checking for the addressIndependence
flag, so I don't have to add compatibleVersions
for each game version.
I could make a Pull Request, but before I do any work, I wanted to ask what are the plans for it.
Best Regards
Igromanru
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.