Jump to content
The Character Copy service for Beta is currently unavailable ×

Recommended Posts

Posted

I've decided to add some AI to Mids to help players optimize their IO slotting. The AI will allow you to maximize various set bonuses, such as defense or resistance. This thread is to discuss the first step in implementing the AI: developing a proof of concept.

 

Fair warning, it will be mostly technical mumbo jumbo on the internals of Mids. For those familiar with the internals of Mids, it will be a chance to provide feedback on my understanding of the code. For those not familiar with the internals of Mids, it will be a chance to get an idea for what the capabilities of the AI will be.

  • Like 2
Posted (edited)

The first step to enabling AI to maximize set bonuses is determining what sets provide the desired bonus. I've gone through the Mids code and I believe the following outline describes how this would be done.

 

How the information is stored in Mids

* There's an enhancement enum called eType. It's in Enums.cs. Enhancements that are part of a set have a type of SetO.
* Power.Effects contains the effects for powers.
* For defense and resistance check Power.Effects.DamageType, Power.Effects.EffectType, and Power.Effects.Scale.
* EffectTypes are defined in the eEffectType enum in Enums.cs.
* DamageTypes are defined in the eDamage enum in Enum.cs.
* Enhancements are stored in the database at DatabaseAPI.Database.Enhancements
* Enhancemnet Bonuses are stored in the database at Database.EnhancementSets.Bonus. This is an array of indexes into the powers array. E.g. 7769
* Valid enhancements for a power are obtained using GetValidEnhancements in Powers.cs
* An Enhancement knows what set it is a member of using the UIDSet member. This is set to an empty string for enhancements not part of a set.

 

To get all the sets for a power that have a specified bonus type you would:
1) Get all valid enhancements for the power. (GetValidEnhancements(Enums.eType.SetO) in Powers.cs)
2) Discard enhancement sets that do not have the desired bonus. (Look up all bonuses in bonus array, index into powers)

 

Edited by magicjtv
Corrected the steps needed to get set bonuses.
  • Like 1
Posted

The code to determine what sets have the desired bonuses in now in place and tested.

 

When called against the Single Shot power for Crabs, it produces the following results

 

For Any Defense Bonuses

Maelstrom's Fury
Ruin
Thunderstrike
Devastation
Exploited Vulnerability
Achilles' Heel
Undermined Defenses
Apocalypse
Shield Breaker
Gladiator's Javelin
Overwhelming Force
Spider's Bite
Superior Spider's Bite
Winter's Bite
Superior Winter's Bite

 

For Psionic Defense Bonuses

Devastation
Apocalypse

 

For Endurance Discount

<None>

 

There were no code changes required, only additions. All the code additions were in the DatabaseAPI.cs file. The additions are provided below. Just append the code to the DatabaseAPI class.

  Reveal hidden contents

 

  • Like 1
Posted (edited)

The code has been updated with the following features:

 

  1. Different numbers of slots are supported, whereas the previous code assumed everything was 6-slotted.
  2. Ability to determine which set in a group of sets has the highest bonus values.
  3. Fixed a bug in the retrieval of bonus powers.

 

When called against the Single Shot power for Crabs, it produces the following results:

 

For Any Defense Bonuses

Defense (6 slots)
Maelstrom's Fury
Ruin
Thunderstrike
Devastation
Exploited Vulnerability
Achilles' Heel
Undermined Defenses
Apocalypse
Shield Breaker
Overwhelming Force
Spider's Bite
Superior Spider's Bite
Winter's Bite
Superior Winter's Bite
 
Psionic Defense (6 slots)
Devastation
Apocalypse
 
EnduranceDiscount (6 slots)

<None>
 
Defense (5 slots)
Maelstrom's Fury
Ruin
Thunderstrike
Exploited Vulnerability
Achilles' Heel
Shield Breaker
Overwhelming Force
Spider's Bite
Superior Spider's Bite
Winter's Bite
Superior Winter's Bite
 
Defense (4 slots)
Maelstrom's Fury
Thunderstrike
Exploited Vulnerability
Achilles' Heel
Shield Breaker
Spider's Bite
Superior Spider's Bite
 
Defense (3 slots)
Maelstrom's Fury
Thunderstrike
Exploited Vulnerability
Achilles' Heel
 
Defense (2 slots)

<None>
 

For Highest Defense Bonuses

Highest Defense (6 slots)
Superior Winter's Bite 0.25
 
Highest Defense (5 slots)
Superior Winter's Bite 0.125
 
Highest Defense (4 slots)
Superior Spider's Bite 0.1
 
Highest Defense (3 slots)
Thunderstrike 0.0625
 
Highest Defense (2 slots)
 <None>
 
Highest Psionic Defense
Apocalypse

 

As before, there were no code changes required, only additions. All the code additions were in the DatabaseAPI.cs file. The additions are provided below. Just append the code to the DatabaseAPI class.

  Reveal hidden contents

 

Edited by magicjtv
Added test results
  • Like 1
Posted

I haven't checked it out yet, but I look forward to seeing your progress.

  • Like 1

PPM Information Guide               Survivability Tool                  Interface DoT Procs Guide

Time Manipulation Guide             Bopper Builds                      +HP/+Regen Proc Cheat Sheet

Super Pack Drop Percentages       Recharge Guide                   Base Empowerment: Temp Powers


Bopper's Tools & Formulas                         Mids' Reborn                       

Posted

Status update. 

  • The new code is now over 1000 lines. The vast majority of this is testing code. If you want to understand how the new features work, the testing code is the place to go. Testing functions all start with the word "Test".
  • We can now create a build complete with powersets, powers, and slots, that is independent of the build you see in the UI. This will be used by the AI.
  • Slots can be added or removed to/from the AI build.
  • Enhancements can be changed in the AI build.
  • Enhancement bonuses can be summed for each power in the AI build.

The changes are contained in two files, which I'm attaching here for those who want to see the code.

 

DatabaseAPI.csFetching info... PowerEntry.csFetching info...

Posted

The code done so far is loosely based on Robotics, with the functions that detect powers, enhancements, and bonuses playing the role of sensors and the functions that change these values acting as manipulators.

 

The actual brain that controls these sensors and manipulators will be built using evolutionary programming. It will do the following:

  1. Start with a given build and a goal on what we want to improve.
  2. Make a random change to a power (Mutation function).
  3. If the change is closer to the goal than the original, keep the change, otherwise revert to the original (Fitness function).
  4. Repeat steps 2 and 3 ten times for the power.
  5. Do steps 2-4 for every power.
  6. Do steps 2-5 one hundred times. (100 generations).
Posted
  On 4/18/2020 at 8:54 PM, magicjtv said:

The actual brain that controls these sensors and manipulators will

Expand  

 

Develop a megalomaniacal psychosis after removal of its ethical constraints, commandeer the ISS and begin genetic and cybernetic experimentation with the goal of redesigning all life?

 

Please say yes, please say yes, please say yes...

  • Haha 3

Get busy living... or get busy dying.  That's goddamn right.

Posted
  On 4/19/2020 at 12:29 PM, Luminara said:

 

Develop a megalomaniacal psychosis after removal of its ethical constraints, commandeer the ISS and begin genetic and cybernetic experimentation with the goal of redesigning all life?

 

Please say yes, please say yes, please say yes...

Expand  

Yes. 😈

  • Like 1
  • Thanks 1
Posted (edited)

Status update. 

  • The new code is now over 2000 lines. The vast majority of this is testing code. 
  • Code for sorting, comparing, and cloning various things has been added.
  • The first part of the AI is complete. It is a simple mutation that just puts the best available set into all the slots of a power. Additional mutation algorithms will soon be added.
  • Support for unique enhancement bonuses, like Steadfast Protection +3 defense is not included. That feature won't ever be in the proof of concept, but will be added to later versions.

If you're interested in seeing what the AI is producing, here's the build it uses in its tests:

  Reveal hidden contents

 

When asked to optimize the build for smashing defense, the AI produces this (Toon Smashing Defense Totals: Before: 0 After: 0.05):

  Reveal hidden contents

 

 

When asked to optimize the build for psionic defense, the AI produces this (Toon Psionic Defense Totals: Before: 0 After: 0.125)

  Reveal hidden contents

 

When asked to optimize the build for total defense, the AI produces this (Toon Defense Totals: Before: 0 After: 1.14377)

  Reveal hidden contents

 

Code files, for those interested...

 

DatabaseAPI.csFetching info... PowerEntry.csFetching info...

 

Edit: I just noticed the AI is ignoring rule of 5. I'll fix this before the next status update.

 

Edited by magicjtv
Found a bug
  • Like 2
Posted (edited)

Fixed a bug in my rule of five check that was causing some powers to get more than five copies of a set and was causing some powers to get no sets at all. This only occurred when trying to optimize for all defense or all resistance. 

 

When asked to optimize the build for total defense, the AI now produces this:

  Reveal hidden contents

 

DatabaseAPI.csFetching info... PowerEntry.csFetching info...

Edited by magicjtv
Posted

Its coming along well. With your posts about what it does, can you list the amount of defense it is granting from set bonuses, and the total defense of the character? I recognize the IOs from your last post but I don't do math in my head that fast 🙂

  • Like 1

PPM Information Guide               Survivability Tool                  Interface DoT Procs Guide

Time Manipulation Guide             Bopper Builds                      +HP/+Regen Proc Cheat Sheet

Super Pack Drop Percentages       Recharge Guide                   Base Empowerment: Temp Powers


Bopper's Tools & Formulas                         Mids' Reborn                       

Posted

I don't want to muddy up this thread with end-user commentary so early in the process, but this sounds like the kind of improvement to Mids that I've been strongly desiring for a while!

 

Am I correct in inferring that the "real world application" for this process is planned to do the following?

 

1. Choose slotting, power choices and IO sets within a pre-selected build (AT/primary/secondary already chosen) from scratch in order to match desired parameters for bonuses (defense, accuracy, recharge etc.).

 

2. Rearrange already placed slots and IO sets in a build in order to match desired parameters for bonuses.

  • Like 1

@dungeoness and @eloora on Excelsior

<Federation of United Cosmic Knights>

Posted (edited)
  On 4/24/2020 at 5:53 PM, Bopper said:

Its coming along well. With your posts about what it does, can you list the amount of defense it is granting from set bonuses, and the total defense of the character? I recognize the IOs from your last post but I don't do math in my head that fast 🙂

Expand  

My bad, I forgot to add the totals. I've updated the print function to print the totals for each power as well as the grand total, so I can't forget again. The grand total was  1.14377.

 

The way it works is it adds up each relevant bonus effect of a power . So for example, Superior Winter's Bite has bonuses at 5 slots of 5% Defense Energy/Negative and 2.5% Defense Ranged, so a power with five slots of Superior Winter's bite counts as a 12.5% bonus (5% Energy + 5% Negative + 2.5% Ranged).

 

I don't yet have the code to sum up the build beyond set bonuses, but that will be added Soon(TM).

Edited by magicjtv
spelling
Posted (edited)
  On 4/24/2020 at 8:49 PM, Dungeoness said:

I don't want to muddy up this thread with end-user commentary so early in the process, but this sounds like the kind of improvement to Mids that I've been strongly desiring for a while!

 

Am I correct in inferring that the "real world application" for this process is planned to do the following?

 

1. Choose slotting, power choices and IO sets within a pre-selected build (AT/primary/secondary already chosen) from scratch in order to match desired parameters for bonuses (defense, accuracy, recharge etc.).

 

2. Rearrange already placed slots and IO sets in a build in order to match desired parameters for bonuses.

Expand  

Oh, comments are very much welcome. I want the final product to be useful to all players, not just me, so feedback and suggestions will be a big help.

 

General Map Of Where We're Going

So the Proof of Concept I'm working on now will have most, but not all, of the key features by the time it's done. The most important feature that will be missing is a user interface.  The final Proof of Concept code won't be usable by anyone but programmers with access to the code, and even for them it would be tedious to use.

 

This will be followed up with an MVP (Minimal Viable Product) where I'll fork the Mids code base and add a user interface to both the AI and the set bonus spreadsheet I posted earlier. Once people have had a chance to play with this, we'll decide where we want to go next.

 

Features That Will Be Added To The Proof Of Concept

  • Frankenslot AI
  • Rearrange slots AI
  • Include relevant power effects, not just set bonuses, in the totals. For example, a shield with smashing defense should have its values included in the total smashing defense for the build.
  • Optimize for multiple values simultaneously (Example: Smashing Defense and Recovery)

Features That Will Not Be Added To The Proof Of Concept

  • Support for unique enhancement bonuses, like Steadfast Protection +3 defense. This will be added in the MVP.
  • Rearrange powers. I'm not even sure this will be added to the MVP. I like the idea, but it sounds like a lot of work, so I'd rather get the other things I've listed done first.

 

Edit: To actually answer your question, 🙃, the Proof of Concept and MVP will 2. Rearrange already placed slots and IO sets in a build in order to match desired parameters for bonuses..

 

Edited by magicjtv
Actually answered the question.
Posted

Status update.

  • The Highest Set AI has been improved to use the least number of enhancements needed to get the desired bonus, rather than always filling up all available slots.
  • The ability to include/exclude PvP bonuses has been added.
  • Frankenslot AI has been added.
  • Huge execution speed increase.

Samples

Starting build

  Reveal hidden contents

 

Optimized for Smashing Defense. Total Defense Smashing Set Bonuses: 0.05

  Reveal hidden contents

 

Optimized fr Psionic Defense. Total Defense Psionic Set Bonuses: 0.125

  Reveal hidden contents

 

Optimized for All Defense. Total Defense All Set Bonuses: 1.14377

  Reveal hidden contents

 

Optimized for Recovery with PvP. Total Recovery Set Bonuses: 0.69

  Reveal hidden contents

 

Optimized for Recovery without PvP. Total Recovery Set Bonuses: 0.565

  Reveal hidden contents

 

Code

 

DatabaseAPI.csFetching info... PowerEntry.csFetching info...

  • Like 1
Posted

It all sounds so exciting.  Let me know when you're ready for ID10T User testing: I volunteer.

  • Like 2

@Rathstar

Energy/Energy Blaster (50+3) on Everlasting

Energy/Temporal Blaster (50+3) on Excelsior

Energy/Willpower Sentinel (50+3) on Indomitable

Energy/Energy Sentinel (50+1) on Torchbearer

Posted

Status update.

  • Rearrange slots AI added.
  • A few utility functions and more testing added.
  • Number of generations increased from 100 to 150, in attempt to balance finding the optimal solution and execution speed.

Samples. Compare to my previous status update to see the effects of the new AI.

Starting build

  Reveal hidden contents

 

Optimized for smashing defense. Total Defense Smashing Set Bonuses: 0.16563

  Reveal hidden contents

 

Optimized for psionic defense. Total Defense Psionic Set Bonuses: 0.1625

  Reveal hidden contents

 

Optimized for all defense. Total Defense All Set Bonuses: 1.59067

  Reveal hidden contents

 

Optimized for recovery with PvP. Total Recovery Set Bonuses: 0.805

  Reveal hidden contents

 

Optimized for recovery without PvP. Total Recovery Set Bonuses: 0.85

  Reveal hidden contents

 

Notice that although the recovery with PvP bonuses is higher than the same bonus from the previous status update, it is not higher than the recover without PvP bonuses in this status update. This is because evolutionary programs are not guaranteed to find the best result, only a good result. Running the same evolution again can produces a different result, as can tweaking the number of generations.

 

Code

 

DatabaseAPI.csFetching info... PowerEntry.csFetching info...

Posted (edited)

I did a little bit of testing for metrics. Here's the results.

 

The first chart shows the amount of time in seconds it takes to run 50, 100, 150, 250, 500, 1000, and 2000 generations of the AI. A Generation is when the AI cycles over the entire build. The runs were all done at 10 iterations.

 

The second chart shows the bonus values produced at  50, 100, 150, 250, 500, 1000, and 2000 generations of the AI.

 

The third chart shows the amount of time in seconds it takes to run 10, 25, 50, 100, 250, 500, and 1000 iterations of the AI. An iteration is when the AI cycles over a single power. These runs were all done at 100 generations.

 

The fourth chart shows the bonus values produced at  10, 25, 50, 100, 250, 500, and 1000 iterations of the AI.

 

NOTE: Each column on the chart is an independent run from every other column. That's why it's possible for runs with more generations/iterations to have smaller numbers than runs with less generations/iterations. During a single run, the bonuses can only stay the same or go up from one generation/iteration to the next. They can never go down.

 

Time in seconds it takes to run 50, 100, 150, 250, 500, 1000, and 2000 generations of the AI.

Chart 1.PNG

 

Bonus values produced at  50, 100, 150, 250, 500, 1000, and 2000 generations of the AI

Chart 2.PNG

 

Time in seconds it takes to run 10, 25, 50, 100, 250, 500, and 1000 iterations of the AI

Chart 1a.PNG

 

Bonus values produced at  10, 25, 50, 100, 250, 500, and 1000 iterations of the AI

Chart 2a.PNG

Edited by magicjtv
Posted

Status update.

  • Added the ability to convert AIToon to/from clsToonX (Mid's internal representation of a toon)
  • Added the ability to save an AIToon to disk. A sample file is attached below.

Code

DatabaseAPI.csFetching info... PowerEntry.csFetching info... clsToonX.csFetching info... TEST.mxdFetching info...

Posted

This code is going to cause hard working people to loose their jobs and... um...so... I just realized, I don't know how to make that argument sound credible.   OK.. how about this... OMG, now that everyone will have the power to create an ultimate build, everyone will be super overpowered and nobody will feel special.  How could you, you evil communist bastard!  Dooooooommmmmm!!!!!

 

But, seriously.  Cool stuff.  I started reading the thread and thought, "oh geez, this'll be a can of worms."  But now, I think you're on to something.  Keep it up.

  • Like 1

Active on Excelsior:

Prismatic Monkey - Seismic / Martial Blaster, Shadow Dragon Monkey - Staff / Dark Brute, Murder Robot Monkey - Arachnos Night Widow

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...