Game Development Community

[RESOLVED-1.1a] Forest Editor Meshes No Save/Reload

by Steve Acaster · in Torque 3D Professional · 11/20/2009 (12:27 pm) · 18 replies

From a New Project:

It doesn't seem to save it's Meshes list, so after saving the level and reloading ... there are no objects.
Because there is nothing listed in the Editor's Meshes list, even though they are mentioned in the Brushes list, select one of them, and it paints nothing, because there is nothing in the Meshes list.

Location of Meshes are getting saved in forest/manageditemdata.cs, and Brushes get saved in brushes.cs, but nothing gets populated on reload in-game.

This means that when first booting up from scratch - there is no default mesh to paint with in the default brush.

Also - nothing seems to have any collision, and so I threw in my custom trees - and they still don't have collision, nor did they reappear in the Meshes list on reload.

-------------

Also, rather oddly, the meshes default directory from scratch was 1.01 and not 1.1alpha. Which caused a bit of confusion initially. I'm fairly sure this wasn't a cockup induced by myself - though it was late/stormy/teh_economy/asteroid_threat/beer/etc.

After finding the correct directory it defaults to that fine now.

#1
11/20/2009 (1:47 pm)
Yep, was just going to post the same problems about forest editor...no save/reload for me as well.
#2
11/20/2009 (4:56 pm)
It sounds like managedItemData.cs is not getting executed. Make sure you have this line in scripts/server/game.cs, within onServerCreated().

if (isFile("art/forest/managedItemData.cs"))
      exec("art/forest/managedItemData.cs");

If you create a new project based on the Full Template, or merge over changes from the template game scripts to your existing project you should also see this as a change.
#3
11/20/2009 (5:13 pm)
That looks like the crux of the issue, James.

That exec script wasn't in game.cs in the Full Template.

Now it reloads said forest, fine. though no collision
#4
11/20/2009 (5:24 pm)
Actually is there a way to count how many objects I've put into a forest? Without using the v1.0 Eyeball?
#5
11/20/2009 (6:30 pm)
Oh no... thanks for bringing this to my attention Steve.

Posted here.
#6
11/20/2009 (6:37 pm)
Concerning getting a ForestItem count for your forest, no this is not currently exposed as a ConsoleMethod of Forest, but it probably should be. Perhaps we should show a total but also a count per Mesh type. Maybe like "DefaultTreeMesh (25)" in the Mesh tree?
#7
11/20/2009 (6:55 pm)
Yeah, those would both be good ideas. I just found that enlargening the brush to slap down whole copses of tree suddenly meant that I had no idea how many object I had to render - and I think it can get quite busy quite fast. 5000 draw calls and a million polys ... ah.
#8
11/20/2009 (7:06 pm)
We are working on getting a metrics(Forest) which will show you useful information for debugging and optimizing performance.
#9
11/20/2009 (7:08 pm)
That'd be good. :)
#10
11/21/2009 (2:00 am)
Only 5000 calls, I need to heat my house this winter so I need more :-).
#11
11/21/2009 (2:29 am)
Quote:5000 draw calls
The forest will eat up draw calls quick... you absolutely must provide LODs for your tree meshes and an autobillboard to get good performance.

Also i'm investigating some simple instancing support which could help us a ton, but i'm not sure if it will make it into the beta.
#12
11/21/2009 (1:24 pm)
Anyone who might be having problem with getting the textures showing on tree's and such when using the Forest Tool ?

I don't have any problems with getting the leafs showing the textures on those, but the tree its self just get the "no material" texture on them.

If I import them as a static mesh there arent really any problems with getting the textures showing.
#13
11/22/2009 (8:01 pm)
Moved to resolved with the new alpha.
#14
11/22/2009 (9:45 pm)
@Simon - If you still have an issues with the new installer then please start a new thread for your bug.
#15
11/13/2012 (3:35 am)
Well great. Download the new open source version and this bug appears to be back in spades. Went in and edited the Game.cs file like it was suggested to no avail. I would really love to learn how to use Torque, but ever time I make progress some kind of bug appears. No forest meshes are being saved, so after making my forest saving (even tried Save As) reopen and BAM no meshes, brushes present, etc, but no mesh, just the original example tree. Fun.

#16
11/13/2012 (3:54 am)
Oh fun, well if I manually type in the entry into managedItemData.cs the meshes are remembered... Man for once I'd like to buy a piece of software that just works as intended. (yes I know this is the open source version, but SFG does own 3 studio copies) Anyone have any ideas? I put

if (isFile("art/forest/managedItemData.cs"))
exec("art/forest/managedItemData.cs");

inside of game.cs

onServerCreated()
{
#17
11/13/2012 (4:21 am)
Ugh... Ok I'm completely lost. This has been two days of screaming into the wind, before I posted here. I'm thinking the way things are handled has changed since 2009. Is how it's setup now like this:

// Load up any objects or datablocks saved to the editor managed scripts
%datablockFiles = new ArrayObject();
%datablockFiles.add( "art/shapes/particles/managedParticleData.cs" );
%datablockFiles.add( "art/shapes/particles/managedParticleEmitterData.cs" );
%datablockFiles.add( "art/decals/managedDecalData.cs" );
%datablockFiles.add( "art/datablocks/managedDatablocks.cs" );
%datablockFiles.add( "art/forest/managedItemData.cs" );
%datablockFiles.add( "art/datablocks/datablockExec.cs" );
loadDatablockFiles( %datablockFiles, true );


and this appears to just be just loading the file and not saving it. The issue is obviously that the manageItemData.cs isn't being updated, while the Brushes.cs is. I have no idea why this is or what I can do about it. :(
#18
11/13/2012 (6:16 am)
Problem solved: http://www.garagegames.com/community/forums/viewthread/132316