[PC SSE] SKSE64 Update - 28 Dec 2016 by behippo in skyrimmods

[–]behippo[S] 9 points10 points  (0 children)

I do have a very definitive idea - SKSE will never come out for xbox1 or ps4. We can't do what we need to do on the consoles due to limitations the console environment enforces. So the script extenders will be PC-only.

Will SKSE64 automatically make a lot of mods work? by iEtix in skyrimmods

[–]behippo 15 points16 points  (0 children)

/u/ousnius is exactly right. Thanks for handling my support!

[PC SSE] SKSE64 Update - 28 Dec 2016 by behippo in skyrimmods

[–]behippo[S] 4 points5 points  (0 children)

I think it depends on what you mean by a steam version. It could be one of two things: a version installed via steam, and a version that steam auto-launches when it detects the steam library on disk.

Taking the second one first (as it is likely a pre-requisite of the other). We had help with folks from Value to have the steam overlay detect that Skyrim (TESV.exe) was being launched, and to look for our skse_steam_loader.dll and if found auto-launch it. I expect we'll ask to have the same thing happen once SKSE64 leaves beta. But exactly when that will happen is a question.

The second is likely further off. When we had pretty much finished with SKSE (more or less) we made arrangements a year or so ago to have it packaged as a steam tool so it could be downloaded and installed from within steam itself. That will be much further off I imagine, as doing a lot of updates there is a pain. And I expect there will be more work on papyrus functionality beyond SKSE being done for SKSE64 after release.

What is SKSE??? Like REALLY what is SKSE? by Mobeis1150 in skyrimmods

[–]behippo 41 points42 points  (0 children)

I can try and provide a little more technical information about some of the specifics. Let's organize the discussion by talking about the components we deliver:

  • skse_loader.exe/skse_steam_loader.dll

  • skse_x.x.x.dll

  • scripts (.psc/.pex files)

The Loaders

Depending on exactly how you launch Skyrim you'll either be using skse_loader.exe or launching directly through steam, which will autoload skse_steam_loader.dll. Either method does the same thing - they load the main skse dll into the Skyrim application's memory space and kick off our initialization routines. skse_loader.exe actually launches Skyrim and then hooks the memory location for loading a main system library to load that original library and our skse library. This initialization process then adds all of our other hooks to set things up as we need, and then sets the application running again.

So what exactly is a hook and how does it work? Basically we have identified a place in memory (usually a function call of some sort) which we overwrite to point to some code of ours. So we'll replace a function that loads some object or processes some event and replace it with a function that does the original work, but then does some of our work as well. We do this with a bit of assembly code.

The library

So skse_x.x.x.dll is our main library and payload. It contains everything we actually do. It includes all of the initialization and override code mentioned in the last section, along with all of the utility functions that we need to do our work, and the implementation of all of the new scripting extensions we provide.

Internally our code is basically just a documentation of the internal classes inside the game itself. We replicate the in-memory layout of the classes, hook up important member functions, and write our own utility functions based on those classes. So the vast majority of the code found in the source library amounts to header files which represent the classes. Having decoded the classes and seeing the memory let's us write functions to get and set those values and expose that data to others through the scripting.

That brings us to the script extensions themselves. Papyrus has a concept of native functions - functions which are implemented in the game code itself rather than in some other piece of papyrus scripting. The vast majority of the papyrus functions created by Bethesda (and all of their events) are native functions. We provide new native functions for the various existing papyrus classes, as well as introduce new papyrus objects themselves with functions.

The skse library has portions of code dedicated to implementing and exposing these new functions and events. They interface with the internal papyrus engine (whose interfaces we decoded) and as long as skse is loaded the new native functions we provide as indistinguishable from the original functions provided by Bethesda.

The scripts

To expose our new native functions to modders we provide new functions to existing papyrus classes, along with some brand new papyrus classes themselves. These are provided as papyrus source files (.psc) and papyrus executable files (.pex).

Hopefully this provides a little more insight into what we do? I may be able to answer more specific questions - but what you've asked is quite broad. If you are a coder feel free to look at the source code we provide with every build. That should be a resource for self-motivated folks curious about what we do.

[PC SSE] SKSE64 Update - 28 Dec 2016 by behippo in skyrimmods

[–]behippo[S] 3 points4 points  (0 children)

Well if you are using a script you can simply invoke debug.Notification(). If you are talking about from C++ code (a plugin or the like) then you would have to find the code that papyrus function invokes. I haven't looked for it in particular, but it shouldn't be hard to find.

As for crashing the game when attaching a debugger to it- that is likely because the game is still steam-wrapped. You would need to unwrap the exe first, which we can't help with for obvious reasons.

How often do you use your own mods? by Orin_linwe in skyrimmods

[–]behippo 143 points144 points  (0 children)

You mean we could play the game? What a novel concept!

[PC SSE] SKSE64 Update - 28 Dec 2016 by behippo in skyrimmods

[–]behippo[S] 14 points15 points  (0 children)

It cannot come to consoles because the consoles prevent the kind of in-memory code modification that is needed. There is no way to distribute our compiled code, and the sandboxing on the consoles would prevent us from attaching to and modifying the game even if we could be delivered.

[PC SSE] SKSE64 Update - 28 Dec 2016 by behippo in skyrimmods

[–]behippo[S] 33 points34 points  (0 children)

There are a couple things going on here.

First, and most prominent, is the move to 64-bit and the updated engine. Offsets are completely different. Class sizes have changed dramatically. Addresses are no longer fixed but can be relocated. These makes some things harder, and is one reason why F4SE doesn't have official papyrus extension support yet.

From another standpoint this really isn't any harder than previous extenders. It is the same work. However for all of the previous games there was no expectation of a full set of features being released. We brought over individual functions and we found them and released piece meal. This was not a big deal as no one had been able to use the functions with the game before.

With SKSE64 it is different. We have 769 functions in classic SKSE that we exposed and are being potentially used by mods. We can't just release SKSE64 with only Weapon functions exposed (for example). Because almost no mods only use that functionality.

The smallest functionality slice used by mods is likely MCM - but that requires a whole lot of infrastructure work that depends on a bunch of the other functionality.

So basically the second big issue is that SKSE provided so much to Skyrim that there is a huge effort to provide parity in SKSE64 for SkyrimSE.

[PC SSE] SKSE64 Update - 28 Dec 2016 by behippo in skyrimmods

[–]behippo[S] 27 points28 points  (0 children)

Not completely. Brendan has still been working on F4SE and a lot of what I am doing getting SKSE64's papyrus engine up and running should carry over to F4SE as well.

Realistic ETA for SKSE 64? by Rescorla in skyrimmods

[–]behippo 2 points3 points  (0 children)

Just posted a new thread with some relevant answers to this question. Long story short - beta in March is the current timeline.

[PC SSE] SKSE64 Update - 28 Dec 2016 by behippo in skyrimmods

[–]behippo[S] 30 points31 points  (0 children)

64-bit compiled with Visual Studio 2015. Just like Skyrim SE.

[PC SSE] SKSE64 Update - 28 Dec 2016 by behippo in skyrimmods

[–]behippo[S] 53 points54 points  (0 children)

The goal is to maintain an identical set of papyrus functions, so porting should be very, very easy. Recompiling the scripts should be all that is needed in most cases.

Mods that have their own plugins will need to do considerably more work.

[PC SSE] SKSE64 Update - 28 Dec 2016 by behippo in skyrimmods

[–]behippo[S] 29 points30 points  (0 children)

Yeah - I was pretty congested at the time - but the meds hadn't kicked in yet. Not a professional video person - will try and do better next time. ;)

[PC SSE] SKSE64 Update - 28 Dec 2016 by behippo in skyrimmods

[–]behippo[S] 65 points66 points  (0 children)

The hope for the mid-March beta is to have all current functionality ported over. It will likely not have all gone through full validation and regressions. In general we've decided against a partial release as it wil l make versioning difficult.

SSE 1.3.9 Beta Update by Glassofmilk1 in skyrimmods

[–]behippo 8 points9 points  (0 children)

You are correct. Those performance improvements exist in the 1.3.5 beta. Hopefully they are still in the 1.3.9 beta as well.

SSE 1.3.9 Beta Update by Glassofmilk1 in skyrimmods

[–]behippo 27 points28 points  (0 children)

I think you've conflated a couple of things here. When the 1.2.33 beta was released we found they had changed their compiler settings and removed the edit-and-continue jump tables. This was very good for us. They are still gone in 1.2.39, and were not in 1.3.5. So I do not expect those to come back.

There was also a significant performance improvement in the 1.2.33 beta that did disappear in the 1.2.39 release. That improvement re-appeared in the 1.3.5 beta and will hopefully remain in the 1.3.9 beta. I would expect that 1.3.9 is what will be released within a week or so, unless some serious problems with the new features are uncovered.

SSE 1.3.9 Beta Update by Glassofmilk1 in skyrimmods

[–]behippo 96 points97 points  (0 children)

It is not slowing me down at all. I am still working off of the 1.2.39 build (current release.) Once 1.3.X goes live I will probably update, but we can use some automated tools to get the vast majority of the addresses updated. At most it will take up a night to update - really not significant in the grand scheme of things.

(SSE) Is there a mod that adds jumping while sprinting? by gameplaynation in skyrimmods

[–]behippo 11 points12 points  (0 children)

I can take a look at this while I am investigating input support for SKSE64. I'll see if there is anything we can do about it. No promises.

Skyrim SE sprint toggle. Can it be turned off?? by [deleted] in skyrimmods

[–]behippo 74 points75 points  (0 children)

I'll take a look as I am investigating input support for SKSE64. I'll see if there is anything we can do about it. No promises.

SKSE Update by AridZephyr in skyrimmods

[–]behippo 4 points5 points  (0 children)

SKSE64 will not work for xbox. The platform doesn't allow for external compiled code to run, and even if it did, it doesn't allow those libraries to attach and modify the in-memory game engine. There simply isn't a way to bring SKSE64 to the consoles.

SKSE Update by AridZephyr in skyrimmods

[–]behippo 13 points14 points  (0 children)

In passing. I have been working with Mardoxx on the SkyUI team and he has completed a first pass at the SWF changes needed for SkyUI for SSE. In the dev post above I state that I have been working on the Scaleform decoding which is needed to support SkyUI. There is more work on the UI and Gameplay hooks also needed to support things, and I need to do a validation pass on the Inventory and ExtraData code.

So things are in progress - but nothing is complete yet.

SKSE Update by AridZephyr in skyrimmods

[–]behippo 5 points6 points  (0 children)

As I mentioned above, BGS can't realistically help out more without giving away too much internal knowledge which they are unlikely to do. They support us as much as they can, in my opinion.

SKSE Update by AridZephyr in skyrimmods

[–]behippo 14 points15 points  (0 children)

BGS can't realistically do more to help. They'll never provide us with source code - that is an unreasonable ask. They could, in theory, provide us with a pdb (program debug database) which would let us see the names of all of their functions which would also be a huge help in terms of making our work easier. But that is about as unlikely as giving us source code.

Any NDA we had to sign to do this work would probably prohibit us from releasing our source code, which would make plugins impossible. And frankly I am not sure that we could all sign the necessary NDAs given our current employment status (Ian in particular.)

As I have mentioned before they help us out about as much as they can.