Skip to content

Commit fada264

Browse files
added a bunch of guard values
1 parent fc8498e commit fada264

File tree

4 files changed

+88
-3
lines changed

4 files changed

+88
-3
lines changed

GGXXACPR_Framework/GGFramework.cpp

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ const char* p1DInputs = nullptr;
2222
const char* p1PInputs = nullptr;
2323
const char* p2DInputs = nullptr;
2424
const char* p2PInputs = nullptr;
25+
const int* camXCenter = nullptr;
26+
const int* camBottomEdge = nullptr;
27+
const int* camLeftEdge = nullptr;
28+
const int* camWidth = nullptr;
29+
const int* camHeight = nullptr;
30+
const float* camZoom = nullptr;
2531

2632
void initalizeWSServer() {
2733
worker.thread = std::make_shared<std::thread>([]() {
@@ -55,6 +61,13 @@ void MessageHandler()
5561
//maybe add camera struct later
5662
try {
5763
newState.frameCount = frameCounter;
64+
newState.cam.camHeight = *camHeight;
65+
newState.cam.camLeftEdge = *camLeftEdge;
66+
newState.cam.camWidth = *camWidth;
67+
newState.cam.camBottomEdge = *camBottomEdge;
68+
newState.cam.camXCenter = *camXCenter;
69+
newState.cam.camZoom = *camZoom;
70+
5871
newState.p1.health = p1->HitPoint;
5972
newState.p1.CharID = p1->idno;
6073
newState.p1.CleanHitCount = p1->ply->CleanHit_count;
@@ -73,6 +86,18 @@ void MessageHandler()
7386
newState.p1.posy = p1->posy;
7487
newState.p1.inputs = inputFiller(*p1PInputs, *p1DInputs);
7588
newState.p1.seals = sealFiller(p1->ply);
89+
newState.p1.guard.FaultlessDefenceDisableTime = p1->ply->FaultlessDefenceDisableTime;
90+
newState.p1.guard.guardSt = p1->GuardSt;
91+
newState.p1.guard.JGWhiteTime = p1->ply->JGWhiteTime;
92+
newState.p1.guard.JustFD_ColorCounter = p1->ply->JustFD_ColorCounter;
93+
newState.p1.guard.JustFD_EasyCounter = p1->ply->JustFD_EasyCounter;
94+
newState.p1.guard.JustFD_EnableCounter = p1->ply->JustFD_EnableCounter;
95+
newState.p1.guard.JustFD_Flag = p1->ply->JustFD_Flag;
96+
newState.p1.guard.JustFD_GuardDisableCounter = p1->ply->JustFD_GuardDisableCounter;
97+
newState.p1.guard.JustFD_ReversalIgnoreTimer = p1->ply->JustFD_ReversalIgnoreTimer;
98+
newState.p1.guard.JustGuardIgnoreTime = p1->ply->JustGuardIgnoreTime;
99+
newState.p1.guard.JustGuardTime = p1->ply->JustGuardTime;
100+
newState.p1.guard.notThrowTime = p1->ply->notThrowTime;
76101

77102
//p2
78103
newState.p2.health = p2->HitPoint;
@@ -93,6 +118,19 @@ void MessageHandler()
93118
newState.p2.posy = p2->posy;
94119
newState.p2.inputs = inputFiller(*p2PInputs, *p2DInputs);
95120
newState.p2.seals = sealFiller(p2->ply);
121+
newState.p2.guard.FaultlessDefenceDisableTime = p2->ply->FaultlessDefenceDisableTime;
122+
newState.p2.guard.guardSt = p2->GuardSt;
123+
newState.p2.guard.JGWhiteTime = p2->ply->JGWhiteTime;
124+
newState.p2.guard.JustFD_ColorCounter = p2->ply->JustFD_ColorCounter;
125+
newState.p2.guard.JustFD_EasyCounter = p2->ply->JustFD_EasyCounter;
126+
newState.p2.guard.JustFD_EnableCounter = p2->ply->JustFD_EnableCounter;
127+
newState.p2.guard.JustFD_Flag = p2->ply->JustFD_Flag;
128+
newState.p2.guard.JustFD_GuardDisableCounter = p2->ply->JustFD_GuardDisableCounter;
129+
newState.p2.guard.JustFD_ReversalIgnoreTimer = p2->ply->JustFD_ReversalIgnoreTimer;
130+
newState.p2.guard.JustGuardIgnoreTime = p2->ply->JustGuardIgnoreTime;
131+
newState.p2.guard.JustGuardTime = p2->ply->JustGuardTime;
132+
newState.p2.guard.notThrowTime = p2->ply->notThrowTime;
133+
96134
json j = newState;
97135
std::thread(sendEvent, "ggxx_stateUpdate", j.dump()).detach();
98136
frameCounter++;
@@ -133,6 +171,13 @@ void hook_RoundStart(SafetyHookContext& ctx) {
133171
p1PInputs = reinterpret_cast<char*>(base) + 0x6D0E81;
134172
p2DInputs = reinterpret_cast<char*>(base) + 0x6D0F18;
135173
p2PInputs = reinterpret_cast<char*>(base) + 0x6D0F19;
174+
175+
camXCenter = (int*)(reinterpret_cast<char*>(base) + 0x6D5CE4);
176+
camBottomEdge = (int*)(reinterpret_cast<char*>(base) + 0x6D5CE8);
177+
camLeftEdge = (int*)(reinterpret_cast<char*>(base) + 0x6D5CF4);
178+
camWidth = (int*)(reinterpret_cast<char*>(base) + 0x6D5CFC);
179+
camHeight = (int*)(reinterpret_cast<char*>(base) + 0x6D5D00);
180+
camZoom = (float*)(reinterpret_cast<char*>(base) + 0x6D5D18);
136181
std::thread(sendEvent, "ggxx_roundStartEvent", "{}").detach();
137182
}
138183

GGXXACPR_Framework/SAMMITypes.hpp

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,24 @@ Seals sealFiller(PLAYER_ENTRY*);
4040

4141
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(Seals, jump, arts, dash, punch, kick, slash, hslash, dust)
4242

43-
struct PlayerState { //TODO: expand to include more relevant data
43+
struct GuardStuff {
44+
int guardSt{};
45+
int FaultlessDefenceDisableTime{};
46+
int JustFD_EnableCounter{};
47+
int JustFD_GuardDisableCounter{};
48+
int JustFD_ColorCounter{};
49+
int JustFD_ReversalIgnoreTimer{};
50+
int JustFD_EasyCounter{};
51+
int JustFD_Flag{};
52+
int notThrowTime{}; //throw invuln time
53+
int JustGuardTime{};
54+
int JustGuardIgnoreTime{};
55+
int JGWhiteTime{};
56+
};
57+
58+
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(GuardStuff, guardSt, FaultlessDefenceDisableTime, JustFD_EnableCounter, JustFD_GuardDisableCounter, JustFD_ColorCounter, JustFD_ReversalIgnoreTimer, JustFD_EasyCounter, JustFD_Flag, notThrowTime, JustGuardTime, JustGuardIgnoreTime, JGWhiteTime)
59+
60+
struct PlayerState {
4461
CharacterID CharID{};
4562
int direction{};
4663
int health{};
@@ -59,17 +76,30 @@ struct PlayerState { //TODO: expand to include more relevant data
5976
int posx{};
6077
int posy{};
6178
Inputs inputs{};
79+
GuardStuff guard{};
80+
};
81+
82+
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(PlayerState, CharID, direction, health, tension, damage, negativeVal, commandFlag, stun1, stun2, tensionBalance, CleanHitCount, hitCount, RISC, hitLevel, posx, posy, inputs, seals, guard)
83+
84+
struct Camera {
85+
int camXCenter{};
86+
int camLeftEdge{};
87+
int camBottomEdge{};
88+
int camWidth{};
89+
int camHeight{};
90+
float camZoom{};
6291
};
6392

64-
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(PlayerState, CharID, direction, health, tension, damage, negativeVal, commandFlag, stun1, stun2, tensionBalance, CleanHitCount, hitCount, RISC, hitLevel, posx, posy, inputs, seals)
93+
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(Camera, camXCenter, camLeftEdge, camWidth, camHeight, camZoom, camBottomEdge)
6594

6695
struct StateUpdate {
6796
PlayerState p1{};
6897
PlayerState p2{};
98+
Camera cam{};
6999
unsigned long int frameCount{};
70100
};
71101

72-
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(StateUpdate, p1, p2, frameCount)
102+
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(StateUpdate, p1, p2, cam, frameCount)
73103

74104
struct RoundEndEvent {
75105
int whoWon{};

SAMMI documentation.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ data.eventInfo.*
2222
p,k,s,h,d,up,towards,away,down,pk,pks,pksh,pd,respect
2323
seals (timers, 0 unless that player has been hit by Baiken GC Baku followups)
2424
arts, dash, dust, hslash, kick, jump, punch, slash
25+
guard (guard related timers and flags, all ints)
26+
guardSt, FaultlessDefenceDisableTime JustFD_EnableCounter, JustFD_GuardDisableCounter, JustFD_ColorCounter, JustFD_ReversalIgnoreTimer, JustFD_EasyCounter, JustFD_Flag, notThrowTime, JustGuardTime, JustGuardIgnoreTime, JGWhiteTime
27+
cam (camera values, all ints except zoom which is float)
28+
camXCenter, camLeftEdge, camBottomEdge, camWidth, camHeight, camZoom
2529

2630

2731
"ggxx_roundEndEvent"

daily log.ntxt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,4 +112,10 @@
112112
Had some more crash reports from Krack, so I fixed them and some others. Now it *shouldn't* crash when correctly closing the game or when switching characters in training mode. Also I added Baiken's
113113
seal timers. I've been meaning to do it for a while, and I did it now so this could be a slightly larger update. Time to play KOF.
114114

115+
11:20 AM Friday, January 17, 2025: Adding more things
116+
Wasn't able to work on the mod yesterday due to a very packed schedule. Fortunately class was cancelled today so I have hella free time. Krack was working on a SB detector yesterday and the discussion
117+
around that led me to add a bunch of guard-related fields to help with that effort. I added them today along with some camera values. Actually getting the correct pointers to those camera values was a
118+
pain though, as for entirely unclear reasons the address was being set incorrectly until I changed the cast from an int to a char and then suddenly it worked fine. If it's cursed but it works then it
119+
isn't cursed I guess? It certainly seems like the disparate values I'm getting are part of a larger structure, so I'd like to implement that at some point.
120+
115121
<>

0 commit comments

Comments
 (0)