Jump to content
Tomcattwo

X-Wing AI 2nd Edition - For Solo Play - HotAC+FGA AI Added!

Recommended Posts

Major Update: AI for HotAC and Flight Group Alpha (FGA) Campaigns Now Available!

Fellow pilots: At the request of Hipsu and Wolfshead, I completed the task of adding all 19 additional ships from the Flight Group Alpha Imperial Cooperative Campaign to the 8 Empire ships from the HotAC AI (both use the same AI methodology) and uploaded the new version x-wing-ai.com .The outstanding HotAC AI data (hard copy version) from the Imperial AI cards v 2.07.04 created by Claes Sorrenson and the Alpha Flight Group for HotAC 2nd Edition, as well as the 19 NEW AI cards from the Flight Group Alpha campaign (also by Claes and the FGA Team) have been faithfully replicated in a web- based version for your use in playing HotAC OR Flight Group Alpha alone or with your fellow pilots on the table-top.

The HotAC+FGA AI now contains "HotAC Rules" AI for the following 27 ships:

  • Empire: TIE Fighter, TIE Interceptor, TIE Advanced x1, TIE Bomber, TIE Defender, TIE Phantom, Lambda Shuttle, Devastator
  • Rebel: Z-95 Headhunter, T-65 X-Wing, BTL-A-4 Y-Wing, RZ-1A A-Wing, A/SF-01 B-Wing, YT-2400, YT-1300, VCX-100 Ghost
  • Scum: Z-95 Headhunter (Scum), BTL-A-4 Y-Wing (Scum), M3A Interceptor, Kihraxz Fighter, StarViper, Fang Fighter, HWK-290, Firespray, Mod TIE Fighter (Mining Guild)
  • First Order: TIE FO Fighter, TIE Special Forces Fighter

Note: You don't have to be playing HotAC or FGA to use this AI for your own solo battles! You can use this app to provide AI using the best solo AI available today (HotAC AI) for any of the above 27 ships. 

The web application does all the dice rolling for you for AI ship maneuvers, Decloaking and Hyperspace Maneuvers per HotAC+FGA rules. It also lists the prioritized activities in each phase that you will use for decision-making for each AI ship, in an easy-to-see and use web-based format. The Help page ("?" icon) will explain how to use the HotAC+FGA AI to run your AI ships for each battle. The "Ships" page ("ship" icon) provides a detailed breakdown of each AI ship and all of its target, action and attack priorities plus all maneuvers in the maneuver tables. I also included additional functionality such as "Flee" tables and Hyperspace Maneuvers, reroll capability, enemy moved/not moved prioritization and symbology, better user feedback when selecting a sector, and other enhancements and fixes (Thanks to Hipsu for playtesting and enhancement recommendations). 

Here is a screen shot of the HotAC+FGA AI 2nd Edition "Main Page":

HotAC_FGA_200623.jpg

You can still use x-wing AI 2nd Edition or x-wing AI 1st Edition for your table-top solo play, just as before.  You can easily switch AI versions using the "AI" icons on the top-right part of the web page. 

As always, x-wing-ai is free to use and no advertising banners. You can also download a stand-alone version in a .zip file for your use off-line here or download it from the info page ("i" icon) or Help page ("?" icon) of the x-wing-ai.com HotAC+FGA AI webpage, or you can use the AI(s) directly from the x-wing-ai.com website.

If you are running a HotAC or FGA campaign or just flying tabletop solo at home, give it a try!

Regards,

Tomcattwo

 

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Major Update: x-wing-AI for Heroes of the Aturi Cluster (HotAC) 2nd Edition, v 2.07.04

Fellow pilots: I have just uploaded a new version of x-wing-ai to x-wing-ai.com which now includes AI for Heroes of the Aturi Cluster (HotAC), using the 2nd edition update created by Shaun Tiernan from Josh Derkson's original 1st edition Rebel campaign. The outstanding HotAC AI data (hard copy version) from the Imperial AI cards v 2.07.04 created by Claes Sorrenson and the Alpha Flight Group for HotAC 2nd Edition have been faithfully replicated in a web- based version for your use in playing HotAC alone or with your fellow pilots on the table-top.

The web application does all the dice rolling for you for AI ship maneuvers. It also lists the prioritized activities in each phase that you will use for decision-making for each of the Empire's eight AI ship types used in the campaign, in an easy-to-see and use web-based format. The Help page ("?" icon) will explain how to use the HotAC AI to run your HotAC Empire AI ships for each battle. The "Ships" page ("ship" icon) provides a detailed breakdown of each Empire AI ship and all of its maneuvers in the maneuver tables.

Here is a screen shot of the HotAC AI 2nd Edition "Main Page":

 

x-wing-ai_HotAC.jpg

 

On the HotAC 2nd Edition AI Main Page, during the AI's Activation Phase, you select a "Target Ship" for the AI using the priorities listed under "Select Target", then click on one of the 9 "Active" sectors in the "Aiming Reticle" diagram where the Target Ship is in relation to the AI. That click will populate the AI Maneuver section with allowable maneuvers for 4 conditions (R1/R2Closing, R2Fleeing/R3, R4+ or AI Stressed), per the HotAC Campaign rules. You select the maneuver that corresponds to the Target Ship's range from the AI ship, and then execute the AI's movement on the table-top per the HotAC Campaign rules and X-Wing 2nd Edition rules. 

Actions for the AI are prioritized in the "Action Selection" list for the selected ship. Based on those priorities, you select and conduct the AI's action(s). 

For the Engagement Phase, you select the AI's "Attack Target" (which might or might not be the same target as the "Target Ship") using the priorities listed in the "Attack Priorities" section for each ship, and execute the attack per the HotAC Campaign rules and X-Wing 2nd Edition rules.

Any End Phase or System Phase AI ship activities are also shown.

You can still use x-wing AI 2nd Edition or x-wing AI 1st Edition for your table-top solo play, just as before.  You can easily switch AI versions using the "AI" icons on the top-right part of the web page. 

As always, x-wing-ai is free to use. You can also download a stand-alone version in a .zip file for your use off-line here or download it from the info page ("i" icon) or Help page ("?" icon) of the x-wing-ai.com HotAC AI webpage, or you can use the AI(s) directly from the x-wing-ai.com website.

Shaun's version of HoTAC 2nd Edition is the same version that has been uploaded to Vassal. The "uploaded to Vassal" post (and the HotAC info and help pages) includes a link to Shaun's HotAC 2nd Edition Campaign (ver 2.07.04) files, in case you don't yet have HotAC. 

If you are starting or running a HotAC campaign, give it a try! Rebels, stand strong in the Aturi Cluster - the Rebellion is counting on you!

Regards,

Tomcattwo

 

---------------------------------------------------------------------------------------------------------------------------------------------------------------------

Update to version 2.0.2!

After a long hiatus, I have finally done an update to X-Wing AI2. This was a big update that includes:

1) Added 2nd Edition new waves 4, 5, 6, and 7 ships

2) Added Gozanti class and C-ROC Cruisers (with faction variants)

3) Completely changed how the AI reads and determines AI actions for all ships (the original version could only accommodate 31 unique actions; this update removes that restriction and adds a number of new actions). This required some major code overhaul in the AI and generation files (python and JavaScript) and updates for every ship file (85 ships/variants)

4) Minor aesthetic changes (Capitalized factions, added tooltips for all icons, cleaned up the presentation and updated the info and help pages a bit).

The update has made for a better app. See below for basic instructions on how to use it.

Give it a try at http://www.x-wing-ai.com, or you can download a zip file of the app for use even when you are off-line (works in any browser except Internet Explorer - it does work in edge, chrome, opera, Firefox, safari, and android internet apps).

Regards,

Tomcattwo

-------------------------------------------------------------------------------------------------------------------------------------------------------------------

Original post:

Fellow X-Wing Pilots,
I ran across Wyzbang's outstanding work creating xwing_ai a month or so ago when I started playing the X-Wing Miniatures Game. I like to play solo, and I decided I would modify his AI under the Open Creative License that he published xwing_ai under ( Creative Commons License 3.0 ) to update the ai to X-Wing Second Edition Rules. I have done so. 

xwing_ai2 allows you to play solo using your tabletop models on your playmat. The AI will provide reasonable semi-random moves depending on the aspect (range, location in a 360 circle and closing/opening orientation), of your ships to the AI ship. It's a simple web-based interface. To use it:

Setup game per standard 2nd Edition rules, choosing any squadrons and or missions.

For each AI controlled ship, instead of setting a dial, you'll use the AI to determine each AI ship's movement during the Activation phase.

  1. Click on the faction of the the AI controlled ship
  2. Click on the ship type for the AI controlled ship
  3. Pick a target (human-controlled) ship for the AI ship to consider/react to
  4. Click on the location on the targeting ring that matches the direction of target (human-controlled) ship
  5. Move the AI ship using the displayed maneuver for the proper condition (target is closing, retreating, out-of-range or the AI is stressed)
  6. Choose an Action for the AI ship. The AI shows available standard actions for that ship.
  7. Carry out attack(s) for the AI ship
  8. Complete round per standard 2nd Edition rules.

xwing_ai2 includes:
1) A complete update to X-Wing 2nd Edition Rules, including all ships, and factions, 2nd Ed maneuver dials, and 2nd edition actions
2) The ability to switch back and forth from 2nd Edition to 1st Edition rules AI (Wyzbang's original AI, but updated to include all 1st edition ships through wave 14).

I have hosted the web version here:

http://x-wing-ai.com

Click on the "?" icon in the upper right for how to use. 
Click on the "AI" icon to switch to 1st edition xwing_ai, "AI2" icon to switch back again to 2nd edition.

There is a download link you can access by clicking on the "i" icon, to download the distributable version for offline use or download it here. Once you download the zip file, unzip it into a convenient directory, then open "index2.htm" in any browser for the 2nd edition ruleset, or "index.htm" for the 1st edition ruleset.

NOTE: THIS APP DOES NOT WORK IN Internet Explorer and I don't have the inclination to fix it for that browser. Works best in Chrome, but also works in Firefox, Opera, IOS Safari and Android Web apps.

xwing_ai2 remains open source under the original Creative Common License 3.0. The source files are here on github:

xwing_ai2 Source Files on Github

Feel free to try it out and post any constructive feedback in this thread. Enjoy.

Regards,
Tomcattwo

Edited by Tomcattwo
Update Post Title and post update information

Share this post


Link to post
Share on other sites

I have tried the app in Chrome, Android Chrome, Samsung Internet and Safari. I have not tried it using Opera or Firefox or other browsers. If anyone does use those browsers, please drop a reply here if it worked or not. The app is not supported for Internet Explorer.

Regards, 

Tomcattwo

Share this post


Link to post
Share on other sites

I just tried it with Firefox, and it seems to work. I haven't explored it enough to know if it is doing what it's supposed to do, but I click things and stuff happens. 😜

I'll have to look at it some more. A few first questions to help me understand more:

1) The ship icon in the upper right corner (along with the other info pages) shows you tables of maneuvers for a ship. When you click on where the ship's target is, the app 'rolls' on this table to pick which maneuver to use? Does it pick one column, or does it roll separately for each condition (closing, retreating, etc)?

2) Why the free target lock? That seems kinda big. Do the AI ships need it that badly?

Good work, it looks good so far!

Share this post


Link to post
Share on other sites

Hi Hatemonger

18 minutes ago, Hatemonger said:

 

1) The ship icon in the upper right corner (along with the other info pages) shows you tables of maneuvers for a ship. When you click on where the ship's target is, the app 'rolls' on this table to pick which maneuver to use? Does it pick one column, or does it roll separately for each condition (closing, retreating, etc)?

The Ships tables shows the moves the AI will randomly roll for based on the orientation of you ship to the AI (i.e., 12 o'clock, 1-2 o'clock etc) and the aspect (i.e., is your ship closing with the AI, retreating from the AI, out of range or if the AI is stressed). Then the app "rolls" a 10 sided die and selects on the row (orientation) in the applicable table for closing, opening, out of range or AI stressed. The tables are set up to "weight" some maneuvers more than others (by providing more chances to select a "normal" or "simple" maneuver and fewer chances to select stressing maneuvers). This provides some reasonableness in picking maneuvers that should help the AI but enough variability that you won't be able to predict with certainty what it will do.

The tables are built using the actual maneuvers on the maneuver dials available to each ship type in the X-Wing Miniatures Game (and the dials are different between 1st and 2nd edition rules), and some basic consideration of what a human would likely do in each aspect and orientation situation encountered in a match.

 

31 minutes ago, Hatemonger said:

2) Why the free target lock? That seems kinda big. Do the AI ships need it that badly?

It helps the AI a bit. That was a holdover from Wyzbang's original 1st edition version, and I just kept it in for 2nd Edition ruleset. You're free to ignore that and just treat it as another possible action. Try it both ways and see which you like. 

Good to hear it works OK in Firefox :)

R/,

TC2

Share this post


Link to post
Share on other sites

Update 2.0.1 is available here

  1. Put TIE/SF and Upsilon Class Shuttle in First Order Faction where they belong and removed from Empire Faction.
  2. Minor update to 2nd edition files to remove Scurrg H-6 Bomber from Rebel Faction inventory and Firespray from Empire Faction inventory - per 2nd Edition ruleset. They are still properly located in Scum Faction listings.
  3. Changed main page and ships page to show Rebel Faction first on main page and ships page, to align all the "good guys" (Rebel, Scum, Rebellion, Republic) in the left-hand column and all the "bad guys" (Empire, First Order, Seperatist) in the right-hand column.
  4. Minor change to Info page in the "Dedication" section and Readme file.
  5. No changes to 1st edition rules AI (1.14.0) files.
  6. Updated all affected files on github.

Enjoy.

Regards,

Tomcattwo

Share this post


Link to post
Share on other sites

Well looking at the HotAC AI algorithms the biggest challenge 2.0 has is brought IMHO is the the way firing arcs and turrets have been changed. HotAC AI designed in 1st edition was essentially a program to do only 1 single thing, chase the opponent, and that was all it needed to do to be effective. All ships can shoot forward, you didn't have to account for turrets as they had 360 arcs, and only a few ships had rear firing arc that just made chasing them down a risky proposition (Boba Fet makes a good Boss fight). The only ship that couldn't shoot forward every turn was the Lancer and that was a mobile firing arc. Okay put in the rotate turret action in the action step subroutine if no enemies were in the active arc. Chase is still the best course of action.

Now with 2.0 you have ships that can only shoot forward or backward but not the sides (and usually not at the same turn). So now chasing the target is not the best course of action as you have different approaches. Take the RZ-2 Awing, you almost have to make 2 separate algorithms, one for pursuit (firing arc forward) and then one for strafing( firing arc to the rear) and on top of that an algorithm to decide which is the best mode for the situation. That simple change has tripled the amount of programming needed. 

There is also landing with Wave 3, the best I can think there is used landing turrets as a set up then have a trigger to get them to launch and they never land again. So still the most difficult thing to program is movement and firing arcs. Simply chasing the closest or marked target won't work.

Share this post


Link to post
Share on other sites

Yep, I agree with you Marinealver. Right now, as the solo human, you have to make the best pick of actions for the AI ships to perform - would be pretty complex to try to have the AI find the "best" action to recommend, especially given the number of additional actions of different types (and new actions) added in the 2.0 rules - heck it was hard enough to fit all the new ones into the current javascript programming :lol: Addition of more ships with turrets, double-tap options etc. makes AI movement selection harder than it was in 1.0 for sure, as you point out. This AI was a relatively simplistic set of algorithms, but it worked pretty well for 1st edition.

xwing_ai and xwing_ai2 use similar methodology to HotAC, but, as I understand HotAC's method, it has an additional "table" for stuff happening at range 2 (different tables depending on whether tgt is opening or closing at range 2). I suppose that would be my next step, to get xwing_ai2 to use HotAC algorithms. Baby steps...

I'd welcome any additional feedback from folks using xwing_ai2 for tabletop solo as to how it plays now under the 2.0 ruleset and recommendations for improvement. If anyone has any ideas on how to go about refining the AI to incorporate those kinds of considerations that Marinealver suggested, I'm all ears.

Regards,

TC2

Share this post


Link to post
Share on other sites

Hello Hipsu,

I'll take a look at the FGA page and see how big of a project that would be. I wasn't even aware there WAS an Imperial campaign 😲!

In AI 1 and AI 2 (non-HotAC), it is easy to add additional ships, since the AI_shipsX.js JavaScript file is updated by using a python "builder" based on an easy-to-populate .XML file or files. But the AI 1/2 are not as "sophisticated" or as complex as HotAC AI. For HotAC AI, I had to make a lot of additions to the AI_shipsX.js file to add the new phase functionality. Since there were only 8 Imperial ship types that were needed, I just did a one-off manual build of that file rather than trying to update the python generation files.

If I then expand the number of both factions and ship types included in HOTAC AI, then I might be looking at a bigger project of needing to rewrite the python generation files, and I'm not as proficient at python programming as I would like. 

I'll have a look and see if what you ask is a do-able thing.

R/

TC2

Share this post


Link to post
Share on other sites
7 hours ago, Tomcattwo said:

Hipsu,

I quickly reviewed FGA. It's do-able. May take me a week or two. I don't plan do the python code - I'll just hand-jam the data into a new ship's file and rewrite the HotAC AI us file to accomodate the new ships (19 of them).

R/,

TC2

That would be great. Our FGA group is looking into starting back up and this would be a big help. 

Share this post


Link to post
Share on other sites

Status update on Flight Group Alpha (FGA) AI inclusion in x-wing-ai:

I started coding about 4 days ago. So far, I have all the functionality properly working, and I have all 4 factions from FGA on the app and running on my test bench. All of the Empire ships have fully functional AI, and tonight I just finished adding full functionality for both First Order ships (TIE/fo and TIE/sf) . I also added Flee table information/maneuvers (for ships with hyperdrives installed) for each ship this afternoon (that functionality wasn't included in the HotAC AI).

I only have one Rebel ship (T-65 X-Wing) and one Scum ship (BTL-A4 Y-Wing) coded so far, but both are working properly. 12 ships down, 15 to go. I should be done and have it published by the end of this week.

Hipsu or Wolfshead, please let me know if you would be willing to check my  work against FGA's AI cards to make sure I got them all correct. If so, when I have it all coded, I will send you a link to the Beta so you can download it and check it out for me. Thanks,

R/,

TC2

Share this post


Link to post
Share on other sites
48 minutes ago, Tomcattwo said:

Status update on Flight Group Alpha (FGA) AI inclusion in x-wing-ai:

Hipsu or Wolfshead, please let me know if you would be willing to check my  work against FGA's AI cards to make sure I got them all correct. If so, when I have it all coded, I will send you a link to the Beta so you can download it and check it out for me. Thanks,

R/,

TC2

I would be happy to assist you in this. Thanks for all your hard work. 

Share this post


Link to post
Share on other sites
Posted (edited)

All FGA/HOTAC Empire ships are done (Decimator, Lambda, Tie fighter, Tie Intetceptor, Advanced, Defender, Bomber, Phantom), First order (Tie fo and Tie SF), Rebels (8 ships -x,y,a,b,z,yt-1300,yt-2400,VCX-100(Ghost)) are now done, as well as 3 of 9 Scum (z, y, M3A). Only 6 more scum ships to program and FGA/HOTAC AI will be done! I should have a beta out this weekend.

Looking at the other solo threads and this very interesting article https://www.goonhammer.com/x-wing-flying-solo-part-3-machine-vs-machine/ , there is definitely usefulness to programming this for Flight Group Alpha (HOTAC plus FGA) AI. 27 ships (of ~85 total x-wing minis) is almost 1/3 of the way to a full blown very decent solo AI. I don't mind doing the programming if Claes or others in FGA want to write up good AI for additional ships outside of the 27 I have already done or am about to finish for HOTAC+FGA) .

With 27 different ships sporting HOTAC/FGA AI, this app takes a lot of the work out of flying solo, and provides a much-improved AI fight whether you are actually playing HOTAC or FGA scenarios or just playing for fun. It's much more competitve than my AI 2nd edition app.

R/,

TC2

Edited by Tomcattwo
corrected minor spelling errors

Share this post


Link to post
Share on other sites

New version 3.1.3 for HotAC+FGA AI, which adds Maneuver Tables for every ship to the "Stats" section of the Main Page and also on the Ships page. This helps a bit when you want to see what maneuvers an AI ship is capable of performing, without having to go to another app to look it up.

To check it out, go here: x-wing-ai.com or download for offline use here.

Many thanks to sirjorj of xhud.sirjorj.com for permission to use his Maneuver Tables for this project.

R/

TC2

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...