Data Tables and Rewards

Managing lots of data in Circuits, especially stuff like sequential strings for dialogue or the details of a progression system, has always been pretty tricky. It requires a ton of variables and complex graphs to select which to use in a given circumstance.

It’s more typical for game designers to use a specialized tool for things like this - like a good ol’ spreadsheet! Given the excitement around Make it to Midnight’s progression and this need, we’re introducing Data Tables, a tool to help make this easier.

Pictured: In-development version of data tables. The UI may be slightly different upon full release. 

How do DATA TABLES work?

To start with Data Tables, spawn a Data Table definition chip with the maker pen and configure it to get to the edit screen. From there, you can add columns and rows. Each column is assigned a Type - int, float, bool, string, color, or Reward (more on these later!)

Input your data, adding or copying or moving columns and rows as needed, and then save. 

⚠️Important: You must use the “Save” button in the data table editing UI, which will then save the room. Saving the room via any other method - including another player saving it while you’re editing - may result in lost work. 

Once there’s data in your table, you can use more chips to pull it out of the table and into the rest of your code.

Configure the DataTable Get Cell chip to point at a specific Data Table and column. (You’ve gotta specify the column in advance because we’ve gotta know the Type of the output pin!) Then, you can extract data from that column on a per-row basis.

The idea is that each row is a set of similar data, and you’re doing the same operation on different sets depending on the circumstances. Let’s say you’ve got a table named Enemies that contains details about various enemy encounters:

You can notify players about each kill and hand out gold with a relatively small graph. Here’s a simplified version here:

You can also search for information within the Data Table. Using DataTable Get Rows Containing or DataTable Get First Row Containing you can reference row information based on the name string “Goblin” (sorry, exact matches only). Or you can pull a random Challenge 6 enemy to throw at your players without having to hard-code what row in the table they’re on.


Rewards

Rewards are a way to pack keys, currency quantities, and consumable bundles into a data table with a consistent and slightly fancier presentation. Rewards are used heavily in the upcoming Progression system (more info about that soon!), and you may have noticed that the gif at the top of this post is from Make it to Midnight, where we’re using Rewards for the Perks. 

You make Rewards a lot like you make Keys and Consumables. Check your Room Settings for a new tab!

Once your room has some Rewards ready to go, you can put them in a data table and/or directly grant them to players with the Reward Constant and the Grant Reward chip. (For those curious, Make it to Midnight’s Perks uses Rewards to grant Keys, and then those Keys enable Circuits behaviors by using Player Owns Room Key as a filter.)

There’s also a new Show Reward Notification chip that you can use to notify players of between 1-3 Rewards at once.

For advanced users

Don’t want to type in all your data manually?

There’s an Import button on the Data Table edit screen. It’s expecting CSV, which you can usually export from other spreadsheets:

Here’s an example of the formatting it’s looking for:

schema:

Score,int

Speed,float

Title,string

CanUseTurret,bool

Rank,Color

data:

10,1.5,Scaredy Cat,False,8080FF

200,2.75,Brave Warrior,True,FF80FF

500,3.25,Expert Player,True,FF8000

Note: This doesn’t work for Rewards. You’re better off leaving those blank and hooking them up in the game.

What’s next?

A Progression system that builds on Data Tables and Rewards - as seen in Make it to Midnight - is coming Soon™.   Watch this space for a tour when it ships!