Designing an Extension and Scripting System for CopperCube

The software I'm working most on, CopperCube, is a quite complicated beast. It is targeted at people who want to create 3D apps and games, but do not want or are unable to program. To make this possible, you can easily click your apps together in CopperCube by using a fixed set of 26 Actions and 18 Behaviors. Together, they offer (an estimated) amount of 300 parameters, so you can do quite much with this already. But still, for more complicated apps - and a computer game is probably the most complicated piece of software there is - this is not enough.

So instead of adding more and more actions and behaviors, implementing them for each of the 5 supported targets separately (Windows and Mac OS X in C++, WebGL in JavaScript, Android in Java and Flash in Actionscript), I decided to create an extension mechanism. So that everyone can create their own actions and behaviors, share them with other users, and of course: So that also I can use this myself, and do not have to implement new functionality for all targets separately.

I did some prototyping and testing during the last days, and managed to create a nicely working extension system already. The prototype already works partially on Windows .exe, Mac OS X .app and on the Flash .swf target, so I can continue working from there:

The above creates a 2D Jump'n'Run behavior, which is actually functional already in my test build. The system works like this: For using/creating/downloading a new Action or Behavior, you only need one single file, which is a standard JavaScript text file, which you only need to copy into a specific extension directory. You can edit and save it with your favourite editor, Notepad++ in my case. CopperCube automatically re-reads this file when creating your app everytime. This makes it very easy to use. The JavaScript file has a small embedded XML section in its top, so the editor knows how and what the user can select and change in the property window of the behavior or the action. You can define types and default values for each property (like 'string', 'int', 'texture', 'color', 'scene node' and similar), and so editing such a behavior is exactly like editing a native one:

New actions or behaviors are written once, and work on all targets. The language used for this is JavaScript. I chose it because it is very simple to learn, most people already know it, and (ab)useing its dynamic features is quite useful for quickly scripting new features like this. It doesn't have the best reputation regarding performance, but I've tested it, and for the needs in CopperCube, it's pretty ok. Just don't try to write a raytracing 3d engine with it :)

This new functionality also makes it possible to script all the target using one, single language, with one single API. Meaning CopperCube will probably be also become a lot more interesting for programmers. So I'm looking forward for it to be finished soon. It will take still a bit of time to be implemented fully, but the next update of CopperCube will already include a usable beta of it.

six comments, already:

I didn’t understand half of this, but it sounds cool :-)
Halo - 11 05 13 - 09:31

This is a really awsome idea and Im really glad you are doing it!
This will open up a whole new dimension in game development, using Coppercube! :-)

Keep on the good work!
Micke - 12 05 13 - 12:45

why are you such a fan of XML? :) it seems to get used a lot in your projects.

what’s the advantage over JSON? JSON looks a lot simpler and cleaner to me.

it’s great that coppercube will get more interesting to programmers! :)
horace () - 15 05 13 - 08:52

Well, XML is much easier to read than JSON, IMO. Also, I wrote a few xml parsers already in my life :)
niko - 16 05 13 - 08:15

good job ,go ahead
zyx () - 21 05 13 - 03:59

i remembered 10-12 years ago, the reason Max became popular with gaming platform is because they provided a plugin mechanism not existing with other 3d packages.

hopefully this is the start of awesome future for coppercube
pots (link) - 29 05 13 - 02:22


Name:  
Remember personal info?
yes
no
Email (optional):
URL (optional):
Enter "layered" (antispam):
Comment:Emoticons / Textile

  ( Register your username / Log in )

Notify: Yes, send me email when someone replies.  

Small print: All html tags except <b> and <i> will be removed from your comment. You can make links by just typing the url or mail-address.
Note: If you type in your email adress above, it will be visible to other visitors, although it will be hidden for bots using javaScript.