Torque X - 2D Features status and poll
by Giuseppe De Francesco · in Torque X 2D · 08/11/2010 (5:02 pm) · 73 replies
Hey guys,
I’m setting a work plan for a few improvements to the engine. At the moment the major improvements available on my SVN repository are:
- Asynchronous Loader (by Duncan Colvin, thanks a lot!)
- Advanced Content Loader (by Duncan Colvin, thanks a lot!)
- Extended Particles Rendering
- Particles collisions
- Full mouse control (Windows only)
- Storage Manager
- Tiled to Torque X (by William McDonald, thanks a lot!)
- Advanced Lighting with depth, layering and spotlight. (by Alex Richards, thanks a lot!)
- Farseer Physics Engine integration (by Ron Barbosa, thanks a lot!)
Coming next: LIVE Network Manager (with integrated High Scores sharing)
So I’m wondering what else you people feel that is missing to make Torque X just a perfect fit for developing XBLIG and Windows 2D games flawlessly. I do have a few ideas but I really want to hear from you.
~Pino
I’m setting a work plan for a few improvements to the engine. At the moment the major improvements available on my SVN repository are:
- Asynchronous Loader (by Duncan Colvin, thanks a lot!)
- Advanced Content Loader (by Duncan Colvin, thanks a lot!)
- Extended Particles Rendering
- Particles collisions
- Full mouse control (Windows only)
- Storage Manager
- Tiled to Torque X (by William McDonald, thanks a lot!)
- Advanced Lighting with depth, layering and spotlight. (by Alex Richards, thanks a lot!)
- Farseer Physics Engine integration (by Ron Barbosa, thanks a lot!)
Coming next: LIVE Network Manager (with integrated High Scores sharing)
So I’m wondering what else you people feel that is missing to make Torque X just a perfect fit for developing XBLIG and Windows 2D games flawlessly. I do have a few ideas but I really want to hear from you.
~Pino
About the author
In the software eng. field since 1981, in charge of R&D during last 10 years. IEEE Senior Member (and volunteer).
#42
I wonder if there could even be a boolean switch of some kind to simulate a split-screen for testing on 1 tv.
The other thing that has always been on my wish-list is a much better integration of the T2dShape3D object. With the increasing 2.5D games, I'd love to have this be better handled. Right now, unles the models are really low-poly, the framerate takes HUGE hits with multiple T2dShape3D objects on-screen.
08/24/2010 (5:45 pm)
The LIVE Network Manager would be awesome.I wonder if there could even be a boolean switch of some kind to simulate a split-screen for testing on 1 tv.
The other thing that has always been on my wish-list is a much better integration of the T2dShape3D object. With the increasing 2.5D games, I'd love to have this be better handled. Right now, unles the models are really low-poly, the framerate takes HUGE hits with multiple T2dShape3D objects on-screen.
#43
Thanks a million!
08/26/2010 (2:13 am)
Pino, just posting here so you can verify that I own a Torque X license so I can get access to the repository.Thanks a million!
#45
08/31/2010 (4:53 pm)
i got the invitation but how do i download the source code? is that even possible? i'm really lost at the moment.
#46
08/31/2010 (5:07 pm)
@Mohammad: First off install TortoiseSVN, then create a folder to contain the engine and right click on it. In the context menu select SVN Checkout and from there it's a piece of cake ;)
#47
09/01/2010 (8:21 pm)
I would like to be able to load 3D objects from within the editor. Not a coder so anything to help my 2.5D game possible the better. I saw somewhere you could load them in the TGB but not TX2D so it would be great to have that ability.
#48
I just found folks talking about this in other threads. I found this thread when searching and wanted to say what you are doing sounds really good. I am also posting here indicating I am an owner and would be thankful for information sent to me concerning this version/development/access.
Thank you...
09/12/2010 (7:48 am)
Hello,I just found folks talking about this in other threads. I found this thread when searching and wanted to say what you are doing sounds really good. I am also posting here indicating I am an owner and would be thankful for information sent to me concerning this version/development/access.
Thank you...
#49
09/12/2010 (9:33 am)
@Kevin: there is no email address shown in your profile so please drop me an email to get access to Torque X CEV (Community Enhanced Version).
#50
09/18/2010 (8:24 pm)
how do i use the storage feature, i want to save the players score when a game is over and have a highscore table in the game. i dont know how to use the storage class.
#51
Somewhere in your code you have to init the manager (after the Press Start is a good place) in this way:
then you simply serialize or deserialize your HighScore class or list:
and
where SavedHighScores is your high scores class or list.
09/18/2010 (9:29 pm)
How to use the StorageManager is very simple:Somewhere in your code you have to init the manager (after the Press Start is a good place) in this way:
if (!StorageManager.Instance.StorageIsValid)
StorageManager.Instance.SetStorageName("MYGAME.DATA");then you simply serialize or deserialize your HighScore class or list:
StorageManager.Instance.SaveData(scores, "Scores.Savfile");
and
SavedHighScores scores = StorageManager.Instance.ReadData(typeof(SavedHighScores), "Scores.Savfile") as SavedHighScores;
where SavedHighScores is your high scores class or list.
#52
09/18/2010 (10:05 pm)
thanks pino, i'l try this later on tonight.
#53
The Bounding Boxes debug rendering doesn't show the bounding boxes for particle effects unless the particle is playing. It would be nice for it to show the bounding box even if the particle has died, if you know what I mean.
Currently I have to select a large area to find the ones that I have set to Kill or Stop.
09/19/2010 (8:56 pm)
Low priority request for TXB.The Bounding Boxes debug rendering doesn't show the bounding boxes for particle effects unless the particle is playing. It would be nice for it to show the bounding box even if the particle has died, if you know what I mean.
Currently I have to select a large area to find the ones that I have set to Kill or Stop.
#54
I think that I have to create a ContentLoader and replace the CurrentContentManager with it, but I'm not sure. Torque X's asset loading code does a great job of confusing me. I understand that I can use a ContentBlock to preload a bunch of assets, which get placed in a global cache. I just don't understand if I need to do anything special to get SceneLoader.Load() to check if the asset is already preloaded so I can avoid duplicate textures being loaded into memory.
09/25/2010 (2:29 am)
Quote:I had planned on a wiki, but never quite got around to it. Keep poking me though and I'll get it done if people are needing it :)Duncan, does your content loader automatically replace Torque X's content loader, or do I have to do something special to hook it up? I've been looking for a way to asynchronously preload and cache some common assets in all my .txscene files so Torque X doesn't keep trying to reload my character sprites every time I change the level. Am I correct in assuming that your content loader can do this?
I think that I have to create a ContentLoader and replace the CurrentContentManager with it, but I'm not sure. Torque X's asset loading code does a great job of confusing me. I understand that I can use a ContentBlock to preload a bunch of assets, which get placed in a global cache. I just don't understand if I need to do anything special to get SceneLoader.Load() to check if the asset is already preloaded so I can avoid duplicate textures being loaded into memory.
#55
But, if you are noticing something different its possible you have loaded too many textures, and those textures shouldn't be cached in memory anyways? I'm not sure...
What is it, and how much of it are you trying to load?
09/25/2010 (5:26 am)
@John, First time you load a scene it actually takes awhile, second time, usually the assets are cached in memory. So far thats been the case when I worked with the scene loaders.But, if you are noticing something different its possible you have loaded too many textures, and those textures shouldn't be cached in memory anyways? I'm not sure...
What is it, and how much of it are you trying to load?
#56
Calling AllowLoading() on _allContent will allow Torque X to behave like it normally does and load new content on demand.
My previous issues were from bugs in the ContentLoader class. It detects file paths that contain backslashes different than paths that contain forward slashes. I was using backslashes in my code while the .txscene files were using forward slashes. Also, I ran into an issue with the Asynchronous Scene Loader. Instead of loading the new scene into a subfolder of the Torque X root folder, it was placing it under a subfolder of the previous scene. So, when I unloaded the previous scene, it was also unloading the scene I had just loaded.
I will commit my ContentLoader fixes to the Torque X CEV SVN, but I will have to ask about my Asynchronous Scene Loader fix first, as I don't know if my fix will break things for other people.
09/25/2010 (10:42 pm)
I ended up figuring it out. The ContentLoader hijacks Torque X's content loading system in the constructor. When you create your first ContentBlock, it creates a new ContentLoader, which sets the whole system up. So, in my Game class, I created two ContentBlocks: one for my common assets and one for all of my assets.public bool LoadedCommonContent
{
get;
private set;
}
public void StartCommonContentLoad()
{
// Start content loading.
_commonContent.AsyncLoadImmediately(_AsyncCallbackLoadCommon, null);
}
protected override void BeginRun()
{
base.BeginRun();
// Set up our content blocks.
_commonContent = new ContentBlock();
_commonContent.AddFolder<Texture2D>(@"data/images/characters/human_knight/", true);
_commonContent.AddFolder<Texture2D>(@"data/images/characters/human_peasant_female/", true);
_commonContent.AddFolder<Texture2D>(@"data/images/characters/human_peasant_male/", true);
_commonContent.AddFolder<Texture2D>(@"data/images/characters/kobold_spawn/", true);
_commonContent.AddFolder<Texture2D>(@"data/images/hud/", true);
_commonContent.AddFolder<Texture2D>(@"data/images/levels/loading/", true);
_commonContent.AddFolder<Texture2D>(@"data/images/objects/", true);
_commonContent.AddFolder<Texture2D>(@"data/images/text/", true);
_commonContent.AddAsset<Texture2D>(@"data/images/storyboard/background");
_allContent = new ContentBlock();
_allContent.AddFolder<Texture2D>(@"data/images/", true);
_allContent.AllowLoading();
}
protected void _AsyncCallbackLoadCommon(IAsyncResult ar)
{
AsyncContentBlockResult result = ar as AsyncContentBlockResult;
if (result == null)
return;
// If we completed loading, finish with loading our scene.
if (result.IsCompleted)
LoadedCommonContent = true;
}
protected ContentBlock _commonContent;
protected ContentBlock _allContent;After the splash screen, I start to load the common content (the splash screen is a .wmv movie and loading in the background makes it choppy.) My level loading code will wait until all the common content is loaded before I start loading the first level.Calling AllowLoading() on _allContent will allow Torque X to behave like it normally does and load new content on demand.
My previous issues were from bugs in the ContentLoader class. It detects file paths that contain backslashes different than paths that contain forward slashes. I was using backslashes in my code while the .txscene files were using forward slashes. Also, I ran into an issue with the Asynchronous Scene Loader. Instead of loading the new scene into a subfolder of the Torque X root folder, it was placing it under a subfolder of the previous scene. So, when I unloaded the previous scene, it was also unloading the scene I had just loaded.
I will commit my ContentLoader fixes to the Torque X CEV SVN, but I will have to ask about my Asynchronous Scene Loader fix first, as I don't know if my fix will break things for other people.
#57
Be a little careful with blocks that have overlapping content as in your case though - it is fine if you aren't planning on unloading the content blocks at different times later, but if you plan on independently unloading them later you should create blocks that don't overlap.
Scene loading: this is the way torque normally does it - it nests scenes by default. Whether or not you want this behaviour isn't something I wanted the async loader to decide for you, so that's why it isn't in there.
When tx loads a scene it sets the current folder to that scene's folder. So any objects that get created at runtime are added to that folder too, and when you unload the scene all the dynamically created stuff gets unloaded too. Nice. But, not *always* what you want to happen. You can put the following code before you start loading the scene - it basically just tells tx that the currently active folder should be the root folder (that way you know your new scene will not be nested inside any other scene's folder).
For content loading \ vs / issues... the tx engine decides whether a content asset is a tx internal one or one of yours by looking to see if you use \ or / in the path. I therefore followed on from that convention to keep things consistent: using / for pathing to content that is your own stuff.
If there is a particular reason why your paths can't use / instead of \ let me know and I'll look into it.
hth
D
09/25/2010 (11:54 pm)
@john: yes, the content block loading works pretty much as you described: create blocks of content for stuff you want to independently load/unload. E.g. a block of shared content and blocks of content for each level (such as when each level has enough art that they cannot all be loaded at the same time so you need to load/unload on demand).Be a little careful with blocks that have overlapping content as in your case though - it is fine if you aren't planning on unloading the content blocks at different times later, but if you plan on independently unloading them later you should create blocks that don't overlap.
Scene loading: this is the way torque normally does it - it nests scenes by default. Whether or not you want this behaviour isn't something I wanted the async loader to decide for you, so that's why it isn't in there.
When tx loads a scene it sets the current folder to that scene's folder. So any objects that get created at runtime are added to that folder too, and when you unload the scene all the dynamically created stuff gets unloaded too. Nice. But, not *always* what you want to happen. You can put the following code before you start loading the scene - it basically just tells tx that the currently active folder should be the root folder (that way you know your new scene will not be nested inside any other scene's folder).
TorqueObjectDatabase.Instance.CurrentFolder = TorqueObjectDatabase.Instance.RootFolder;
For content loading \ vs / issues... the tx engine decides whether a content asset is a tx internal one or one of yours by looking to see if you use \ or / in the path. I therefore followed on from that convention to keep things consistent: using / for pathing to content that is your own stuff.
If there is a particular reason why your paths can't use / instead of \ let me know and I'll look into it.
hth
D
#58
Yeah, previously it worked fine because I unloaded the previous scene, then loaded the new one. With the asynchronous loader, I unload my previous scene, load my loading.txscene file, then start loading my new level. Once the new level has finished loading, I unload loading.txscene. Which is when I encountered my problem. I'll use your method to fix the folder issue.
@Duncan, irt \ vs /
Ah, I see. Totally my fault, then, as I did not know Torque X had a reason to use \ vs /.
What was happening was that I was doing something like this:
It worked before just fine, but when I added your content management system, it was failing to work properly because I told it to load assets from "data/images/hud/".
There was also an issue where things result in a file name like:
data\images\characters\kobold_spawn/blue/fall.png
I'll revert the changes I made and search for all backslashes in my project and convert them to forward slashes. Maybe I'll add a little note to the ContentLoader to help people if they run into the same problem.
09/26/2010 (3:47 am)
@Duncan, irt scene loadingYeah, previously it worked fine because I unloaded the previous scene, then loaded the new one. With the asynchronous loader, I unload my previous scene, load my loading.txscene file, then start loading my new level. Once the new level has finished loading, I unload loading.txscene. Which is when I encountered my problem. I'll use your method to fix the folder issue.
@Duncan, irt \ vs /
Ah, I see. Totally my fault, then, as I did not know Torque X had a reason to use \ vs /.
What was happening was that I was doing something like this:
_koboldIcon.Bitmap = @"data\images\hud\kobold_portraits_brown";
It worked before just fine, but when I added your content management system, it was failing to work properly because I told it to load assets from "data/images/hud/".
There was also an issue where things result in a file name like:
data\images\characters\kobold_spawn/blue/fall.png
I'll revert the changes I made and search for all backslashes in my project and convert them to forward slashes. Maybe I'll add a little note to the ContentLoader to help people if they run into the same problem.
#59
10/04/2010 (11:45 pm)
Another low priority TXB feature request. If there's a way to make it not hijack one of my cores no matter what it's doing, that would be awesome.
#60
10/05/2010 (12:55 pm)
TXB essentially runs on top of a game engine. It doesn't do 'idling'. Just be thankful for multi-core :-)
Associate Giuseppe De Francesco
DFT Games Ltd
I'm mot sure why you want that. Playing raw audio files gives you way inferior SFX ability. XACT3 is actually a very good system allowing a quite simple SFX management, 3D sound effects and so on.
If you have issues with XACT drop me an email so you'll be back on track in a blink ;)