Game Development Community

Auto adding materials bug?

by Will O-Reagan · in Torque X 2D · 05/09/2007 (7:31 pm) · 10 replies

I'm starting to think this is a bug... Ok, I have two scenes in my project. Scene A uses Material A, Scene B uses Material B.

I delete Material A from Scene B,

And I load up Scene A

I load Back up scene A, Then decide I want to work on Scene B

Scene B, has auto included material A!

This is all in the editor...

This is undersirable, and I think its a bug? Why would I delete a material from the XML, if I wanted it to come back automattically? Theres just something about it that doesn't seem right. I know this probobly goes back to the game.txproj, and what has been added to it. However, When I delete an object from a scene, even if its in the editor, it sould stay gone! It seems kind of uncanny that it does not... Not to mention, each scene that I load now loads all my materials each time, this too does not seem optimal. What are the specs on material loading, could this hamper my game at all if I am doing alot of loading?

About the author

I have a degree in dramatic art, and literature, from UC Santa Barbara. I've worked for a few studios, also at Animax Ent in 2008, and some smaller studios. Currently studying Computer Science at CSU Channel Islands.


#1
05/10/2007 (7:22 am)
I'm assuming you mean you delete the material from the list of materials and not from the scene itself. If this is the case, the PROJECT file is the same from one scene to the other and that is actually what defines which materials/animations/etc are to be included when editing a scene. They ALSO track it in the scene itself, but that list is seperate. the txproj file has those. (IIRC)
#2
05/10/2007 (9:53 am)
Thats not entirely true jonathon. I think you may be missing some key clues here to why I think this is a bug. The project file is only a partial list of what materials will be added to the editor of your scene. The other source for materials is the txscene file.

The reason I think this is a bug, is that while editing a scene, you get certain options, such as "save scene". However, it automatically saves to your project file almost immediately. TGBX has a "save project" option as well which leads me to believe that these actions are meant to be somewhat seperate, and somewhere along the line, Garage over-looked this bug...

Why else would it be saving to the project file? TGBX doesn't need every material to be in the project file, it has a list of materials in the TXScene file right there...

Which brings up, why do we have to open a project file at all? can't we just open up and edit a scene file and load the schema?
#3
05/10/2007 (11:50 am)
I'll have to verify when I get home, but I'm pretty dang certain that you are wrong about the project file. The project file is intended to track all available materials, animations, layers, etc. etc. The scene file itself only tracks what you are using in the actual scene and should not have ANY project specific data at all in it. I'd ask that GG could reply to this with the official word if they can before I get home, otherwise I'll double check when I get home.

I think the project file looks at the scene files when they are loaded and if anything is in the scene that the project file doesn't have loaded, it then loads and defines it so it's available. This would cause it to reappear in a second scene if you removed it in another and it's used somewhere else.

Like I said, I'm going off of memory here and my wife tells me I have a pot smoker's memory, so take it with a grain of sand.
#4
05/10/2007 (12:44 pm)
Quote:Like I said, I'm going off of memory here and my wife tells me I have a pot smoker's memory, so take it with a grain of sand.

um, I think you mean salt.. but ok.
#5
05/11/2007 (7:30 am)
Salt tastes good and i don't want to be eaten, so i use sand =P
#6
05/11/2007 (10:09 am)
That would be great because as it stands now, if I try to switch scenes I can crash my computer if I don't switch my project files first. I think I have 375 materials in one, and 500-600 in the other, which is well over my maximum... In my humble opinion I should be able to keep a relativlely barron project file, If I chose not to save. The auto saving feature is the bug I am sure of it... Now if someone from garage can just reply to this...
#7
05/13/2007 (2:53 pm)
I'm lame, I figured out what i was doing.
#8
05/15/2007 (7:27 am)
Share the wealth?
#9
05/15/2007 (8:50 am)
No problem.. Its not a bug. like you said, TGBX does need that list of materials. However, its very very easy to create multiple project files. I simply copied my original project file, and renamed it. Then removed all unwanted materials, loaded new materials using the editor. Now Instead of having two scenes, and one project file, I have two project files, and two scene files. By keeping them seperate, I can reep alot of benifits. IE: faster material finding, faster performances, no crashes, higher amounts of materials, etc.

The process is simple. Just when switching scenes, I simply open the other project file first. I just had a minor misconception I think of what a project file was, I though because it was a project file, I would only be able to have one of them. This is not the case... Almost ready to add a third!
#10
09/12/2009 (4:02 pm)
I know this thread is a couple years old, but I just want to say that it was a HUGE help. I have been using Torque for a few months, and I didn't realize until recently that I was loading all my materials twice, which caused me to hit the memory limit on the Xbox360 a lot sooner than I should've. I'm not sure if I missed the part in the documentation where this was explained or maybe it needs to be made more clear somewhere.

I was doing basically the same thing as Will, loading two scenes under one project. Creating another project and removing the unneeded materials for that project solved the problem and saved me 200 MB of RAM. Not to mention my levels load a heck of a lot faster now.