Curation round 5: Game construction, FXLayers, PlayerManager, the menus; the main menu renders
Eight agents took over ScoreSheet, DeathmatchManager, giantbook and boss overlays, FXLayers, PlayerManager, the menu manager with the save and prompt flow, twelve menus (character wheel, options, challenges, daily (offline), special seeds, leaderboard (local), collection, bestiary, stats, controller select, key config, cutscenes), console text input and gamepad hot-plug through platform listeners. Integration moved input to device ids. KAGE's projection matrix now reaches the 'ProjectionMatrix' uniform the basic shaders from afterbirthp.a declare, as well as the exe's 'Transform', which takes the color-mod and HQ4X passes from black to correct output. Under gdb with stubs skipped, the intro, title, file select, main menu and character wheel render as in the game. 1330 functions taken over, boot path 261/615. build/isaac stops at OnlineEmotes::init in Game::LoadConfigXmls. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
fd8b965350
commit
233d5123e8
128 files changed
+10194
-36967
No files matched your search
+100
-3
@@ -1,14 +1,21 @@
|
||||
#pragma once
|
||||
|
||||
#include "anm2.h"
|
||||
#include "challenge_params.h"
|
||||
#include "console.h"
|
||||
#include "deathmatch_manager.h"
|
||||
#include "generic_prompt.h"
|
||||
#include "item_pool.h"
|
||||
#include "kage_graphics.h"
|
||||
#include "leaderboard.h"
|
||||
#include "player_manager.h"
|
||||
#include "room_config.h"
|
||||
#include "score_sheet.h"
|
||||
#include "seeds.h"
|
||||
#include <array>
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
|
||||
@@ -18,9 +25,13 @@ constexpr int ROOM_LIST_SIZE = ROOM_GRID_SIZE + OFF_GRID_ROOM_COUNT;
|
||||
constexpr int GREED_WAVE_SLOTS = 12;
|
||||
constexpr int BACKWARDS_STAGE_COUNT = 7;
|
||||
constexpr int GLOWING_HOURGLASS_SLOTS = 2;
|
||||
constexpr int GIANTBOOK_ENTRY_COUNT = 48;
|
||||
constexpr int BOSS_OVERLAY_COUNT = 5;
|
||||
constexpr int COOP_AWARD_COUNT = 21;
|
||||
constexpr int COOP_STAT_NONE = 22;
|
||||
|
||||
// The xorshift every RNG of Game starts on, before a run seeds it (shift index 35).
|
||||
constexpr RNG RNG_DEFAULT = {0xaa17414f, 5, 9, 7};
|
||||
constexpr RNG RNG_DEFAULT = {RNG_SEED_DEFAULT, 5, 9, 7};
|
||||
|
||||
// A screen color modifier that changes nothing.
|
||||
constexpr ColorModState COLOR_MOD_NEUTRAL = {1, 1, 1, 0, 0, 1};
|
||||
@@ -34,6 +45,78 @@ enum Difficulty : uint32_t
|
||||
DIFFICULTY_GREEDIER
|
||||
};
|
||||
|
||||
// The run's state flags (Lua's GameStateFlag) the curated code reads, by bit.
|
||||
enum GameStateFlag : int
|
||||
{
|
||||
GAME_STATE_BOSSRUSH_DONE = 33,
|
||||
GAME_STATE_BOSSRUSH_DOOR_SPAWNED = 38,
|
||||
GAME_STATE_BLUEWOMB_DOOR_SPAWNED = 39,
|
||||
GAME_STATE_BLUEWOMB_DONE = 40,
|
||||
GAME_STATE_BACKWARDS_PATH = 48
|
||||
};
|
||||
|
||||
// The string table keys of the co-op awards, in the order of Game's award table.
|
||||
constexpr std::array<std::string_view, COOP_AWARD_COUNT> COOP_AWARD_KEYS = {
|
||||
"#Online/COOP_AWARD_ETERNAL", "#Online/COOP_AWARD_HEARTLESS", "#Online/COOP_AWARD_ENVIOUS",
|
||||
"#Online/COOP_AWARD_DRESSED_UP", "#Online/COOP_AWARD_PRIDEFUL", "#Online/COOP_AWARD_SAVIOR",
|
||||
"#Online/COOP_AWARD_WRATHFUL", "#Online/COOP_AWARD_BIG_BOSS", "#Online/COOP_AWARD_EXPLORER",
|
||||
"#Online/COOP_AWARD_EXPRESSIVE", "#Online/COOP_AWARD_GLUTTONOUS", "#Online/COOP_AWARD_RECKLESS",
|
||||
"#Online/COOP_AWARD_ESCAPE_ARTIST", "#Online/COOP_AWARD_GAMBLER", "#Online/COOP_AWARD_GREEDY",
|
||||
"#Online/COOP_AWARD_MYSTIC", "#Online/COOP_AWARD_PILL_POPPER", "#Online/COOP_AWARD_BIG_SPENDER",
|
||||
"#Online/COOP_AWARD_JANITOR", "#Online/COOP_AWARD_LUSTFUL", "#Online/COOP_AWARD_SLOTHFUL"};
|
||||
|
||||
// An award the online co-op stats screen gives: its translated name, the player stat that decides it (none by default),
|
||||
// whether the most or the least wins and within what threshold, the least the first stat must reach, whether a tie
|
||||
// shares it, and the players who earned it.
|
||||
struct CoopAward
|
||||
{
|
||||
std::string name;
|
||||
std::vector<uint64_t> userIds;
|
||||
float threshold = 0;
|
||||
int minimumFirstStat = 0;
|
||||
int statId = COOP_STAT_NONE;
|
||||
bool isTieShared = true;
|
||||
bool isMostWins = true;
|
||||
};
|
||||
|
||||
// A layer of a giant book animation recolored by giantbook.xml.
|
||||
struct GiantbookLayer
|
||||
{
|
||||
std::string name;
|
||||
ColorMod color{};
|
||||
};
|
||||
|
||||
// A giant book animation (the full screen item use overlays) as giantbook.xml defines it.
|
||||
struct GiantbookEntry
|
||||
{
|
||||
std::string anm2Path;
|
||||
std::string animation;
|
||||
std::string gfxPath;
|
||||
std::vector<GiantbookLayer> layers;
|
||||
int id = 0;
|
||||
};
|
||||
|
||||
// A boss overlay animation (the Dogma and Beast screen effects) as bossoverlays.xml defines it.
|
||||
struct BossOverlayEntry
|
||||
{
|
||||
std::string anm2Path;
|
||||
std::string animation;
|
||||
int id = 0;
|
||||
bool isPersistent = false;
|
||||
};
|
||||
|
||||
// What Game::Spawn creates: an entity by type, variant and subtype at a position and velocity, from a seed.
|
||||
struct EntitySpawn
|
||||
{
|
||||
Vector position{};
|
||||
Vector velocity{};
|
||||
Entity* spawner = nullptr;
|
||||
int subType = 0;
|
||||
int type = 0;
|
||||
int variant = 0;
|
||||
uint32_t seed = 0;
|
||||
};
|
||||
|
||||
// A boss by type and variant, as the run's encountered list holds it.
|
||||
struct BossId
|
||||
{
|
||||
@@ -53,6 +136,8 @@ struct ErasedEnemy
|
||||
// draws from, the UI overlays and menus of a run, and the screen effects, counters and history of the run so far.
|
||||
// Members of classes not taken over yet keep their generated types and start zeroed.
|
||||
// The render surfaces were file globals of the original, created once by the first Game.
|
||||
// The giant book and boss overlay tables live in the item and boss overlays of the original, which classes.h holds as
|
||||
// bytes. They move there with those classes' takeovers.
|
||||
class Game
|
||||
{
|
||||
public:
|
||||
@@ -109,13 +194,17 @@ public:
|
||||
ProceduralItemManager proceduralItemManager{};
|
||||
std::array<GlowingHourglassState, GLOWING_HOURGLASS_SLOTS> glowingHourglassStates{};
|
||||
std_vector onlinePlayerStats{};
|
||||
std::array<CoopAward, COOP_AWARD_COUNT> coopAwards;
|
||||
bool isOnlineStatsFinalized = false;
|
||||
std::vector<BossId> encounteredBosses;
|
||||
std::vector<ErasedEnemy> erasedEntities;
|
||||
|
||||
RoomTransition roomTransition{};
|
||||
StageTransition stageTransition{};
|
||||
ItemOverlay itemOverlay{};
|
||||
std::array<GiantbookEntry, GIANTBOOK_ENTRY_COUNT> giantbookEntries;
|
||||
BossOverlay bossOverlay{};
|
||||
std::array<BossOverlayEntry, BOSS_OVERLAY_COUNT> bossOverlayEntries;
|
||||
GameOver gameOver{};
|
||||
Leaderboard leaderboard{};
|
||||
HUD hud{};
|
||||
@@ -123,9 +212,10 @@ public:
|
||||
RevivePlayerMenu revivePlayerMenu{};
|
||||
OnlineStatsScreen onlineStatsScreen{};
|
||||
Minimap minimap{};
|
||||
ScoreSheet scoreSheet{};
|
||||
ScoreSheet scoreSheet;
|
||||
GenericPrompt genericPrompt{};
|
||||
DebugRenderer debugRenderer{};
|
||||
OnlineEmotes emotes{};
|
||||
ANM2 completionWidgetSprite;
|
||||
|
||||
KAGE::Graphics::ImagePtr giantBookClickerImage;
|
||||
@@ -214,7 +304,8 @@ public:
|
||||
~Game();
|
||||
|
||||
static void LoadConfigXmls();
|
||||
static uint32_t load_bossoverlays_xml(std::string_view path);
|
||||
bool load_giantbook_xml(std::string_view path);
|
||||
bool load_bossoverlays_xml(std::string_view path);
|
||||
static void LoadBossRushXml(std::string_view path);
|
||||
void reset_run_state();
|
||||
void ResetState();
|
||||
@@ -227,4 +318,10 @@ public:
|
||||
bool IsPaused();
|
||||
bool IsGreedMode();
|
||||
int GetStageID();
|
||||
bool GetStateFlag(GameStateFlag flag);
|
||||
Entity_Player* GetPlayer(int index);
|
||||
ChallengeParam& GetChallengeParams();
|
||||
Entity* Spawn(const EntitySpawn& spawn);
|
||||
};
|
||||
|
||||
void coop_awards_load(std::array<CoopAward, COOP_AWARD_COUNT>& awards);
|
||||
Reference in new issue
Block a user