It seems that you're using an outdated browser. Some things may not work as they should (or don't work at all).
We suggest you upgrade newer and better browser like: Chrome, Firefox, Internet Explorer or Opera

×
avatar
Azrapse: I have made a little mission to test the AI behavior for the different types of starfighters.
Mission .ZIP
I notice that GUNs and SHUs behave quite differently from all others.
I just made a quick test and it seems to work.
Furthermore I wrote a bat and xcd file so that xcdr will replace "defect" with your AI Test mission. It is meant for users of the CD-ROM Edition:
https://mega.co.nz/#!F9FAHIzb!6l60pHmsa-2fimpZGtkZUOvf5ulQIWPyJgB7zZfJ5ho (Extract it to your xwingcd-directory. XCDR is required.)
I hope that's ok for you.

A first observation:
The TIE Fighters try to evade missiles.
avatar
FekLeyrTarg: A first observation:
The TIE Fighters try to evade missiles.
They definitely behave differently by type.
I tried that mission first in Veteran AI. The version I uploaded uses Top Ace AI, that I have not tested myself so much.

It seems most ship types will attempt some evasive maneuvers before going back on their target.
TRNs, X-Ws, Y-Ws, B-Ws, A-W, T/Bs, T/I and T/F.

There are others that don't do that.
For example, GUNs and SHUs will shoot back and engage the player in dogfighting even when the player is not a primary or secondary objective of theirs, and their orders are to attack the Practice Target.

I have observed some interesting behavior about the group leader.
Destroying the flight leader, promotes the remaining wingmen up. That is, if you kill T/F Alpha 1, then T/F Alpha 2 moves to the leader's position in the formation.

Some times, attacking the leader makes all wingmen target the player, while the leader does evasive maneuvers. The achieves to keep the player focused on the leader while the wingmen place themselves behind the player and attempt to destroy him or her.

Some times, damaging the hull of a ship will make it attempt to go back to their container. This doesn't happen always, only a minority of the times.

We might be seen here the work of some mechanism that randomly selects a tactic from an assortment of them. I wonder if the tactics depend on the kind of orders and target the AI starfighter has.
I say that because in general I have observed a more jealous attitude on torpedo-carrying ships than on missile-carrying ones, regarding their determination to shoot down the ISD.
X-Wings, Y-Wings, B-Wings, TRNs and TIE Bombers suicidally rush towards the ISD, while TIE Fighers, Gunboats, Shuttles and A-Wings seem to be easier to distract from their task.

I might build another test mission where the practice target is a group of starfighters. Maybe in that case, missile-carrying ships will be more interested on destroying them than torpedo-carrying ships.

Also, it seems that ships are more likely to perform evasive maneuvers and counter attack the player when they are out of range from their target, the ISD. But once they are on range of their torpedoes or lasers, they focus quite a lot more on the star destroyer.

I would glady thank if someone could verify or refute my hypotheses here.
So far, at least we have got some evidence of some different reactions being performed by the flight groups as response to the player´s interaction:
1 - Attacked wingman does evasive maneuvers away from their pals, sacrificing himself to give more room to their teammates.
2 - Attacked wingman does evasive maneuvers while keeping on going in the same general direction, trying to survive the attacker's fire while retaining their attention. Meanwhile, other wingmen target the attacker.
3 - Attacked wingman totally ignores incoming fire.
4 - Attacked wingman targets their attacker and totally forgets about their objective until attacker is destroyed.
5 - The whole flight group attacks the attacker, like in 4.
I have updated my previous post with a link to a test mission where I replaced the ISD with a squadron of B-Ws, to check whether the AI behaves differently against starfighters.
I'll check out those bevahiors asap.

I also made a quick test of your second mission and it seems to work. I've updated my aitest.xcd to let xcdr replace id-recon with aitest2.

Before I forget:
If you'd like to keep using any XWAUP assets, I would ask their authors for permission first.
Many years ago, there was an incident in which someone used XWAUP assets without permission and Darksaber decided to deny further permissions to use them. I don't know whether he has reconsidered that decision or not.

You can look up what happened back then at http://www.darksaber.xwaupgrade.com (News post from Saturday, September 06, 2008)

Edit: I've just had another idea: With the B-Wings, we can assign each of them pilots of different skill levels (from novice to top ace), meaning that we can observe the behavior of each AI skill level as well.
Post edited December 01, 2014 by FekLeyrTarg
Blast, the forum ate my lengthy response. Sigh.

avatar
FekLeyrTarg: If you'd like to keep using any XWAUP assets, I would ask their authors for permission first.
Many years ago, there was an incident in which someone used XWAUP assets without permission and Darksaber decided to deny further permissions to use them. I don't know whether he has reconsidered that decision or not.

You can look up what happened back then at http://www.darksaber.xwaupgrade.com (News post from Saturday, September 06, 2008)
It seems some nasty people downloaded and modified their models, and they claimed those a theirs. That's not cool and I have no intention to do anything like that. I have downloaded the XWAU models that match those ships present in X-Wing so that I have something to show onscreen instead of plain blocks.
This is only for development purposes. I need some models that roughly match the proportions and size of the actual ships, and I do not wish to waste any time making them myself.

The XWAU states in their site:
[i]Everything that you find on this server is property of the XWA Upgrade project. This means you may not take anything from the server and use it for your own purpose in any way without the approval of the XWA Upgrade Team! There are some exceptions:
a) you may use and modify anything you find here for your own purpose, but never make it public in case you do
b) you may use the screenshots provided on the page for your own purposes, but you need to keep the copyright intact!
c) you may do screenshots of all models yourself and then do whatever pleases you with those shots![/i]

I think we will be okay with this because we will not publish anything at all, we are just developing the engine. A day will come when we are done with the remake and we need the final models put in place, so that we can make the program available for public download. Then I will ask Darksaber and his team about the models. No need to bother them before we are there.
All intermediate builds of the engine will be kept in private among us, the developer team.
Because of point c, we will be okay to post screenshots (or videos) of the remake in action, also.

avatar
FekLeyrTarg: I've just had another idea: With the B-Wings, we can assign each of them pilots of different skill levels (from novice to top ace), meaning that we can observe the behavior of each AI skill level as well.
I hit the limit of 16 flightgroups, and for doing what you say we would need to have five different flightgroups for each skill level.
We can just make another mission that compares the different skill levels of a same kind of ship.
It was actually a lot of fun making mission for X-Wing again, along with the totally unnecessary briefing, that I made just for the fun of the old days. :)
Post edited December 01, 2014 by Azrapse
Update on the progress of the coding:

I have been working on the code for the past week, but I hit a roadblock for a while with the AI.
Most of this game is AI, so it's quite a roadblock. The problem is that as we saw, the different behaviors can be quite rich (and this is just the first game in the series!).
So I have stepped back a little bit to rethink how the AI should be programmed.

Instead of a lengthy amount of code dealing with multiple situations and cases, and considering a more modding-friendly approach, I have opted instead for making something more like AI blocks that will be configurable externally and put together to build up behaviors.
These blocks are basically the different triggers and conditions to be checked, and the atomic tasks and actions to be performed by the ships.
These blocks will be hardcoded, but exposed in a way that we can then use them combined to build the rich behaviors we are observing.
I made a listing of the different Actions and Checks blocks I could identify on this diagram here.
To the right in that diagram I attempted to have a simple example of how could we combine the blocks in a flowchart-kind of way to build the behavior for the Fly Home flightgroup order, as well as some reactions for combat events.
I didn't like how messy and complex it seemed to become, though.

So, while still liking the blocks idea, I approached the combination in a different way that should be both simpler and more effective. Inspired by Tarvis progress with the iMuse system, I elaborated a similar mechanism based on tables of sequential states with responses to cue events, and I am much happier with what I got there.
Have a look at the document I'm building with it here.

These tables could be exposed as XML or JSON files that make use of the different AI blocks to define behaviors for all the different mission orders and AI Skill Levels. We could have simpler tables for Rookie and more complex ones for Top Ace.

Now that I have two Orders basically defined (Fly Home and Attack Enemies) I can write the code for "interpreting" them in the game and go on with my Rescue Ackbar test mission.
Don't worry: I know that you wouldn't commit any mod theft like this. :)
I just wanted to point out the permission thing just in case.

Regardind the AI skills:
What I actually meant is that we use the pilot assignment screen to give the B-Wings different skill levels. But we'll need to create pilot files with those skills.
Post edited December 01, 2014 by FekLeyrTarg
avatar
FekLeyrTarg: What I actually meant is that we use the pilot assignment screen to give the B-Wings different skill levels. But we'll need to create pilot files with those skills.
*Facepalm*
Sometimes I am so dumb...
avatar
FekLeyrTarg: What I actually meant is that we use the pilot assignment screen to give the B-Wings different skill levels. But we'll need to create pilot files with those skills.
avatar
Azrapse: *Facepalm*
Sometimes I am so dumb...
Actually I think the error was on my end. I probably haven't expressed myself clearly enough. Anyone could've misunderstood what I wrote.

Edit: Here are some test pilots ranging from Rookie over Officer and Veteran to Ace:
https://mega.co.nz/#!tpUzCLQJ!Mkkr9Wwz1O_f-_cfPnQqXfiuRUX92XyrXZ3l9EWJMu0
Post edited December 01, 2014 by FekLeyrTarg
Sorry I haven't been active lately or finished the iMUSE player yet. I've been busy since exams are coming up this week and next week, so I've prioritized studying over this. Here's the github repository though, if you want a quick glance. There hasn't been a whole lot done in terms of actual MIDI parsing yet though. I could have copied most of this from ScummVM, but it's a hell of a lot more complex and has a lot more cases for sound effects and specific games and other things that X-Wing doesn't use at all, so I think it would be more elegant to make my own. Better learning experience, too, since I want to get better at object oriented programming.

I decided to use C++ since it would be easier to port to C# later since I'm using classes for it. I'll try to keep things as low level as possible otherwise, though.

https://github.com/Tarvis451/X-Wing-iMUSE-Simulator

To do: Make the MIDI parsers/players. There will be one per MIDI segment to play. Simply, when called: play a MIDI segment, implementing the jump command to skip silence, and if the end segment SysEx command is encountered, make a new parser/player in parallel to play the next segment. Parser/players will be destroyed when its particular segment is complete.

Otherwise: the AI blocks seems good. Though I have a feeling the original games probably hardcoded hem instead of having the individual blocks. Remember that this is an early 90s game that had to run on relatively slow systems, so if there's a simple implementation, that's probably what it was. Though, for modding purposes, it is a good idea. Otherwise, I think what they probably did for the originals was just have different AI profiles for superiority, bombers, interceptors, capships, etc.

Other things to look into: TIE Fighter has a difficulty setting. Does this affect AI or only what happens during missions? (more/less ships, etc)

Finally, I think the XWA modding community might have a lot of insight into AI and how it's assigned since they've made many custom fighters. I'd imagine the AI might be fairly similar to the originals in terms of responding to stimuli. You should ask around there.
Post edited December 01, 2014 by Tarvis
avatar
Azrapse: Hi, all X-Wing fans.

...

What is your opinion/interest on something like this?
You have my sword.

DW
avatar
Tarvis: Sorry I haven't been active lately or finished the iMUSE player yet. I've been busy since exams are coming up this week and next week, so I've prioritized studying over this. Here's the github repository though, if you want a quick glance. There hasn't been a whole lot done in terms of actual MIDI parsing yet though. I could have copied most of this from ScummVM, but it's a hell of a lot more complex and has a lot more cases for sound effects and specific games and other things that X-Wing doesn't use at all, so I think it would be more elegant to make my own. Better learning experience, too, since I want to get better at object oriented programming.
Real life first. Always first. We aren't getting any money for this, and if X-Wing has waited 21 years to get a remake, it can wait some time more.

I think it's positive that you do it yourself. There would probably be a lot of "dead weight" if we used ScummVM's implementation of it.
And in any case, I will need to translate this to C# for Unity. Once you have it up and running, that not complicated (basically all languages are equivalent, and moreso C++ with C#). So better to have a minimum iMuse engine that has just what we need.

(Note: I could also P/Invoke the binary C++ library. But I am not sure how that would go for other platforms like Android and iOS).

avatar
Tarvis: I decided to use C++ since it would be easier to port to C# later since I'm using classes for it. I'll try to keep things as low level as possible otherwise, though.

https://github.com/Tarvis451/X-Wing-iMUSE-Simulator
I will put whatever I have on github when I actually have something more advanced that does something meaningful. It will be just the code, not the models, to avoid problems with the XWAU team.

avatar
Tarvis: Otherwise: the AI blocks seems good. Though I have a feeling the original games probably hardcoded hem instead of having the individual blocks. Remember that this is an early 90s game that had to run on relatively slow systems, so if there's a simple implementation, that's probably what it was. Though, for modding purposes, it is a good idea. Otherwise, I think what they probably did for the originals was just have different AI profiles for superiority, bombers, interceptors, capships, etc.
With "AI blocks" I actually mean some hardcoded checks and actions, that are referenced by tables. The checks and actions are the most basic things a ship can do, like aim at something, shoot a weapon, check if its mothership is around, etc.
The tables are much like your iMuse tables and cue events. If Condition Do Action, Then go to state X.
I don't think there is much overhead on that. And I don't think hardcoding all of that in individual functions would be much faster.
That is what I tried to do first, but soon I realized there was a lot of common code that couldn't benefit from inheritance because it was more like common steps than common structure.
I opted for a Strategy Pattern, but the class model was starting to get too complex so I flattened it all with jump tables.

In any case, It is clear that ships in X-Wing (more evident in TIE Fighter) are in different tasks and states during flight. You can Shift+R an ally and they will tell you what they are doing. In TIE Fighter you can inspect every single step in their flight plan from the Z information window.

avatar
Tarvis: Other things to look into: TIE Fighter has a difficulty setting. Does this affect AI or only what happens during missions? (more/less ships, etc)

Finally, I think the XWA modding community might have a lot of insight into AI and how it's assigned since they've made many custom fighters. I'd imagine the AI might be fairly similar to the originals in terms of responding to stimuli. You should ask around there.
I am not sure if it changes the amount of damage taken/inflicted. I know that some flightgroups appeared only on particular difficulty settings. Beyond that, I have not researched much how TIE Fighter works. I'm limiting myself to X-Wing so far.
i putzed around in AlliED for a while trying to fix some problems with the otherwise-wonderful implementation of the X-wing and Tie Fighter campaigns in X-Wing Alliance ( I gave up because i never could get XWA to run with 3d acceleration on my machine, and because these GOG releases became available).

After spending just a little bit of time with the editor, i walked away with a better understanding of the states/structure of the missions. Unfortunately, this was kind of like "seeing the matrix" and makes the game a bit less fun to play if you can't shut out the images of the game's skeleton.

Anyway, thought you might want to poke around in it (or its x-wing specific predecessor X-ED) a bit to try and osmose some of the underlying mechanics of how the missions are put together and what the ships are "thinking."

they're available here: http://www.troyed.com/x-wing/DLAlliED.htm

p.s. i highly recommend the accompanying HELP file as it helps clarify some of the more obtuse capabilities of the editor
Post edited December 02, 2014 by kristenmaxwell
avatar
kristenmaxwell: After spending just a little bit of time with the editor, i walked away with a better understanding of the states/structure of the missions. Unfortunately, this was kind of like "seeing the matrix" and makes the game a bit less fun to play if you can't shut out the images of the game's skeleton.
It always kills the magic a little bit, when you see the backstage of your favourite show, doesn't it? :)
Still, I marvel at the work of Dave Wessman and Dave Maxwell in X-Wing. They built all the missions and made up the story arcs behind them.
Their missions are an almost perfect work in puzzle-making. A Rube-Goldberg machine where the player needs to find out which pieces are missing to make it work.
And made in a way that they aren't too easy or impossibly hard. And just with those 16 flightgroups available in the mission editor.
avatar
kristenmaxwell: Anyway, thought you might want to poke around in it (or its x-wing specific predecessor X-ED) a bit to try and osmose some of the underlying mechanics of how the missions are put together and what the ships are "thinking."

they're available here: http://www.troyed.com/x-wing/DLAlliED.htm
I know them. I have been editing missions for all games in the X-Wing series since they came out. The first thing I remember doing with an Internet connection was to look for XMB (X-Wing Mission Builder), a DOS program that made missions for the first X-Wing.
The mission format is totally figured out and my prototype can already read them and place the different ships around.
What I am missing right now is the AI, that is what the ships actually did in order to accomplish their assigned orders.
The AI has never been editable by modders, as it is hardcoded in the game executable.
I guess it could be reverse-engineered with a lot of work.

But I am not sure it is legal everywhere to reverse-engineer an executable (I think it is here, but not in the USA).
In any case, it's fun to reimplement it by ourselves.
It would be of course nice to put my hands on some original specs, design documents or source code. Even just some hints. But I think the chance for that is an infinitesimal, being a commercial product, ancient software, Totally Game basically moved on, LucasArts defunct, and Disney owning the property.
in retrospect i should have known that you were no stranger to these. sorry for coming off as a condescending know-it-all who jumps on threads to try and look smart.