Limits on AI Ship Building?

This forum is for outdated or irrelevant Modding Information that may or may not be 3 months old.

Moderator: thunderchero

Post Reply
User avatar
LoneCrusader
Cadet 2nd Year
Cadet 2nd Year
Posts: 6
Joined: Fri May 06, 2011 2:00 am

Limits on AI Ship Building?

Post by LoneCrusader »

Hello everyone, I hope some of you may be able to answer some questions for me.

I have played BOTF off and on since its release, but only recently discovered all of the wonderful tools and information here. Excellent site!

I have downloaded the Main Multi Installer and installed the Error Correction Mod (with Large Galaxy), and I have been using it as a base for some changes I wanted to make.

1. Does the AI have to pay full "Maintenance" costs on its ships?
It seems the AI has no shortage of ships, it doesn't always use them intelligently, but if I made that many I would be in negative credits...

2. Is there any way to limit the number of a specific type of ship that can be built?
Basis for this being that there are most likely not "hundreds" of Sovereign dreadnoughts running around the galaxy, in TOS there were only 12 Constitution class ships at that time.

3. What is the maximum number of ships that can be involved in a single battle?
I ended up with a battle so large that it crashes the game.


Thanks in advance!
User avatar
Peter1981
Rear-Admiral
Rear-Admiral
Posts: 1118
Joined: Tue May 06, 2008 2:00 am
Location: England

Post by Peter1981 »

1. AI gets various (cheats) bonuses depending on difficulty. This is why the AI is really bad -- it's not cleaver it's just rich. SCT had some ideas on improving this.

2. 'Yes' but you'll need to learn how to enable this yourself. Have a look at the modding index's 'how to's'.

2. 'No' your asking for a huge code rewrite that no-one here has time to get into on your behalf. (Sorry that wasn't meant to sound harsh.)

3. IIRC it has something to do with polygon verticies. So it depends on the number and type of ships.

Sorry for not being really helpful,
User avatar
LoneCrusader
Cadet 2nd Year
Cadet 2nd Year
Posts: 6
Joined: Fri May 06, 2011 2:00 am

Post by LoneCrusader »

Thanks for your response Peter.

Regarding #1 and #3, I had assumed that the AI couldn't possibly be paying full maintenance costs for it's ships, so I edited the maintenance costs of all ships to 1 (didn't know if 0 would be a "valid" entry) so that I would be able to produce a comparable fleet. The battle that ensued consisted of 237 Warbirds/Cruisers and 1 Scout vs. a mixture of 295 Ferengi ships. The game crashes immediately with this battle, whether one tries to "Fight" it or click "Auto" either one. If it is of any assistance, here is the crash log produced:

Code: Select all

ST:BOF Fri May 20 03:18:15 2011

Version Under Test: 72
File: tcmath\tcmath.c, Line: 576, REAL_GE_ZERO(amount) && REAL_LE(amount,1.0)
Initialize State: 31
Player Empire: 4	Starting Seed: 1305764150
Galaxy shape: 1	Galaxy Size: 2
Turn State: 20
Turn Number: 326
With the Maintenance cost changes, it is possible to make a comparable fleet of ships, but if the game is going to crash when they meet, then it renders the game unplayable. Also, needless to say with this many ships, one bombardment on a system results in "All life destroyed" - extremely irritating if they decide to bomb one of my minor race systems.


#2 was just an idea that I had to control this behavior, if it can be done, great, if it can't, I understand that. I wasn't "asking" anyone for anything, other than answers :wink:
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 896
Joined: Sun Apr 27, 2008 2:00 am

Post by Spocks-cuddly-tribble »

Basically Peter1981 is correct.


1.) AI pays full ship support cost and gets no bonus to pop support (i.e. there is no AI cheat in sub_45FAC0). Pop Support, Ground Combat, Orbital Batteries, Credit Output

But income cheats compensate for this: Tweaking AI & Difficulty Level -> Solution: On difficulty level 1 AI has no bonuses.

2.) Nice idea, technically possible, but it's going to be alot of work.

3.) Interesting question, not that we know of (but I don't remember 500+ ships battles).

LoneCrusader wrote:It seems the AI has no shortage of ships (...) but if I made that many I would be in negative credits... (...) so that I would be able to produce a comparable fleet. (..) With the Maintenance cost changes, it is possible to make a comparable fleet of ships, but if the game is going to crash when they meet, then it renders the game unplayable.
In fact the most AFC member complain that AI builds too less ships... (to increase your income just produce & scrap some colony ships each turn).

@ the game becoming unplayable with too much ships: Unfortunately, this is true in many respects (turn time, map-lag...).

LoneCrusader wrote:whether one tries to "Fight" it or click "Auto" either one

Code: Select all

File: tcmath\tcmath.c, Line: 576, REAL_GE_ZERO(amount) && REAL_LE(amount,1.0)
Never heard of this problem before, but sounds like a floating point issue:
Limited exponent range: results might overflow yielding infinity, or underflow yielding a subnormal number or zero. In these cases precision will be lost.
http://en.wikipedia.org/wiki/Floating_point
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
User avatar
LoneCrusader
Cadet 2nd Year
Cadet 2nd Year
Posts: 6
Joined: Fri May 06, 2011 2:00 am

Post by LoneCrusader »

Spocks-cuddly-tribble wrote: In fact the most AFC member complain that AI builds too less ships...
Interesting. With the changes I made, I had to devote all of my starting systems to ship construction to even think about keeping up with the AI ship production, and I was still behind. I compensated to some extent by building nothing but Command ships while the AI built a mixture, but groups of 100+ Fast Attack ships are not to be sneezed at.

The changes I had made are as follows:

Adjusted the ratio of Stars to Anomalies (Less Black Holes, Neutron Stars, etc)
Adjusted the ratios of Planet Environments (More Terran/Jungle/Oceanic, less others)
Edited Upper & Lower System Population limits (400 min, 600 max)

There were a few other very minor things that I know cannot be related to this, for example I increased the shields and hit points of Starbases, but the "major" changes were only what I listed above.

The game was played on Impossible difficulty on a Large Galaxy (Large Galaxy ECM) map.

Any further ideas or suggestions you all can provide will be much appreciated. Thanks guys!
User avatar
Peter1981
Rear-Admiral
Rear-Admiral
Posts: 1118
Joined: Tue May 06, 2008 2:00 am
Location: England

Post by Peter1981 »

might have something to do with the ai fight or flight battle calculation;

don't know what the theoretical maximums are but before battle the AI decides to fight or flight based on adding up its various fleets values versus it opponents. so an overflow could happen if ships are cheap enough to have to many other stats.

i don't think 'the maintenance costs of all ships to 1 ' is the best solution to your initial problem, see the topics on AI fleet build up, this would have implication by stalling the list if you implemented your second point.
JeanLucPicard1
Commander
Commander
Posts: 338
Joined: Thu May 01, 2008 2:00 am

Re: Limits on AI Ship Building?

Post by JeanLucPicard1 »

What's a good hex editor to use in order to make the changes to trek.exe? Can I use notepad++ or is there something better?
JeanLucPicard1
Commander
Commander
Posts: 338
Joined: Thu May 01, 2008 2:00 am

Re: Limits on AI Ship Building?

Post by JeanLucPicard1 »

2. Is there any way to limit the number of a specific type of ship that can be built?
Basis for this being that there are most likely not "hundreds" of Sovereign dreadnoughts running around the galaxy, in TOS there were only 12 Constitution class ships at that time.
No, but you can tweak the shiplist so that there is an upgrade for the ship type in question and lower it's tech level. Therefore, you could have the Sovereign Class available before the Galaxy Class that way the AI would only build a limited amount of Sovereign Class starships before upgrading to the Galaxy Class. After that, it wouldn't build anymore Sovereign Class though.

If you're playing the Federation and still want to be able to build the Sovereign Class, set the Galaxy Class as an upgrade for nothing and place it above the Sovereign in the shiplist.

Example:

Command Cruiser II (Galaxy) upgrade for nothing
Command Cruiser (Sovereign)

Now let's say I want the Ferengi to build the Raider for a few turns instead of the Light Raider II. I'd set the tech level for the Raider below that of the Light Raider II, and the tech level for the Raider II above the Light Raider II. However, place the Raider before the Light Raider in the shiplist. Again, afterthat the AI will specifically build the Light Raider II.

Example:

Raider-Tech lower than Light Raider II
Raider II-Highest Tech
Light Raider-Lowest Tech
Light Raider II-Tech higher than Raider
JeanLucPicard1
Commander
Commander
Posts: 338
Joined: Thu May 01, 2008 2:00 am

Re: Limits on AI Ship Building?

Post by JeanLucPicard1 »

The problem I noticed is that the AI will build hundreds of ships and try to rush you. If you survive the zerg of ships their ships are either destroyed or seem to suddenly disappear. The AI will just sit there and build very few ships or not build any at all.
User avatar
Kellir
Cadet 3rd Year
Cadet 3rd Year
Posts: 14
Joined: Mon Jan 04, 2010 3:00 am

Re: Limits on AI Ship Building?

Post by Kellir »

I noticed far less ship production when i changed the

Factory 3, 6 and 9 to needing full tech
Farms 3. 6 and 9 to needing full tech
Power 3, 6 and 9 to needing full tech

From what I can tell, this slows the AI down big time for ship production for the first 200 turns or so.
Post Reply

Return to “Modding Information Archive”