Cartographer API [CAPI]: Map Analytics for Forgers

Discussion in 'Halo and Forge Discussion' started by Ray Benefield, Apr 27, 2016.

By Ray Benefield on Apr 27, 2016 at 7:07 PM
  1. Ray Benefield

    Ray Benefield Godly Perfection
    Forge Critic

    Messages:
    1,183
    Likes Received:
    518
    UPDATE [05/31/16]: CAPI has now been submitted to the Halo API Hackathon. You can see it here, thanks for all the support folks. There is still more work to be done, but the hard part is over:



    [​IMG]

    The Cartographer API, or CAPI for short, is a map analytics extension of the Halo API. It provides the ability to grab game data based on Maps, Gametypes, and Forgers rather than just Players and Games like the standard Halo API. This means that people will be able to see every custom game ever played on a map, be able to see how often their map is being played, generate statistics on their maps, and so much more.

    I'm currently just previewing CAPI to draw up some discussion on it. My current projection will probably be within the next month. I've got the core of the system working that can essentially store every custom game available and keep the system up to date. At this point it is stress testing, catching edge cases, building the discovery system, and building out every materialized view for every question we could possibly want to answer. So expect it to come soon. ;) On to the details...


    [​IMG]

    API stands for a Application Program Interface. Basically it is a way to communicate with an application. So CAPI will be your interface for accessing map analytics. Data is returned in JSON format (a fairly standard format for web APIs), so the data will come back looking like this (this is just a rough example):

    Code:
    {
      "Map": "Goliath",
      "GamesPlayedOnMapTotal": 73,
      "CreatedDate": "2016-04-23T00:00:00Z",
      "UpdatedDate": "2016-04-23T00:00:00Z",
      "URL": "https://www.halowaypoint.com/en-us/games/halo-5-guardians/xbox-one/map-variants#ugc_halo-5-guardians_xbox-one_mapvariant_A%203%20Legged%20Goat_1849cde2-b4bc-40c2-a385-a689992da3fd",
      "Authors": [
      {
      "Gamertag": "Black Picture"
      },
      {
      "Gamertag": "Whos Blaze"
      }
      "GamesPlayedOnMapData": [
      {
      "PlayerStats": [
      {
      "KilledOpponentDetails": [
      {
      "GamerTag": "moo43",
      "TotalKills": 2
      },
      {
      "GamerTag": "THEMASTER952009",
      "TotalKills": 1
      },
      {
      "GamerTag": "LunaticLawyer",
      "TotalKills": 2
      },
      {
      "GamerTag": "MultiLockOn",
      "TotalKills": 3
      },
      {
      "GamerTag": "Hi Im Shaz",
      "TotalKills": 1
      },
      {
      "GamerTag": "A Wild Iron",
      "TotalKills": 1
      }
      ],
      "KilledByOpponentDetails": [
      {
      "GamerTag": "LunaticLawyer",
      "TotalKills": 2
      },
      {
      "GamerTag": "MultiLockOn",
      "TotalKills": 2
      },
      {
      "GamerTag": "moo43",
      "TotalKills": 1
      },
      {
      "GamerTag": "A Wild Iron",
      "TotalKills": 2
      },
      {
      "GamerTag": "Null Parameter",
      "TotalKills": 1
      },
      {
      "GamerTag": "Hi Im Shaz",
      "TotalKills": 2
      },
      {
      "GamerTag": "THEMASTER952009",
      "TotalKills": 1
      }
      ],
      "FlexibleStats": {
      "MedalStatCounts": [],
      "ImpulseStatCounts": [
      {
      "Id": "ba327946-418c-495d-90c0-89f084bf7447",
      "Count": 10
      },
      {
      "Id": "7dcd7306-f905-401a-97f2-345d4b25170a",
      "Count": 7
      },
      {
      "Id": "ea38d25f-d887-4bdf-b17b-8e8e649b9a87",
      "Count": 11
      },
      {
      "Id": "a1d97ad4-c1d9-4807-b619-ca3710cc5a8d",
      "Count": 0
      },
      {
      "Id": "3465eba1-608c-47d7-9cb6-ef4c7a55a2dd",
      "Count": 6
      },
      {
      "Id": "780104cb-5b86-4ed9-8fb1-40b919de0766",
      "Count": 1
      },
      {
      "Id": "a5a0d0d5-5c9f-4888-b42a-2c87f8e58336",
      "Count": 0
      },
      {
      "Id": "71ce2293-23bb-492f-a8c0-46e095b55eb7",
      "Count": 1
      }
      ],
      "MedalTimelapses": [],
      "ImpulseTimelapses": [
      {
      "Id": "f1c317ee-1ac4-4089-85e8-a9c536c6cf18",
      "Timelapse": "PT6M25.5491296S"
      }
      ]
      },
      "Player": {
      "Gamertag": "Time Glitch",
      "Xuid": null
      },
      "TeamId": 0,
      "Rank": 8,
      "DNF": false,
      "AvgLifeTimeOfPlayer": "PT23.319986S",
      "PreMatchRatings": null,
      "PostMatchRatings": null,
      "PlayerScore": null,
      "TotalKills": 10,
      "TotalHeadshots": 6,
      "TotalWeaponDamage": 1323.2091388702393,
      "TotalShotsFired": 166,
      "TotalShotsLanded": 82,
      "WeaponWithMostKills": {
      "WeaponId": {
      "StockId": 4096745987,
      "Attachments": []
      },
      "TotalShotsFired": 91,
      "TotalShotsLanded": 51,
      "TotalHeadshots": 6,
      "TotalKills": 7,
      "TotalDamageDealt": 917.58932113647461,
      "TotalPossessionTime": "PT2M32.5333S"
      },
      "TotalMeleeKills": 0,
      "TotalMeleeDamage": 70,
      "TotalAssassinations": 0,
      "TotalGroundPoundKills": 0,
      "TotalGroundPoundDamage": 70,
      "TotalShoulderBashKills": 0,
      "TotalShoulderBashDamage": 95,
      "TotalGrenadeDamage": 114.51982879638672,
      "TotalPowerWeaponKills": 1,
      "TotalPowerWeaponDamage": 93.5999984741211,
      "TotalPowerWeaponGrabs": 1,
      "TotalPowerWeaponPossessionTime": "PT35.0833S",
      "TotalDeaths": 11,
      "TotalAssists": 7,
      "TotalGamesCompleted": 0,
      "TotalGamesWon": 0,
      "TotalGamesLost": 0,
      "TotalGamesTied": 0,
      "TotalTimePlayed": "PT6M25.5491296S",
      "TotalGrenadeKills": 0
      }
      ]
    }
    
    With data like above, websites and applications can pull the data out of it and display it however they want. It is how websites like HaloCarnage.com exist. CAPI will do the same as the Halo API except give data centered around User Generated Content.


    [​IMG]
    • What games have been played on my map?
    • What players have played on my map?
    • Who has played the most on my map and may be a good resource for feedback?
    • What does the heatmap look like for my map?
    • How much of an impact does this weapon have on my map?
    • How often are people leaving games that are played on my map?
    • Are players playing on the right version of my map?
    • Has this reviewer even played on my map and how much have they?
    • Have any pro/semi-pro/amateur pro players tried playing on my map?
    • Who are my biggest fans as a level designer?
    • How many people are playing on my map when I'm not there to ask them to?
    • How has my map's popularity grown over time?
    • How does this version of my map play compared to this version?


    [​IMG]

    As a level designer this means that you can watch your content go viral. You can see how it is tested throughout the community. Imagine being able to see the statistics for every single custom game ever played on your map. Imagine being able to see a list of every single player that has played on your map. Even better see who has played your map the most and then ask to get some feedback from them since they have played your map X times. Perhaps you are interested in a heatmap of your level from every game ever played on it. Maybe you are curious to see how changing that DMR to a BR affected how your map played. Perhaps the average WeaponPossessionTime on the BR is less than it was when you had a DMR there instead. Or maybe you move a weapon from bottom blue to to blue, how did the WeaponPossessionTime change based on that? This is all stuff that you could learn from CAPI and more.

    Your users are looking to post their maps on your site already... but with CAPI they can get statistics on their maps as well. Show them the latest game that was played on their map. Show them how many times their map has been played on. Use CAPI to get a list of popular maps based on criteria that would be difficult to aggregate on your own. Track versioning and update the version and link to a map as CAPI figures out what is the latest version for them. Perhaps reviews are getting out of hand and are a bit too troll-y... well then add testing statistics next to reviews and ensure that Forgers can get a glimpse of how much the reviewer has played the map before posting their review. This will help weed out the quality reviews from the useless reviews.

    Time to build your next big app that is centered around the source of unlimited content for the Halo Community. Perhaps it is time to build a mobile app that allows Forgers to submit reviews for a map directly from their phone after playing on a map. How about a MapCarnage site that shows the latest games and auto-updates with the latest games based on maps rather than players? Have you thought about running a tournament site revolving around a particular set of maps? Have CAPI automatically finds these custom games for you based on that map's ID, and automatically verify who played in the game and have access to the statistics right there at your finger tips. The possibilities are endless.

    CAPI is a public display and open sourced project that will be streamed throughout its development. It will give software engineers of a variety of skill levels a glimpse and an example into using AWS as a serverless solution for an API. It will also show techniques that will help developers build code that is easier to read, easier to maintain, and easier to add features to. We want CAPI to be able to grow quickly and we have processes that are being followed to allow rapid development. Things like the Repository pattern, working with strictly domain objects to speed up development, and also using pub/sub models to not have to edit old services when new services are introduced. This will also help people take enterprise level concerns into account like monitoring and logging on a massive scale. AWS is a beautiful tool and show how small time devs can use it to maximize their productivity is part of the goal.

    Halo will become a platform in which level designers have access to a tool like CAPI in order to quickly refine and iterate their maps with full blown analysis of how their changes affected the map. This will grow the quality of community maps which means better content for the community. The ability to watch your own map grow throughout the community means that more developers of maps will be more engaged and more motivated to complete and test content. More testing is always better. More playing is always better. Was there a problem finding content for matchmaking? Are the wrong maps being pushed up? This can be validated with CAPI, finding out what content is actually trending in terms of people actually playing on the map. Validate if someone who proposes a map for matchmaking isn't doing it prematurely. Find the best maps out there based on actual playtime statistics not just based on how many times someone has saved a file.


    [​IMG]

    Because CAPI is an API this means that it can be tapped into just like the Halo API and custom web apps, mobile apps, and more can be created based on the data that CAPI provides. It does this by storing every single custom game ever played and then running those custom games through an analytics system that takes note of answers to questions like what map was this game played on? Sounds like a lot of information right? Well it is. Storing every custom game and the analysis for maps will take a huge amount of storage and the entire system will need to have a ton of processing power to pull this off. And this would normally be a huge development effort? Open up the spoiler below for more details on how that will be handled.

    Enter Amazon Web Services (AWS)... AWS provides an infinitely scalable platform that will allow CAPI to grow to whatever it needs to grow to. Using the latest tech like AWS Lambda and AWS Gateway means that CAPI is backed by enterprise level tech and hardware to ensure it meets the expected demands of the Halo Community. I won't bore you too much with the technology, but if you are interested then there are some details on the Bitbucket repository page. And that leads to my next point.

    CAPI is an open source project. This means that not only does CAPI exist for the improvement of the Halo Community, but it also exists for the teaching of an enterprise level API that is easy to manage thanks to the beauty of AWS. And that means that any member of the Halo Community that has the know how can participate in the development of CAPI. All of my development for CAPI will be live streamed for the world to watch how the system grows and learn from its explorations through LiveCoding.tv. And those that have even a bit of development experience can learn, ask questions, and help build CAPI to be the best that it can be.

    In addition CAPI is looking to also hold some key software engineering principles to speed up development. A serverless architecture will be used to remove the overhead of most of the systems work. No managing servers, deploying servers, or dealing with databases crashing. Nanoservices is how things will be segmented. Thanks to AWS Lambda we are able to keep our business logic in small compartmentalized portions without ridiculous overhead to deployment of new features. Also following things like the SOLID principles, pub/sub systems, and things like automation will speed up the development of features. And thanks to AWS we will have a lot of features covered for us like logging, monitoring, and scaling. All in all this means that it will be wonderfully simple to add new features to CAPI within a matter of hours or a few days. This will allow developers to focus on what matters. Below is a current model of the architecture that is in place right now. Anything in red lettering has not been implemented yet and this is far from complete as the system is just going to keep growing from here.

    [​IMG]


    [​IMG]

    When I first saw the Halo API, my first thought was is it possible to have these kind of statistics for maps? And then I saw it... the map and game variant data on a game. So here I am today, after having built a forge team and experienced the new Forge for myself. Last month I made plans to build this project as I had finished my contract with Nike in February. Not only did I feel that this would be powerful for my hobby and the community I care about, but also that it would help be a display of public code to show what I know how to do. Because all of my work has been proprietary so no new employer will ever get a feel for what I know at first glance. So I plan to go all out with this project and with the support of my partner, Jessica, I have the time to devote to this ambitious project. So expect me to pull out all the stops to make this a success.

    I dreamed big while designing CAPI. One of the ideas I had while designing CAPI's functionality is that CAPI can be an additional Artificial Intelligence character in the Halo universe. CAPI cares about the growth of the future. It cares about the builders and the architects and hopes to support their endeavors as environments come into fruition. CAPI is being designed with this thought in mind. Perhaps its interface will be a little more interactive than most sites... perhaps CAPI will communicate with Cortana on Windows 10. CAPI is here to assist the Forgers of the Halo Community to achieve great things. I hope that CAPI will do good for this community. I've been around since the birth of Forgehub... that is a LONG time since Forge came to life in Halo 3. And I hope that the experiences that I have gained (both as a level designer and as a software engineer) will help bring this community a tool that helps it thrive going forward. I grew up in Halo... and I'm looking forward to seeing how it grows with this new addition to the universe.


    [​IMG]


    [​IMG]
    The open sourced public repository for CAPI development.
    My LiveCoding.tv stream where you can watch me code CAPI. This means you can ask questions, stay up to date on the roadmap, and more.
    The reddit post for those that want to help CAPI get out there into the world.


    [​IMG]

    Do you have any ideas on what CAPI could do? Use this thread as an idea generation space. Help design a tool that will bring the level design community that much further.
     
    #1 Ray Benefield, Apr 27, 2016
    Last edited: Jun 1, 2016
Tags: this article has not been tagged

Comments

Discussion in 'Halo and Forge Discussion' started by Ray Benefield, Apr 27, 2016.

    1. Doctor Squishy
      Doctor Squishy
      [​IMG]

      Really just fantastic! I really look forward to using this in the future to analyze maps and even look into how current matchmaking maps play like BTB currently.
      Last edited: Apr 27, 2016
      CL0WN FAC3, Wally12, Dunco and 7 others like this.
    2. PharmaGangsta1
      Last edited: Apr 27, 2016
      CL0WN FAC3, Wally12, Yevah and 4 others like this.
    3. Xandrith
    4. Zandril
      Zandril
      Is this the part where I shitpost a reaction gif?












      just a prank guys
    5. Given To Fly
      Given To Fly
      Like I said before, you are a wizard Godly, and I love you.

      You're doing wonders for us.
    6. WAR
      WAR
      Excellent preview for this Godly, your combination of talent and passion in the Halo community is really admirable. I'm looking forward to the integration of map data you've built. ForgeHub has been having trouble extracting simple things like 'number of bookmarks' per map, so its really refreshing to see what other creative applications can be built and extracted using the current Halo API. I've sent feedback to 343 asking them to open up more data through the waypoint API recently. Should be good news for CAPI if fulfilled.
    7. AnonomissX
      AnonomissX
      The part where CAPI becomes a full blown NPC and interacts with Windows 10 Cortana...
    8. Ray Benefield
      Ray Benefield
      Thanks @WARHOLIC . I'm really excited to have this built and it has been a blast so far. I hope your request to 343 gets through so I don't have to hack around Waypoint to scrape up data. lol... But thank you good sir. You are awesome.

      And thank you everyone for the support. I look forward to seeing this through to the end. Lots to do, but motivation is not an issue. ;)

      Also here is the reddit post for anyone who would like to help this be seen by the community:

      https://www.reddit.com/r/halo/comments/4grdmm/for_the_halo_community_and_hackathon_contest/
    9. Randy 355
      Randy 355
      I love what I see as usual Godly. I haven't been following to close on slack, but I am extremely excited to utilize this. I'm going to throw so many amateur blockouts at this to master my skills!
    10. Yevah
    11. FrostPhoenix0
      FrostPhoenix0
      Doesn't AWS cost to use?
      Nitro and Ray Benefield like this.
    12. Goat
    13. AceOfSpades
      AceOfSpades
      Holy **** this is an amazing effort dude. Seriously, this will help so so much with map testing and tweaking.
    14. Ray Benefield
      Ray Benefield
      Correct as do most services. With services like Lambda and a serverless architecture I don't have to pay for uptime of a server. I pay for the use of the services.



      So this weekend will be big. I'm finishing up a large segment of the system doing parallel scans of any table and populating a queue for processing with new views. Basically it will enable building features MUCH faster. Once that is finished up, I will be working on the first major view which is being able to get every custom game played on a map. I have an idea on how to provide some frontend functionality for people like @SecretSchnitzel who have presented a concern about not being able to use CAPI until a website is built or a community uses it. Next week I'll try to see if I can build in that functionality for people to play with earlier than a frontend would be created.

      Follow along at: https://www.livecoding.tv/godlyperfection/ for the exclusive details. ;)
      Last edited: Apr 29, 2016
    15. Ray Benefield
      Ray Benefield
      This is something I want to achieve for forge maps as well... this kind of analysis is what we want:

      Michael Wetzel, Big Data Engineer
      When the sandbox team came to us and asked us if we could somehow measure weapon effectiveness and balance, we were super excited about the idea. The concept of being able to distill weapons and player usage into metrics that we could compare was very compelling from an analysis standpoint, and could potentially provide huge value to our designers. The challenges however, were substantial – trying to come up with a single number or set of numbers that accurately describes a weapon is a very difficult task, as each weapon has its strengths and weaknesses, situational suitability and “places” in the sandbox. Normalizing this data is also challenging – for example, in Warzone we see a huge number of AR and Pistol kills, does this mean they’re the best weapons? Probably not.

      Initially we looked at kills per weapon per death as a starting point, but this turned out to be non-ideal. For example, how do you measure weapons that are thrown away after being used? Next on the list was kills/weapon instance, but it turns out there are some potential issues with this metric also. How do you deal with spawned weapons on the map versus picking up weapons from dead players? Also, how do you deal with loadout weapons that are never actually used by the player?

      The main metric we landed on was kills per weapon use. This allows us to easily compare weapons no matter where they came from based on whether they were used or not. It's not without complications though, because we have to define use as something that is fair to all weapons. For example, if we only considered use to be shooting the weapon, then weapons that have more deliberate shots (e.g. Railgun) would naturally have an advantage since the usage wouldn't be counted unless they get their shot off. That's why use has a time component – if you hold the weapon as your primary for more than 5 seconds, it counts as being used. In addition, damage dealt per use is also important, especially for weapons like the Plasma Pistol that are great at dealing out damage or nuking shields, but maybe not great at racking up kills.

      Along with this, for each of these data points, we capture information about the game mode, the map, the killer’s and victim’s respective skill levels, distances, etc – this allows us to do cool drill-downs on the data to understand which weapons are more favored by higher skill players, which weapons are most effective at which ranges, and on which maps, and if they’re overpowered on a particular map.

      We can of course find cases where these details are not 100% representative of effectiveness in particular instances, but after many iterations, we’re pretty happy with how it allows us to interpret the data, especially when we look at it over the entire dataset of the billions of kills that have happened in the game.


      Also I came up with a wonderful realization. I can make it so you can trigger special things with CAPI by playing your map with a particular gametype to trigger certain things. Imagine being able to submit your map for matchmaking or a contest in-game by playing "CAPI Matchmaking" as a gametype on your map... or perhaps you want to automatically tie videos or screenshots to your map... then play "CAPI Media" as a gametype on your map as it will have machinima mode on and CAPI will go to your XboxDVR account to find all videos and screenshots taken on the same day as that custom game that you played on CAPI Media and tie those screenshots and videos to the map you played that gametype on. Perhaps a community wants to run a tournament... so they create a special gametype to "label" that tournament or tie certain maps to that tournament. Those games that you play tied to that gametype or maps are automatically recorded for the tournament.

      Or if we get file descriptions we can allow people to tag their map for categories. Or maybe they include a version number in their description. We can add commands and metadata to File Descriptions to trigger anything we want with CAPI. There is lots we can do with this system and we are only just scratching the surface of the possibilities.

      Stay tuned for more crazy ideas folks. ;)
    16. xMalevolution
      xMalevolution
      Godly, you have a mind like nothing I've ever seen!
      The ideas you concoct is absolutely incredible!
      You are an insanely valuable asset to the Halo forgers!
      AnonomissX and Ray Benefield like this.
    17. Agent Zero85
      Agent Zero85
      I could say countless things, but i'm just gonna say 343 must hire you if this becomes a reality.

      Btw, while i'm an advanced internet user, i haven't touched anything to do with coding/api, how could a user use this api without any previous experience like me, just a suggestion, create a program users can download to view the data.

      I have no idea if the above is possible, or probable, thanks in advance for a reply.
      Ray Benefield and Wally12 like this.
    18. Wally12
      Wally12
      Damn, you are smart! But you knew that already :cool:. Nice work, I'm excited to see how this turns out!
      Ray Benefield likes this.
    19. Ray Benefield
      Ray Benefield
      Thanks for the compliment Agent Zero. :) I definitely plan to make a frontend for CAPI for non-developer individuals. Probably not a desktop application, but more than likely a web application and perhaps a mobile application. I also have an idea for a couple of unique ways to gain access to the data, and communities like Forgehub and Forge.World will also be providing the data.

      Also an API is just a URL that returns plain text data in a particular format. So the API will be available for you to use. So I wouldn't stress about it. And yes it is more than possible and I've more than considered all of that. ;)

      Thanks Wally, I appreciate the support man. :)

Share This Page