Sorting missions by name gets number order wrong

Missions in banners are usually numbered. e.g. Mission 1 of 18

The 'sort by name' is strictly alphabetic. E.g. Mission 10 of 18 comes before Mission 9 of 18.

Could you change the sort to be numerically aware?

  1. Write a compare function that compares characters.
  2. When both names contain a digit, parse the digits, convert to an integer, and compare the numbers.

Here is some python for an alphanumeric compare.

```

def compare_strs(str1, str2):

  winner = 0 # which one's bigger

  num_sort_mode = False

  for i in range(min(len(str1),len(str2))):

    if winner == 0:

      if str1[i].isdigit() and str2[i].isdigit():

        if num_sort_mode:

          str1_num += str1[i]

          str2_num += str2[i]

        else:

          num_sort_mode = True

          str1_num = str1[i]

          str2_num = str2[i]

      elif num_sort_mode:

        if str1[i].isdigit(): str1_num += str1[i]

        if str2[i].isdigit(): str2_num += str2[i]

        winner = int(str1_num) - int(str2_num)

        num_sort_mode = False

        if winner != 0: break

      if str1[i] != str2[i] and not num_sort_mode:

        if str1[i] > str2[i]:

          winner = 1

        else:

          winner = -1

  if num_sort_mode: # if it's still in num_sort_mode then find the results

    if len(str1)-1 > i:

      i += 1

      if str1[i].isdigit(): str1_num += str1[i]

    elif len(str2)-1 > i:

      i += 1

      if str2[i].isdigit(): str2_num += str2[i]

    if int(str1_num) > int(str2_num):

      winner = 1

    elif int(str1_num) < int(str2_num):

      winner = -1

    num_sort_mode = False


  if winner == 0:

    if len(str1) != len(str2):

      if len(str1) > len(str2):

        winner = 1

      else:

        winner = -1

  return winner

```

Comments

  • KarM3LKarM3L ✭✭✭✭

    That would require someone other than players to recognize consecutive missions are a thing,

  • ArtilectZedArtilectZed ✭✭✭✭✭

    Mission authors should be doing a better job naming their missions, honestly. Banners are a creation of players, not a function Niantic officially supports.

  • Mission naming has become a mishmash. The original method of Mission 1 of 18 broke down when Niantic required (unofficially) for names to contain the city, so names got long. Which would be fine, but then Prime truncated the name, making it hard to tell which mission is next.

    So people put the number first, but once you have multiple banners doing this, the names dont sort well.

    I think we should go back to the original numbering, but fix the 2 issues.

    1. show the full mission name in the scanner.
    2. sort them by name alphanumerically.

    I'm not sure how the 'distance' sort works, but its not just distance, and I've had to start missions on the 4th page, even when very near the next mission. It would be nice if it were actually distance. If its including rating or something else, that could be a different sort criteria. It can be hard to find new missions.

  • Niantic doesn't recognize banners - when reviewing missions OR when displaying them.

    You could send a Comm message to the mission author, asking them to rename the first 9 using two digits: "01 of 18", etc. Then they'll sort fine. And share the suggestion in different Ingress user groups.

    Everyone reading this, who has ever made a banner - could you please edit mission numbers 1-9 to be 01-09 so they'd sort correctly? Thanks!

  • HosetteHosette ✭✭✭✭✭

    What @MargariteDVille said! Mission authors have control over how they name their missions.

    I don't do banners so I don't have a horse in this race[1] but it's hard for me to imagine that Niantic is going to special case alphabetical ordering when players can just name missions so that Ingress sorts them numerically.

    [1] Other than desperately wishing Ingress could somehow only show the first mission in the list unless the player expanded a group, so I could find interesting missions without scrolling through screens of banner chunks.

  • KarM3LKarM3L ✭✭✭✭

    Distance is sub sorted/filtered by Completed Missions, this is why those doing mission day missions first thing, generally have harder time finding missions than late comers...

  • i think is not so simple, there are missions not sequential who agents would want to have in no order. you can have missions between other same mission and like it as it looks.

    as automatic ordering is not 100% efective and you must keep respect for the current mission pannel, i think the only way is let agents to interchange missions, i mean, click on A, click on B.. done.. in a few moments you'll get it changed. with patience you could have as you want.

  • Scanner -> Home button -> Missions

    Missions are displayed by distance to the portal that the creator put FIRST in the list. Not necessarily the closest portal.

    I wish Niantic told creators about that. For a miles-long mission, you might want a portal in the middle to be #1, so it can be discovered from either end.

  • KarM3LKarM3L ✭✭✭✭

    All Missions have a 'start' portal, to anchor them to the game board, it makes sense that that's the portal you are sent to....

  • phthoruthphthoruth ✭✭✭

    Those are for 'distance' sort. My request is that sorting missions by 'name' respected numerical order of banners.

    name 9 of 18 could be sorted to come before name 10 of 18.

Sign In or Register to comment.