Skip to content
Hedera edited this page Mar 12, 2026 · 2 revisions

Stefan (Sleeper Games) has responded to a Q&A regarding HDC's internal mechanics on the developer end, which is transcribed here.

Upgrades

Upgrade are handled around individual upgrade IDs, these ID are also what the individual animations in obj_upgrade are named. Upgrades need to have an animation in obj_upgrade to work.

Upgrades then get initialized by their variable "up_initialized" being checked, trace that variable name and you might be able to find the initialization process for all upgrades. This initialization is what sets upgrade effects and compatibility conditions. Most upgrade effect variables in obj_upgrade start with "upmod", requirements start with "upreq".

Similarly searching for the card_get_upgraded variable in obj_card will lead to all upgrade effects getting applied.

Upgrade effect might need to be reset as part of card_full_reset of obj_card being checked, otherwise they might persist or duplicate when upgrades are removed (this resets the entire card applies all remaining upgrades again).

Upgrade add pipeline is just a reminder for me what I have to cover to add upgrades.

Upgrade Add Pipeline

Not part of Stefan's response, taken from the development Trello

Tooltip

Initialize event

Add new compatability reqs, if necessarry

Apply effect event

Add this upgrade's effects to reset event (Init)

Add new items to loot lists (json)

Starting Decks

Starting decks are defined as the title screen is generated by pl_is_on_title being checked, easier to trace might be pl_time_on_title which is incremented there. This generates title buttons and assigns icons to them. New decks would require extending this to accomodate new buttons, which might get difficult spacially, you'd probably have to figure out new generation math to have the new decks on screen at all.

Title buttons are a version of ui_element_main and get handled via various properties, most essentiall obj_button_number and but_deck_comp_id, which is the id of the deck element they represent. Tracing these IDs leads to the cards they create when clicked.

Card Effects

Card effects get assigned when obj_card checks card_initialize_me, this triggers the entire card initialization, creating all basic card components and so on.

During this process, the numbers effects are checked by card_type_read, which you can trace to each effect getting assigned. There is a couple hundred of these and they have sub_variables that sometimes define 50 or so variants. I don't keep a list, you'll just have to look at these and trace what they change in obj_card. You can find any effect in the game by simply looking for card_effect_type_read corrosponding to the "effect_type" listed in the cards.json effect sections of each card.

Data Cloud

Data cloud positions are defined by an external scene called "index" which has card portrait objects and upgrades layed out as you see them ingame. Adding additional of these object to the scene will make them show up in the data cloud. I have no idea how this looks in the compiled code, but if there is a hundreds of instances of objunit and objab somewhere with position data then that's probably it.

Adding Cards (since that also came up)

Similar to upgrades, cards need a portrait object animations to work. The animation needs to exist for the "por_obj" defined in cards.json and the animation name needs to again be identical to the card main id used in the data file. Especially for ships these animations need to have a lot of points set to work. Tech cards are more simple, but they still need a basic animation set up. So creating a new animation in one of these portrait objects would be the first step to actually making a new card work.

Clone this wiki locally