Stellaris
Let's talk about how Stellaris "supports modding"...
Their claim of modding support tends to be nothing but a throne of lies. Nothing beyond the most simplistic & costmetic changes, yet is regarded as a "good mod game".

Sure, you can do some simple tweak's to global constants easy enough in the 00_defines.txt. Then we got some ship components, weapons and "easy" items (using stock behavior, just changing existing values, again). Next up in difficulty is adding ship sizes with custom meshs. Then, maybe, if you really understand their horrible systems you can implement a few war-goals, custom events, and so forth. But beyond that this game is dreadful to mod for.

While I and many others began trying to mod FTL support back into the game (warp & wormhole), it became quickly obvious that modding this game had some serious limitations. This was more news to me than them. They've all been modding for a long time. I'm an experienced programmer but this was my first time looking in to stellaris indepth. I always regarded Stellaris as a "mod friendly game" based sheerly on the amount of mods that exist for it.

Turns out an insane amount of behavior is hard-coded into the exe. Normally, this would be something I'd support because it lends itself to efficiency and optimization. But this takes it a step further. Most (modern) games have a core engine. A highly efficient and optimized program who's task is to render, manage memory, very low level behavior, and things that require high degrees of percision. On top of that, they have scripting languages (lua, python, ...), data-loading and parsing languages (xml, ini, ...), and some graphic related stuff (shader tweaks, meshs, textures, post-FX,...).

The scripting language tends to have a cooresponding API within the game. For example, telling the game to update object coordinates, physics, state, etc. Even with Some generic search algorithms being hard-coded into the game engine for increased runtime efficieny. That API would be bound to the scripting language, so you could instruct the low-level engine from a high-level language and define behavior in the high-level language for ease of production (a perfect case of "abstraction").

Instead of using a known-good interpreted scripting language, like Lua or Python, stellaris (for whatever reason) decided to go with... whatever the hell this is.

immediate ={ from = root fromfrom = fromfromfromfrom if ={ limit ={ AND ={ is_subject = no OR ={ is_country_type = default is_country_type = fallen_empire is_country_type = awakened_fallen_empire } NOT = { has_country_flag = silence_destroy_event } } } #...some behavior if == true... else ={ #...some behavior if == false... } } }

Now, if you have any programming experience, you're probably asking yourself "what the **** is that syntax?!". Aside from the "#" comments, that's real "code". Yes, even the "fromfrom = fromfromfromfrom" bit. No, I'm not making that up. (not sure it's valid in the country scope. don't care. it's an example).


This is perhaps the most esoteric production-language I've ever seen.
I dub thy language, "WTF" language!


For the context of these people trying to get FTLs working, we need to get the destination of the player who wants to enter FTL. Well, since there's no way to tell what the player has selecting, state of key actions, or anything of the sort; the main effort has been focused behind using "bypass"'s in 2.0 to determine the coming-from and going-to system. (Basically, gateways for all as a primary mode of travel. as proof-of-concept in "FTL Resoration Project" mod).

Normally behavior is defined in the scripting language and function bindings are used to call internal non-scripted functions. This is where functions(?) like "create_bypass" come in. Instead of this behavior being handled in WTF-language, it's dispatched to the engine itself. (Frankly, not a bad idea since the language is so **** incompetent, but that's a self-made problem and not an excuse).

Using pseudo-gateways, create_bypass (which is a 2.0 thing) would be required to work-around the inability to get FTL destinations. For the life of me and others, we can't get the bloody thing to work. Also, it's not used anywhere in the game files what-so-ever, despite being documented on a wiki and in the devnotes. On top of that, pathfinding is completely zonked from script-land and hard-coded with no bindings and is practically impossible to re-create with any degree of efficeny. (also probably completely impossible due to the limitations of WTF language).

In any other "mod friendly" game, FTL behavior, logic checks, restrictions, behavioral calls and ordering -- would all be handled in the scripting language with practically zero efficiceny cost in the grand scheme of things. But since it's handled hardcoded in engine with some dangling, dead, and completely unused or undocumented "API" calls...

It's easier to hack the game externally to get the behavior you want than it is to mod it in natively, in a so-called "mod friendly" / "mod supporting" game.

I can't tell if it's malice in an attempt to have new behavior restricted to DLC and updates, or sheer incompetence on the side of whoever decided to use WTF-language.

Hell, some of us even want to reverse engineer it and make a process-injected "Stellaris Script Extender" (similar to SKSE for skyrim) because it would probably be easier than dealing with the game's nonsense and would have VASTLY more utility than WTF-language. We decided against it because it would likely take months and be a giant pain in the butt to maintain.

There are far better games to mod where our time will be put to better use.

I have no idea how this game got viewed as a "good modding game", but if you want to do anything beyond the most basic of changes, it's a massive undertaking of work-around ingenuity.

God. What a horrible game to mod for.


Update:

Ryuku has been working on pathfinding for the FTL Restoration Project. The game's pathfinding is hardcoded and it isn't bound to any WTF-Language objects. After quite a few days of trying to find a work-round, Ryuku finally broke through. However, due to the limitations of WTFL, it required over 300 if statements. Obviously this would be near-impossible to tweak and maintain through normal means, so Ryuku wrote a C# program to write the if-statements for him...

namespace ConsoleApplication2 { class Program { static void Main(string[] args) { string currDir = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); if (File.Exists(currDir + "\\output.txt")) File.Delete(currDir + "\\output.txt"); FileStream fs = File.Create(currDir + "\\output.txt"); fs.Close(); using (var sw = new StreamWriter(currDir + "\\output.txt")) { for (uint i = 0; i <= 1400; i += 14) { sw.WriteLine("\t\t\t\tif = { limit = { event_target:destination_star = { distance = { source = event_target:current_system min_distance = " + i + " } } }"); sw.WriteLine("\t\t\t\t\troot = { set_variable = { which = currDistance value = " + i + " } }"); sw.WriteLine("\t\t\t\t}"); sw.WriteLine("\t\t\t\t"); } } } } }


THIS IS WHAT I MEAN!
Even the simplest of behavior-related tasks in Stellaris requires a staggering amount of ingenuity and a pain-stakingly massive time investment.

If we had a binding, it would look like pathfind{ from= thing1 to=thing2 }...
If the language worked properly, it would look like https://pastebin.com/cuw8NDKH
But since it doesn't, the result: https://pastebin.com/9ijaPAZr


another (better) example https://pastebin.com/RTuPyyVm
Legutóbb szerkesztette: Honshitsu; 2019. ápr. 14., 23:22
< >
7690/113 megjegyzés mutatása
eredeti hozzászólása:
Does anyone know if it is possible to view any of the internal code that I assume is part of the exe file?

The _source_ code itself? No. To my knowledge, it isn't JIT (just-in-time) or anything like that; so it's compiled to native assembly (in contrast to something like C# mono or Java, who's source code tends to be available).

Although I'm sure it's against TOS/EULA, if you're technical enough; you can always string-search the exe and reverse engineer functions to see whats going on -- which is what myself and others have done to see what's hardcoded and impossible to change from the WTFL modding system.

The game internals can be modified by something like a DLL injection. You could hook certain functions and provide overrides + an API for modders to use from a script system like Lua or Python, which would allow modders to access and interact with the hardcoded game behavior. However, besides what I mentioned about the TOS/EULA violation of what is effectively hacking and reverse engineering their game; it's also a massive pain in the a** to document, update, and maintain such a library.

On top of that there's little to no interest in making such a thing because modder time and effort is best spent on other games that don't hit them in the face with a rock every time they try to do something (see: gta v, skyrim, rimworld, sims 4, pong, whatever...)
Legutóbb szerkesztette: Honshitsu; 2019. ápr. 13., 17:25
Hi,

@Alaestor @Sarno

I don't know this community. A friend pointed this thread out to me.

I don't own the game and have never actually played it. I don't count the few times I played it at a friends place. That was the time he asked for my programming skills to make a personal mod for him. A tech dependent cooldown of the jump drive, which is what I believe you're talking about.

He mentioned that something was hardcoded and he couldn't anymore have a tech dependend cooldown. That was a few months back.

I first was taken aback by the "scripting language". I've never seen something like this and I do know my fair share of languages C# (primarily), Python, Lua, VB.NET, F#, JavaScript...

Anyway, after a few hours of digging I figured it out back then. Anyway I believe the following functionality was moved to the exe only for the sole reason of them implementing a countdown in the UI in a tooltip. If I remember correctly there's a tooltip which counts how many days this will be active.

After a bit more digging I managed to implement for my friend this tech based cooldown he so wanted at the cost of him having no countdown in the tooltip (small price to pay acording to him). I'm surprised nobody managed to figure that out.

Anyway, feel free to take this proof of concept I threw for you guys if you're interested in having tech based cooldown for this jump drive. Just remember the drawback is no countdown in the tooltip.

Repository I literally created a few mins ago: https://github.com/bcssov/stellaris_jump_drive_cooldown_example

There might be some errors or bugs. I forgot the syntax of the language and have no way of testing this. I hope this POC works in the latest version of the game. Hope this helps to someone.
I sus sus suspect that WTFL is something that Ma Ma Max Headroom con con concocted from from from thin air.
Legutóbb szerkesztette: BGR; 2019. ápr. 14., 13:30
mario0244 eredeti hozzászólása:
I first was taken aback by the "scripting language". I've never seen something like this and I do know my fair share of languages C# (primarily), Python, Lua, VB.NET, F#, JavaScript...

Anyway, after a few hours of digging I figured it out back then. Anyway I believe the following functionality was moved to the exe only for the sole reason of them implementing a countdown in the UI in a tooltip. If I remember correctly there's a tooltip which counts how many days this will be active.

After a bit more digging I managed to implement for my friend this tech based cooldown he so wanted at the cost of him having no countdown in the tooltip (small price to pay acording to him). I'm surprised nobody managed to figure that out.

If I recall, the old non-hardcoded modifier also had a countdown? I may be mistaken, but I thought it did.

Anyways, yes, I have a similar solution - implementing your own cooldown and setting the hardcoded one to expire immediately. Mine has custom jumpdrives with differing cooldown periods. Thanks for the input though.

The only thing that changed is I don't believe "remove_modifier = jump_drive_cooldown" in your jump_check is needed, due to it expiring immediately (and from what I last tested, it isn't even actually applied to the ships anymore - the modifier effects are hardcoded now).


I was more ranting about them hardcoding things that used to be user-moddable and making it so difficult to change game behavior, like removing the various types of FTL drive in favor of hyperlanes + a jumpdrive cooldown system (I could have sworn there was a counter before. Even if not, it would be an easy change to make; tooltipped modifiers w/ duration... they have it for other things ingame.)

p.s. Also, since you're a programmer, you may get a laugh out of this (i just posted it the other day on the previous page of comments as an example of the dumb hoops you need to jump through) https://pastebin.com/RTuPyyVm
Legutóbb szerkesztette: Honshitsu; 2019. ápr. 14., 19:03
Oh my god... I am speachless. It truly deserves the name WTFL.

I also distinctly remember my friend talking about not previously having the counter in the tooltip. Investigation to the structure and implementation lead me to this conclusion. I was convinced that was the reason, or at least one of the reasons. As I stated I am not at all familiar with the engine or the game to say that for certain but it did seem as a logical conclusion.
😂 This "language" is all kinds of terrible
This thread is from 2018.
Why doesn't it have Lua scripting?
Ryika eredeti hozzászólása:
This thread is from 2018.
One hell of a necro-post. But on the plus side, I think this information is still just as relevant as the day I wrote it lol

Though I probably could have done a bit better framing my argument: I (and many other modders) were really pissed off at the time... This was just my way of expressing our frustrations to the lay users who were counting on modders to restore FTL travel after they removed it. There were some hacky workaround, but ultimately nothing like what people hoped for.

Tag365 eredeti hozzászólása:
Why doesn't it have Lua scripting?
Because they chose not to. It's just how their engine works; there's no scripting publicly exposed.

WTFL just lets us define structured data the engine uses; like XML. It doesn't "run" the code in the normal sense.

I'm not sure if WTFL is Turing-complete (I don't think so?) But it's Turing-enough to where someone could probably write a macro-based compiler to make things easier without too much effort. But there are still severe limitations because there are plenty of behaviors / game mechanics / systems that just can't be changed from WTFL, because there's no bindings or API; it's all hardcoded in the executable (afaik).
Legutóbb szerkesztette: Honshitsu; márc. 24., 11:20
I've seen this sort of argument in a number of places over the years. What I've never seen, regardless of the merit of the arguments or the level of expertise of the arguer, is a thought to maybe applying to join the company that is clearly making bank with a subpar language and upgrading it for a respectable salary.

Be the change you want to see.
RCMidas eredeti hozzászólása:
I've seen this sort of argument in a number of places over the years. What I've never seen, regardless of the merit of the arguments or the level of expertise of the arguer, is a thought to maybe applying to join the company that is clearly making bank with a subpar language and upgrading it for a respectable salary.

Be the change you want to see.

As if a corpo would hire a modder and not set him immediately to work on stuff they don't want to do.

Also cya thread, necroing close incoming. I've so wanted to see this mod be a thing, ever since they idiotic removal of FTL options, seeing this thread bumped up was a glipse of hope that was quickly dashed away.

Legutóbb szerkesztette: Knightspace; márc. 24., 11:27
RCMidas eredeti hozzászólása:
I've seen this sort of argument in a number of places over the years. What I've never seen, regardless of the merit of the arguments or the level of expertise of the arguer, is a thought to maybe applying to join the company that is clearly making bank with a subpar language and upgrading it for a respectable salary.

Be the change you want to see.

Oh no, I'm sure they're perfectly capable of doing that on their own. They chose this. They don't use WTFL for anything significant, and I'd be a little surprised if they hand-rolled all of what exists in the game. This approach also simplifies security concerns related to mods, as it isn't capable of executing arbitrary instructions. It also lets them have more control over the systems and game mechanics, and makes DLC more relevant.
Legutóbb szerkesztette: Honshitsu; márc. 24., 11:29
Knightspace eredeti hozzászólása:
RCMidas eredeti hozzászólása:
I've seen this sort of argument in a number of places over the years. What I've never seen, regardless of the merit of the arguments or the level of expertise of the arguer, is a thought to maybe applying to join the company that is clearly making bank with a subpar language and upgrading it for a respectable salary.

Be the change you want to see.

As if a corpo would hire a modder and not set him immediately to work on stuff they don't want to do.

Also cya thread, necroing close incoming
If you can demonstrate that your methods would produce higher revenue for a corporation, or cut spending costs...plus, you can always just quit and go back to your old life. You're not locked into it for a multi-decade immutable contract that results in your imprisonment or dismemberment if you violate or secede from it.
Knightspace eredeti hozzászólása:
I've so wanted to see this mod be a thing, ever since they idiotic removal of FTL options, seeing this thread bumped up was a glipse of hope that was quickly dashed away.

From all the modders who've tried to work on this problem over the years:
https://youtu.be/BsBK3gyMFcw
Knightspace eredeti hozzászólása:
ever since they idiotic removal of FTL options
I'd played in 1.0 release version. It wasn't an "idiotic" move - they never be able to balance a Hyperlines & Warp engines. Same with AI handling a WH - it will be never capable to counter them (as example from modern Stellaris - player is able to abuse Jump Drives waaaaay better then AI).

You're whining about choice between 3 options that never was a choice : one type of drive was always inferior, one is always superior.
Legutóbb szerkesztette: corisai; márc. 24., 11:48
< >
7690/113 megjegyzés mutatása
Laponként: 1530 50

Közzétéve: 2018. febr. 28., 21:03
Hozzászólások: 113