OpenXcom Forum

OpenXcom => Suggestions => Topic started by: Slaughter on June 02, 2016, 05:16:17 am

Title: Active Alien Geoscape AI - has anyone ever taken a stab at this?
Post by: Slaughter on June 02, 2016, 05:16:17 am
Has anyone ever tried to take on alien geoscape AI - as in, the aliens acting and reacting to human behavior on the geoscape.
And by that, I mean (mostly) things like aliens fighting an active air war and attacking your Interceptors and Skyrangers?
Title: Re: Active Alien Geoscape AI - has anyone ever taken a stab at this?
Post by: Hobbes on June 02, 2016, 05:41:29 am
I've suggested this in the past but so far no one has picked it.

Things like having to escort the Skyrangers on their way to and back from a mission. UFOs set to patrol specific zones, like the airspace around mission sites or alien bases.
Title: Re: Active Alien Geoscape AI - has anyone ever taken a stab at this?
Post by: Stoddard on June 07, 2016, 12:19:13 am
I'm working on a prototype for better adversary simulation for geoscape.

My motivation is that Piratez factions' actions in geoscape look even more ridiculous than vanilla game's aliens', to the point I can't play Piratez in geoscape any more. So the prototype aims at supporting a believable simulation of multiple factions mostly zooming around minding their business, but occasionally clashing, or banding together against some other faction or the player.

I want tens to hundreds of flights in progress, deeper detection simulation, escorts, hostile interceptions, and  reasons why all this is happening. For the first step, something barely looking as living, ala the enemy in c64 ROBB (https://en.wikipedia.org/wiki/Raid_on_Bungeling_Bay) will suffice.

This will also show what changes would be needed to the OpenXCOM itself, since the current alien mission implementation there just cannot support anything fancier than a bunch of random stuff happening randomly plus a retaliation or two. Emulates the original faithfully, great work, but the original was very limited. So it has to be extended, and it is completely unclear how.

That is why the prototype is being developed completely separate from the openxcom codebase, sharing only the data.

Also, traditional geoscape view is not really suited to debugging such sims, so I currently use half-baked 2D Miller cylindrical (https://en.wikipedia.org/wiki/Miller_cylindrical_projection) projection map like they use in space mission control, generated from the geoscape data, to see the whole world at once.
(Polar regions are mostly unusable, but I hope to get the north-south scrolling to work).

No idea if the map even has a chance to getting into OX, but it is sure easier to keep track what's going on.
Title: Re: Active Alien Geoscape AI - has anyone ever taken a stab at this?
Post by: Hobbes on June 07, 2016, 01:47:10 am
This will also show what changes would be needed to the OpenXCOM itself, since the current alien mission implementation there just cannot support anything fancier than a bunch of random stuff happening randomly plus a retaliation or two. Emulates the original faithfully, great work, but the original was very limited. So it has to be extended, and it is completely unclear how.

Hm? With the current missionScripts you can have a lot more than 'random stuff happening randomly plus a retaliation or two', unless you mean some specific features that you'd like to be implemented.
Title: Re: Active Alien Geoscape AI - has anyone ever taken a stab at this?
Post by: Slaughter on June 07, 2016, 02:47:39 am
Stoddard if you implement this you will be a saint.

If it can be dynamic then even better.

I'm imagining the start being like vanilla, with UFOs just doing their thing and minding their bussiness and laughing at puny humans and their puny jets and radar.

Then in month 2 or 3 they start sending UFOs to escort vessels, or even do Close Air Patrol missions near mission sites.

Late-game it would probably be sending battleships in groups to patrol and attack everything flying nearby, doing so to obtain total control of worldwide airspace.

Btw, how would Reverse-Interception work?

Enviado de meu SM-G3502T usando Tapatalk
Title: Re: Active Alien Geoscape AI - has anyone ever taken a stab at this?
Post by: Stoddard on June 07, 2016, 02:51:50 am
Hm? With the current missionScripts you can have a lot more than 'random stuff happening randomly plus a retaliation or two', unless you mean some specific features that you'd like to be implemented.

Current code does it like this (github.com/SupSuper/OpenXcom@a617d7c):

Code: [Select]
void GeoscapeState::time1Month()
{
    _game->getSavedGame()->addMonth();

    https:// Determine alien mission for this month.
    determineAlienMissions();
    ...
}

void GeoscapeState::determineAlienMissions()
{
    ...
    https:// level four condition check: does random chance favour this command's execution?
    if (process && RNG::percent(command->getExecutionOdds()))
    {
        https:// good news, little command pointer! you're FDA approved! off to the main processing facility with you!
        success = processCommand(command);
     }
    ...
}

bool GeoscapeState::processCommand(RuleMissionScript *command)
{
    ...
    https:// more randoms here ...
    ...
     mission->start(command->getDelay());
    ...
 }


So there goes any possibility of a hostile intercept, for example. The code gets called once a month.

I accept than on the timeframe of a year  the mission set is not entirely random and it is possible to see some correlation to player actions. But inside a month or two it quite is, which is what I wanted to say.

I didn't even begin to write down what I want to accomplish besides the vague idea of much more stuff happening on the planet, adversaries actions being much more clearly attributable to either their agenda or player's actions, and player having much more visible impact on adversaries' strategy. The only clear thing is that the current code just doesn't cut it, and that I have no idea what would be required of any future code.

So I hack around. Maybe something will come out of it.



Title: Re: Active Alien Geoscape AI - has anyone ever taken a stab at this?
Post by: Stoddard on June 07, 2016, 03:02:59 am
As for hostile intercepts, well, I imagine there would be some means for adversaries (aliens,  bought-out governments, etc) to detect the flights and to dispatch intercept missions against player craft. So the player won't be able to send lone transports all over the world with impunity in mid-late game. I thought about making inter-base material transfers a separate mission that can be shot down (but are faster than standard 24-48-72 hour transfer).

The logic would have to run at minimal - 5sec intervals, plus some modding to grant the detection ability and UI to tell the player that he's being intercepted. Nothing quite impossible, just a big bunch of workfun.
Title: Re: Active Alien Geoscape AI - has anyone ever taken a stab at this?
Post by: Cooper on June 07, 2016, 05:19:02 am
Active Alien Geoscape AI would be awesome, and make a not so interesting part of the game a lot more fun! Would also make it more interesting to create a mod where you attack Mars.
Title: Re: Active Alien Geoscape AI - has anyone ever taken a stab at this?
Post by: Stoddard on July 06, 2016, 12:14:54 am
Since it's been a month already, time for an update.

I had the custom map projection working at the beginning, drawing continents, borders, cities, labels, bases, craft markers, radar ranges, missions and their areas.

Now instead I have a mod loader that correctly loads and merges the OG ruleset and all the mods enabled in the options plus loading whatever resources that might be needed for the geo/basescape. So that the whole thing would work with whatever modset one prefers.

The modloader itself might be useful for finding stupid errors and typos while modding, it has some basic consistency checks and is verbose about them. Many more can be added (I don't really know what might be useful).

Next step would be to redo the renderer to a) drop SDL_gfx in favor of GLES/GLSL (SDL_gfx is no good, I could actually see the triangles being textured at each redraw) and b) switch  between original (orthographic)  and arbitrary cylindrical (miller, mercator, whatever) projections at will. Horizontal ( logntitude-wise) scrolling worked already, it will be grandfathered in. Vertical (latitude-wise, as when one wants to take a look at the pole) scrolling in cylproj mode will be done too.

After that the whole OG mission logic will be reimplemented, to a) learn how it works down to the last detail and b) see what's the best way forward for the new AI API so that it can be turned on and off at will (depending on a mod).

Detection/Intercept UI will be reimplemented at this stage too, starting with OG's one, to see exactly how inadequate it gets given massive increase in flights detected.

It might further be necessary to do the basescape, so that the whole project gets to be a semi-playable half of a game, without the battlescape (tactical mission results decided by RNG plus maybe some function defining abstract strengths of opposing squads, taking into account terrain, races, geoscape-level morale, whatever).

If all that leads somewhere, there would be a fork of Meridian's tree with the new AI support. That's the long range goal.

These are the plans.

I'll be putting up the code on github shortly, I have to whack the SDL_gfx graphics code into shape so that it at least displays something again. Just a question of adapting the draw code to the modloader API from an ad-hoc one.

Title: Re: Active Alien Geoscape AI - has anyone ever taken a stab at this?
Post by: Slaughter on July 10, 2016, 09:23:09 pm
I can only understand half of your tech details but yet they are very interesting!

Seems like your sainthood miracle is soon a go!

From one modder to another - fantastically done!

Enviado de meu SM-G3502T usando Tapatalk

Title: Re: Active Alien Geoscape AI - has anyone ever taken a stab at this?
Post by: Stoddard on July 15, 2016, 11:48:09 pm
Thank you.

Here goes an example of 2D map, that's X-Piratez mod, but it should work for any mod out there.
Note that the radar circles are all of the same 800 nmi radius.

(https://lxnt.wtf/oxem/builds/Cellar/screenshot.png)

The modloader works, projection/renderering sort of works.

The code is at https://github.com/StoddardOXC/minicom (https://github.com/StoddardOXC/minicom)

Next step - original mission mechanics, I don't want to dive into GL right now.
Title: Re: Active Alien Geoscape AI - has anyone ever taken a stab at this?
Post by: Hobbes on August 19, 2016, 05:58:08 pm
Stoddard, any progress on this?
Title: Re: Active Alien Geoscape AI - has anyone ever taken a stab at this?
Post by: Stoddard on August 20, 2016, 12:36:10 am
Yup, factions launch intercepts if you fly too slow / often near a city. Makes bulding the first base in a populated area a bad choice :)
Just this evening  I made nearby craft assist each other, very hacky, but it turned the regular 'secret base' hgunship/frig/cruiser swarm from a turkey shoot megascorp hunt into an omg gtfo moment, baracudas and dragons nonwithstanding. The can't disengage if your speed is too low feature I like the most.

I'm working on UI side of this. 4x4 dogfights just might be possible without drastic changes, but i'd like to go beyond that. No idea how though.

I wonder, what all the comments like

https:// Set UFO size - going to be moved to Ufo class to implement simultaneous dogfights.
(DogfightState.cpp)

are about? Was there some abandoned work on this? I'd hate reinventing more wheels than abs necessary.


Current version is a scrapheap, and also kills fps on anything above 5 minute rate. Only works on linux too,
but i'm getting there, yeah!

Economy stuff took the farthest seat for now.

EDIT:
also, the cylindrical map worked for some time alongside the game in a separate window, but got bitrot as it's not really needed right now.
Title: Re: Active Alien Geoscape AI - has anyone ever taken a stab at this?
Post by: Hobbes on August 20, 2016, 01:05:17 am
Yup, factions launch intercepts if you fly too slow / often near a city. Makes bulding the first base in a populated area a bad choice :)
Just this evening  I made nearby craft assist each other, very hacky, but it turned the regular 'secret base' hgunship/frig/cruiser swarm from a turkey shoot megascorp hunt into an omg gtfo moment, baracudas and dragons nonwithstanding. The can't disengage if your speed is too low feature I like the most.

I'm working on UI side of this. 4x4 dogfights just might be possible without drastic changes, but i'd like to go beyond that. No idea how though.

Oh, this sounds really interesting. I suppose the alien bases could also be set to launch interceptions?

The reason I asked has to do with some experiments I've been making for a possible new mod project set on the Terminator series and this feature would fit like a glove since right now I'm looking to make the Geoscape a little more active:

(https://dl.dropboxusercontent.com/u/18824603/screen171.png)

Each of the different letters is a type of Skynet base. Bases generate Aerial Hunter-Killers (UFOs) which perform regional missions: Supply, Retaliation, Infiltration, Research etc. Each different base type generates different missions:
* H bases generate additional bases of type B or C or Supply missions
* I generates Retaliation/Infiltration/Supply missions
* L generates Abductions/Harvest/Supply missions

Or, if there was instead an 'Interception' alienMission, it could be assigned to base type I, or a base type specifically dedicated to Interception and it would be run several times in a month, and even set specific patrol areas using missionZones.

But alien bases launching automatically interceptors works too.
Title: Re: Active Alien Geoscape AI - has anyone ever taken a stab at this?
Post by: Stoddard on August 20, 2016, 01:45:28 am
Oh, this sounds really interesting. I suppose the alien bases could also be set to launch interceptions?

But of course. Cities are there only because there's much more of them currently than the bases, and it fits xpiratez lore, which I understand assumes there's big faction presence in cities.

(https://dl.dropboxusercontent.com/u/18824603/screen171.png)

Each of the different letters is a type of Skynet base. Bases generate Aerial Hunter-Killers (UFOs) which perform regional missions: Supply, Retaliation, Infiltration, Research etc. Each different base type generates different missions:
* H bases generate additional bases of type B or C or Supply missions
* I generates Retaliation/Infiltration/Supply missions
* L generates Abductions/Harvest/Supply missions

Or, if there was instead an 'Interception' alienMission, it could be assigned to base type I, or a base type specifically dedicated to Interception and it would be run several times in a month, and even set specific patrol areas using missionZones.

But alien bases launching automatically interceptors works too.

That's really nice.

I didn't start yet on how all the activity will be guided by rulesets really. Currently it's like GCI, in addition to regular missions, if the code decides you're detected, and random gods wink so an so (to be tied into craft availability), it spawns an ufo and guides it to the target, no connection to existing AlienMissions.

As it is, the only AlienMission that resembles interception a bit is the base assault, and it is so hardcoded, that it's useless as a model. So something else will emerge. Currently I'm reassigning missions from ufos to flights of ufos, so that the dogfight UI will have some uniform place to fetch info from.
Title: Re: Active Alien Geoscape AI - has anyone ever taken a stab at this?
Post by: Hobbes on August 20, 2016, 02:12:06 am
I didn't start yet on how all the activity will be guided by rulesets really. Currently it's like GCI, in addition to regular missions, if the code decides you're detected, and random gods wink so an so (to be tied into craft availability), it spawns an ufo and guides it to the target, no connection to existing AlienMissions.

Well this is great just as a difficulty option for OpenXCom: activate it and a few ufos will instead attack your craft if detected by either a base or a ufo

Quote
As it is, the only AlienMission that resembles interception a bit is the base assault, and it is so hardcoded, that it's useless as a model. So something else will emerge. Currently I'm reassigning missions from ufos to flights of ufos, so that the dogfight UI will have some uniform place to fetch info from.

If the GCI option was available, then all it would require is a setting for the specific ufo type (canIntercept: true) for the ruleset so that the engine uses the detection/interception for this specific type, then it would be a matter of creating a regular alienMission of objective 0 like Alien Patrol (who just fly around and not land), assign to its waves the interceptor ufos  and you could have alien bases spawning either intercept or/and patrol missions.
Title: Re: Active Alien Geoscape AI - has anyone ever taken a stab at this?
Post by: Stoddard on August 20, 2016, 03:20:16 am
Well this is great just as a difficulty option for OpenXCom: activate it and a few ufos will instead attack your craft if detected by either a base or a ufo

If the GCI option was available, then all it would require is a setting for the specific ufo type (canIntercept: true) for the ruleset so that the engine uses the detection/interception for this specific type, then it would be a matter of creating a regular alienMission of objective 0 like Alien Patrol (who just fly around and not land), assign to its waves the interceptor ufos  and you could have alien bases spawning either intercept or/and patrol missions.


I'm not sure how bases can spawn missions, but anyway I don't know enough about modding side yet. These simple rules would be a great start, thank you.

I plan to stop at 4x4 max intercepts right now, each intercept window will show all the ufos, current target being designated like this:

(https://s4.postimg.org/3su9y7an1/reti.png) (https://postimg.org/image/6zothtv2x/) (https://postimage.org/)

and changed by just clicking another ufo; the "show ufo" button showing currently designated target, possibly with damage levels (might depend on a craft module). Did not decide on how approach should work wrt other ufos yet, any ideas appreciated.

This flight vs ufo business proves to be tough though.
Title: Re: Active Alien Geoscape AI - has anyone ever taken a stab at this?
Post by: Solarius Scorch on August 20, 2016, 10:33:24 am
Cool, we could have UFO formations then. Like in Xenonauts, where it could be a real PITA.

What's next, tactical aerial combat? :)
Title: Re: Active Alien Geoscape AI - has anyone ever taken a stab at this?
Post by: Yankes on August 20, 2016, 10:42:25 am
I think one biggest change needed to made intercepting workable is blocking of minimizing dogfight windows when UFO is in aggressive stance.
With that you can easy surpass limit of interceptions without any exploits.

Image that I send 4 crafts to attack some ufo and another to attack base. Now when I have all 4 in range I decide to only follow it and not to attack.
But meanwhile my transport craft get attacked. New popup is shown (maybe with different color when ufo is aggressive?) all other are blocked and now I need resolve this fight to continue. I can press disengage to try run away but as long ufo is in range and aggressive you cant skip it.
Similar for normal interceptions, normally you can always end fight but if you piss off it too much it switch to aggressive and block you option to minimize all windows.

With that all fights always will be 1 vs 1 or 1 vs 4 if you start it. Is no way to block alien interceptions because if all other windows are hidden then you will have new popup but if they are show then time is stop.

If something like that will be implemented I gladly grab it to my branch.
Title: Re: Active Alien Geoscape AI - has anyone ever taken a stab at this?
Post by: Meridian on August 20, 2016, 10:45:57 am
I think that shouldn't be too hard to implement.

However, if we do that, we need also those X-Com crash sites...
Title: Re: Active Alien Geoscape AI - has anyone ever taken a stab at this?
Post by: Solarius Scorch on August 20, 2016, 12:24:54 pm
However, if we do that, we need also those X-Com crash sites...

It would be nice, but Xenonauts skipped this part.
X-Com: Apocalypse did that too, BTW. Whoever was on board, dies.

A possible half-assed solution would be to go the Power Dolls route: any lost crew has a chance of returning. If it happens, it happens within days or weeks, not straight away.
It's not very elegant and would require new mechanics, but the feels when someone you thought dead suddenly shows up at your base are wonderful. :)
Title: Re: Active Alien Geoscape AI - has anyone ever taken a stab at this?
Post by: Hobbes on August 20, 2016, 04:45:05 pm
It's not very elegant and would require new mechanics, but the feels when someone you thought dead suddenly shows up at your base are wonderful. :)

"Frank, you're alive!"
"Quick, shoot it you moron! That's a alien disguised as Frank!"
Title: Re: Active Alien Geoscape AI - has anyone ever taken a stab at this?
Post by: Solarius Scorch on August 20, 2016, 05:18:45 pm
"Frank, you're alive!"
"Quick, shoot it you moron! That's a alien disguised as Frank!"

...well, at least we recover his corpse...
Title: Re: Active Alien Geoscape AI - has anyone ever taken a stab at this?
Post by: Stoddard on August 20, 2016, 06:23:00 pm
A possible half-assed solution would be to go the Power Dolls route: any lost crew has a chance of returning. If it happens, it happens within days or weeks, not straight away.
It's not very elegant and would require new mechanics, but the feels when someone you thought dead suddenly shows up at your base are wonderful. :)

Set up a transfer. Choose a base that has spare barracks space at random.

This should be easy enough to implement. Only the surprise part isn't entirely possible: even if the transfer is made to not show in transfer lists, the barrack space must be reserved. If the only base with spare space is the launching one, that'd be a clue that someone made it out. Still unknown who exactly of course.
Title: Re: Active Alien Geoscape AI - has anyone ever taken a stab at this?
Post by: Hobbes on August 20, 2016, 07:30:11 pm
...well, at least we recover his corpse...

Just to quietly dispose of it in the base's furnace because funeral services were held for Frank 3 weeks ago and you wouldn't want to upset his family again, would you?

Set up a transfer. Choose a base that has spare barracks space at random.

This should be easy enough to implement. Only the surprise part isn't entirely possible: even if the transfer is made to not show in transfer lists, the barrack space must be reserved. If the only base with spare space is the launching one, that'd be a clue that someone made it out. Still unknown who exactly of course.

This idea of the crew or parts of it returning after some days doesn't make much sense if you consider that if there was a crash there would be a search and rescue operation right away.

Also, why would aliens be present on a crashed xcom craft site?

The aliens could assault the crashed craft right away (and you'd be defending it, so essentially another ufo mission), but it doesn't make much sense for these sites to be present for days or weeks.
Title: Re: Active Alien Geoscape AI - has anyone ever taken a stab at this?
Post by: Stoddard on August 21, 2016, 03:41:42 am

This idea of the crew or parts of it returning after some days doesn't make much sense if you consider that if there was a crash there would be a search and rescue operation right away.

I guess the idea was that it was you who has to execute CSAR. Which you might not be able to do right away. So if enemy doesn't arrive, and friendlies don't arrive, survivors hitchhike out and you lose whatever equipment survived the crash.

It all depends on the setting. I agree this all doesn't make much sense in vanilla setting. There are others though.

Also, why would aliens be present on a crashed xcom craft site?

They don't, unless they come, as you say. They might not be able or willing to come though.

The aliens could assault the crashed craft right away (and you'd be defending it, so essentially another ufo mission), but it doesn't make much sense for these sites to be present for days or weeks.

The first part I agree, but still think that for some settings having to do SAR yourself or lose stuff and possibly more people might make sense.

I'm of no opinion on whether or how exactly to implement this. Got to do the basics first. Let's return to this after hostile intercepts and multifights actually work.
Title: Re: Active Alien Geoscape AI - has anyone ever taken a stab at this?
Post by: Stoddard on September 01, 2016, 04:10:16 am
I'm writing god-damned flight model for the ufos, complete with orbital insertions and reentry. Someone please stop me.

Also, Hobbes, how did you do non-stock markers for the bases?
Title: Re: Active Alien Geoscape AI - has anyone ever taken a stab at this?
Post by: Hobbes on September 01, 2016, 07:16:53 am
Also, Hobbes, how did you do non-stock markers for the bases?

Code: [Select]
alienDeployments:
  - type: STR_SKYNET_BASE_ASSAULT_CORE
    markerName: STR_SKYNET_CORE
    markerIcon: 13
extraSprites:
  - type: GlobeMarkers
    width: 60
    height: 3
    subX: 3
    subY: 3
    files:
      0: Resources/Geoscape/globe_ufo_expanded.png

You can find the vanilla markers on \openxcom\standard\xcom1\Resources\UI\globe_ufo.png, just add to that image file the new markers (they're 3x3 in dimensions so really limited in design). You can add new markers for bases and terror sites but for everything else (UFOs, craft and waypoints) you can only replace the existing markers.
Title: Re: Active Alien Geoscape AI - has anyone ever taken a stab at this?
Post by: Solarius Scorch on September 01, 2016, 10:31:48 pm
I'm writing god-damned flight model for the ufos, complete with orbital insertions and reentry. Someone please stop me.

Are you trying to woo me? Because it's working. :)

I'm not sure how much it relates to Area 51, but I'd love to hear more.

You can find the vanilla markers on \openxcom\standard\xcom1\Resources\UI\globe_ufo.png, just add to that image file the new markers (they're 3x3 in dimensions so really limited in design). You can add new markers for bases and terror sites but for everything else (UFOs, craft and waypoints) you can only replace the existing markers.

How are these extra markers numbered? In your example it's number 13, but where does it start?
Title: Re: Active Alien Geoscape AI - has anyone ever taken a stab at this?
Post by: Hobbes on September 01, 2016, 10:57:06 pm

I'm not sure how much it relates to Area 51, but I'd love to hear more.

This isn't related at all with Area 51. If this is implemented it might be included on the Terminator: Tech-Com mod, but right now that total conversion is way still on its early stage.

Quote
How are these extra markers numbered? In your example it's number 13, but where does it start?

0-8 are used for vanilla, extra markers start at 9

Title: Re: Active Alien Geoscape AI - has anyone ever taken a stab at this?
Post by: Solarius Scorch on September 01, 2016, 11:55:56 pm
Thank you. One last question, what palette does it use?
Title: Re: Active Alien Geoscape AI - has anyone ever taken a stab at this?
Post by: ivandogovich on September 02, 2016, 12:13:37 am
Thank you. One last question, what palette does it use?
Geoscape at a guess.
Title: Re: Active Alien Geoscape AI - has anyone ever taken a stab at this?
Post by: Hobbes on September 02, 2016, 12:39:21 am
Geoscape at a guess.

Yup, Geoscape palette it is and I'd advise to stick to the top row of colors because all the other ones are used for the terrain textures, space background, etc. You'll also notice that each color on the top row has 2 different tones. The 2nd tone is used for the 'blinking' effect on Geoscape, I think, so you can't assign that one as well.
Title: Re: Active Alien Geoscape AI - has anyone ever taken a stab at this?
Post by: Solarius Scorch on September 02, 2016, 12:56:22 am
Thank you guys. This is valuable info.

Now, getting back on topic... I wonder how aggressive alien air force would work in the vanilla. I guess Skyranger would be too much of an iron coffin to be in use, so before you get Lighting you would be really stressed, and that would kinda suck - there's nothing you can do, you just lose your entire team sometimes. Unless you could give your Skyranger some escort, that would actually be interesting.

Speaking of formations... Yes, formations. Three planes that act like one (at least as long as all have enough fuel). Would help with managing interceptions.

And UFOs in formations? That would be so wicked. What's worse than being attacked by an alien vessel? Being attacked by two alien vessels. Want to shoot down that Terror Ship? Deal with these three Large Scouts first.
Title: Re: Active Alien Geoscape AI - has anyone ever taken a stab at this?
Post by: Hobbes on September 02, 2016, 01:16:46 am
Now, getting back on topic... I wonder how aggressive alien air force would work in the vanilla. I guess Skyranger would be too much of an iron coffin to be in use, so before you get Lighting you would be really stressed, and that would kinda suck - there's nothing you can do, you just lose your entire team sometimes. Unless you could give your Skyranger some escort, that would actually be interesting.

Send the Interceptor first to scout and engage possible hostile UFOs? Of course, if your Interceptors don't have range, then you either risk sending the Skyranger without protection or don't the mission at all. Or send a Darkstar or another AWACS type craft to monitor the hostile UFOs and then maneuver the Skyranger to avoid their paths. Plenty of possibilities there.

Quote
Speaking of formations... Yes, formations. Three planes that act like one (at least as long as all have enough fuel). Would help with managing interceptions.

And UFOs in formations? That would be so wicked. What's worse than being attacked by an alien vessel? Being attacked by two alien vessels. Want to shoot down that Terror Ship? Deal with these three Large Scouts first.

To me this feature would not require formations to work - add the ability for airborne UFOs to detect and engage XCOM craft, add a new alienMission to regularly generate Alien Patrols (in addition to specific flags for some UFOs in the vanilla mission to act as escorts) and you're all set.

Formations come from Xenonauts, and from the reviews I've read 80-95% times you simply click on the autoresolve button to skip aerial combat. Which makes sense because these game is all about tactical combat, the air combat is mainly for show.
Title: Re: Active Alien Geoscape AI - has anyone ever taken a stab at this?
Post by: Solarius Scorch on September 02, 2016, 01:22:16 am
Send the Interceptor first to scout and engage possible hostile UFOs? Of course, if your Interceptors don't have range, then you either risk sending the Skyranger without protection or don't the mission at all. Or send a Darkstar or another AWACS type craft to monitor the hostile UFOs and then maneuver the Skyranger to avoid their paths. Plenty of possibilities there.

To me this feature would not require formations to work - add the ability for airborne UFOs to detect and engage XCOM craft, add a new alienMission to regularly generate Alien Patrols (in addition to specific flags for some UFOs in the vanilla mission to act as escorts) and you're all set.

It depends on how exactly it works, I am somewhat sceptical about the ability to outmanoeuvre UFOs on the globe, if they go for the kill. I mean they can simply ignore the Interceptor and go around it, plus keeping the Interceptor close to the much slower Skyranger would be a chore (unless X-Com craft can follow another, I never tried).

Formations come from Xenonauts, and from the reviews I've read 80-95% times you simply click on the autoresolve button to skip aerial combat. Which makes sense because these game is all about tactical combat, the air combat is mainly for show.

Well, in my opinion that was the best part of the game. :P And it was somewhat tactical, though simple.
Title: Re: Active Alien Geoscape AI - has anyone ever taken a stab at this?
Post by: Yankes on September 02, 2016, 01:37:48 am
It depends on how exactly it works, I am somewhat sceptical about the ability to outmanoeuvre UFOs on the globe, if they go for the kill. I mean they can simply ignore the Interceptor and go around it, plus keeping the Interceptor close to the much slower Skyranger would be a chore (unless X-Com craft can follow another, I never tried).

Then we should add option for "follow" your crafts. After that it should be rule that if one craft is attacked and have another very close by (they could start interception) they can join fight.

I think another important element is that ufo should switch to "combat speed" that is slower than max speed. This will allow sometimes run away from it before ufo start chase you at max speed again.
Title: Re: Active Alien Geoscape AI - has anyone ever taken a stab at this?
Post by: Arthanor on September 02, 2016, 01:46:22 am
It depends on how exactly it works, I am somewhat sceptical about the ability to outmanoeuvre UFOs on the globe, if they go for the kill. I mean they can simply ignore the Interceptor and go around it, plus keeping the Interceptor close to the much slower Skyranger would be a chore (unless X-Com craft can follow another, I never tried).

Well, in my opinion that was the best part of the game. :P And it was somewhat tactical, though simple.

The aerial combat was the only thing I've ever seen that appealed to me in Xenonauts, it sure is more interesting that XCom's. Although since I never played, I don't know if I'd have gotten bored of it. And it raises the question: If UFOs are as maneuverable as they should be (from UFO reports they do all kinds of crazy things no plane could), wouldn't they just outclass your interceptors and dance around you?

I think what Hobbes was going for is to scout the area and stay away from the detection range of UFOs, if present. If they don't see you, they can't go for the kill (hence the AWACS being useful). The ability to follow a skyranger with an interceptor and, if engaged by an UFO, to automatically start a 2vs1 battle as both the skyranger and interceptor engage the UFO, would be really neat too.
Title: Re: Active Alien Geoscape AI - has anyone ever taken a stab at this?
Post by: Hobbes on September 02, 2016, 02:03:46 am
I think another important element is that ufo should switch to "combat speed" that is slower than max speed. This will allow sometimes run away from it before ufo start chase you at max speed again.

How about adding a 'Evasive Maneuvers' button  (or replacing the vanilla button to disengage) where the craft attempts at 50% chance to break off from the ufo, if successful the ufo has to reacquire your craft on radar before attacking again? This evasion chance could then increase to 75% once UFO Navigation is researched.

To me having a combat speed vs maximum speed makes perfectly sense for current human planes built to our current understanding of physics, which places limits both on the pilot and craft, but an extraterrestrial civilization capable of building craft magically moved by anti-gravity waves might not have that limitation and use its max speed whenever it wants (or as long as there's Elerium) :)
Title: Re: Active Alien Geoscape AI - has anyone ever taken a stab at this?
Post by: Solarius Scorch on September 02, 2016, 02:51:26 am
Then we should add option for "follow" your crafts. After that it should be rule that if one craft is attacked and have another very close by (they could start interception) they can join fight.

See? A formation! :D

How about adding a 'Evasive Maneuvers' button  (or replacing the vanilla button to disengage) where the craft attempts at 50% chance to break off from the ufo, if successful the ufo has to reacquire your craft on radar before attacking again? This evasion chance could then increase to 75% once UFO Navigation is researched.

I like this idea. It's simple and does the job, and doesn't break anything.
I imagine it would have a cooldown, yes?

To me having a combat speed vs maximum speed makes perfectly sense for current human planes built to our current understanding of physics, which places limits both on the pilot and craft, but an extraterrestrial civilization capable of building craft magically moved by anti-gravity waves might not have that limitation and use its max speed whenever it wants (or as long as there's Elerium) :)

I kinda agree... Well, it could be different, but why complicate things?
Title: Re: Active Alien Geoscape AI - has anyone ever taken a stab at this?
Post by: Yankes on September 02, 2016, 11:39:00 am
How about adding a 'Evasive Maneuvers' button  (or replacing the vanilla button to disengage) where the craft attempts at 50% chance to break off from the ufo, if successful the ufo has to reacquire your craft on radar before attacking again? This evasion chance could then increase to 75% once UFO Navigation is researched.

To me having a combat speed vs maximum speed makes perfectly sense for current human planes built to our current understanding of physics, which places limits both on the pilot and craft, but an extraterrestrial civilization capable of building craft magically moved by anti-gravity waves might not have that limitation and use its max speed whenever it wants (or as long as there's Elerium) :)
I think that current disengage will work as evasive maneuvers if click multiple times or something.
Title: Re: Active Alien Geoscape AI - has anyone ever taken a stab at this?
Post by: Stoddard on September 04, 2016, 07:25:27 am
A bit of an update.

The nightvision mode, sca work and another upcoming patch doesn't mean I abandoned geoscape ai. It's just I got a bit burned out reworking the coordinate system and then relearning how to code autopilots given non-dead-trivial constraints. So the work is continuing.

Current short-term goals are:


The first release will include:


Those points round up the base. After that's done the following will be trivial to do and will follow shortly:



I often found whatever was happening in the geoscape to be either too boring or too short, and the game consisting mostly of the same ground missions over and over again. Dioxine made a great work of fixing the issue by enormously expanding research, manufacture and ground mission variety, for which I'm eternally grateful. But still the geoscape minus basescape looks dead-ish. Not as dead as in vanilla, but still. This will fix it.
Title: Re: Active Alien Geoscape AI - has anyone ever taken a stab at this?
Post by: Yankes on September 04, 2016, 02:37:11 pm
How your code will handle old saves? And when I save in new exe, old one could open it without crash?

What will be default behavior? UFO always attacks? Or its config that enable it?

To include to my branch (Meridian could have different criteria for his brach) I would like that overall default behavior will stay same (same time for dogfight and geoscepe is detail that can be changed).
Another thing is that save file do not change its structure, if you need add something its better if it separate node not used by normal OXC.
Title: Re: Active Alien Geoscape AI - has anyone ever taken a stab at this?
Post by: Stoddard on September 04, 2016, 03:13:43 pm
Since there are so many things built on existing alien mission system, I made all my changes separate.
It's in fact another class of Ufos, driven by separate code, they just share the stats and icons.
Old code and ufos that belong to it operate as usual.

How your code will handle old saves? And when I save in new exe, old one could open it without crash?

Old saves have old UFOs, old missions, so old code handles that. It's not going anywhere.

Load code just ignores stuff it doesn't know about, if it's separate enough, so I don't see any crashes forthcoming.

What will be default behavior? UFO always attacks? Or its config that enable it?

New code does not automatically take over over anything, this has to be done in the mods.
All old missions work exactly as they did before. So do the ufos they spawn.

To include to my branch (Meridian could have different criteria for his brach) I would like that overall default behavior will stay same (same time for dogfight and geoscepe is detail that can be changed).

From the start it all was done so that if one turns off the new ai, or opens the save in an old build, all new features just vanish.
So the old dogfight code will have to stay. I have yet to think this through though.

Another thing is that save file do not change its structure, if you need add something its better if it separate node not used by normal OXC.

That's the plan.


Title: Re: Active Alien Geoscape AI - has anyone ever taken a stab at this?
Post by: Yankes on September 04, 2016, 03:28:15 pm
Great, I looking forward to steal it when you finish it :)
Title: Re: Active Alien Geoscape AI - has anyone ever taken a stab at this?
Post by: Meridian on September 04, 2016, 03:36:11 pm
To include to my branch (Meridian could have different criteria for his branch) I would like that overall default behavior will stay same (same time for dogfight and geoscape is detail that can be changed).

No, my criteria are basically the same.
I want that OXCE+ can be used with vanilla ruleset and have the same mechanics.
Most (if not all) of my features are:
1. either optional, i.e. activated by mods
2. or QoL improvement without any effect to game mechanics

The only exceptions I can think of are:
a/ the default experience training for throwing accuracy... but I plan to make this optional in the future too
b/ arcing shot miss fix... which was removed for now, but will be re-introduced sooner or later
c/ turned off crazy CGA flashing epileptic 1 frame effect on explosions... I hope nobody wants that shit back!
d/ going to Mars is possible only with 100% fuel
e/ alt, shift and ctrl cannot be used as hotkeys

PS: @Yankes: I hope that your new lighting changes in OXCE 3.3 will be optional too, and won't affect performance negatively
Title: Re: Active Alien Geoscape AI - has anyone ever taken a stab at this?
Post by: Yankes on September 04, 2016, 04:10:05 pm
PS: @Yankes: I hope that your new lighting changes in OXCE 3.3 will be optional too, and won't affect performance negatively
This will depend how it will work on other people machines. First will be always enabled and I will try optimize it further if someone have bad performance.
If I do not manage to fix it, I will disable this feature for default and add option in ruleset to enable it back. I simply need some feedback to fine tune it.
You can be first beta tester if you want :) Right now most costly part is light from fire, especially when you set whole map on fire.
Title: Re: Active Alien Geoscape AI - has anyone ever taken a stab at this?
Post by: Hobbes on September 04, 2016, 05:38:06 pm
  • A disgustingly artificial limit of 4 dogfight participants per side.. but required so as to not have to design a whole new dogfight UI.

I think the 4 craft per side limit is quite sensible. Having to control dozens of craft might sound nice but the more craft you add, the more playability will suffer because of all the micromanagement involved.
Title: Re: Active Alien Geoscape AI - has anyone ever taken a stab at this?
Post by: Stoddard on September 11, 2016, 02:44:48 am
An update.

Prototype flight model is partially implemented. What's missing is the code to have them behave at close ranges.


Todo list for the first playable release is thus:



Next things would be:
Title: Re: Active Alien Geoscape AI - has anyone ever taken a stab at this?
Post by: Solarius Scorch on September 11, 2016, 02:54:04 am
This is going to be a revolution.
Title: Re: Active Alien Geoscape AI - has anyone ever taken a stab at this?
Post by: Hobbes on January 25, 2017, 10:39:18 pm
And I've decided to give this thread another bump since this is something that really interests me for my future plans :)
Title: Re: Active Alien Geoscape AI - has anyone ever taken a stab at this?
Post by: HelmetHair on January 26, 2017, 12:35:37 am
Sheeeyit.

Any progress?
Title: Re: Active Alien Geoscape AI - has anyone ever taken a stab at this?
Post by: KBGhost on February 24, 2017, 02:34:14 pm
Bump. Is Stoddard still working on this?
And if not can someone else pick this up?
It looks very interesting but I have no coding knowledge.
Title: Re: Active Alien Geoscape AI - has anyone ever taken a stab at this?
Post by: Hobbes on August 25, 2017, 06:54:26 pm
And another bump, since I've started pushing the Terminator total conversion for an alpha release, and I've been long wanting to include this feature.
Title: Re: Active Alien Geoscape AI - has anyone ever taken a stab at this?
Post by: Stoddard on August 25, 2017, 11:39:19 pm
The short story: prototyping AI in C++ is masochism. Even adding trivial features like the leeroy-jenkins mode is, well.., it took way more time than expected. So..

So I wrote bits and pieces of an 'AI' (but mostly ufos moving around on a geoscape, some data structures to extend their 'awareness', pure python junk code piles). That was promising.

I then embedded a Python interpreter in the game, since the previous approach of communicating with a separate process running the alien AI was a) very high latency, slowing the game like 10+ times, b) hard to maintain api/protocol-wise.

See https://openxcom.org/forum/index.php/topic,5519.msg84269.html (https://openxcom.org/forum/index.php/topic,5519.msg84269.html)

As it says there, the UI is the hardest part in the game to control/define an exported api/this kind of thing. Still quite straightforward if a bit boring.

And it's also the first part that has to be done, since new AI requires debug (which is better done via UI) and also UI as such.

Since July I was settling in at a new job, so there wasn't any progress. I think in September there would be some.
Title: Re: Active Alien Geoscape AI - has anyone ever taken a stab at this?
Post by: Hobbes on August 26, 2017, 12:31:08 am
The short story: prototyping AI in C++ is masochism. Even adding trivial features like the leeroy-jenkins mode is, well.., it took way more time than expected. So..

So I wrote bits and pieces of an 'AI' (but mostly ufos moving around on a geoscape, some data structures to extend their 'awareness', pure python junk code piles). That was promising.

I then embedded a Python interpreter in the game, since the previous approach of communicating with a separate process running the alien AI was a) very high latency, slowing the game like 10+ times, b) hard to maintain api/protocol-wise.

See https://openxcom.org/forum/index.php/topic,5519.msg84269.html (https://openxcom.org/forum/index.php/topic,5519.msg84269.html)

As it says there, the UI is the hardest part in the game to control/define an exported api/this kind of thing. Still quite straightforward if a bit boring.

And it's also the first part that has to be done, since new AI requires debug (which is better done via UI) and also UI as such.

Since July I was settling in at a new job, so there wasn't any progress. I think in September there would be some.

I was hoping but not expecting for a reply. Sweet :)

One of my wishes for the Terminator TC is to have Hunter-Killers conducting aerial patrols in regions and intercepting Resistance craft. I've already been modifying some of the missionZones used to determine the flight paths of UFOs since this might require some specific waypoints
Title: Re: Active Alien Geoscape AI - has anyone ever taken a stab at this?
Post by: Meridian on September 21, 2017, 08:00:02 pm
Don't want to steal this thread, so I opened a new one with some pre-alpha hunter killer footage: https://openxcom.org/forum/index.php/topic,5717.0.html

It doesn't have any big ambitions, just allow UFOs to attack xcom under some conditions and allow alien bases to spawn such hunter killers too.