Skip to content
Hawkmax edited this page Oct 3, 2025 · 23 revisions

Welcome!

RichJSON is a powerful extension of the JSON format,
designed to make your game data highly modular and modifiable on the fly.

Note

RichJSON is not MIT Licensed and not Freeware.
A raptor Pro License is required.

Key Features

  • RichJSON does not violate any JSON format conventions,
    which means it can still be read by any standard JSON parser or editor.
  • What makes RichJSON special compared to normal JSON files is its modularity, achieved through features such as:
    • referencing JSON objects/files/folders and GameMaker assets/globals
    • inheriting JSON objects/files/folders
    • calling GameMaker constructor functions
    • implementing raptor interfaces
    • using nested string interpolations
  • But that’s not all! RichJSON also provides a variety of commands, enabling advanced GameMaker and raptor functionality, such as:
    • finding game objects (gml with command)
    • choose a value randomly (gml choose function)
    • defining colors (gml constants, rgb, bgr, hsv and scribble colors)
    • coping of JSON objects/files/folders
    • merging folders to one single JSON object
    • referencing scriptor scripts as callback functions
    • defining Collage sprite sheets
    • defining raptor UI trees
  • And if that weren’t enough, you can also create custom modules to implement new commands for your specific use cases.
    And yes, there will be use cases... we promise!

Note

In this documentation, the term JSON object is used interchangeably with GameMaker struct.
From now on, we’ll simply use struct since it’s shorter and clearer.

How does it look like?

1. Just create a JSON file

{ // root struct
	"data": {
		"member1": "member1",
		"member2": "member2",
		"member3": "member3"
	},
	"reference_of_data": "#ref:data" // this is were the magic happens #ref is a RichJson command,
                                     // which will resolve the path starting at the file root
}

2. Read the file with the raptor function file_read_struct or file_read_struct_async

var struct = file_read_struct(<filepath>);

How will the result struct (file) look like?

{ // root struct
	"data": { // this struct has the same reference id as the "reference_of_data" struct
		"member1": "member1",
		"member2": "member2",
		"member3": "member3"
	},
	"reference_of_data": { // this struct has the same reference id as the "data" struct
		"member1": "member1",
		"member2": "member2",
		"member3": "member3"
	}
}

And of course you do not have to name your member "reference_of_data" in order to use the command #ref. Member names are only relevant for path declarations.

Start by understanding Command Categories.

Yours,
Hawk aka Max
Coldrock Games

Clone this wiki locally