Modding to increase difficulty

A place for discussion of making game modifications.
zolobolo
Posts: 1544
Joined: Fri Nov 25, 2016 3:49 pm

Modding to increase difficulty

Post by zolobolo »

Update: There is now a tactical combat AI mod available by harpy eagle that massively increases AI performance and difficulty
It doesn't add or change any existing game elements to vanilla but it will make the AI much-much smarter when using all the existing tools at its disposal including Assault Shuttles

Be sure to check it out and download from http://stars-in-shadow.com/forum/viewtopic.php?f=5&t=666

It will increase difficulty dramatically without resulting to "cheating" the mechanics :)

------

So in order to increase AI difficulty in a reasonable manner without breaking game mechanics, I was playing around a bit with the config files.

The lowest-hanging fruit, the way I see it are Marauders, who are too aggressive and technologically advanced for the AI to compete with

Thanks to the help of siyoa, targeted following file to reduce their handicaps:
\\Steam DIR\steamapps\common\Stars in Shadow\Lua state\raiders.lua
Reduced their resource bonuses to be below of normal AI strength:
local difficulty_to_value_curve = {
normal= function(pop) return 60+200*pop end,
}
local difficulty_to_min_psudeo = {
normal=60,
}
local difficulty_to_cost_mult = {
normal=10,
}

Adjusted their tech bonuses to match AI tech scaling:
[75] = tech_costs.early(.5),
[150] = tech_costs.early(1),
[200] = tech_costs.mid(.2),
[250] = tech_costs.mid(.7),
[300] = tech_costs.mid(.9),
[350] = tech_costs.late(.1),

Now on to the AI: It is too friendly toward the player, largely due to the favors and low border tension

Found this files as a possible cure:
\\Steam DIR\steamapps\common\Stars in Shadow\Lua state\Encounters\generic_resource_request.lua
Increased penalty for refusing help:
refused_help_issue=5
refused_help_issue=10

\\Steam DIR\steamapps\common\Stars in Shadow\Lua state\diplo_issues.lua
Uncommenting the last couple of parameters here and increasing penalty for boarder tension + reducing positive relationship effects does not work - file gets syntax error though the placeholders are there maybe from an earlier reference :(
Increased at least my planets>Their planets penalty to -20

To make AI more interesting, changed below before starting new game:
\\Steam DIR\steamapps\common\Stars in Shadow\Lua state\new_galaxy.lua
Reduced tech cost multiplier to 0.9 to keep AI tech progress fun
Resource multiplier to 1.5 (AI is loosing ships left and right so is not noticeable by the player unless over 200%)
Ship cost multiplier to 0.9 as it seems to lead to odd ship building behaviour)

To make things a bit more easy on the AI, using small maps with 5 players, and set habitable planet count and pirate raid chance to minimal
Another successful scenario is to go bit: around 170 systems and 7 empires. This will leave the AI plenty of room to expand and build up (it will not be hampered by Raiders due to the above settings).

With the above, the AI managed to expand and build fleets quite early on, and their fleets seem to be balanced in their composition.

Next: would be nice to have an influence cost included in the soft resource request rejection, so that the AI gets angrier faster.
Has anyone an idea if this can be coded into for example the below file?:
\\Steam DIR\steamapps\common\Stars in Shadow\Lua state\Encounters\generic_resource_request.lua
Last edited by zolobolo on Sat Apr 07, 2018 7:16 am, edited 11 times in total.
User avatar
siyoa
Posts: 182
Joined: Fri Apr 21, 2017 3:19 pm

Re: Modding to increase difficulty

Post by siyoa »

just curious (I didn't have a chance to try it myself), how these changes turned out ?
How did YOU get a key? All right, go in.
zolobolo
Posts: 1544
Joined: Fri Nov 25, 2016 3:49 pm

Re: Modding to increase difficulty

Post by zolobolo »

siyoa wrote:just curious (I didn't have a chance to try it myself), how these changes turned out ?

Played a couple of maps with these settings and they were working as expected:
- Marauders were still everywhere on the map, but with smaller and less advanced fleets
. AI was definitively more fun, and actually had fleets this time around
- Also found that the mixture of AI ships has improved

Did some repeated testing on tiny maps with around 12 systems and an enemy with the same race as mine and found these matches quite enjoyable. If the AI was a tad smarter, it would have beaten me in one or two occasions.

Only thing I am still really missing is that the AI is more aggressive in diplomacy. Still need to declare war on them to get the ball rolling, but after that it is fun on the bun :)
zolobolo
Posts: 1544
Joined: Fri Nov 25, 2016 3:49 pm

Re: Modding to increase difficulty

Post by zolobolo »

Just finished my first game when I have lost against the AI :)

The AI is much fun with these adjustments on 1:1 in small map, but tried medium with only 3 civs and boy they were frisky :)

Played with Gremak against Ashdar Colonials and Imperials
Made a couple of mistakes by not building up my fleet (overconfidence) and colonizing deep into enemy range (the same reason)

Colonials declared war on me! And attacked with slightly better tech and more ships - I could still put up a fight and had some chance to maybe win if I played my cards right but I haven't and lost. Best game so far :)
Uncle_Joe
Posts: 44
Joined: Wed Jul 19, 2017 10:55 pm

Re: Modding to increase difficulty

Post by Uncle_Joe »

Hi, I'm trying to duplicate your modding effort but I'm not even able to locate the raiders.lua file at the indicated location (or indeed, anywhere on my PC).

I'm assuming some of the file structure might have changed since April?

Do you know what files to mod to make these changes at this point?

Thanks in advance!
zolobolo
Posts: 1544
Joined: Fri Nov 25, 2016 3:49 pm

Re: Modding to increase difficulty

Post by zolobolo »

Uncle_Joe wrote:Hi, I'm trying to duplicate your modding effort but I'm not even able to locate the raiders.lua file at the indicated location (or indeed, anywhere on my PC).

I'm assuming some of the file structure might have changed since April?

Do you know what files to mod to make these changes at this point?

Thanks in advance!


I am using the Steam version are you using the download client?

The files themselfes I can also not find per default, searching for them in windows explorer "Lua State" folder
Marauders are the largest penalty on the AI followed by Pirate raids, so make sure to downsccale these two (Pirate raids can be set to minimal probabilit in the new game setup menu

All the changes are listed in my first post of this thread

Hope this helps
Cheers
Uncle_Joe
Posts: 44
Joined: Wed Jul 19, 2017 10:55 pm

Re: Modding to increase difficulty

Post by Uncle_Joe »

Found them, thanks! All modded up and fired up my first game (Ashdar Colonials). Will let you know how it goes.

Thanks again!
zolobolo
Posts: 1544
Joined: Fri Nov 25, 2016 3:49 pm

Re: Modding to increase difficulty

Post by zolobolo »

Uncle_Joe wrote:Found them, thanks! All modded up and fired up my first game (Ashdar Colonials). Will let you know how it goes.

Thanks again!

Go man go! :)

If you are happy with the results in a 1:1 map with around 20 stars, suggest you jump into a game with 7 empires and 170 star systems.
Juts trying out the setting on such a large constellation and it is promising. The AI has now territory to expand to and produces fleets in satisfactory numbers without them being ridiculously modern so just the right mixture for some fun battling
zolobolo
Posts: 1544
Joined: Fri Nov 25, 2016 3:49 pm

Re: Modding to increase difficulty

Post by zolobolo »

AI kicks a** now: Testing with 7 players and 170 stars, declared war on Yoral and Imperials on my two flanks. Both empires managed to build up colonies and fleet well without considerably surpassing me technologically so make for interesting fight

Here the save of the turning point:
https://www.dropbox.com/s/n2m9m13hf1wzt ... g.rar?dl=0

At this point, the game can go either ways (my mineral reserves are depleted, lots of slaves everywhere and large combined fleets are attacking), it all depends on the decisions of the player - so perfect :)

Only place where I needed to kick off this situation was to declare war on both empires directly and myself. Even though Yoral had a bad relation with me, was much stronger and was waging war on Phidi and Orthin, it left me hanging :(

A bit of diplomatic aggressiveness tweaking and we are there though :)
Uncle_Joe
Posts: 44
Joined: Wed Jul 19, 2017 10:55 pm

Re: Modding to increase difficulty

Post by Uncle_Joe »

I'm still in my first game as the Ashdar Colonials and I'm in about an even war with Yoral. They are clearly more teched than I am (despite me making it a focus lol) but I'm within shouting distance enough to keep it interesting.

Thanks again for the suggested tweaks! Will report back in later...
zolobolo
Posts: 1544
Joined: Fri Nov 25, 2016 3:49 pm

Re: Modding to increase difficulty

Post by zolobolo »

Uncle_Joe wrote:I'm still in my first game as the Ashdar Colonials and I'm in about an even war with Yoral. They are clearly more teched than I am (despite me making it a focus lol) but I'm within shouting distance enough to keep it interesting.

Thanks again for the suggested tweaks! Will report back in later...


Can you see if their tech advantage is limited to ship components?
With these settings they should not get a huge jump on you here are some possible explanations:
- They have 3-4X the pop and colonies like you do
- They did not research more advanced buildings (you can see this when selecting their colonies and checking out their improvements)
- Your tech research has been slow for some reason: consider if your laboratories are working efficiently (clicking on hem shows if they do, and hovering over the a new lab you can see how much pop is needed for full capacity. Also consider prioritizing tech that you actually use, and do not neglect the lab upgrade tech

One more thing: When playing on large galaxies, do not forget to set the speed to Epic so that low-level tech does not get useless as everyone would already pass that level till the point they first meet and conduct combat
Uncle_Joe
Posts: 44
Joined: Wed Jul 19, 2017 10:55 pm

Re: Modding to increase difficulty

Post by Uncle_Joe »

I'm playing a Normal size map (50 stars) with the default number of players (5?). I left it on the default speed (not Epic), but I did reduce Pirates to the minimum.

Overall, it's been a really good game. The AI tends to make way too many Scout/Exploration vessels though (last battle was vs 2 Dreadnoughts and like 30 Exporation Vessels lol). They can fight OK, but they'd be better of cranking out traditional warships I would think...

Tech is leveling off with most of us having the majority of the later tech. I think the earlier tech lead from the AIs was a product of their super-quick expansion with the modded settings. The Yoral had 38 planets when I was still at 19 or so (and I wasn't being slow about it lol). I'm still behind the leader (Gremak now) in terms of planets and population, but our techs seem roughly equivalent.

The Gremak seem like they'll be a 'run-away leader' this game. They have at least double what anyone else has and the power seems to scale linearly so I'm not sure how I'll be able to overtake them. I imagine the tech tree will be long completed before I can begin to make a dent in their holdings lol. I'm still dealing with the remnants of the other AIs while the Gremak were safely in a corner and expanded/conquered out from there.

Was a lot of fun though and definitely more difficult than the standard (non-modded) game. Fleet sizes are significantly bigger leading to far more interesting battles. I think next game I'm going to try Sparse planets to try and slow the mix down a bit.
zolobolo
Posts: 1544
Joined: Fri Nov 25, 2016 3:49 pm

Re: Modding to increase difficulty

Post by zolobolo »

Uncle_Joe wrote:I'm playing a Normal size map (50 stars) with the default number of players (5?). I left it on the default speed (not Epic), but I did reduce Pirates to the minimum.

Overall, it's been a really good game. The AI tends to make way too many Scout/Exploration vessels though (last battle was vs 2 Dreadnoughts and like 30 Exporation Vessels lol). They can fight OK, but they'd be better of cranking out traditional warships I would think...

Tech is leveling off with most of us having the majority of the later tech. I think the earlier tech lead from the AIs was a product of their super-quick expansion with the modded settings. The Yoral had 38 planets when I was still at 19 or so (and I wasn't being slow about it lol). I'm still behind the leader (Gremak now) in terms of planets and population, but our techs seem roughly equivalent.

The Gremak seem like they'll be a 'run-away leader' this game. They have at least double what anyone else has and the power seems to scale linearly so I'm not sure how I'll be able to overtake them. I imagine the tech tree will be long completed before I can begin to make a dent in their holdings lol. I'm still dealing with the remnants of the other AIs while the Gremak were safely in a corner and expanded/conquered out from there.

Was a lot of fun though and definitely more difficult than the standard (non-modded) game. Fleet sizes are significantly bigger leading to far more interesting battles. I think next game I'm going to try Sparse planets to try and slow the mix down a bit.


Thanks for the feedback, sound like a good game indeed :)

Did you need to declare war on the other empires yourself?
Did you see Gremak enslave its conquered pops?

Yoral are super expansionists due to their perks (production and ships).

If you want to enjoy the early tech as well, you need to go to Epic speed.

To make thing interesting we might experiment giving the Marauders some of their fangs back. If you go for sparse system, there will be much less planets in their range... so in theory they would not cause that much trouble to the AI, but beware, when I was trying this out, they still kicked them in the hynie on the original settings (they were just to over-teched)
Uncle_Joe
Posts: 44
Joined: Wed Jul 19, 2017 10:55 pm

Re: Modding to increase difficulty

Post by Uncle_Joe »

I did declare on the Yoral first (we both arrived a system on the same turn and I decided to kick them out).

The Orthin declared on me when I was gearing up to attack the Ashdar Imperials. We've each scrubbed a few of the other's colonies but we are a stalemate while the Gremak seem to be running away with it on the other side lol.

I haven't seen much of the Gremak. I just know they have twice the votes and planets/pop of everyone else from the Diplo screen.

One of the other AI issues is that it loves to be at war with everyone lol. The Orthin were at war with the Gremak (and presumably losing) when they DoW'ed me. I imagine they'll collapse pretty quickly now since I smacked down their main fleet on my side of the galaxy.

The Ashdar Imperials seem content to sit it out on the far east side of the galaxy (they got boxed in by me and the Yoral). They are just in their corner building up substantial fleet but so far haven't decided to use it.

The Yoral are now extinct (again, multi-front war against the Gremak, the Orthin, and later me...although it was me that initiated it).
Uncle_Joe
Posts: 44
Joined: Wed Jul 19, 2017 10:55 pm

Re: Modding to increase difficulty

Post by Uncle_Joe »

I finally gave up on my Ashdar Colonials game. By the time I had consolidated my area, the Gremak had completely taken more than half the map (Orthin folded) and I was still mopping up the Ashdar Imperials.

I made peace with the Imperials and declared on the Gremak (they were dangerously close to winning a vote so I wanted to reduce some of their colonies). We fought back and forth for a while but they Stealth thing just made it impossible. I never got more than 1 turn's warning of when they would hit and they had massed BBs and BCs which required major fleets to defeat. We traded colonies for a while but in the end, I simply couldn't mass up where I needed to due to the stealth.

Is there anything that defeats the stealth and lets you see them coming from farther out? If not, I'd call that a potential game screw (especially if MP capability is ever added).

I tweaked a few things in the mod and fired up a new game (still Ashdar Colonials so I had a basis for comparison). AIs were very aggressive and DoW'ed me repeatedly. I eventually ended up over my head against the Yoral (after having fought multiple wars against the Imperials and the Orthin). But that was the best game yet with lots of early skirmish and combined arms fleets. I had cranked the tech cost to 1.2 so it wasn't quite at Epic, but it made the early game far more interesting.

Looking forward to trying again. Will play the Humans next to see if I have any chance with them using the modded settings. ;)

Thanks again for your modding efforts!
Post Reply