Jump to content

Scripted AI Discussion


Recommended Posts

Any discussion about the scripted AI should take place here, to make things manageable for me Ive only allowed 4 testers so far (I don't want 20 emails all telling me this and this doesn't work whenever I turn off a feature for testing). Not that it looked like 20 people where interested in testing it though  :P.

If anyone else wants to join in I might accept a person or two, but not more, to make things easier for me I closed down the application thread so you'll have to let me know in this thread, no PMs please.


Ill start off the discussion by telling everyone why I'm doing this and what my goals are.


I'm doing this because the stock HW2 AI sucks.

It builds oddly and unpredictably, it doesn't check if it can actually afford something before building it, it has stupid "counter building" that is unrealistic and can lead to very poorly balanced fleets, it doesn't work well with some features of warlords because of how rigid its system is, its only military tactic is to attack your mothership, warlords ships cant be hyperspaced (not that *I* would want that though) and its horribly unreliable and can break down seemingly for no reason.


I want an AI that can:

Take and hold areas of space, sending reinforcements to help the most attacked areas.

Defend its harvesting operations in facilities mode.

Only build factories it will actually use.

Build from simpler lists and make sure it can afford something before building.

Dock fighters when they get damaged.

Dock capitalships with yards or special drydocks that only repair (been bugging eville for this for a while now).

Kick your butt without cheating (this will likely never happen).


I don't think this is going to happen over night, I also work on the fightermod and have a lot of things I want to improve there (not to mention a real life), and these things tend to take time.


Currently the beta of the scripted AI only function with a new gametype I designed, its called "capture the points" and works like this:


-You build from a build buoy just like reinf mode.

-You get RUs from injections just like reinf mode.

-You win by taking and holding points on the map (bet you didn't see that one coming).


I really prefer reinf mode to facilities but Ive always been bugged by the lack of "game" in regular reinf mode, I needed a reason to get out of the starting location and actually do stuff on the map, with this mode I have that. The AI only works with this gametype atm and most likely for a long time, getting it to work with regular reinf mode wound not be too hard though, so I might do that if there is demand for it.

Link to comment
Share on other sites

well to help lower the emails i will also post feedback here if you don't mind



so after 5 games of playing i noticed only some slight problems with the ai


-when ships form the ai reach one of the points they don't move to engage threats even when under fire. this gets really anotying with fighters but not so much other ships.

-the ai doesn't seem to be active if certain teams are involved or if its higher that a 1v1 to much.

-i got some weird error saying the ai had crashed and wouldn't work right when i was in game on one of the random maps.


now for positives i got

- i really love how the ai uses units effectively when taking points form the player. like how capital ships will be long range support fighters and corvettes will rush in and  frigates will flank.



things for the future

-i think the ai should bring in stations after points are secure to hold them and free up capital ships.

-points should be objects so people can see them without going to sencors.



so far so good id say  ;)

Link to comment
Share on other sites

- Im going to increase the size of the volume of space around the points that the AI will defend, I dont want them chasing after your ships once you get too far away though, but it needs tweaking yes.

-It only has buildlists for rebs and imps, anything other than that will not build anything. I have run it with several AI players, so that works, but alliances do not, or rather the AIs will treat its allies like everyone else.

-Im assuming you mean the ingame message telling you the AI has errored and will not function properly, Ive heard this from other testers as well, and I will look into it, its basicly a crash in the AI, I'll paste in the explanation I gave in the feedback email, incase someone is wondering.


This message is not supposed to show up, EVER. If it did then a really bad bug occured and the AI most likely will not function properly afterwards, you could compare this to a hang or crash in a regular game, its not supposed to ever happen and it will kill your game (most likely).

Comparing it to a hang is actualy very accurate, it happens when the AI has found ships in its fleet that isnt assigned to do anything, it goes into a loop to try and put them into point-defending fleets but if it runs the loop 10 times without actualy acomplishing anything and there are STILL unassigned ships in its fleet it will drop out of the loop (other games might not have this feature and simply keep looping, a classic "hang") and display the error. If this happens, save the game and send the save file and the log file (hw2.log in the bin\release folder) to me.



As for the positive, thanks but that is really evilles work, my AI just attacks, his attackscripts do the rest.


Having it put stations on captured points is high on my todo list, I would like eville to add something below the XQ1 in price though, its rather steep if your not playing with loads of injections.

I dont want to change anything on the maps, Ive tried to put the points on stuff already there but on some maps thats not possible, I might do special maps like the big earth map (this mode needs bigger maps anyway, or rather warlords needs bigger maps anyway...) but its not high on the todo list, I might have the gametype spawn buoys on the point though, that could work.


Thanks for the feedback, I'll be sending out a new version once I find the cause of the AI "hang".

Link to comment
Share on other sites

  • SWR Staff - Executive

I've always felt that the points should be key things like stations or resourcing points (the script could spawn the stations at the beginning or something so the map doesn't need changing) and the stations could be set to give the player some advantage (like calling in more ships or increased refining)


what type of platforms would you suggest? its a big jump from the stuff like the heavy launcher and perimeter defense platforms to the XQ I agree, just need some suggestions, if it is civilian platforms I can do those at least in a simple fashion

Link to comment
Share on other sites

The points are supposed to represent areas of strategic inportance that your superiors want you to capture, in most RTSs the game gets easier the more of the map you control, but I wanted the opposite in this gametype so I dont want the points to actualy give you anything besides bringing you closer to winning.

Most RTSs tend to use resource gathering as the incentive to take and hold areas on the map, this often means the game becomes easier the more of the map you control. This in turn often leads to knowing that youve won half-way into the game, the rest is just mopping up, I hate that.

So, in an effort to avoid that I invented the capture the points system, it actualy gets harder the more of the map your controlling, self-regulating difficulty if you will, the incentive to take points is that it will help you win, makes for a more fun match imo.


Thats only half the reason though, not having to worry about resourcing while designing the AI makes it so much easier.


Some type of civilian station that can dock a fightersquad and has a handfull of lasers and TLs, nothing fancy maybe in the 30-40k range.

An alternative would be a simpler XQ1 similar platform (I belive there where a couple of those in TIE-fighter) just give it fewer guns, less hitpoints and fewer fighters.

Link to comment
Share on other sites

I know in EAW, there are small platforms in some maps in space...maybe you guys could design something similar?

Here is my suggestion: the player builds a platform at his shipyards and then hyperspaces it to a capture point (provided friendlies are near, or some condition that prevents the player from just hyperspacing stations all over the map). The platform then serves as a forward observation base, creating a large area of revealed space, like a probe, it creates a small RU injection (maybe 1000 every minute or something), has decent antifighter weaponry, poor capital/frigate firepower, but heavy shielding. This way, the AI may be more interested in capturing the station rather than blowing it up (and it gives some purpose to the Galofree tranport and Assault Shuttles :P) The design of the platform could be the old Imperial Research facility that was in version .40. Maybe the Station could also be a production facility for fighters.

Edited by chrlsthgreat
Link to comment
Share on other sites

I was also thinking if you add stations as points to make them diffrent things that the player can't normaly build.


-like the eaw mercenary stations were you can build some unique ships.

-heres one form xwa if you want to add a moving point to one map.  you could have a point that was the unarmed imp droid contorl ship and you could build the ties like the tie bomb and the tie with one wing and a turbolaser.

- i also think it would be cool if there were a few points that were farther form the main battle that could be unique structures like the orbital guns form jedi starfighter.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Copyright (c) 1999-2022 by SWRebellion Community - All logos and trademarks in this site are property of their respective owner. The comments are property of their posters. Star Wars(TM) is a registered trademark of LucasFilm, Ltd. We are not affiliated with LucasFilm or Walt Disney. This is a fan site and online gaming community (non-profit). Powered by Invision Community

  • Create New...