Category king: Rock Solid Geekness

Best use of tools and technologies.

In a combination of the Pirate 365 Recruit and Pirate 365 Enhance applications we claim the ROCK SOLID GEEKNESS badge.

Pirates 365 Recruit – Recruitment of pirates

By using several AI components in Power Automate and leveraging vue.js, pinia, three, troisjs, tensorflow, and ChatGPT. The list goes on..

The Pirate 365 Enhance app

What is the best use of tools to create a game? Canvas apps of course🤠🤓

We have used Power Apps canvas app to create a game that allows new pirate recruits show their skills and prepare them for the sea.

In short, the game uses a Timer that we use to move the ship forward. The timer repeats on short intervals and in the OnStart event we move the ship object on the Y axis and also calculate if the ship touches any of the different obstacles. If a collision is detected, the ship explodes (change the picture on the Picture object). If a crash is detected on the first level, a Game Over popup is displayed and the pirate is automatically offboarded (which technically means we call a Flow that deactivates the user in AAD…. and in real life the recruit is fed to the sharks).
We also check if the ship has reached to top of the screen. If it does, the level is complete and the next level will be shown.
We have a total of 4 levels.

If the player reaches level 2 (or more), we navigate (no pun intended) to a ‘final’ screen where the total points achieved are displayed – IF a collision is detected OR if the user reaches the top of the screen on level 4 OR docks the island on level 4.

We calculate ‘running scores’ as the ship moves forward and every time a new level is reached, points are added to the total score (these points we query from Dataverse). For each ‘event’ (e.g. reach new level) we log this to Dataverse (System User table). These events are used to calculate the total score for the user and is used in our other app to suggest a role for the recruit/pirate.

The crash detection and level completion require extremely complex expressions😉

If(
    shipPositionY > 85,
    Set(
        shipPositionY,
        shipPositionY - 10
    );
    Set(level1VariableScore, level1VariableScore + 1);
    Set(totalScore, totalScore + 1),
    Set(TimerStart, false);
    Set(
        shipPositionX,
        645
    );
    Set(
        shipPositionY,
        611
    );
    Navigate('Level 2')
);
If(
    Or(
        And(
            Image_PirateShip.X <= Image_ReefOne.X + Image_ReefOne.Width,
            Image_PirateShip.X + Image_PirateShip.Width >= Image_ReefOne.X,
            Image_PirateShip.Y <= Image_ReefOne.Y + Image_ReefOne.Height,
            Image_PirateShip.Y + Image_PirateShip.Height >= Image_ReefOne.Y
        ),
        And(
            Image_PirateShip.X <= Image_ReefTwo.X + Image_ReefTwo.Width,
            Image_PirateShip.X + Image_PirateShip.Width >= Image_ReefTwo.X,
            Image_PirateShip.Y <= Image_ReefTwo.Y + Image_ReefTwo.Height,
            Image_PirateShip.Y + Image_PirateShip.Height >= Image_ReefTwo.Y
        )
    ),
    Set(shipVisible, false);
    Set(shipExplodedVisible, true);
    Set(startGameOverTimer, true);
    Timer_GameRun.Repeat = false;
    Reset(Timer_GameRun);
    ,
    false
)

The game consists of four levels:

Level 1:
Easy level obviously. Must be passed to continue with the onboarding process. Only two obstacles in the water.
Tip: You don’t really need to do ANYTHING to pass this level 😉

Level 2:
Some more obstacles and you WILL have to move the boat (using one of the two buttons on the bottom right side of the screen).

Level 3:
Even more obstacles and much rougher sea.
Caution: you might get sea sick here – for real!

Level 4:
Still rough sea and many obstacles. You can pass this level in two ways. Either you dock on the island on top of the screen (this will give you some bonus points) or you can just reach the top of the screen.

If you fail level 1:

Please take note of the sharks as obstacles. We listened to the judges!


Badges

arrgghh, we claim to be awarded the “Rock Solid Geekness” because…..

  • A game in canvas app 🙌, great playability and great graphics.
  • Because we have a digital 3D parrot that moves, talks, and onboards recruits with on a really creative way.
  • We got face recognition and object recognition
  • Error handling for to many pirates or object during the photo process.
  • Feature to scare the hell out of the judges
  • No server side code, all in the browser.



Maritime Mischief Manager (MMM) – A description

“MMM.. is the ultimate tool for pirate captains looking to maximize their raids. With our comprehensive system, you’ll be able to plan, organize, and execute the perfect plunder. No more manual logs, no more disorganized crew. Just a streamlined, efficient process for taking what you want from the high seas. Upgrade your pirate game today with Maritime Mischief Manager.”

Pirates are met with a friendly user interface where they can manage all aspects of pillaging.

Creating a Raid

Under the “New Raid” menu, pirates with the rank of Captain can take a look at possible raid prospects and get an overview of the best possible strategy and also an estimation of the loot potential in the selected location.

The results we are seeing above comes from a query against the ChatGPT API with the use of Power Automate.

Being satisified with the current target, the Captain selects the vessel for the raid, choose to create it and the raid enters planning mode.

Raid planning

From the raid list, piratescan view raids in the planning stage. Simple pirates can choose to join a raid if they want to, but Captains can also choose to invite his best men. Pirates receiving an invitation will have to accept/reject the invitation through their Teams account.

Once the pirate has received and accepted an invitation, they have to scan their provided RFID card when they board the ship. They will then enter the status of Checked in.

Once the RFID card is scanned at the ship, a HTTP request is sent to the raid check-in flow, the flow will update the crew status.


When the Captain is happy with his band of criminals, he chooses to start the raid. The app conveniently simulates the battle as well, together with some nifty battle music. This is of course to save the hassle of actually raiding a place.

Reporting

The pirate management team of course also have access to beautiful numbers of the entire operation

The Orange Nasty Hackers

In simple words, we though that this below wasn’t a very sustainable solution!

We though we could have used a more sustainable solution using our mobile phones and Power Apps. Anyone can get location coordinates from the mobile app in Power Apps. Though, Power Apps canvas doesn’t have a looping mechanism (a function) that can keep sending location coordinates. The hack here is to use a timer control and call the location tracking service every 5 seconds. and you end end up with a tracking app in your mobile 🙂

Once we are in position, the admiral click start loot and the tracking starts right away.

Pretty simple but nasty! 😉

It even works on the operations management tracking live map.

Pirates 365 Enhance Module

In the Pirate 365 Enhance module the pirates goes through a simulation to prepare for the sea. The simulator has different levels that the pirate needs to go through. If the pirates don’t pass level one the pirate is offboarded and has to walk the plank, and that means that the AD User is disabled in the Azure Active Directory. If they pass level 1 they will proceed in the onboarding process.

The pirates goes through the Pirate 365 Enhance Simulator and here they get a score that it used to suggest the best role for the pirate (this will be described later in the post).

Gif from a gameplay:

During the gameplay we collect points based on the different levels they pass. We have created a list of points in Dataverse that they can achieve as can be seen below:


During the game play we assign points to the pirate that is later calculated to a final score. In the image below you can see the log of the game play and what Score Points they achieved.

They also get bonus points on each level based on how far they get in the game.

To calculate the total score we are using Roll Up fields in Dataverse, like below:

For the Pirate 365 Enhance Bonus Score:

For the Pirate 365 Enhance Score:

and a Business rule to add the bonus and the scores together:

And we have added a section with the score on user (pirate) table in the Model-driven app, Pirate 365 Manage:

This score is used in the next part of the evaluation process.

The Pirate 365 Evaluation app

After the game is over the process continues to an evaluation process and the pirate score is compared to the score limit of the different pirate roles we’ve created in Dataverse.
The role can be seen in the image below:

Image of the pirate roles

In the evaluation process we are using the Pirate 365 Evaluation app module that is used to evaluate the pirates scores and assign them to an appropriate role and ship. To handle this we have a Canvas app.

When a recruit is selected in the leftmost list, a Power Automate Flow is called with the recruits ID. The flow then finds the role that has a Score Limit closest to the recruit’s score from the game. The role is sent back to the canvas app.

The flow looks like the following after a flow run and returns the suggested role.

When the suggested role is received in the app, the role is highlighted in the Role Gallery in the canvas app. The user can then click on the suggested role (or any other role, if the user humanly evaluates the recruit to not qualify for the suggested role, for unknown reasons) and on the ship the recruit should be assigned to.

A flow is called and assignes the role and ship.

The pirate then gets assigned to a pirate ship and eventually there is enough crew members that they can go onto the big sea. Arrrghh..

When a recruit, role and ship has been selected, the app goes to the final stage of the process. On this screen the user can choose to onboard the recruit (hence, becoming a true pirate) OR offboard the recruit (meaning sending him/her out on the plank and leap to certain death in the shark and kraken infested waters).

See the gifs below:
Gif showing the onboarding process in the app.

Gif showing the offboarding in the app

Addition content

To illustrate how both the onboarding and the offboarding processes are carried out in person, we hired a professional movie crew to record both processes in real life.
Both the pirate and to different recruits in the videos have asked to be anonymous, for personal reasons.

Onboarding video from the Pirate 365 Evaluation app:

Video from the Office 365 Enhance app for offboarding when the pirates fails on level one.

Summary:

Business value:

  • A screening process for getting the right people on a ship
    • A easy assignment process for onboarding of pirates and ships

Learning take aways:

  • Creating games in Power Apps
  • Using Power Automate, Dataverse, Canvas apps to create a game

Going old-school!

The cool new kids on the block (who have now idea who New Kids On The Block really are) use modern frameworks like React, Angular ………

On the big screen Maverick is still kicking ass and we think that ASP.NET still rocks.

So when we needed something quick and easy we went old-school and choose ASP.NET

Dash it out – right now Matey!

Arrr matey! Welcome to the world of reporting on port ships, pirates and fleets!

As ye might already know, Power BI is a powerful data visualization tool that can help ye track and monitor yer fleet, port ships and even pirate activities. Ye can easily gain insights into yer fleet’s performance, inventory & pirate attacks, and so this is what we have done as shown in the images below.

HRGhh report
Ships O’hoy Fleet Management report


Arrr matey, we’ve created not just 4 graphs, but 4 report pages to address some of the various business needs a pirate may face on the high seas. Thar be a pirate HRGhh report, a Ship o’hoy report for fleet management, a map displayin’ our location and foes in real-time usin’ the DirectQuery capabilities in Power BI, and lastly a raid report utilizin’ Azure ML to predict which pirate ships we may loot successfully. This’ll aid us in makin’ informed decisions about the future of our fleet and help us chart our next course.

Below be a snapshot of the real-time, allowin’ captains and pirates to collaborate from different ports. This way the captain can signal which pirate to attack or stand down based on their proximity to the enemy, makin’ the collaboration smoother, even from a distance. This map be based on the location data from other ships and our own (Raspberry Pi) and displays the last recorded location through longitude and latitude.

When it be comin’ to pirate raids, there be other booty that be worth a king’s ransom, and that be understandin’ the chances of a successful pillage. To be doin’ this, we scallywags created a simple map usin’ Azure ML that be givin’ us the lay of the land, predictin’ our loot based on the target’s worth such as their ship’s maker, the distance they’ve sailed, the power of their engine, and their current state.

We be feedin’ th’ AutoML model int’ th’ Power BI report, savvy? This be allowin’ us t’ do predictions on new data ’bout our enemies, which we be displayin’ in our report fer th’ captains t’ make well informed decisions, specially when coupled with th’ map. By clickin’ on a license plate number as ye see below, th’ captain will be taken t’ our model driven app and shown more information ’bout th’ possible target, aye aye!


Yarrr! That’s a wrap matey!

Thieving the solutions with Orange Bandits

We decided to ingest information from Norwegian National Registry of Vehicles (Statens vegvesen) in order to limit the information Pirates need to input when onboarding the vehicle in our app:

We can use this information to get the Make, model, registration data, technical check, etc… Basically, anything that is needed to be known to thieve the vehicle! And this is just by query by registration plate.

The Bi-Pirates :)

Once upon a time, in the world of Business Intelligence, there was a ship with 3 crew members, who were struggling to make ends meet. They would sail from port to port, hoping to find some treasure, but to no avail. That was until they discovered Power BI.

They were able to analyze data from different sources and turn it into valuable insights. They used Power BI’s interactive visuals and dashboards to identify the ports and ships with the most valuable cargo. No more guessing, no more wandering aimlessly. so were able to sail straight to the ports or ships with the most valuable treasures. 🙂

Mobil view

used jason file to use “shape map” in power BI https://github.com/deldersveld/topojson

Prey on the weak and the lonely – in a very Native Way

All is fair in love and war, and we know the pirate motto:

Also, me every lunch at this ACDC

So, being the scumbags that we are, we have decided to prey on the lonely and thirsty enemy pirates finally coming home after a long voyage.

Step 1: Enemy pirate downloads are professional grade, completely inconspicuous app called “Clap of Booty”

nice, right?

Step 2: After opening the app, user is prompted to share the phone location (android.permission.ACCESS_FINE_LOCATION)

Step 3: User is greeted with a Steve-Jobs-would-be-jealous level of design, where they get to choose the pirate they like.

Apple if you are recruiting, we are currently unavailable

Step 4: And all the while they are liking the handsome dogs and wenches of the seven seas (or not, beauty is a spectrum or whatever kids say these days), the app is secretly logging their live location every 5 seconds to our CRM database.

in case you are a diagram nerd like us

Okay okay, you love it…but why??

Well this data is stored in our CRM database and later shown on Model Driven App dashboard, so our smart pirate managers to make a more informed decision on which target to attack…but you will read more about that later in another blog post.

Keep on pirating!