1
1
---
2
2
description : An example of applying ILP to solve an optimization problem.
3
- date : 2024-07-07
3
+ date : 2024-07-09
4
4
5
5
search :
6
6
exclude : true
@@ -9,20 +9,22 @@ hide: [navigation, toc]
9
9
10
10
# Optimizing FFXIV Trust EXP with Integer Linear Programming
11
11
12
- I've been a long time player of _ Final Fantasy XIV_ , and in the past weeks I've been playing its recently released expansion _ Dawntrail_ .
12
+ I've been a long time player of _ Final Fantasy XIV_ , and in the past weeks I've
13
+ been playing its recently released expansion _ Dawntrail_ .
13
14
As is typical for expansions to massively-multiplayer online role-playing games,
14
15
_ Dawntrail_ raised the level cap--from level 90 to level 100.
15
16
This also includes a corresponding increase to the level cap of the Trust
16
- system, a game mode where the player can form a party with three non-playable
17
- characters (NPCs) and take them into a dungeon.
17
+ system, a game mode where the player can form a party with three AI-controlled
18
+ non-playable characters (NPCs) and take them into a dungeon.
18
19
Since each dungeon takes approximately 30 minutes to clear and there are 8 NPCs
19
20
to level up in total, it would take quite a lot of time to get all NPCs to
20
21
level 100.
21
22
22
23
This begs the question: what would be a strategy for minimizing the number of
23
24
runs (i.e., time) required to get all NPCs to level 100?
24
25
To get an answer, I ended up writing a calculator that can compute such a
25
- strategy, and I will be describing how it works in this article.
26
+ strategy, and I will be describing how it works in this article--no background
27
+ knowledge on FFXIV required.
26
28
You can find the source code [ here] [ calculator-sources ] .
27
29
28
30
<!-- more -->
@@ -34,48 +36,86 @@ You can find the source code [here][calculator-sources].
34
36
If you are playing FFXIV but haven't started the story for _ Dawntrail_ ,
35
37
proceed at your own risk.
36
38
37
- ## The Optimization Problem in Detail
38
-
39
- Before we think about a strategy, let's try to understand the problem more
40
- carefully.
39
+ ## A Problem of Trust
40
+
41
+ Before we think about a strategy, let's try to understand how Trusts work in
42
+ detail.
43
+
44
+ In the Trust system, the player selects a _ party_ consisting of exactly four
45
+ characters, where one character takes on the role of a "tank", one character
46
+ takes on the role of a "healer", and two characters take on the role of "DPS".
47
+ The player chooses which role they want to play themself, and then they choose
48
+ AI-controlled NPCs to fill the remaining roles.
49
+ Each NPC has a different set of roles; for example, one of them can only take
50
+ on the tank role, while another character can take on two different roles.
51
+
52
+ !!! example
53
+ One possible Trust party is one where the player decides to play as a healer
54
+ role, and then they choose the characters Thancred, Alphinaud, and Alisaie
55
+ for the tank and two DPS roles, respectively.
56
+
57
+ Thancred and Alisaie each only have one role.
58
+ However, Alphinaud may be chosen for either a healer or DPS role.
59
+
60
+ Once the player has formed a party, they can then play through a _ dungeon_ .
61
+ Each playthrough, which I will refer to as a "dungeon run", takes approximately
62
+ 30 minutes to complete.
63
+
64
+ ### Levels
65
+
66
+ Every character has two numerical quantities called _ level_ and _ experience_
67
+ (typically shortened as "EXP").
68
+ The level is a reflection of the progress or strength of the character, and it
69
+ is a general goal of the game to increase the level to its maximum value
70
+ possible (the "level cap", which is 100 for _ Dawntrail_ ).
71
+ In order to increase the level, the player must accumulate _ experience points_
72
+ by accomplishing tasks, such as completing a Trust dungeon.
73
+
74
+ Each dungeon has a minimum level requirement, such that a dungeon can only be
75
+ run if all party members have a level exceeding that of the minimum.
76
+ There are five _ Dawntrail_ dungeons available with the Trust system, unlocked at
77
+ levels 91, 93, 95, 97, and 99, respectively.
78
+ For example, the level 95 dungeon can only be run by a party where all members
79
+ are at least level 95.
80
+
81
+ Once a dungeon run is fully complete, a fixed amount of EXP will be awarded to
82
+ all Trust NPCs that participated in that run.
83
+ Higher level dungeons award more EXP.
84
+
85
+ For the dungeons from levels 91 to 100, the Trust system provides 8 NPCs that
86
+ may be used in parties.
87
+ The amount of EXP required to level an NPC up increases as the NPC's level
88
+ increases;
89
+ however, for each level, the amount of EXP required to level up is the same for
90
+ all characters.
91
+
92
+ ### Trust EXP
41
93
42
94
The problem, which I will call the "Trust EXP Problem", consists of coming up
43
95
with a list of parties (duplicates allowed) that can be be used in Trust dungeon
44
96
runs, such that the NPCs can be levelled up from level 91 to level 100.
45
-
46
- * In the Trust system, each party consists of exactly four characters, where one
47
- character takes on the role of a "tank", one character takes on the role of a
48
- "healer", and two characters take on the role of "DPS".
49
- The player chooses which role they want to take on, and then they choose NPCs
50
- to fill the remaining roles.
51
- * From levels 91 to 100, the Trust system provides 8 NPCs to play with.
52
- * The amount of EXP required to level an NPC up increases as the NPC's level
53
- increases;
54
- however, for each level, the amount of EXP to level up is the same for all
55
- characters.
56
- * Each NPC has a different set of roles; for example, one of them can only take
57
- on the tank role, while another character can take on two different roles.
58
- * There are dungeons unlocked at levels 91, 93, 95, 97, and 99.
59
- A dungeon can only be run if all party members have a level exceeding that of
60
- the dungeon's.
61
- For example, the level 95 dungeon can only be run by a party where all members
62
- are at least level 95.
63
- * Once a dungeon run is fully complete, a fixed amount of EXP will be awarded to
64
- all Trust NPCs that participated in that run.
65
- Higher level dungeons award more EXP.
66
-
67
- While the EXP considerations are significant, it is the number of runs that are
68
- the most important for this problem.
69
- For example, the level 91 dungeon awards about 5.8 million EXP, but leveling up
70
- from 91 to 92 requires 13 million EXP.
71
- It will therefore take 3 dungeon runs to level up from 91 to 92.
97
+ Specifically, we would like to minimize the total number of dungeon runs that
98
+ must be performed so-as to save time.
72
99
73
100
I'll use the term "strategy" to refer to a solution to the problem.
74
101
For example, a strategy for leveling all eight NPCs from level 91 to 92 could be
75
102
to run the dungeon three times with the first three NPCs, run the dungeon three
76
103
times with the next three NPCs, and then run the dungeon three more times with
77
104
any party that contains the last two NPCs.
78
105
106
+ !!! note
107
+ EXP considerations are somewhat secondary here as they are a somewhat
108
+ continuous measurement of the progress towards leveling up.
109
+ One issue is that EXP is awarded in discrete, not continuous chunks.
110
+ For example, the level 91 dungeon awards about 5.8 million EXP, but leveling up
111
+ from 91 to 92 requires 13 million EXP.
112
+ It will therefore take 3 dungeon runs to level up from 91 to 92.
113
+ However, those 3 runs will award more EXP than is required to level up.
114
+
115
+ We will focus on the number of runs initially.
116
+ Later, we will see that EXP needs to be factored in to construct a better
117
+ strategy.
118
+
79
119
## Formulating the Trust EXP Problem as an ILP problem
80
120
81
121
A solution to this problem will be lower-bounded by $M$, while the objective
@@ -673,7 +713,7 @@ Excluding the healer role excludes a larger number of better strategies, though
673
713
I understand why someone might not be interested in playing as a healer in
674
714
Trust dungeons...
675
715
676
- ## Was this worth it ?
716
+ ## Was this worth the time ?
677
717
678
718
In total, I spent around an afternoon writing the calculator and had a lot of
679
719
fun in the process (more than I did playing the game).
@@ -686,8 +726,8 @@ You can find my email address on the home page.)
686
726
687
727
Would it be worth spending 31 hours trying to level up all Trust NPCs from 91 to
688
728
100?
689
- That's something you'll have to ask yourself.
690
- Personally, I'm not sure if I want to .
729
+ It might be a nice side goal if you primarily play DPS roles and you don't want
730
+ to bother with long matchmaking queues .
691
731
692
732
In any case, you can find the source code for the calculator
693
733
[ here] [ calculator-sources ] .
0 commit comments