• 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.
Attaching mod that "fixes" the AI. For whatever reason loading the mod causes the game to crash at the start screen multiple times until it just works. I have no idea why it drives me insane though. Just keep reloading sometimes takes 3-5 times, nothing comprehensible in crash logs. This runs on 4.0.21 not wildernes beta but I backported most changes outside the main uses pretend pop stuff that is not backportable.
EDIT: found a bug that was keeping devouring swarms overly in check while cleaning up the code. It is now less ugly code and devouring swarms are 10x scarier early on.

Another of the main issues was that if the AI is meeting 90% of the target goals, it will consider a plan "complete" and look for a more advanced plan to move to. (But it'll fall back to the original plan if it's no longer meeting those goals at some point.)

Also as I wrote before this scales AIs forever and does not trigger the above bug highlighted. All the way up to 40k science output on multiple empires. My laptop became the bigger issue as the game ran slow as hell by that point. I played on GA no scaling havent tested it for lower difficulties or with the other output bonus.

Notes:
  • The name is because I originally wrote a mod for weaver combat computers and never actually renamed it
  • The code is ugly AF and has multiple commented out parts I will make a prettier code one but this is testable
    • It also contains alot of curse words those will stay
  • Changes just to AI behavior that can be used stand alone but works a lot better with all of the below to just get these delete everything other then common/inlinescripts/ep/* and common/economic_plans/02_fixed_plan.txt
    • Scales science and unity output based on empire size
      • Ugly would rather this be settable directly in the plan as scaled unity/science instead of having to check for it
    • Removed mixed optional and non optional scaling AI scales forever and doesn't break and die at any point
    • Cleaned up military scaling for ship types
    • Cleaned up potential triggers for scaling and base plans to follow a statemachine based setup
      • It is any of these states
        • only basic being targeted
        • if uses consumer goods targeting consumer goods
        • base and scaling unity/trade/military resources/science
      • Allows only 2 types of main checks and shuts all other groups off at once instead of by resource this prevents weird subtle scaling issues
    • Added multiple non scaling fixed buffers based on total expenses
      • This heavily prevents AI collapse and also gives extremely high weights when it falls below these thresholds
        • Doesn't get scaled down when the AI goes to 0 instead if they have 6k in monthly expenses it would be ~1000
      • This code is ugly and I hate it
  • I backported a bunch of wilderness beta changes but this is for 4.0.21 not wilderness beta buiild
    • A few triggers don't exsist in 4.0.21 so those ones where brought back unless I could easily change them
    • I included large files for the events because pulling them out individually was taking too long
  • Other Changes I added to clean up AI behavior for what is actually coded to work
    • Ship
      • I took the ship changes in wilderness further and completely removed frigates once cruisers are discovered and removed corvettes once battleships get x slot weapons
      • made bioships always build there largest variant
      • if an empire has advanced ships (cosmogensis/ Nemsis ships) it no longer builds mech ships
      • Disabled taking Galactic nemesis if bioship because the AI isn't setup for this
    • Civic/origin blocked a bunch from AI random generation because the AI isn't setup to use them or they are extremely broken
      • Rouge servitor isn't coded for properly in economic plans
        • This needs to be standalone because it cannot scale unity via building creation only collecting more pops
      • Void dwellers does not want to work well
      • Necrophage/Syncratic are broken
      • Clones is broken
      • Beastmasters isn't coded for AI scaling behavior
        • I have no idea how to figure out which ship to scale for
      • Environmentalist is broken
      • I didn't port galactic curators so I disabled it
      • Because it targets 4.0.21 I removed wilderness you can easily delete that part if you want to try it on the wilderness beta
  • Changes to improve AI performance
    • Minimum bio growth was moved from 10 pop to 1500 pop because the AI just settles everything and I cannot find any other way to deal with it
    • increased monthly resettlement to 50 because the AI doesn't do anything sane
    • Blocked solo science zone because the AI uses them too much probably will end up changing this to be restricted only for the first 10 colonies or something
    • Blocked entertainment building unless the AI has a civic that uses advanced versions
      • NOTE for devs if you read this the wilderness one locks these building if they do not have 0 housing avaible this trigger is wrong, also medical buildings wrongly got the change restricting there build if AI doesn't have low amenties which makes 0 sense.
    • Added a job cost reduction modifier of half the extra job efficiency bonus
      • The AI desperately needs this and still sucks even with it
    • Removed outdated building destroy triggers, all where on pop assembly buildings
    • Added a different hydroponics farm for voidborn and removed the normal one from the base slot (NO MORE FARMS EVERYWHERE!!!)
    • Shifted the 20% bonus and +2 per basic resource buildings to upgrade to the base +200 job building similar to how wilderness is setup
      • AI still deletes these for some reason but its super random and very annoying may need to adjust some other value I am missing. May also be an issue with it not checking where buildings can be place before looking to delete stuff.
      • No it doesn't do multiple you can use planet limit on them like wilderness please make all buildings like this its so much easier on the AIs sanity
    • Marked the hive pop building as essential
      • I have tried everything else to get the AI to build this but I am under the impression it is actually just outright not being evaluated properly clone vats also does not build
    • increased the AI selection chance 1000x for tech that is part of the asenscion the AI has taken the AP for
      • Please actually pull these changes live ATLEAST on higher difficuties
    • Increased AI selection chance for tech_capital_productivity 1 2 and 3 this tech is insane and the Ai ignores that fact despite it having a HORRIBLE draw chance
    • Allowed AI to build unity buildings again, was the only mainline resource one not changed in wilderness beta and I had to hand design the change.
 

Attachments

  • Archive.zip
    416,4 KB · Views: 0
  • lessuglycode.zip
    1,1 MB · Views: 0
Last edited:
  • 3Like
  • 2
  • 1Love
Reactions:
Dealing with all the fleets and such, why not remove travel time entirely once within the same system, meaning as ships filter into a system the transit from the hyperlane to their assigned fleet, nearest fleet, or largest fleet until filled? Its not exactly a joy to watch reinforcement chase a fleet and never really catch it. trading a little immersion for performance is one I would make given most fleets filling are off screen anyway.


a possible fleet performance fix is reduce how many of each ship is rendered. Titans would always be rendered. Battleships in multiples of three, cruisers and destroyers by five, and corvettes and frigates by ten. There can be a floating segmented bar indicating how many remain. It could be a simple advance options check box for those who want the clutter.
 
  • 2
  • 1Like
Reactions:
Dealing with all the fleets and such, why not remove travel time entirely once within the same system, meaning as ships filter into a system the transit from the hyperlane to their assigned fleet, nearest fleet, or largest fleet until filled? Its not exactly a joy to watch reinforcement chase a fleet and never really catch it. trading a little immersion for performance is one I would make given most fleets filling are off screen anyway.


a possible fleet performance fix is reduce how many of each ship is rendered. Titans would always be rendered. Battleships in multiples of three, cruisers and destroyers by five, and corvettes and frigates by ten. There can be a floating segmented bar indicating how many remain. It could be a simple advance options check box for those who want the clutter.

Your first point about reinforcements sounds good. Just have them pop into the fleet and make reinforcement more robust so we don't have tonnes of 1 ship fleets appearing if the fleet they're going to goes MIA.

Second point I would be hugely against. Stellaris is much more visual than other paradox games which is one of its draws. Having ships be abstract icons floating around that don't actually represent what's in your fleet would be a significant downgrade.
 
  • 5
Reactions:
One thing that comes to mind is that shields and/or armor could apply a flat reduction in damage...

This is one of the key pieces for differentiation between ship sizes and tech levels that Stellaris is missing. At heart, Stellaris doesn't have armor or shields; it has hit points divided into three buckets with slightly different rules on how they regenerate and how weapon bonuses work.

In the gunpowder and metal armor eras of ship combat, smaller weapons were of extremely limited use against heavier classes of warship; and a single hit from a significantly heavier class could be devastating. Even a 5" destroyer class gun (M?) would be significantly out-ranged and dramatically out-damaged by 8" cruiser class guns (L?); and a cruiser should have no significant problems targeting a destroyer with them. A 2 to 3" S weapon on a smaller ship would be lucky to survive long enough to close to the point they could even get hits on a cruiser, would be seriously outclassed by even a cruiser's secondary 5" M weapons, and would be completely ineffective against the armored vital parts of the ship, being limited to doing annoyance damage and hoping for lucky hits on some less-armored component.

Picking some numbers from the air, let's say that small craft have about 4 armor, destroyers normally have 8 armor, cruisers 16, and battleships 24 and up. S weapons might typically do 2-10 damage, M 6-18, L 14-26, and X 22-34. So, you're not quite certain to do damage against your own class, and you have some chance of doing damage to the next class up. If we add some sort of "critical hit" system, that gives a small chance for additional damage, that would replicate the odds of hitting a previously damaged area or something less armored like a sensor mast.

Balancing the above in a setting with both shields and armor is left as an exercise. One interesting take would be for shields to be more of the "deflector shield" type; they have hit points, but their primary benefit is to provide a bonus to evasion until they get worn away. Smaller ships would end up being more shield oriented, and larger ones primarily depending on their thicker armor.
 
  • 2
Reactions:
I think I would prefer a setup where you start with all four of the basic ship types unlocked (or at least corvettes, destroyers, and cruisers), and then tech allows you to unlock more advanced/specialized sections.

I've played around in previous versions with some related ideas. My concept would be that Gunships, Frigates, Destroyers, and Cruisers would be available at game start for most empires; but only PD, S and M weapons. You would have to develop L weapons, and then Battleship Yard infrastructure, and then Battleship hulls, and then X weapons.

So you'd have eras of Cruisers with M weapons, Cruisers with L weapons, Battleships with L weapons, Battleships with X weapons. (And probably continue above; develop Titan yards, then Titan hulls, then T weapons.)

You could make a case for extending it down a level; but I think it's likely that civilian ship types get up to cruiser size. After all, the Liberty ships were 2/3 the length of a heavy cruiser, and actually displaced more due to a much chunkier build.

Ideally, for more differentiation, you'd have an initial empire choice of a section type / theme, and have to research others at some considerable expense. (Much like the Colossus gives you one type for free, and you can research others later.) Perhaps choices like faster combat speed + more medium guns + less protection, vs. slower combat speed + more large guns + more protection, vs. medium combat speed + more fighters or missiles + more point defense. This would give empires the feeling of a "theme" again, as is present in much of the source fiction.
 
  • 4Like
  • 1Love
Reactions:
One thing that comes to mind is that shields and/or armor could apply a flat reduction in damage. I remember shields working this way back in my MoO2 days, so you'd have to upgrade to higher-tech weapons if you wanted to do any appreciable damage. A similar approach (and one which I think is preferable) would be something like

damage_taken= incoming damage**2/(incoming_damage+damage_reduction).

E.g., if you're firing at a target that has damage_reduction=50, let's say, with a weapon that would do 60 damage to an unarmored target, the actual damage you'd do would be 60^2/(60+50)= 32.7 (a 45% reduction), but if your weapon did 600 base damage, the damage taken would be 600^2/(600+50)= 554, which is only an 8% decrease.

With this kind of set-up (which I think is more or less how armor worked in Morrowind, although it's been a few years!), larger ships would have more armor/shielding, and thus high values for damage_reduction. These ships would be stronger against weapons that do low damage per shot, and so you'd need larger weapons to be effective. I can also imagine this framework providing a (potentially) better way to handle penetration: rather than bypassing shields or armor entirely, you'd just get to ignore some of the damage_reduction stat.

Obviously this would require a significant rebalancing of both weapon damage and ship protection, but I think it could be sufficiently beneficial to justify the time spent.

I really like this idea. It's simple but creates an intuitive balance if smaller weapons are worse against larger ships due to the number of flat-damage reducing components, but larger weapons are worse against smaller ships due to poor tracking (which could be buffed/rebalanced for a change like this). You get a nice pattern of what beats what (grey arrow), all else being equal.

components.png


With something like this it would be harder to have monofleet designs, though not impossible. Since it's intuitive rather than being some abstract game rule you have to learn it would be easier for newer players to grasp too.

EDIT: Thinking about this further I thought it would be interesting to plot the curve of that damage reduction equation. Essentially at a ratio where the damage reduction is larger than the damage you get >50% reduction in final damage. When they're equal it's 50%, and as it goes onwards it trends towards doing max damage.

D DR.png
 
Last edited:
  • 7Like
  • 3
Reactions:
1 I propose to prohibit the expansion of flotillas outside the shipyard, because:
a) individual flying ships slow down the game
b) building a reinforcement path is ineffective. For example, I had a case when the whole galaxy was at war with me. All the reinforcements flew through the L-gate, where I had a fleet stationed and I shot all the enemy single reinforcements.

2 Did I read that trade is now (in version 4.0+) responsible for supply? But in the game, it is impossible to see in advance how the cost of supplies will change when the flotilla moves. As a result, I'm sure that not a single player thinks about how moving the flotilla will affect his expenses.
Therefore, when planning the flotilla route, I suggest adding a pop-up window showing the change in the cost of supplies. And, perhaps, it is worth adding illumination of low/medium/high cost supply zones when choosing a flotilla to move.
 
  • 1
  • 1Like
Reactions:
I propose to prohibit the expansion of flotillas outside the shipyard
The design around fleet reinforcements needs reconsideration, but this brute-force proposal just pushes us into micromanagement hell.
 
  • 9
Reactions:
Playing the beta for a bit, I don't like the increased fleets. The performance feels worse compared to vanilla. Wouldn't it be better to reduce the fleet limits and buff the components to reduce lag? I would also think decreasing travel times would help more with that
 
  • 1
Reactions:
The design around fleet reinforcements needs reconsideration, but this brute-force proposal just pushes us into micromanagement hell.
Alternatively, when you click to replenish the flotilla, a window should open with a choice of shipyards to use and design the player's path.
Reinforcements should be sent only after all ships are ready, not 1.
If the flotilla is unavailable, it means that it cannot be replenished.

In this way, we will solve the problems of designing the PC path and performance.
 
  • 2
Reactions:
Reinforcements should be sent only after all ships are ready, not 1.
I need some reinforcements ASAP, not all reinforcements "when they're ready".

(Also, if I can reinforce my fleets, then the bot players need to be able to reinforce their fleets.)
 
  • 1
Reactions:
I need some reinforcements ASAP, not all reinforcements "when they're ready".

(Also, if I can reinforce my fleets, then the bot players need to be able to reinforce their fleets.)
Solving performance issues requires compromises.
If you need reinforcements urgently, it makes sense to send a new manned flotilla, rather than sending one ship at a time.
After all, do you think that in real life during the war, reinforcements are sent one soldier at a time as they are recruited at the military enlistment office, or do they send a fresh company, and the old one is sent to the rear for reinforcement?
 
  • 1
Reactions:
If you need reinforcements urgently, it makes sense to send a new manned flotilla, rather than sending one ship at a time.
If I need reinforcements urgently, I want to start pushing new ships to the front, through the territory I have already occupied, from my nearest shipyards.

Once the first replacements start arriving, I merge them into the existing fleet and start splitting off the worst-damaged ships to be either scrapped or sent home for repairs.

(Also, the unit that naturally corresponds to one ship is the regiment, not the company.)
 
Last edited:
  • 1
Reactions:
Once the first replacements start arriving, I merge them into the existing fleet and start splitting off the worst-damaged ships to be either scrapped or sent home for repairs.
If I understood you correctly, then you are engaged in some kind of micromanagement, which 99% of the players definitely do not do.
 
  • 2
  • 1
Reactions:
If I understood you correctly, then you are engaged in some kind of micromanagement, which 99% of the players definitely do not do.
At the moment, micromanaging fleet reinforcements is not necessary because we push a button and new ships get sent towards the front as they are completed. A particularly fanatical micromanaging player (i.e. one that actually likes micro) might be able to get marginally better results, but in general it's not worth the effort.

Replacing performance hell with micromanagement hell that causes performance hell is very far from a satisfactory solution.
 
  • 2Like
  • 1
Reactions:
At the moment, micromanaging fleet reinforcements is not necessary because we push a button and new ships get sent towards the front as they are completed. A particularly fanatical micromanaging player (i.e. one that actually likes micro) might be able to get marginally better results, but in general it's not worth the effort.

Replacing performance hell with micromanagement hell that causes performance hell is very far from a satisfactory solution.
I would like to note that the replenishment of the flotilla does not cancel the unification and separation of the flotillas.
If you want to engage in micromanagement, you're welcome. Create 1 ship each and send it to the flotilla for replenishment, and then combine and disassemble the ships.
I'm sure that AI is not currently replenishing in the same way that you are doing.

Therefore, in any case, it is useful for AI to replenish in the form of rotation. That is, an incomplete flotilla is taken to the shipyard for repairs and retrofitting, and a new or more complete one is brought to replace it.
The absence of single flying ships will significantly speed up the game.

What is the alternative way to avoid the load on the PC? Teleporting new ships directly to the flotilla? This will simplify the game to the point of making it boring
 
  • 1
Reactions:
I would like to note that the replenishment of the flotilla does not cancel the unification and separation of the flotillas.
If you want to engage in micromanagement, you're welcome. Create 1 ship each and send it to the flotilla for replenishment, and then combine and disassemble the ships.
I'm sure that AI is not currently replenishing in the same way that you are doing.
Technically, no. But for all practical purposes, the two systems are incompatible. If you order reinforcement for a fleet, then merge it with another, the reinforcements will arrive as dozens of individual ships, at some unknown later date, and it takes fairly annoying fiddling to sort things out again (especially if you have any kind of fleet composition which isn't just "80 cruisers with the same loadout").

With a handful of fleets, that's ok. More than that, and it gets fairly tedious.

It would be nice if there were a "merge and just figure it out" button that just combined/divided a big ol' stack of fleets into as few fleets as possible, with roughly equal distribution of hulls.

Ex. take a fleet of 17 battleships (136), a fleet of 50 cruisers (200), a fleet of 190 corvettes, and a bunch of miscellaneous single-ship-fleets that total to another 10 cruisers, 4 battleships, and 20 corvettes, and end up with 3 fleets of 8 battleships, 20 cruisers, and 70 corvettes (210 capacity).

3 big mismatched fleets and 34 single-ship fleets go in, 3 nicely distributed fleets come out.
 
  • 1
Reactions:
What is the alternative way to avoid the load on the PC?
Redesign the warfare model so that it doesn't rely on tracking individual ships as discrete on-map entities that move around like RTS units.

As an added bonus, this addresses the combat lag caused by 100 artillery-computer missile corvettes dancing around trying to stay out of range of 100 swarm-computer gun corvettes.
 
  • 5
Reactions:
Have they changed the requirements for choosing a second planet specialisation district? I get that they changed it to requiring a Planetary Capital (2500 pops), but sometimes it lets me choose one, and sometimes it doesn't. Can't figure out if a bug or in game mechanics...