• Hello and welcome to MSFC. We are a small and close knitted community who specialises in modding the game Star Trek Armada 2 and the Fleet Operations modification, however we have an open field for discussing a number of topics including movies, real life events and everything in-between.

    Being such a close community, we do have some restrictions, including all users required to be registered before being able to post as well as all members requiring to have participated in the community for sometime before being able to download our modding files to name the main ones. This is done for both the protection of our members and to encourage new members to get involved with the community. We also require all new registrations to first be authorised by an Administrator and to also have an active and confirmed email account.

    We have a policy of fairness and a non harassment environment, with the staff quick to act on the rare occasion of when this policy is breached. Feel free to register and join our community.

Balancing the AI

at3unit3

Cadet Freshman
Joined
12 Jun 2016
Messages
24
Age
42
I need some advice on how to balance my AI I got some really great ships and stations and I like to add them to the AI and yes I know how to add them to the AI but I can't seem to get the balance right when I do the game just crashes and I have no idea where to look after I've re written all of the AI for say the Federation as an example. Added to this is my Tech Tree so you have some idea what I'm talking about.
 

Attachments

  • tech1..txt
    49.2 KB · Views: 3

kjc733

Wibble
Staff member
Site Manager
Seraphim Build Team
Master Shipwright
Joined
30 Mar 2008
Messages
2,477
Age
39
Wow, that is a lot of ships!
In all honesty, getting the AI to build all of those in is likely to be a nightmare - at the very least it's going to take time and effort to do.

Firstly, do you have a plan about how you'd like your AI fleet to unfold? I.e. have you made sure that you have a logical hierarchy tree so that the order of units off the line matches what is required in the tech tree. It's no good having the AI build fighters if the required base isn't there yet.

As for implementing it, I always start with modifying one existing AI file. I look at the ships I want to build, look at what is already in the AI file, and either replace the existing ship or replicate the line, changing only the ship name. I then copy the content of that file into the other AI files for that race so that it can only use my modified text and run a mission where I've deliberately set the fleets as far apart as possible, warp drive to off and the fog of war to off.

Here's the important bit - I then watch the AI fleet unfold. I don't play the game, I watch to see if the fleet builds units in the expected order. If it doesn't - it's usually because there's a dependency that hasn't been built yet. SO I go back to the AI file, modify it so that the dependency is there, copy it into the other AI files, and start the mission again and watch it build again.

And I do this over and over until all my ships are in and this sole AI file works correctly.

Then I start making variations in the other files, some will be fighter heavy, some will skip certain types of ships and so on and so forth. So long as the dependencies are there it should work ok.

As for game crashes - I can't say I've ever had a game crash because of an error in the AI file. Usually it just stops building or skips the unit. What I have had happen on many occasions is a crash where the AI has tried to build a ship that has an error in the odf. So again, it's a good idea to watch the AI build and see what exactly causes the crash - then check that ship odf for typos etc.

Unfortunately there is no quick and easy win in balancing an AI - it took us months on the BSG mod.
 

at3unit3

Cadet Freshman
Joined
12 Jun 2016
Messages
24
Age
42
Thank you for responding to make things a wee bit more clear. I wasn't thinking earlier I just added my Fed Defense list. I've been working on this at work for quite some time haven't added it to the game yet. When I first tried to mod this adding ships and stations was actually pretty easy using the method you recommended. What I tried to do in the past is really make each tier a bit more balanced with small, medium, and large ships. Each from both Star Trek and B5 with added ships from newer mods. some took some didn't. The one area I tried fixing was its defensive side IE more bases and turrets to make it harder for my ships to penetrate. I do so often make fleets that might have matched the Fleet we've either seen in B5 or the last Episode of Star Trek DS9. So I'd tried to break up say the first tier with Star base and Spacedocks with ships being built in between and when I start the game more time then not either the game just would load or if it did nothing happen.
 

Attachments

  • federation_defensive_txt.txt
    17.7 KB · Views: 3

Rifraf

I know just enough to be a danger to myself
Joined
25 Aug 2013
Messages
1,206
Age
51
Just so we know you've tested everything, you can play as the Federation and build every ship and station yourself and they'll fight/research/blow up without any crashes?

If that's the case then at least we know for fact it's none of your individual ship/station files. I didn't notice any glaring issues with your fed buildlist or techtree files either. You said above that more times than not the game just would load (sic) or if it did nothing happen. Does this mean sometimes it loads and sometimes it doesn't?

If it does load does everything work? Did you change something after it loaded that time to make it not load the next time?
 

at3unit3

Cadet Freshman
Joined
12 Jun 2016
Messages
24
Age
42
That has been the hard part of it all nothing glaring was popping out so. It looks as if it should work I was hoping someone would see something I was missing.
 

Terra_Inc

MSFC's Cheshire Cat
Staff member
Site Manager
Necromancer/Troll hunter
Kitten Commander
Joined
16 Dec 2009
Messages
3,121
Age
34
I'll try to help, since I've worked with the AI quite a bit before. But first, you need to fix your crashes. Modder's rule number one: Fix your crashes first, otherwise it's only going to get worse.

First of all, the AI usually doesn't cause the game to crash. The AI just follows the build list - if there is no valid producer for something it's supposed to build, it'll just get stuck. Any crashes you might be experiencing are most likely due to ODF errors in ships or stations you've added to your game.

Here's what you can do to fix your crashes: you can try checking whether A2 correctly loads all your units' files and the files they refer to. The most common mistakes are made when adding ship and station ODFs, so that is what you should be checking for. I'll give you my standard debug procedure, which can help to find the most common causes for crashes.

1) Try building every one of your ships/stations once. (This checks whether the ship/station ODF is working correctly.)
2) Try shooting at something with them, if they have weapons. (This checks whether the ship ODF refers to correct and working weapon ODFs.)
3) If an object can build other objects, make sure it can build all of them without crashing. (This checks whether the build list is okay.)
4) Blow them up. (This checks whether the ship/station ODF refers to valid explosions.)

This is obviously easier if you use the map editor, so that's what I do. If you find a ship or station that crashes, you can post the respective ODF here and I'll try to help you find the error.
 

at3unit3

Cadet Freshman
Joined
12 Jun 2016
Messages
24
Age
42
Thank you, believe it or not I do. actually do most of that before I even load a ship or station, map editor is great in getting a ship or station working perfectly even if I have to change say weapons around. I will most definitely use these suggestions.
 

Archonon

Master Chief Petty Officer of Starfleet
Joined
13 Aug 2016
Messages
539
Age
46
As someone that heavily mods the game, I can tell you that I've been where you are. Usually, as others have mentioned, my problems have been in the odfs.

The main culprit is almost always a " for me. Either one is missing or it's placed in an incorrect manner. IE:

"USS Enterprise

Instead it should say: "USS Enterprise"

This can be true of any weapons, physics or any other file that a ship/station odf is connected to, if not a ship/station itself. From the description to hardpoints to names or custom sound, any misplaced " will immediately cause the game to crash.

Have you noticed any specific moment when the game crashes? Is it right as you are booting up? After a specific time that you should be expecting certain kinds of ships being built?

If you can boot up the game and play a while and you know your AI is building Galaxy classes and they show up ingame but shortly after there is a crash, then the culprit may be something that comes after the Galaxy, as an example. If it crashes on startup, take a look at your starting units.

I'm sorry I can't be of much more help, but some things to take a look at if you've not already done so.
 

at3unit3

Cadet Freshman
Joined
12 Jun 2016
Messages
24
Age
42
It would crash on start up, or it would hang and not advance. When I remove the modded AI the game would start back up.
 

Archonon

Master Chief Petty Officer of Starfleet
Joined
13 Aug 2016
Messages
539
Age
46
Ok so if it would crash on start up (While you are loading the game) then it is one of the starting units for the races you are choosing, a starbase, a construction ship, scout, etc.

I believe the freeze on load is the result of the same thing, but I'm not entirely sure, it's been a while since I've modded A2 (Since 2003) lol.

But I remember this happening to me a lot when I added a new race/ship/gui/etc.

So you need to check your starting units, your race odf. the gui.global, basically anything you modified that immediately is used when you first boot up a game. It likely is a missing " somewhere.
 
Top