Torque 2D Editor Work

2D version of the Torque engine.

Moderator: marauder2k9

70 posts Page 4 of 7
Posts: 12
Joined: Wed Feb 18, 2015 11:58 pm
by trident » Wed Jan 22, 2020 2:21 pm
thanks for the update and sorry about you job
am not working even as i've been off sick for over 2 years. even with all the free time you still dont have time to do stuff lol

anyway love reading what you doing and have done so looking forward to breaking it all for you when i have time
Posts: 418
Joined: Wed Feb 18, 2015 7:36 am
by marauder2k9 » Tue Jan 28, 2020 12:29 am
Short Update:

Okay so i got stuck for a while on a loading and unloading problem for a bit but i think i have it sorted out.

To explain - in the editor each object is loaded in a simset. This simset is named the same as the object such as sprite, compositesprite, scroller etc

All the simsets were created when the particular object was created so when you did this it created the sprite simset. The way i was trying to load up objects was to already have the simset loaded and then assign them to it as they are read back in. This wont work as long as you have a simset object already created. My own stupidity got me stuck on this one. Previously i was loading saved scenes through the console, at this point i had an object automatically being created because i was also testing out autosave, and auto load upon relaunch. This was creating the simset before a new scene could be loaded. So not only do i have it changed so we don't have to load scenes in through the console, i also have a new script in place that deletes these simsets if they are present. So if you load up a scene that new scene creates the simsets along with the objects that were saved, along with all their saved attributes.

At the moment a module is really just a place marker in script until the module is exported. All assets are loaded as assets of the editortoy so in their associated taml file the file name for example would be EditorToy:ImageName. Upon export of the module this is changed to your module name.

CompositeSprites: Almost completely finished off but unfortunately they will need some further work. The problem i am facing is i have no way to load work previously done by a user into the composite sprite again. for example: Say you are working on rect layout for a tilemap say, you would choose a width in sprites and a height in sprites say 10 x 10. Then you load in your assets into a paintmode that allows you to change the default rect texture to whatever imageasset you have selected in your palette. This is a very easy and comfortable way of editing composite sprites.... until you decide after your work is done that you need a 10 x 11... then you have to start over from scratch. Granted you could just add another composite sprite for the extra row but there has to be a better way. and one way i was thinking of doing it was making a tilemap designer specifically for it. Instead of loading up a composite sprite it will load up a number of shapevector squares. These squares will be used to number the sprites that are painted over the top of them. These shapevectors will never be able to be changed and they will have an id number. This id number is assigned to whatever sprite you choose to paint over the top of it. Now if u change the row and column count the shapevector count will update and will be assigned a new number (much like it does in the imageasset viewer function) then each sprite will be checked to see if it's id matches the id of the shapevector at the same position. Then when u click create each sprite is iterated into a simset by name then placed into a composite sprite in that same order but positioned based on the id. because object 0 should always be the top left, once we know the number of columns and rows it should be easy to figure out the positions of all other sprites.

I haven't even begun working on a designer as it is just a concept at the moment but the basic composite sprite painting is working, but takes some planning before you start, and i'm not that disciplined i want to get into it and start drawing and figure things out later lol. Granted it shouldn't take too long to just do a composite sprite over again if its only a 10 x 10 but if your working on say 100 x 100 level. Tensions will rise if you have to start that all over again. The option to add or remove rows and columns to a compositesprite without losing all your hard work is a must.

Good things to come! Watch this space ;)
Posts: 418
Joined: Wed Feb 18, 2015 7:36 am
by marauder2k9 » Mon Feb 03, 2020 7:35 pm
First update of February :D

Sorry this isn't really what you guys were waiting for but it shows the additions to the sprite setup. Now you have scene layer, scene group. Collision layer, collision group and Blending options. Blending should be a lot easier now that we have the ability to see what those options are actually doing :)

As you can see from the video i got a bit confused as to why the collision layers werent working. Turns out the collision layers and collision groups are connected to scene layer and scene group. So if both objects are on scene layer 1 and you want them to collide, the collision layers should be set to 1. Same for groups if both objects are on scene group 1 and you want them to collide you set their collision group to 1.
Posts: 418
Joined: Wed Feb 18, 2015 7:36 am
by marauder2k9 » Tue Feb 04, 2020 9:47 pm
Another short video showing module creation

Closing in on that 5.0 release for the editor! I am now working on making it all a bit more pleasing to work with and making a better gui for it. This way it will just look a bit more professional. Another thing i forgot to show in the video, when u create a module it will automatically add it to the sandbox's list of tools on category 5 for games :D

This should be almost ready for proper use. The only thing left to do is sort out scene creation, loading and saving.
Posts: 418
Joined: Wed Feb 18, 2015 7:36 am
by marauder2k9 » Sat Feb 15, 2020 4:45 am
It has been a busy couple of weeks! lol here is the first look at the new gui for the editor


Atm not all of these settings are tied in but the functionality for new scene,load scene, save scene, scene settings and camera are all linked up, so are the buttons to create physics shapes and import image assets. The reason the sprite in the screenshot is saying cannot render is because i just loaded up a sprite in the launch of the editor so i could show the sprite menu, the sprites asset is tied to a project and therefore because i dont have that module loaded it wont render the texture. The menu at the bottom also hides itself when a module is created or loaded.

I am going to create a menu bar for all of these functions as well as loading and creating a module dont think it is a good idea making module buttons at the top bar be too easy to hit them by accident which atm will break the editor and make you lose work.
Posts: 12
Joined: Wed Feb 18, 2015 11:58 pm
by trident » Sat Feb 15, 2020 8:11 pm
wow looking good
Posts: 418
Joined: Wed Feb 18, 2015 7:36 am
by marauder2k9 » Sun Feb 16, 2020 4:56 pm

Quick video showing some of the expanded additions to modifying sprites :D Still needs some work but very nearly there!
Posts: 418
Joined: Wed Feb 18, 2015 7:36 am
by marauder2k9 » Mon Feb 17, 2020 10:10 pm

AnimationBuilder Finished!!!

With the animation builder all tied up, the module saving and loading sorted, scene saving and loading done. Just a few more to go :)
Posts: 418
Joined: Wed Feb 18, 2015 7:36 am
by marauder2k9 » Tue Feb 18, 2020 10:45 am
In the Image builder i have implemented the cell stride function. I am still running into the same error when it is being used. When an image is created it is claiming that the cells are cutting off the right side of the image now due to offset and stride together.

As an example the cannonball image has a 4 x 4 grid of images for a cannon ball, whenever i set the cells up properly to cover the full 4 x 4 it pushes out the error. But if i change the number of cells on the x axis to 3 instead of 4 it works fine and when you load it up as a sprite asset the cells seem to be fine so i think the viewer is showing everything in the correct position.

Does anyone know if there is any correlation between offset and stride. As far as i know the offset is just to set the distance from the top left of the image to put the first cell and then the stride is the distances between each cell. But again no matter what image is used if you try to use the correct amount of cells it fails on the export and creation due to the error mentioned before.

This is the output from the image asset importer. With the blocks.png file set up properly with a cell on every visible block.
If i change CellCountX to 7 it will work, as it is now it doesnt.
Posts: 418
Joined: Wed Feb 18, 2015 7:36 am
by marauder2k9 » Tue Feb 25, 2020 6:38 pm
So far this is what i have done:
Key: red = not started, blue = in progress, green = done

Module Creation
Module Load
Scene Creation
Scene Load
Scene Save
Scene Auto Save
ImageAsset import
AudioAsset import
ParticleAsset creation
Scroller Creation
Sprite creation
CompositeSprite creation
TextSprite Creation
Trigger Creation
ShapeVector creation
ForceController Creation
Joint Creation

Getting the list down to only a few to go, once this is finished i have been toying with the idea of working on a gui editor but in all seriousness an ingame gui can just be made with anything in a 2d game doesnt have to be an actual gui object, any sprite can be handled as if it is a gui object but i can understand how gui objects changing sizes between device resolutions can be quite jarring so it may need to be implemented for these reasons.

Once the items listed above are ready there should be enough for people to create their games in a visible way and should make development a lot easier for everyone. Future implementations will include:

//These i have already tested and should work
Behavior creation
Behavior linking (to in game objects without needing to write scripts)
Dynamic Fields for objects
Event Management
Callback Event Management

//Ideas that will need source code changes
Wave Machine
LiquidFun implementation(Physics Particles)
Object Debris(i already have a basic idea of this in my app CritterBits but to be able to create debris dynamically will need source code changes)

Big things are coming!

Finished off scene autosave, now whenever you exit torque2d with the editortoy loaded it will automatically save the scene you are working on and if u load another scene. I don't think saving on a timer is necessary but it can be implemented if you guys want.

TextSprite is also finished off with most of the available options for a text sprite including the jumping text type effects

An idea i have had to save messing up scenes when playing physics simulations, the scene creates a temporary save file when the play button is pressed and then that temp save is loaded when the rewind button is pressed. To continue adding and manipulating objects the physics simulations have to be stopped/paused first. If u manipulate an object or add another object, this temporary save will be deleted.

Default camera size when creating a scene is set to 16x9 the reason for this is because torque is built with Box2D physics and in box2d 1 unit = 1 meter so for expected physics results this should yield the best visual representation or atleast 1 that should be expected. Furthermore i have researched quite extensively on resolutions and such and most devices these days especially the latest are 16:9 aspect ratio with some later devices being 16:10 as well. You can change this if you want and due to being able to change this in the editor you can also change what you want the default size of added objects to be.

The editor views camera size is worked out from whatever camera size you want for your module and the aspect ratio of your windows view to allow for a bit of screen space around your scene. The cameras view is represented with a box shapevector. I am trying to make this a gui element instead so it will always be on top but for a while it will be a light blue shapevector box.
70 posts Page 4 of 7

Who is online

Users browsing this forum: No registered users and 3 guests