### Torque 2D Editor Work

2D version of the Torque engine.

Moderator: marauder2k9

• 1
• 3
• 4
• 5
• 6
• 7

#### Re: Torque 2D Editor Work

marauder2k9
Posts: 399
Joined: Wed Feb 18, 2015 7:36 am
Particle Asset Creation

So far the particle asset creation is not in the editor that is released but i can talk about it a bit.

At the moment i have it setup that each variation field can have 4 datafields, their time values are heavily controlled by the datakey that comes before it. This also means that defaults are easily set for these and the code is more easily diagnosed. If you need more than 4 fields it would be pretty easy to load up the taml file in an editor and add that extra key. I understand this may be pretty counter intuitive as the main focus of this editor is to try and stop any need to modify scripts. But we all know that is impossible no matter what. No matter what game you will try to make it will require some form of scripting in order to make it work. This has been heavily minimized however as you can tell by trying out the editor at its current state. You can create levels in a much easier and much simpler way now with visual feedback as you are creating them. This will be the same for any ParticleAsset created.

EDIT:

I should point out that when you create a particleasset it is displayed in the same scene as everything else for the moment. You can just move to another portion of the scene if u want to see very faint particles. If it becomes too much of a problem i will create a separate scene for particle creation much like how the image asset importer is done. For the time being i was thinking it may be good to be able to visualize very directly how your scene interacts with particles.

Kind of relevant:

With this editor i was thinking of creating some custom "objects" that will help with game development such as:-

Spawner
Explosion
PathFinding
(if you've been watching the videos you would see some simple steering behaviors)
Checkpoint System
Parallax Scroller
Parallax Sprite

To name a few.

Showcasing The Editor

To showcase the editor i am working on creating a couple of examples, much like the Toys that already come with torque. Just to show a few examples of how easy it is now to create different objects, set up different values for objects etc.

#### Re: Torque 2D Editor Work

XIXWYRMEXIX
Posts: 64
Joined: Sat Mar 07, 2015 3:13 pm
Was not able to DL until today, DL now and I will begin playing with it today.

#### Re: Torque 2D Editor Work

marauder2k9
Posts: 399
Joined: Wed Feb 18, 2015 7:36 am
Was not able to DL until today, DL now and I will begin playing with it today.
Brilliant !! let me know any features u think would help.

#### Re: Torque 2D Editor Work

marauder2k9
Posts: 399
Joined: Wed Feb 18, 2015 7:36 am
ParticleAsset Update:

So the particle asset creator is taking a little bit longer because i cant find a way to change the time of a key without completely removing the key and then adding a new one in place of it with the new values. This is done through simsets and simobjects (almighty simsets praise be to thee ) but there is a problem in that if you have say key 1 (the second key) at time 0.6 and key 2(the third key) at 0.2 it will just write out key 3 and skip over the second key so creating a way to modify the lowest values allowed by each keys time value is proving a little sketchy. Because the gui has to be built sort of dynamically each gui object has an EmitterId value that is created when a new emitter is added to the particle asset. This is then added as a dynamic field for the SimObjects when each gui element is created. Then each key is cleared on each update of any field and recreated with a special function for any of the values that are at Key0 because key 0 needs to be at 0.0 time when keys are cleared they automatically create this default key so only the value of that key is updated rather than the time. As each SimObject is added to the SimSet it is pushed to the bottom of the simset so when the objects are iterated through they are done in the correct order. There is a simset now for each and every Graphfield value in the particle emitter asset and soon there will be for particle asset as well.

#### Re: Torque 2D Editor Work

marauder2k9
Posts: 399
Joined: Wed Feb 18, 2015 7:36 am
Example of ParticleAsset Output
Below is an example of the ParticleAsset files that will be output from the creator. This is without the proper assetname being defined on output this was just written out from the console to create the file without actually saving it and loading it back into the editor.
<ParticleAsset
Name="DefaultParticleAsset"
AssetName="ParticleAsset_1">
<ParticleAssetEmitter
EmitterName="DefaultEmitter"
Image="@asset=EditorToy:Blocks"
Frame="0">
<ParticleAssetEmitter.Fields>
<Quantity>
<Key
Time="0"
Value="0" />
<Key
Time="0.5"
Value="20" />
</Quantity>
<Key
Time="0"
Value="2" />
<QuantityVariation>
<Key
Time="0"
Value="20" />
<Key
Time="0.1"
Value="5" />
</QuantityVariation>
</ParticleAssetEmitter.Fields>
</ParticleAssetEmitter>
</ParticleAsset>
You can see the DataKeys are now working properly

#### Re: Torque 2D Editor Work

marauder2k9
Posts: 399
Joined: Wed Feb 18, 2015 7:36 am
With just 3 days and 15000 lines of code... Lovely particle assets

#### Re: Torque 2D Editor Work

marauder2k9
Posts: 399
Joined: Wed Feb 18, 2015 7:36 am
So final quick update before the ParticleAsset creation is released for some reason there is no visual feedback in emitters when changing their Src Blend Factor and their Dst Blend Factor yet when selecting intense particles they get the blend settings from this. The gui is setting the relevant properties properly as is visibly seen by echoing out getsrcblendfactor and when saving the file the settings are there. But no matter what they are set to there doesnt seem to be any change in the visual.

#### Re: Torque 2D Editor Work

marauder2k9
Posts: 399
Joined: Wed Feb 18, 2015 7:36 am
LATEST PUSH

So the ParticleAsset creation is added to the editor now.

Be advised this is still very buggy and really reliant on users making sure that they don't change a value without pressing return on their keyboard. Because the gui objects for most of the options in the particle editor being class based simple object updates and returns cannot be used because if you think about it Emitter 0 cant be updated without effecting Emitter 1. So the values for the graph field values will not show a visible update unless you either press return on the field or edit the field then select another (onLoseFirstResponder)

Other than that every function for particle assets and emitters are made available for editing and creation apart from the ability to switch Emitters around because this will change the emitter Index and this is used to link the gui elements to each other.

#### Re: Torque 2D Editor Work

marauder2k9
Posts: 399
Joined: Wed Feb 18, 2015 7:36 am
So whats next:

Now that basically all assets, all apart from Font Assets, are able to be created in the editor and separated out into their own simset it is possible now to create quick menu buttons to create different sceneobjects such as sprites, animated sprites, scrollers, and particle players.

If you guys would rather keep it to the toolbar at the top with a separate window popping up to choose an image for these objects then let me know because i quite like the toolbar too but the original editor for Torque2d (TGB) had a handy section for creating different objects in the scene instead of having to navigate through a file browser window.

Plus sides to this:-
-You can see all assets that are available to your module at a glance
-You can create sceneobjects instantly spawning the correct asset at the camera position
-Affords more of the gui real estate to allow for modifying scene settings and module settings

Down sides to this:-
-Modules with a lot of assets will need to be navigated through every asset every time you want to choose one, you might think this already happens with the file open window but take into account in a file window you can adjust the scaling of objects to show quite a lot more items than what would be able in the editor without becoming distracting
-ImageAssets can be used for everything from sprites to scollers to composite sprites so the same image asset will be appearing multiple times which could cause some jarring experiences. imagine you would be scrolling through a section tagged as static sprites, then going through scrollers and seeing all the same imageassets again until you get to the one you need

I will ultimately leave this up to everyone else because i am not sure about how the file system in torque works on other operating systems. On windows it works fine but for the likes of mac and linux i wouldnt know unless people test it out and let me know.

#### Re: Torque 2D Editor Work

marauder2k9
Posts: 399
Joined: Wed Feb 18, 2015 7:36 am
on another note this is what you see when you finally get things working in torque lol

• 1
• 3
• 4
• 5
• 6
• 7

#### Who is online

Users browsing this forum: No registered users and 0 guests