Author Topic: Another look at Geoscape AI.  (Read 17099 times)

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Another look at Geoscape AI.
« Reply #15 on: November 07, 2012, 12:00:22 pm »
as found on:
https://www.ufopaedia.org/index.php?title=UFOs#UFO_Behavior

Quote
UFOs will ALWAYS head to their mission locale (as listed in the Hyper-Wave Decoder information) at top speed and then initiate one of the following behaviors depending on the mission

so the first waypoint is in the mission area, any additional waypoints would probably be generated within the borders of the target region (country?) or a radius of the original waypoint, until "go home" is triggered (-1?)

Quote
If you are successful at preventing lesser UFOs from doing their jobs, the aliens will eventually send Battleships to do the dirty work, hoping you won't be able to attack them. (They will not participate in Alien Research and Alien Terror missions, though.)

translation: shoot down scouts, aliens get mad and send bigger scouts and eventually battleships as scouts, or even as the mission ships themselves. (in certain cases, hence why we define it in the rulesets)

see also:
https://www.ufopaedia.org/index.php?title=Terror_Mission#UFOs_with_Terror_Missions

Quote
If you are consistent and successfully destroy the scouts, the aliens will start sending out heavier UFO classes as scouts. This will gradually increase until you finally have Battleships and Terror Ships as scouts during the last few UFOs in the Alien Terror waves.
« Last Edit: November 07, 2012, 12:05:44 pm by Warboy1982 »

Volutar

  • Guest
Re: Another look at Geoscape AI.
« Reply #16 on: November 07, 2012, 12:08:59 pm »
what vanilla are you talking about?
ufopaedia doesn't have too much info on how waypoints work. but this info was properly reversed and was given to oxc developers. waypoints are limited to regions. each region actually have its own set of waypoint zones for each trajectory stage.

Offline karvanit

  • Captain
  • ***
  • Posts: 94
    • View Profile
Re: Another look at Geoscape AI.
« Reply #17 on: November 07, 2012, 12:14:02 pm »
what vanilla are you talking about?
ufopaedia doesn't have too much info on how waypoints work. but this info was properly reversed and was given to oxc developers. waypoints are limited to regions. each region actually have its own set of waypoint zones for each trajectory stage.

Good to know. The published OpenXcom does not have waypoint information right now, all waypoints are random coordinates. Could you provide a file or page with this information, so I can take advantage of it?

Offline karvanit

  • Captain
  • ***
  • Posts: 94
    • View Profile
Re: Another look at Geoscape AI.
« Reply #18 on: November 07, 2012, 12:21:51 pm »
translation: shoot down scouts, aliens get mad and send bigger scouts and eventually battleships as scouts, or even as the mission ships themselves. (in certain cases, hence why we define it in the rulesets)

see also:
https://www.ufopaedia.org/index.php?title=Terror_Mission#UFOs_with_Terror_Missions

Yes, but on eg Terror info from MISSIONS.DAT it appears only 4 ships will take part in the terror mission. Two scout and two terror ships.

So, how does it work? How do we want to encode it so that at least the vanilla behaviour happens for 1.0? How to encode it so that additional things can be done just by tweaking the ruleset?

Volutar

  • Guest
Re: Another look at Geoscape AI.
« Reply #19 on: November 07, 2012, 12:49:52 pm »
each mission row in mission array referred to predefined craft+mission table trajectory type.
there are 10 trajectory types.
each trajectory type can have maximum 8 stages, and each of it have its own speed %, altitude and globe site.
globe sites are taken from huge table of 720 random squares. it devided on 12 zones (actual game zones). each zone have 6 different sites, and each site consists of 10 random areas. when game choose location - it takes random location from one of these 10 random areas.

some of sites actually have width=height=0 (which is city location). which are used for terror missions (and for city rendering as well).

https://pastebin.com/SUDr1YF0

you can see them visualized with my globe editor https://www.ufopaedia.org/index.php?title=User:Volutar (second list at right)

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Another look at Geoscape AI.
« Reply #20 on: November 07, 2012, 02:14:31 pm »
minScouts: 2
maxScouts: 2
MinMissionShips: 2
MaxMissionShips: 2

also, i'm done with the code to read in the ruleset as per your requests, gonna attempt to merge now.

here's the basic structure for the ruleset:

Code: [Select]
missions:
  - type: STR_ALIEN_HARVEST
    scoutList:
      - STR_SMALL_SCOUT
      - STR_MEDIUM_SCOUT
      - STR_LARGE_SCOUT
      - STR_BATTLESHIP
    minScouts: 1
    maxScouts: 3
    minScoutTime: 120
    maxScoutTime: 240
    scoutFlightPattern: [ 0, 0, 1, 0, 0, 1, 0, -1 ]
    missionShip:
      - STR_HARVESTER
      - STR_BATTLESHIP
    minMissionShips: 1
    maxMissionShips: 3
    minMissionTime: 80
    maxMissionTime: 300
    missionFlightPattern: [ 0, 1, 2, 0, -1, -1, -1, -1 ]
    points: 100
    races:
      - STR_SECTOID: 50
        STR_SNAKEMAN: 20
        STR_MUTON: 0
        STR_ETHEREAL: 0
        STR_FLOATER: 30
      - STR_SECTOID: 50
        STR_SNAKEMAN: 0
        STR_MUTON: 0
        STR_ETHEREAL: 0
        STR_FLOATER: 50
      - STR_SECTOID: 30
        STR_SNAKEMAN: 0
        STR_MUTON: 30
        STR_ETHEREAL: 0
        STR_FLOATER: 40
      - STR_SECTOID: 10
        STR_SNAKEMAN: 0
        STR_MUTON: 40
        STR_ETHEREAL: 0
        STR_FLOATER: 50
      - STR_SECTOID: 30
        STR_SNAKEMAN: 0
        STR_MUTON: 30
        STR_ETHEREAL: 0
        STR_FLOATER: 40

obviously not all these values are the PROPER values, i just needed something to read in to test it, but it should have all you need available.

Offline karvanit

  • Captain
  • ***
  • Posts: 94
    • View Profile
Re: Another look at Geoscape AI.
« Reply #21 on: November 07, 2012, 04:20:03 pm »
@volutar: Great information, thank you. Could you also add the region and zone for each area?
@Warboy1982:
Races should be a sequence of maps, like so:
Code: [Select]
races:
  - afterMonth: 0
    distribution:
      STR_SECTOID: 10
      STR_MUTON: 5
  - afterMonth: 3
    distribution:
      STR_SECTOID: 10
      STR_FLOATER: 20
      STR_MUTON: 50

Taking the info Volutar has uncovered, I think we should either have a table of trajectories common to all missions (and use trajectory number / id) or replicate the trajectory information per type (scout / mission). I'm leaning towards common list and using ids myself, less typing / cut-and-paste. This means the flightPattern is not needed as we discussed.

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Another look at Geoscape AI.
« Reply #22 on: November 07, 2012, 04:24:55 pm »
i can't figure out github.
i have the changes ready to push, but i don't think i forked it properly, nor do i really see any option to.
little help?
or you want me to post... what i've changed... somewhere?

edit ---

https://dl.dropbox.com/u/47596892/Changes.rar

because i can't find the "fork this" button
« Last Edit: November 07, 2012, 04:53:07 pm by Warboy1982 »

Offline karvanit

  • Captain
  • ***
  • Posts: 94
    • View Profile
Re: Another look at Geoscape AI.
« Reply #23 on: November 07, 2012, 05:04:32 pm »
The steps to do to prepare a clean pull request are:
  • Add my repository as a remote (let's say karvanit).
  • Create a local branch from the branch you want to get merged in eventually. (my devel)
  • Work locally until you are satisfied (making logical and nicely commented commits!).
  • Push your changes to a new branch on GitHub.
  • Make the pull request.

In command line git the commands are (assuming your GitHub remote is origin:
  • git remote add -t devel karvanit git:https://github.com/karvanit/OpenXcom.git
  • git checkout --no-track -b for-karvanit karvanit/devel
  • ... (many git commits later)
  • git push origin for-karvanit


If you are using a GUI tool, I'm sorry, but you'll have to figure the proper way to do steps 1,2 and 4, I have ABSOLUTELY no experience with them.

Offline karvanit

  • Captain
  • ***
  • Posts: 94
    • View Profile
Re: Another look at Geoscape AI.
« Reply #24 on: November 08, 2012, 12:08:53 am »
I now have code to read / write (incomplete) alien mission rules in 'devel'.
Only the racial distribution is stored for now, and I'm not actually using the rules yet.

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Another look at Geoscape AI.
« Reply #25 on: November 08, 2012, 06:35:34 am »
and this is the point where i say "forget the whole thing" and move on to something else.
you've got my code, whether you use it or not is up to you, github has made this whole process about 1000x more painful, frustrating and downright confusing than it needs to be.
github is about as user friendly as a bicycle with no seat, no handlebars and no wheels.
good luck with it.
« Last Edit: November 08, 2012, 06:39:06 am by Warboy1982 »

Volutar

  • Guest
Re: Another look at Geoscape AI.
« Reply #26 on: November 08, 2012, 07:30:24 am »
karvanit, what do you mean by "region and zone for each area"?
There's also race/mission/month distributon data (https://pastebin.com/4wCVZ36G) .. that's all.

I suppose all this table/distribution data should be somehow unwrapped into uniform ruleset structure.
 But I have no clue how to do that, considering the fact, that there are number of crosstables over there, and it can be unwrapped in different priority, like race as main structure, or mission as main structure, or zone.. or something else. Trajectories probably better to be defined in separate ruleset.
There is another way. We may totally unrwap whole hierarchy, and "mission setup" way from the start, and re-invent this.

Offline Fenyő

  • Colonel
  • ****
  • Posts: 423
    • View Profile
Re: Another look at Geoscape AI.
« Reply #27 on: November 08, 2012, 07:33:03 am »
Warboy1982: You are speaking from my heart. :)
But don't give up so easily!

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Another look at Geoscape AI.
« Reply #28 on: November 08, 2012, 01:27:08 pm »
so i finally get github "figured out", sit down to take a look at your code, and you've used completely different methods in ruleAlienMission than in... every other ruleset in openxcom.
i'm at a loss here. i just don't know what to do.
should i rewrite it? should i try to figure out wtf you're doing and try to do it that way?

Offline karvanit

  • Captain
  • ***
  • Posts: 94
    • View Profile
Re: Another look at Geoscape AI.
« Reply #29 on: November 08, 2012, 06:39:22 pm »
karvanit, what do you mean by "region and zone for each area"?
I mean, of the 720 areas, which belong to each region (eg North Americe) and which belong to each zone (eg North America zone 0)? Is it just by position (offset) in the table?

I have already set the race/month/mission distribution data according to the data in Ufopaedia.org as data in the mission rules.

For the rest (trajectories, UFO types etc) we need a way to represent it in the ruleset. I think trajectories (zones and areas) should be a different ruleset, as well, but the rest (UFOs and spawning them) should be part of a mission's rules. That's what we should be trying to figure out.

We need  a way that can:
  • Handle all the vanilla data. It needs to give as close toi same behaviour as we can get.
  • Allow easy modification.
  • Allow extension (eg new mission types) with minimal of extra coding, only ruleset changes.