HOWTO: Enable Debug Console on Current Version (With Textures)

Moderator: Makail

Post Reply
User avatar
willdieh
Posts: 105
Joined: Mon May 08, 2017 4:41 pm

HOWTO: Enable Debug Console on Current Version (With Textures)

Post by willdieh » Sat Mar 24, 2018 3:09 pm

Greetings,

In my ongoing efforts to try and bring some low-level improvements to this wonderful game, I've found how to re-enable the development console while still allowing the game to locate the various textures and model definitions it needs to be fully functional.

Background:
I noticed some activity on these forums (quite) a while back regarding the console, how to enable it, etc. At that time, it seems that even when enabled, the models were un-textured/not located or the console was eventually altogether disabled following Kerberos patch releases. I found that re-enabling the console using the sots2.exe.config file can still be done and that doing so requires the game to be run in an alternate deployment configuration which has special development only folders for game assets. By examining the log and console messages and through some trial and error I was able to reconstruct the development directories sufficiently well to allow the game to run "normally" while still providing full access to the console. This is a great benefit to modders as the console provides low-level details as to how the AI is thinking, what "scores" are attributed to fleet constructions, etc. It is my hope this will further spur creative development on improving the AI as well as helping to identify other potential areas for improvement.

DISCLAIMER: The Debug Console is intended to run in a development environment and should not be used by casual users for troubleshooting purposes. It was disabled by Kerberos for a reason!
These instructions may result in unexpected in-game behavior and should be performed at your own risk

ENABLE CONSOLE
Enabling the Console is pretty straight forward. Once enabled, the game will launch and the console will display, but without the development asset folders, you will probably only see limited models (if any), most notably the LOA which seem to at least be able to display untextured models, probably because of their unique folder structure as part of an expansion.

Steps
1. Open the SOTS2 installation folder and navigate to \bin\x86 where you'll find the various executables that launch the game.
2. Edit sots2.exe.config and set the following tags to "True"
AllowConsole
DevMode
3. Start the game launcher by double clicking sots2.exe. If you click on Options in the game launcher window you will now see the Allow Console option (in red). Enable it if it's not already enabled.
4. Click Play on the game launcher. This should launch SOTS2 with console and you will probably see some incomplete battle screen during the main menu.

CREATE DEVELOPMENT FILE STRUCTURE
Now that you are running in Developer Mode, the game is looking for assets in a slightly different folder structure. For each of the main asset subdirectories, the game expects to find an _assetbin folder located under the parent folder. I originally tried creating symlinks for these folders which just pointed back to the parent folder but the game refused to load the missing textures. Instead, I was forced to create actual folders and then copy all the data from the parents into the _assetbin folders. I also tried moving all the data from the parents into the _assetbin folders but some of the content has to be in the parent and some has to be in the _assetbin folder or the game won't launch and I didn't want to waste the time to figure out which data goes into which.

EDIT 3/25/2018: Spent some time in PROCMON.EXE looking at which files are actually accessed from the non-_assetbin locations and with some more trial and error found out it's not that many. Only the UI and AUDIO folders need to be in the parent location for BASE and (presumably) the UI folder for EOF. I haven't changed the instructions below however, because while it's now possible to simply MOVE the entire parent folder (except the UI and AUDIO folders) into its respective _assetbin sub-folder, this will break your file layout if you switch back to non-development mode. If you'd like to save some time/disk space though, you can simply MOVE the parent files/folders into their respective _assetbin locations. If you DO decide to do this, you might want to keep an eye peeled in the console log for legitimate missing files though, just in case I missed something. There are a several missing file messages that are legitimate (actual missing files not included in the game) so keep that in mind.


Steps
1. Open the SOTS2 installation folder and navigate to the \asssets\ folder
2. Create a folder named "_assetbin" under each of the content directores like so

\base\_assetbin\
\dlc_hiver\_assetbin\
\dlc_human\_assetbin\
\dlc_liir_zuul\_assetbin\
\dlc_morrigi\_assetbin\
\dlc_tarkas\_assetbin\
\dlc_zuul\_assetbin\
\eof\_assetbin\

3. Copy the contents of each of those main content directories INTO their respective _assetbin folders. In essence you're duplicating all the assets for each of the individual main content folders into the _assetbin folder for that content folder. I suppose the developers probably had copies of their assets in these _assetbin folders that they were working on. Or perhaps all the assets were in the _assetbin folders and only the basic configuration xml files were in the parent folders, but as I already mentioned I didn't want to spend the time to figure out what goes where and just copied everything.

Now if you re-launch SOTS2 you should see the console AND have full textures. I have noticed at least one oddity - the star maps are duplicated, so that's at least ONE thing that didn't need to be copied to the _assetbin folders, but that's easy enough to fix.

The console supports the "help" or "?" commands and has pre-set debug settings for AI (which just helps by auto selecting the appropriate logging categories but doesn't change what is logged). I recommend enabling VERBOSE logging as this displays much greater detail on how the AI is designing ships and plotting along.

Another note, developer mode does not store profile/log info in the %userprofile% folder. Instead, it's all conveniently stored in the same folder as the executable. As such, you'll probably want to copy over your profile/save games from your user folder.

Let me know if you have any feedback! I wrote this up AFTER enabling it on my system, so I may have missed a step. If it doesn't work on your vanilla install, let me know and I'll see what I can figure out.

William
Last edited by willdieh on Tue Mar 27, 2018 1:02 am, edited 9 times in total.

User avatar
Rossinna-Sama
Posts: 1631
Joined: Sun Nov 11, 2012 5:38 am

Re: HOWTO: Restore Console to Current Version (With Textures)

Post by Rossinna-Sama » Sat Mar 24, 2018 11:05 pm

Your steps worked, though a little clarification that its the launcher's options that need to be selected, not the ingame options.

It makes a new profile in the x86 folder so another step would be to go find your older saves to put in dev mode.
Now I really wish I could get my hands on the retail EOF SOTS2, so I could attempt to get x64 working again. :cry:
Sword of the Stars 2 : Project Hiver - work in progress
Sword of the Stars 2 : Vanilla AI Enhancement Mod - Alpha Version 6 now Available.
Creator of the upcoming Seimei universe.

User avatar
willdieh
Posts: 105
Joined: Mon May 08, 2017 4:41 pm

Re: HOWTO: Enable Debug Console on Current Version (With Textures)

Post by willdieh » Sun Mar 25, 2018 1:54 am

Glad it's working for you Rossinna. I hope it helps you with your fantastic modding work.

William

User avatar
Rossinna-Sama
Posts: 1631
Joined: Sun Nov 11, 2012 5:38 am

Re: HOWTO: Enable Debug Console on Current Version (With Textures)

Post by Rossinna-Sama » Sun Mar 25, 2018 2:18 am

willdieh wrote:
Sun Mar 25, 2018 1:54 am
Glad it's working for you Rossinna. I hope it helps you with your fantastic modding work.

William
It is. I've figured out a way to get the AI to actually play a match without me having to input anything so I can see in real time exactly what it is doing, and the log usually tells me why as well.

I saw every AI at around turn 20 go into bankruptcy barring the Tarkas. Zed was right, the trade stimulus is not making any difference since the AI actually turns it all the way to 0 if they fall into negative credit balance. That's not something I could have caught with save-game slot swapping.

For the record, I'm using TogglePlayerAI then using Simturns 10 for 10 turns of the AI controlling whatever empire I'm using. It even lets combat simulations play out.

Its also showing me (I think, need more test cases first) what AI stances the AI uses in different stages of a war. I'm not seeing them go into the defensive stance, its always the conquest stage until they are well ahead of the opponent.

So far, the only AI which didn't mess itself up by going into debt was the Tarkas AI. Not quite sure why exactly as of yet. My theory that allowing AI ships to have too much supply might be a factor, since the AI wants to be choosy and go for good systems early on regardless of distance, and due to the ballistic\missile preference of the Tarkas, their fleets can't afford to be so choosy so they go for good enough ones closer by.

EDIT - I found the problem. Stupid me forgot to allow colony fleets to SUPPORT worlds. :roll:
Sword of the Stars 2 : Project Hiver - work in progress
Sword of the Stars 2 : Vanilla AI Enhancement Mod - Alpha Version 6 now Available.
Creator of the upcoming Seimei universe.

User avatar
willdieh
Posts: 105
Joined: Mon May 08, 2017 4:41 pm

Re: HOWTO: Enable Debug Console on Current Version (With Textures)

Post by willdieh » Sun Mar 25, 2018 12:41 pm

Awesome, yeah the debug console is so great. I can only imagine where the modding scene would be now if we had it enabled all this time. Over the last six years though, most of the community has fizzled out. I'm trying to get more interest by cross posting on Reddit /r/sots and steam when possible. Thanks for everything you've done Rossinna!

William

User avatar
Mecron
Kerberos
Posts: 38423
Joined: Fri Aug 05, 2005 7:26 pm

Re: HOWTO: Enable Debug Console on Current Version (With Textures)

Post by Mecron » Mon Mar 26, 2018 8:14 pm

"I can only imagine where the modding scene would be now if we had it enabled all this time."


For the record it was enabled for quite awhile and it created a ton of false signals in bug reports. Hence why it was shut down.


"Asking...its the first step in learning."

User avatar
willdieh
Posts: 105
Joined: Mon May 08, 2017 4:41 pm

Re: HOWTO: Enable Debug Console on Current Version (With Textures)

Post by willdieh » Tue Mar 27, 2018 1:44 am

I just put in a disclaimer - I certainly don't want to cause any headaches for Kerberos! I saw some of those false-positive error reports in the forums. Hopefully modders will be allowed to continue to use it, with discretion.

On a side note, development mode must be doing something more than just enabling the console. I can now see a SOTSPedia icon for each tech tree item - a fantastic idea! Maybe I can figure out how to make that work outside of development mode and flush out the wiki files with technology details.

Mecron, I don't want to sound too much like a fanboy, but I really do want to say how much I appreciate you and the entire team that brought the Sword of the Stars universe into existence. SOTS 1 and 2 are both unique and brilliant gems and I'm sure I speak for many when I express my gratitude for all the many hours of enjoyment these games have brought to our lives.

User avatar
Mecron
Kerberos
Posts: 38423
Joined: Fri Aug 05, 2005 7:26 pm

Re: HOWTO: Enable Debug Console on Current Version (With Textures)

Post by Mecron » Tue Mar 27, 2018 11:03 pm

You are most welcome and its fine to have the console back as the days of frantic bug fixing are long gone. :cry:

User avatar
Marakis
Posts: 202
Joined: Sat Nov 15, 2008 10:16 pm

Re: HOWTO: Enable Debug Console on Current Version (With Textures)

Post by Marakis » Sun Aug 05, 2018 10:38 am

So dev mode is the only way to use the console? Al this is wierd... Ships are duplicated, ...Weapons are duplicated, ..its wierd and funny, badges are duplicated...

What exactly do I need to transfer over and not?

User avatar
willdieh
Posts: 105
Joined: Mon May 08, 2017 4:41 pm

Re: HOWTO: Enable Debug Console on Current Version (With Textures)

Post by willdieh » Sun Aug 05, 2018 1:42 pm

Were the instructions unclear? It's developer mode, for developers, so it's an entirely different folder structure.
Last edited by willdieh on Sun Aug 05, 2018 7:11 pm, edited 1 time in total.

User avatar
Marakis
Posts: 202
Joined: Sat Nov 15, 2008 10:16 pm

Re: HOWTO: Enable Debug Console on Current Version (With Textures)

Post by Marakis » Sun Aug 05, 2018 5:38 pm

I put everything in the asset bin like I'm supposed to, duplications.
What I was saying is that "Ingame." ..I'm seeing like..Duplicates of the same avatar selections, duplicates of the same ships and weapons, ect, Tech not so much. Its like how you said there was duplicated starmaps.

User avatar
willdieh
Posts: 105
Joined: Mon May 08, 2017 4:41 pm

Re: HOWTO: Enable Debug Console on Current Version (With Textures)

Post by willdieh » Sun Aug 05, 2018 7:15 pm

Well, once you start playing you won't see any more duplicate avatars. It's because the game reads data out of both the normal and dev folders. If you prefer to move the files, that will avoid duplication but you'll be stuck in dev mode until you move files back - thus my suggestion to copy instead of move. Also, the game will be slower in dev mode (I think) so be prepared for that. It's really only good for modders trying to see how the ai is working. Hence it's place in the modding subforum.

Post Reply

Return to “Modding”

Who is online

Users browsing this forum: No registered users and 3 guests