Skip to content

Commit

Permalink
Updated guts value with live memory data
Browse files Browse the repository at this point in the history
  • Loading branch information
PC_volt authored and PC_volt committed Sep 9, 2024
1 parent 9b12675 commit c9371b5
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 18 deletions.
1 change: 1 addition & 0 deletions App.config
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<add key="HitstopOffset" value="0x1AC"/>
<add key="Flags0x4d3cOffset" value="0x4D3C"/>
<add key="Flags0x4d48Offset" value="0x4D48"/>
<add key="DefenseModifierOffset" value="0x9874"/>
<add key="ForceDisableFlagsOffset" value="0x24E3C"/>

<add key="GithubPage" value="https://github.com/PCvolt/rev2-Labtool"/>
Expand Down
6 changes: 2 additions & 4 deletions Labtool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ public void updateFrameInfo()

_player1._HP = MemoryAccessor.ReadInfoInt(ref _player1, MemoryAccessor._HPOffset);
_player2._HP = MemoryAccessor.ReadInfoInt(ref _player2, MemoryAccessor._HPOffset);
_player1._defenseModifier = MemoryAccessor.ReadInfoInt(ref _player1, MemoryAccessor._DefenseModifierOffset);
_player2._defenseModifier = MemoryAccessor.ReadInfoInt(ref _player2, MemoryAccessor._DefenseModifierOffset);
_player1._meter = MemoryAccessor.ReadInfoInt(ref _player1, MemoryAccessor._MeterOffset);
_player2._meter = MemoryAccessor.ReadInfoInt(ref _player2, MemoryAccessor._MeterOffset);
_player1._RISC = MemoryAccessor.ReadInfoInt(ref _player1, MemoryAccessor._RISCOffset);
Expand Down Expand Up @@ -203,7 +205,6 @@ public void macroButtons()
/*
* TODO
* - Find Camera center
* - Fix character pointers
* - Fix display when playing as p2 (most probably, find real positions and/or which side they are facing at first)
* - Find dizzy thresholds and guts in memory
*
Expand All @@ -212,11 +213,8 @@ public void macroButtons()
* keyboard key "1" or joystick button 6 (select) do reset the positions you saved by using keyboard key "2". Custom buttons and keys implementation is planned.
* Consistency of framedata readings improved (the tool may be wrong once every twenty times now, and only by a frame)
* Using actual blockstun and hitstun values to compute gaps
* Displays 0F when a combo/blockstring is tight by a frame (accidental, but useful)
* Dizzy renamed to Stun to avoid confusions with the playable character
* Stun values corrected: Johnny 7000, I-no 5500
* Leo backstance is now considered idle
* Labtool automatically sets Xrd as the foreground window, once booted up
*
* NOTES
* If stuck falling on the ground indefinitely because of the position reset, you can jump to go back to normal
Expand Down
2 changes: 1 addition & 1 deletion MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:rev2_Labtool_Framework_"
mc:Ignorable="d"
Title="rev2-Labtool (v0.5.0)" Height="468" Width="auto"
Title="rev2-Labtool (v0.5.1)" Height="468" Width="auto"
Loaded="Window_Loaded" Closed="Window_Closed"
WindowStartupLocation="Manual" Topmost="True"
SizeToContent="WidthAndHeight"
Expand Down
7 changes: 4 additions & 3 deletions MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,12 @@ private void refreshInfo()
updateLabel(this.p2xPosLabel, "x: " + _labtool._player2._pos.x / 1000);
updateLabel(this.p2yPosLabel, "y: " + _labtool._player2._pos.y / 1000);

// Player is always #1, dummy is always #2, how to find which character is at which side ?
updateLabel(this.p1CharLabel, "(Player)" + Player.charactersList[_labtool._player1.characterIndex]);
updateLabel(this.p2CharLabel, Player.charactersList[_labtool._player2.characterIndex]);
updateLabel(this.p1DefModifLabel, "[x" + Player.defmodifList[_labtool._player1.characterIndex] + "]");
updateLabel(this.p2DefModifLabel, "[x" + Player.defmodifList[_labtool._player2.characterIndex] + "]");


updateLabel(this.p1DefModifLabel, "[x" + _labtool._player1.getDefenseModifier() + "]");
updateLabel(this.p2DefModifLabel, "[x" + _labtool._player2.getDefenseModifier() + "]");
updateLabel(this.p1StunLabel, "" + _labtool._player1._stun + "/" + Player.stunList[_labtool._player1.characterIndex]);
updateLabel(this.p2StunLabel, "" + _labtool._player2._stun + "/" + Player.stunList[_labtool._player2.characterIndex]);
updateLabel(this.p1GutsLabel, "(x guts)");
Expand Down
1 change: 1 addition & 0 deletions MemoryAccessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class MemoryAccessor

public static readonly int _charIndexOffset = Convert.ToInt32(ConfigurationManager.AppSettings.Get("CharIndexOffset"), 16);
public static readonly int _HPOffset = Convert.ToInt32(ConfigurationManager.AppSettings.Get("HPOffset"), 16);
public static readonly int _DefenseModifierOffset = Convert.ToInt32(ConfigurationManager.AppSettings.Get("DefenseModifierOffset"), 16);
public static readonly int _MeterOffset = Convert.ToInt32(ConfigurationManager.AppSettings.Get("MeterOffset"), 16);
public static readonly int _RISCOffset = Convert.ToInt32(ConfigurationManager.AppSettings.Get("RISCOffset"), 16);
public static readonly int _PositionXOffset = Convert.ToInt32(ConfigurationManager.AppSettings.Get("PositionXOffset"), 16);
Expand Down
26 changes: 16 additions & 10 deletions Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class Player

public string _currentAnim;
public int _HP;
public int _defenseModifier;
public int _meter;
public int _RISC;
public int _stun;
Expand All @@ -44,15 +45,21 @@ public Player()

public int characterIndex;
static public List<string> charactersList = new List<string>() { "Sol", "Ky", "May", "Millia", "Zato=1", "Potemkin", "Chipp", "Faust", "Axl", "Venom", "Slayer", "I-no", "Bedman", "Ramlethal", "Sin", "Elphelt", "Leo", "Johnny", "Jack-O'", "Jam", "Haehyun", "Raven", "Dizzy", "Baiken", "Answer" };
static public List<int> stunList = new List<int>() { 6000, 6000, 7000, 5500, 6000, 8000, 5000, 6500, 6000, 6000, 7000, 5500, 6000, 6000, 6000, 6000, 7000, 7000, 6000, 6500, 7000, 5500, 5000, 5500, 5500 };
static public List<float> defmodifList = new List<float>() { (float)1.00, (float)1.03, (float)1.06, (float)1.21, (float)1.09, (float)0.93, (float)1.30, (float)1.00, (float)1.06, (float)1.03, (float)0.96, (float)1.06, (float)0.98, (float)1.06, (float)1.04, (float)1.03, (float)1.00, (float)1.00, (float)1.03, (float)1.06, (float)0.96, (float)1.10, (float)1.06, (float)1.12, (float)1.03 };
// 90% 76% 60% 50% 40% Answer, Bedman, Elphelt, Faust, Zato
// 87% 72% 58% 48% 40% Axl, I-No, Ramlethal, Sin, Slayer, Sol, Venom, Dizzy
// 84% 68% 56% 46% 38% Ky, Haehyun, Jack-O'
// 81% 66% 54% 44% 38% Johnny, Leo, May, Millia, Potemkin, Jam
// 78% 64% 50% 42% 38% Baiken, Chipp
// 75% 60% 48% 40% 36% Raven

static public List<int> stunList = new List<int>() { 6000, 6000, 7000, 5500, 6000, 8000, 5000, 6500, 6000, 6000, 7000, 5500, 6000, 6000, 6000, 6000, 7000, 7000, 6000, 6500, 7000, 5500, 5000, 5500, 5500 };
// 90% 76% 60% 50% 40% Answer, Bedman, Elphelt, Faust, Zato
// 87% 72% 58% 48% 40% Axl, I-No, Ramlethal, Sin, Slayer, Sol, Venom, Dizzy
// 84% 68% 56% 46% 38% Ky, Haehyun, Jack-O'
// 81% 66% 54% 44% 38% Johnny, Leo, May, Millia, Potemkin, Jam
// 78% 64% 50% 42% 38% Baiken, Chipp
// 75% 60% 48% 40% 36% Raven

public double getDefenseModifier()
{
float actualDefenseModifier = (float)(256 + _defenseModifier) / 256;
// Truncate instead of rounding to line up with the Dustloop
return Math.Truncate(actualDefenseModifier * 100) / 100;
}

private class IsIdleResponse {
public Player player;
public bool isIdle;
Expand Down Expand Up @@ -91,7 +98,6 @@ public void assignPlayerPtr(IntPtr ptr)
_playerPtr = ptr;
}


public bool IsCompletelyIdle()
{
(string charName, string animName) charAndAnim = (charactersList[characterIndex], _currentAnim);
Expand Down

0 comments on commit c9371b5

Please sign in to comment.