1 of 28

2 of 28

Writing and validating your data with CastleDB

3 of 28

Our Ingame Database

Our Ingame Entities

A long list of static (read-only) definitions that always exist in the game:

  • Items
  • Recipes - how you craft items and buildings
  • Biomes
  • Overworld locations & missions
  • Etc...

Everything (ish) that is spawned in the game is an entity

Similar to Unity Prefabs.

4 of 28

Our

Data

Format

5 of 28

Problem #1: References!

Database references

Does the recipe need or produce an item that doesn’t exist?

Entity references

Is there no corresponding entity to an item or location?

Image references

Do we have all the icons and other images we refer to?

Localization

Do we have proper translation entries for everything in the database?

6 of 28

Problem #2: Typos and copy-paste errors!

7 of 28

Problem #3: Not super nice for non-techies

8 of 28

Problem #4: Hard to overlook

Can only fit 3-6 entries on screen

9 of 28

CastleDB

10 of 28

JSON based

Version control friendly!

Human readable!

Easily parsable!

11 of 28

Getting started

12 of 28

Many different types

13 of 28

References

14 of 28

Multiple items per field

15 of 28

Add some massage

16 of 28

Output:

17 of 28

Friendly

log

18 of 28

Can run in watch mode

19 of 28

File output, prettily formatted

20 of 28

Reference validation with clear error messages

21 of 28

Disabled invalid data:

22 of 28

WIP toggle

23 of 28

Entity

file

generation

24 of 28

Schema definition

25 of 28

The bad?

26 of 28

Columns are equal width!

It’s written in javascript/haxe/node.js (I think)

(only bad if you aren’t familiar with it… like me!)

No in-editor validation

27 of 28

100%

Done

28 of 28

Questions?