iitc-project / ingress-intel-total-conversion

ingress.com/intel total conversion user script with some new features. Should allow easier extension of the intel map.
http://iitc.jonatkins.com/
ISC License
991 stars 552 forks source link

Missions support #960

Closed ianmcorvidae closed 9 years ago

ianmcorvidae commented 9 years ago

The default intel map has support for showing missions, it seems, via a POST to /r/getTopMissionsInBounds. Presumably IITC can do something with this as well!

Yossi commented 9 years ago

missions can be linked to directly like so: https://www.ingress.com/mission/ad612a19b1864cbf8143957fc6c74de0.1c but since iitc only kicks in on https://www.ingress.com/intel you still get the stock view when iitc is enabled. adding https://www.ingress.com/mission is not quite the fix though, because it then shows all portals not just the mission portals.

JensenDied commented 9 years ago

Did some work on gathering the data to map responses from r/getMissionDetails as that's the relevant call made from the above link. Haven't looked into the mission listing stuff when panning around.

Formatted the response array as an object for formatting and easy indexing reading, but are actually arrays. The parts that are defined as an array below are reference as an int in the related data structure.

The mission array is contained within response['result'];

Mission

{
    0: guid,
    1: title,
    2: description,
    3: authorNickname,
    4: authorTeam, // "E", "R"
    5: ratingE6,
    6: medianCompletionTimeMs,
    7: numUniqueCompletedPlayers,
    8: type, // int, see below
    9: [waypoints], // array of waypoints, see: MissionWaypoint
    10: logoUrl
}

Mission Types

mission[8];
[ undefined, SEQUENTIAL, NON_SEQUENTIAL, HIDDEN_SEQUENTIAL]

MissionWaypoint

{
    0: hidden, 
    1: guid,
    2: title,
    3: portalOrFieldTripCardFlag, // See portalOrFieldTripCardFlag 
    4: objectiveType,
    5: portalOrFieldTripCardArray // See fieldTripCardArray for the Field Trip Card def
}

portalOrFieldTripCardFlag

missionWaypoint[3];
[ undefined, PORTAL, FIELD_TRIP_CARD]

Objective Types

missionWaypoint[4];
[undefined, HACK_PORTAL, CAPTURE_PORTAL, CREATE_LINK, CREATE_FIELD, INSTALL_MOD, 6 /*unknown*/, VIEW_FIELD_TRIP_CARD, PASSPHRASE]
Hidden Waypoint

(Every Waypoint after the first in a HIDDEN_SEQENTIAL mission). Untested if these appear on intel in the middle of mission progress, unlikely as it would give away the next portal location.

[true, "", "", 0, 0, null]

fieldTripCardArray

These appear to have no ability to be interacted with on stock intel, render the same as an unclaimed portal.

missionWaypoint[5];
{
    0: type, // "f"
    1: latE6,
    2: lngE6
}
Issues - Missing Waypoints

Example: title: Unavailable, null fieldtrip card / portal data structure.

[false, guid, "Unavailable", 1, 1, null]

Stock Intel does not render these, in sequential missions the line is broken (stops at the previous waypoint, and starts at the next one) if it is in the middle of them, and in the scanner they are not required to perform any action with. I have seen both Portal and Field Trip Cards in this state. My recommendation is to filter them out if encountered.

Meaglin commented 9 years ago

When opening missions from the bottom right of the intel map it requests https://www.ingress.com/r/getTopMissionsInBounds With the bounds as parameters and some random other stuff(i think version hash is there aswell) boundskeys(put in request payload): eastE6, northE6, southE6, westE6

response['result']:

{
    0: guid,
    1: title,
    2: logoUrl,
    3: ratingE6,
    4: medianCompletionTimeMs
}
Meaglin commented 9 years ago

I just build a very simple setup to implement this: Image of setup

Would you guys be interested if i opened a pull request for this?

Yossi commented 9 years ago

The way I envision IITC working with missions is as follows:

For mission discovery, have a layer that hides all portals except for mission start portals. When the mission layer is active, the portal info pane will have a list of the missions that start at this portal. (like stock) Each mission in the list should have a checkbox to mark it as done (like uniques plugin) If a portal has missions that have not been marked competed yet it should be red. If all missions are done it should be yellow.

When a specific mission is selected, only show all the portals of that mission, linked up with lines if the mission has an order. (like stock) Hidden portal missions should have a spoilers setting: Show only the first portal (stock), reveal one portal at a time by clicking next (what I prefer), or just spill all the beans at once (with lines).

Fieldtrip waypoints should be noted with triangle shaped markers, analogous to the circles that currently mark portals. (stock renders them like bronze colored unclaimed portals)

Each portal on the mission should have a letter on it (like portal level numbers) that indicates what action needs to be done at that portal. (Visit [waypoints only], Passcode, Hack, Capture, Mod, Link, Field)

Would be nice to have some built-in intelligence that can highlight potential problems: -Capture portal that is already as high as you can upgrade it yourself -Mod portal that already has 2 of your mods or no empty mod slots -Link or field portal that is under a field or has max outgoing links

Meaglin commented 9 years ago

Yossi, several thinks are and are not possible:

Rendering lines/circles for mission portals / mission start portals is already in my current version.

Showing the list of available missions when opening portal details is not possible since it would require and extra server request when opening portal details.(We don't get any mission details in the server response when requesting portal details).

Checkboxes should be easy to add.

Hidden portals missions only send info about the first portal, so we can't disclose any information even if we wanted to.

Why would you want special rendering for fieldtrip waypoints ?

The mission overview already shows the actions, why would you need them on the map?

Extra intelligence is hard to implement, since we have limited information about portals on the map. Details are only available when we open the portal details, and we don't want to request that for every portal in a mission since Niatic could ban you for sending to much requests.

Image of setup

Yossi commented 9 years ago

Don't we get all the missions in view? These can be sorted to the correct start portals and listed there.

Hidden missions were/are available on caconym. I don't know how he did that, but if it's not something straightforward then forget it.

Actions on the map make it much easier to know what needs to be done where. Especially useful if no AI gets implemented.

The intelligence could be implemented in a way that uses what little we do get off the bat (like portal level) and then enhanced when user opens portal details. This is similar to how the Uniques plugin works right now.

Meaglin commented 9 years ago

No, per portal we only get a 'flag' that tells us if the portal is a mission start point

Also getTopMissionsInBounds only returns a selection of the contained missions in the viewport. This information was probably not hidden in his datasources, but is in current official endpoints.

Do you have any suggestion on how to add this? And preserving a clean map look?

That could be done yes, but i prefer making a proper 'first' setup be4 adding that kind of complexity.

Yossi commented 9 years ago

What I had in mind is a letter representing the action required instead of a number that shows the portal level. I don't know how well that will deal with the portal numbers currently there. I don't use the portal numbers plugin so I didn't think about it.

MonoTovarisj commented 9 years ago

I would love a way to show more missions at once, maybe save a mission to a planning list and an ability to show all those missions on a map. Where can I find the current plugin that you guys are working on? The missions plugin I have right now (0.0.1.20150404.1504) does not show the stuff I'm seeing here. Anything is better than shifting back and forth between stock and iitc.

Meaglin commented 9 years ago

I have opened a pull request here: https://github.com/jonatkins/ingress-intel-total-conversion/pull/973

MonoTovarisj commented 9 years ago

Thx, however i don't see the missions link in the toolbox, however might just be me who doesn't know how to install from github, just took the raw file and put it in, might not be the way to go. Would love to take a look at it, but I can't do any javascript, so won't be of much use other than usability help.

Meaglin commented 9 years ago

You can't install directly from github. Try my testing url: http://meaglin.com/scripts/ingressmissions.user.js

Meaglin commented 9 years ago

Also: my primary goal for the first pull request was to mirror stock intel support. We can always expand from there.

MonoTovarisj commented 9 years ago

Yes, it is a very good start, so I have a few things to start out with. I would like the color of the lines and the circles to be white instead of black, as I am quite fond of the stock intel map, and black does not work on it. But white still works on google roads map. Other thing is that with long mission descriptions there are not enough room for the text. It would also be great to add waypoint numbers, at least maybe mark the first portal.

missionsplugin

Meaglin commented 9 years ago

MonoTovarisj, is there any other way to get in touch. Exchanging ideas on github is kind of hard :P

MonoTovarisj commented 9 years ago

Of course, hangouts? monotovarisj@gmail.com just start one with me.

jonatkins commented 9 years ago

pull req merged

Yossi commented 9 years ago

The checkboxes I had in mind are not per action in a mission, but per mission as a whole. i want to be able to filter out missions that I have already done. Maybe also tie in to sync so I can have this information across computers.

MonoTovarisj commented 9 years ago

Yossi: Click on the image to mark whole mission completed, however no option for hiding missions yet I think.