DATA+ (Construct 3 Behaviors and Plugin Addons)
A downloadable tool
Thanks to everyone who already got the addon pack, i'm glad it's useful
NEW : MAJOR 2.0 RELEASE, JSON+ is now DATA+ :
- Polish and improves JSON+ Behavior and JSON+ Plugin
- Now includes 2 New Behaviors : Array as Behavior + Dictionary as Behavior
DATA+ is the best way to handle the data of your game in Construct 3.
This pack includes :
- JSON+ Plugin
- JSON+ Behavior : allowing you to use all the JSON+ features directly on a game object to handle its complex/runtime/dynamic data.
- (2.0 Bonus) Array as a Behavior !
- (2.0 Bonus) Dictionary as a Behavior !
- Example/documentation Construct Project (.c3p)
(also includes a few tips and tricks I found)
I spent years trying to figure out how to handle complex and dynamic data management in Construct and this tool is the one i've been using for almost everything for my upcoming SECRET ROGUELIKE™, I decided to release it to help people to unleash the true potential of C3 without headaches and so we can just enjoy the process of making our games, even when dealing with Data Management.
With this Addon Pack you can add all Data stuff directly as Behaviors of your Families and Objects. All you need to do you is to access your data is Player.MyDictionnary.Get("key") or Player.MyArray.At(x, y). All Data Actions, Conditions, Expressions are just directly accessible on the Object/Family. No need to create a bunch of extra Data Objects and do tedious picking tricks everytime.
But the biggest and most powerful addition of this Addon Pack is JSON+ addons (can be either used as a Plugin or as a Behavior), which allows you to create all kind of variables, arrays and data structures (even at runtime !) for your game objects and comes with a lot of additional ACEs, Utilities and QOL enhancements, to make the whole process as fast and enjoyable as possible.
HAVE FUN !
JSON+ Behavior and Plugin
Here are some advantages of using JSON+ over the vanilla solution included in Construct :
1. You can use it directly as a behavior :
✅ JSON+ can be used either as a Plugin or as a Behavior, so this is by far more pleasant and easier to use as a Data Holder for your Objects such as Entities or the Player Object
- no need to double pick different objects each time you want to read or write your data associated to an Object
- no need to use the Container trick that prevents you to use the Family feature
- no need to loop all your Entities instances with a For Each to pick the right associated Data Objects
❌In Vanilla Construct, if you want to link complex data to your Player Sprite for example, you need to create additional Data Objects (such as Dictionnary/Array/JSON) to handle that data and use tedious shenanigans to pick that second object everytime you need it.
NEW IN 2.0 : For the exact same reasons, DATA+ now comes with 2 additional Behaviors :
- Array as Behavior
- Dictionary as Behavior
- Basically allow you to use Arrays and Dictionaries as "instance variables"
- Those behaviors are handy for most simple situations, in case JSON+ Behavior is overkill. They can also be useful if you prefer to break down your data into smaller and simpler pieces
2. No need to deal with tedious/unreadable/error-prone Path expressions :
✅JSON+ provides several useful expression to reference or get a JSON Path
❌ The Vanilla JSON Plugin is also tedious to use because of how we need to use the expression system to handle path of nested properties. There are several main ways to handle path expressions in C3 but it always turns either into monstrosities or either into error-proned stuff such as :
STRING1 &”.”& STRING2 &”.”& JSON.CurrentValue &”.” &STRING3
- “String1.String2.”&JSON.CurrentValue&”.String3”
✅ JSON+ | MyJSON.Get( Inventory, Items, MyJSON.CurKey, Price) |
❌ Vanilla JSON | MyJSON.Get( Inventory &”.”& Items&”.”& MyJSON.CurrentKey &”.” &Price) |
You can use both Vanilla ways and JSON+ ways to write your paths with JSON+ using the same expressions, it let you do things as you prefer.
3. Better Loops
✅ JSON+ is packed with all the Loop features that the Vanilla JSON doesn't have :
- Loopindex Expression
- Stop Loop Action
- Orderered Loop Conditions : you can order any JSON array or object by their keys and/or by their values (ascending/descending)
4. Better Arrays :
✅ JSON+ allows you to sort/shuffle/loop through your JSON arrays in an order defined by its contained values. It also let you pick a random element with ease.
❌The vanilla arrays of the JSON Plugin don't let you do any of this.
5. Better Debugging :
✅ JSON+ comes with a Log Action that allows you to directly log any path of the JSON Object in the console as JS Object. Which means you can expand/collapse the section as you wish and don't need to use other Objects and tedious expression to achieve the same results
❌ Vanilla JSON is extremely tedious to debug, you need to use the JSON.GetAsBeautifiedString("MyPath") expression logged via the Browser Plugin and when do you so it prints it as a string in the console, so you can't collapse/expand any part of the gigantic string you get, making it impossible to find a value or a nested object efficently.
6. Better Scripting Interfaces :
✅ JSON+ comes with additional JS scripting interfaces making it easier to set or get the value at a given path of your JSON from Javascript (and to Javascript). Indeed, JSON+ is the best way to make a bridge between your Eventsheet Data and Javascript for the most advanced usecases.
7. Create new data structures on the fly with ease :
✅ JSON+ automatically creates the right data object if you try to act on it while it's not created yet. As JSON is meant to be used to handle dynamic/runtime data, it's very useful and avoid you the pain to do a complex setup everytime to check if the path exists and handle things differently depending on if it does or not.
Examples:
- If you use the action "Remove 5 to MyObject.MyProperty" but MyProperty doesn't exists yet, it will automatically create and set MyProperty to the numeric value -5.
- If you use the action "Push MyTargetUID to MyObject.TargetsArray but TargetArray doesn't exists yet, it will automatically create an array with MyTargetUID as its first element
❌In many situation Vanilla JSON needs you to first manually create your values/arrays/objects before acting on them, because of this, in many situations, you need to do extra checks and handle the different cases, which implies that you need to write 3 or 4 times the same path in different conditions/actions just to do 1 simple thing (very tedious to do, especially as Vanilla JSON Path are unreadable and error-prone, and because if you need to change that path later, you need to replace it manually in many places)
8. And other Quality of Life ACEs :
✅ JSON+ comes with additional QOL ACES (such as picking a random element of your array or object, or check if an array or object is empty just to name a few). JSON+ also makes some expressions shorter to keep things readable.
9. Better performance in common usecases:
✅ Thanks to all the enhancements listed above, JSON+ avoid a lot of extra steps and additional checks (which all come with performance overhead) that you would be required to do in common situations, using the Vanilla solution.
Moreover, you can also optimize heavy stuff further thanks to the better Loop features and the new scripting interfaces.
10. Better UX :
✅ The JSON+ ACEs (Action/Conditions/Expressions) are tidied in a pleasant way, so it feels less overwhelming than the Vanilla JSON, yet being able to do more. It also prioritize the most commonly used actions in the order they're display in the Action List. The goal it to make Data Management in Construct as smooth and enjoyable as possible so we can just have fun making our games.
GOOD LUCK ON YOUR PROJECTS ! 💪
Feedbacks, Questions & Contact in my Community Discord
I'm also doing Construct 3 consulting, feel free to DM me if you're interested
Status | Released |
Category | Tool |
Rating | Rated 5.0 out of 5 stars (8 total ratings) |
Author | OVERBOY ツ |
Made with | Construct |
Tags | 2D, addon, construct, Construct 2, construct-3, Game Design, js, json, Modular, tool |
Purchase
In order to download this tool you must purchase it at or above the minimum price of $20 USD. You will get access to the following files: