• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.
I still think that replacing the text-based thing with a well documented Lua API would maybe boost things up a little, and give a lot more power to mods, reducing compatibility issues that mostly come from the need of replacing Stellaris original files.

Actually, Stellaris was using Lua before release. On the third paragraph of this pre-release dev diary : https://forum.paradoxplaza.com/foru...-diary-31-modding-scripting-anomalies.923348/

it is mentionned a Lua script in Stellaris\common\defines that is no more. Since they separated from the use of Lua I don't think it could be back anytime soon. I also saw mentionned once or twice that Lua would have better range of functionnalities yes, but at the expense of performance actually, the current system managing fewer things and thus being quicker.


Well he ended with, "Discussions of "this is the engine's fault" are almost certainly incorrect."

So I do not think he had any idea what he was arguing.

The use of the term "traditionnal" engine for Unity or Unreal seem to hint that way.
 
Actually, Stellaris was using Lua before release. On the third paragraph of this pre-release dev diary : https://forum.paradoxplaza.com/foru...-diary-31-modding-scripting-anomalies.923348/

it is mentionned a Lua script in Stellaris\common\defines that is no more. Since they separated from the use of Lua I don't think it could be back anytime soon. I also saw mentionned once or twice that Lua would have better range of functionnalities yes, but at the expense of performance actually, the current system managing fewer things and thus being quicker.

I don't know about Lua having any performance issues... All benchmarks I've seen are quite impressive (I'm not a computer scientist, so I have no idea how Lua can perform that well). As for managing fewer things... I'm also skeptical of that one... The API could be just enough to manage the exact same things.
 
I don't know about Lua having any performance issues... All benchmarks I've seen are quite impressive (I'm not a computer scientist, so I have no idea how Lua can perform that well). As for managing fewer things... I'm also skeptical of that one... The API could be just enough to manage the exact same things.

It's not that Lua in itself is having performance issues, but it offers lots of functionalities that are not used in the game, so while it could do the same thing, it taxes performance on maintaining functionalities available for nothing. This perf cost is uncompressible, unless stripping components from the API. Short of doing that, a specialized tool designed to do what is strictly necessary will always perform better, granted it is well written.

Now most game devs probably don't have a need for that kind of things, as usually games are not that hard on CPU, and can afford the overhead. But in the case of CPU intensive games, this can be a sensible choice.
 
Ummm.. I do not think you know how a game engine works.
Game engines aren't my specialization per se, but I do know a bit about the more common ones. When I said "traditional" engines, perhaps I should have said "general-purpose" engines, with Unity and Unreal as examples.

Any time the devs comment on what the Clausewitz engine does, it's almost always to tell someone "no, the engine isn't responsible for that". A classic example is "Clasewitz can't multithread properly".

Further evidence that Clusewitz is not the cause of performance drops can be seen from other games that are using the engine. It's not like EU4, CK2, Imperator, and HoI4 run into this level of performance issues. Even Stellaris 2.1 runs quite smooth.

The performance issues are just an issue of bad coding and/or design.
 
What's this for [Mod edit: language] strategy Paradox? Damage control by containing all complaints in one thread and then ignoring it forever (30 pages at time of writing)?
Speak with your wallet people, it's the one thing they cannot ignore...
 
Last edited by a moderator:
It's not that Lua in itself is having performance issues, but it offers lots of functionalities that are not used in the game, so while it could do the same thing, it taxes performance on maintaining functionalities available for nothing. This perf cost is uncompressible, unless stripping components from the API. Short of doing that, a specialized tool designed to do what is strictly necessary will always perform better, granted it is well written.

Now most game devs probably don't have a need for that kind of things, as usually games are not that hard on CPU, and can afford the overhead. But in the case of CPU intensive games, this can be a sensible choice.
To know if it's well written enough to outperform a much easier to write Lua API they should first write the Lua API and test it against the current text-based thingy. Everything would break and have to be rewritten sure (including all mods) but I have a hunch a Lua API would do wonders for game performance.

Actual multithreading (the threads can run on different cores) is a Lua feature (implemented by the Lane module): different Lua instances running in parallel. (Just don't give us modders access to that module, cause multithreading can hurt performance when done badly).
 
Game engines aren't my specialization per se, but I do know a bit about the more common ones. When I said "traditional" engines, perhaps I should have said "general-purpose" engines, with Unity and Unreal as examples.

Any time the devs comment on what the Clausewitz engine does, it's almost always to tell someone "no, the engine isn't responsible for that". A classic example is "Clasewitz can't multithread properly".

Further evidence that Clusewitz is not the cause of performance drops can be seen from other games that are using the engine. It's not like EU4, CK2, Imperator, and HoI4 run into this level of performance issues. Even Stellaris 2.1 runs quite smooth.

The performance issues are just an issue of bad coding and/or design.

Well yes, I agree the perf issues had not been brought by Clausewitz. We got them after a series of several patches, none of them did any change to it. But at this point, I don't really care what is guilty or not. What I look for is areas where perf gains can be made, and Clausewitz is one of those areas.

If you look back at what I said earlier about rendering, those are tasks that would normally be undertaken by a general-purpose engine. Using the ticks_per_turn command, which is sacrificing rendering up to 2 frames per game's month, you can halve the month duration and double the CPU usage. Using a small mod that disable job calcs, you shave off only a third of that month duration. Counting the fact that whatever you do, you will have to keep some job calcs at least so the third is not attainable.

While a dedicated rendering thread could be entirely offloaded on another core and get the game to that roughly X2 speed ticks_per_turn manages. So if I had free rein and had to choose a target, it would be rendering. Pop/job calcs would come second only. Hence why I tackle the engine.


To know if it's well written enough to outperform a much easier to write Lua API they should first write the Lua API and test it against the current text-based thingy. Everything would break and have to be rewritten sure (including all mods) but I have a hunch a Lua API would do wonders for game performance.

I couldn't find you the source, but I recall a dev in a conference answering questions addressing this, and IIRC he told that what they use now was faster for their specific use. Can't tell you what they did to test it tho.
 
Last edited:
People have narrowed it down to vacant jobs on planets checking every single pop for viability, every single day, on every planet.
Is game optimization in the works?
Supposedly, but talk is cheap.
 
I couldn't find you the source, but I recall a dev in a conference answering questions addressing this, and IIRC he told that what they use now was faster for their specific use. Can't tell you what they did to test it tho.
Is it a quote from back when the game ran smoothly? Maybe they should give it another go now that all the new features are piling up.
 
The problems that are causing these performance issues, are in fact, parts of the engine we do not have access to.

There's plenty of performance improvements to be made through review and optimisation of soft-level functions, such as scripted triggers and weightings. There's been at lesat two AI mods that have done just that, without compromising basic features such as job allocation by trait: Starnet and EDAI.

Stellaris Immortal has provided significant performance improvements by overhauling game features and content at the soft-level, but then it is an overhaul (not meant derogatively).

AlphaMod 2.3, that greatly expands content and improves AI, also performs far better than vanilla. Because I integrated and tailored EDAI to work with it. At the soft-level.

Side-note: I relayed numerous basic fixes to vanilla (G)AI (all soft-level fixes) by a colleague who is now employed by PDS. Months ago. A few of those would have provided some performance improvements. I'm pretty sure none of those fixes made it into 2.4 or 2.5, but I haven't bothered to check and that opinion is based on peer review of the AI in 2.4 and 2.5. (Not like a dev is going to pop in and dispute it, anyway.)
 
Last edited:
Economic Development AI, or E.D.A.I: https://steamcommunity.com/sharedfiles/filedetails/?id=1805681002

Currently works with 2.3 of Stellaris. I'm waiting on improvements to the launcher, QA, performance, AI, my income and my health before considering updating it.
Oh ok! Yeah, I think the least Paradox could do would be to incorporate mods like yours into Vanilla code. There are a lot of mods that fix a lot of stuff that are obvious bugs... at this rate, the majority of people will start to believe they actually don't care.

Worse of all, when you use a mod that merely fix stuff Paradox doesn't seem to care enough to do it themselves, there goes your checksum...
 
Is it a quote from back when the game ran smoothly? Maybe they should give it another go now that all the new features are piling up.

Yes, it's at least that old. But I don't think it would do anything to change it back. If their claim is true, what is lagging now will do the same with Lua. Plus it would be quite some work now. If they were to pour that much work on changing stuff, I'd honestly prefer them to put it on the rendering issue, that would be far more productive IMO. Anyway and more in line with a realistic cost/benefit ratio, as @AlphaAsh said, there's plenty to do at soft level.
 
This mod seems great but having to use it in the first place just doesn't sit right with me.

I agree. But in the absence of a good-faith response to the years-long community outcry, it's far better than nothing. We waited a long time, but enough is enough. We want a Stellaris that delivers on the conceptual promises of it's marketing. I've never had that game, despite owning every bit of Stellaris DLC so far.

So we decided to make it...