GPGT Chapter 6 - Issues and Questions
by Edward F. Maurina III · in Torque Game Engine · 05/16/2006 (10:41 pm) · 29 replies
Hello All. This thread is dedicated to any questions or issues that you may find in this chapter.
If you have issues and questions for other chapters, please post them in the appropriate thread:
Chapters 1 & 2
Chapter 3
Chapter 4
Chapter 5
Chapter 6
Chapter 7
Chapter 8
Chapter 9
Chapter 10
Chapter 11
Chapter 12
Chapter 13
Chapter 14
GPGT Support Page
Appendix E. Maze Runner Lessons (Steps Only) - Covers Mac and Windows
OSX Executable - Use for GPGT Lesson Kit and MazeRunner
If you have issues and questions for other chapters, please post them in the appropriate thread:
Chapters 1 & 2
Chapter 3
Chapter 4
Chapter 5
Chapter 6
Chapter 7
Chapter 8
Chapter 9
Chapter 10
Chapter 11
Chapter 12
Chapter 13
Chapter 14
GPGT Support Page
Appendix E. Maze Runner Lessons (Steps Only) - Covers Mac and Windows
OSX Executable - Use for GPGT Lesson Kit and MazeRunner
About the author
Recent Threads
#2
I'm looking at how to add multiple skins. Looking at the book it says to add multiple skins the form of the textures should be setName.skinName.suffix. Comparing that with the examples, it looks like it should be skinName.setName.suffix instead. Is this right?
06/28/2006 (10:19 am)
Page 161 SkinsI'm looking at how to add multiple skins. Looking at the book it says to add multiple skins the form of the textures should be setName.skinName.suffix. Comparing that with the examples, it looks like it should be skinName.setName.suffix instead. Is this right?
#3
i don't see anything inconsistent or wrong on page 161.
but perhaps a better way to prototype it would be:
<"base" or skinName>..
Ed - are there different editions of the book by any chance ? I picked mine up pretty early at GDC, is it possible Marcus has a different text ?
06/28/2006 (11:14 am)
Hey Marcus -i don't see anything inconsistent or wrong on page 161.
but perhaps a better way to prototype it would be:
<"base" or skinName>.
Ed - are there different editions of the book by any chance ? I picked mine up pretty early at GDC, is it possible Marcus has a different text ?
#4
If you look at the examples however:
base.skin.png - this follows base.setName.suffix
skin0.skin.png - this follows skinName.setName.suffix not the prototype setName.skinName.suffix.
I guess my point is that he has it as setName.skinName.suffix, but the first part is what changes (setName part) so I think it should be skinName that should be first, then setName.
Your prototype is what I think it should be as well. Since only the first part is changing, I think that it should be the skinName not the setName.
06/28/2006 (11:20 am)
If you notice it says the base form is: base.setName.suffix. Then to add more textures to the group it should be: setName.skinName.suffix. If you look at the examples however:
base.skin.png - this follows base.setName.suffix
skin0.skin.png - this follows skinName.setName.suffix not the prototype setName.skinName.suffix.
I guess my point is that he has it as setName.skinName.suffix, but the first part is what changes (setName part) so I think it should be skinName that should be first, then setName.
Your prototype is what I think it should be as well. Since only the first part is changing, I think that it should be the skinName not the setName.
#5
but i'm not sure where you're seeing "setName.skinName.suffix".
.. OH. there it is. i should have read the page more carefully.
yeah, i think you're right - looks like a mistake in the book to me.
06/28/2006 (11:26 am)
Right,but i'm not sure where you're seeing "setName.skinName.suffix".
.. OH. there it is. i should have read the page more carefully.
yeah, i think you're right - looks like a mistake in the book to me.
#6
Yes. That is a typo. The sentence should read:
Please note: Before this feature will work, you MUST create a DTS that uses a texture that has been named using the following form:
base.setName.suffix
base - Must be the word "base"
setname - This can be anything you want it to be. It groups textures in a set.
suffix - jpg, png, etc.
I hope this clarifies things!
Hall Of Worlds - For Gamers
EdM|GPGT
06/28/2006 (1:19 pm)
@ Marcus and Orion Yes. That is a typo. The sentence should read:
Quote:"skinName.setName.suffix"
Please note: Before this feature will work, you MUST create a DTS that uses a texture that has been named using the following form:
base.setName.suffix
base - Must be the word "base"
setname - This can be anything you want it to be. It groups textures in a set.
suffix - jpg, png, etc.
I hope this clarifies things!
Hall Of Worlds - For GamersEdM|GPGT
#8
Then the following code appears:
Isn't ItemData() a datablock? I see the same thing under Rotating Items on the same page. Where am I going wrong. Isn't Item the object and ItemData the datablock?
Thanks in advance. :)
06/30/2006 (3:25 pm)
Sorry for asking yet another question. I am on page 177 6.3.3 Item Physics, it says:Quote:When we create an item, we can set the static field in the object (not the datablock) to true or false.
Then the following code appears:
%theEgg = new ItemData() {
...Isn't ItemData() a datablock? I see the same thing under Rotating Items on the same page. Where am I going wrong. Isn't Item the object and ItemData the datablock?
Thanks in advance. :)
#9
Good catch, in both cases, the code should be:
Hall Of Worlds - For Gamers
EdM|GPGT
PS - I'll update the errata document.
PPS - The remaining bits of code in the item discussion are correct. (In reply to question below).
06/30/2006 (3:31 pm)
@MarcusGood catch, in both cases, the code should be:
%theEgg = new Item() {
. . .
Hall Of Worlds - For GamersEdM|GPGT
PS - I'll update the errata document.
PPS - The remaining bits of code in the item discussion are correct. (In reply to question below).
#10
WOW!!! That was fast! You must be on GG as much as I am. ;) I'm assuming the other pages on Item/ItemData are OK? Thanks.
06/30/2006 (3:36 pm)
@EdwardWOW!!! That was fast! You must be on GG as much as I am. ;) I'm assuming the other pages on Item/ItemData are OK? Thanks.
#11
"...To see this geometry, open the \Mazerunner\prototype\data\Mazerunner\shapes\mazeblock\blockA,ms3d using Milkshape"
Are the source files for the content available in 3dsmax format anywhere?
Thanks.
07/15/2006 (12:47 pm)
Page 185, Block Geometry."...To see this geometry, open the \Mazerunner\prototype\data\Mazerunner\shapes\mazeblock\blockA,ms3d using Milkshape"
Are the source files for the content available in 3dsmax format anywhere?
Thanks.
#12
Hall Of Worlds - For Gamers
EdM|GPGT
07/19/2006 (5:41 pm)
@13 - Sorry, but no. I did this all on the cheap. I don't have 3DSMAX.
Hall Of Worlds - For GamersEdM|GPGT
#13
Regarding the ability to use multiple textures on the same mesh..
You suggest that if multiple skinned textures are used on the same mesh, whenever you change one of the skins the others will change to the default base texture.
What I see with Torque 1.4 is that if all of the texures are named consistently, then all of them change to the named skin.
In other words you can set up multiple skins with multiple textures like so:
base.headtexture.jpg
base.body.jpg
base.booties.jpg
skin2.headtexure.jpg
skin2.body.jpg
skin2.booties.jpg
etc.
This does not give you individual skinning control over the textures (in other words you can't mix and match different head, body and booties textures), but it does allow you to use a model that has multiple texture maps and still be able to create different sets of skins for it.
N.B. - your book has allowed me to get further in a month than in the two or three years I've had a TGE license.
[EDIT] Hmmmm... make that three and a half years.. time does fly
08/30/2006 (10:29 am)
Page 161/162Regarding the ability to use multiple textures on the same mesh..
You suggest that if multiple skinned textures are used on the same mesh, whenever you change one of the skins the others will change to the default base texture.
What I see with Torque 1.4 is that if all of the texures are named consistently, then all of them change to the named skin.
In other words you can set up multiple skins with multiple textures like so:
base.headtexture.jpg
base.body.jpg
base.booties.jpg
skin2.headtexure.jpg
skin2.body.jpg
skin2.booties.jpg
etc.
This does not give you individual skinning control over the textures (in other words you can't mix and match different head, body and booties textures), but it does allow you to use a model that has multiple texture maps and still be able to create different sets of skins for it.
N.B. - your book has allowed me to get further in a month than in the two or three years I've had a TGE license.
[EDIT] Hmmmm... make that three and a half years.. time does fly
#14
Regarding the mounting of shapes....
In TGE 1.4, I have mounted 32 shapes onto a single object. The eight slot limitation therefore appears to apply only to ShapeBaseImages, and not to actual shapes. Given that the function for mounting objects does not allow you to specify a mount slot, this does make some sense. My suspicion is that mounting objects as opposed to shapes does not consume any slots at all.
It may also be helpful to note in the description of mounting that mounted objects also inherit the scale of the object they are mounted to, and that there appears to be no limit on how many nested mounts can happen.
For example, I've modified the chain link fence from one of the content packs so that only one side has a pole, and the other end has three mount points going to the right, straight ahead, and to the left. I can construct a chain link fence from code by simply interpreting a string describing the desired perimeter, and linking fence to fence to fence in a long chain as below, and then mount the whole chain onto the object it surrounds. Using this method I get precise and repeatable joints between the segment, and as a bonus I only need to move the root segment to position the entire thing:
08/30/2006 (1:16 pm)
Page 172Regarding the mounting of shapes....
In TGE 1.4, I have mounted 32 shapes onto a single object. The eight slot limitation therefore appears to apply only to ShapeBaseImages, and not to actual shapes. Given that the function for mounting objects does not allow you to specify a mount slot, this does make some sense. My suspicion is that mounting objects as opposed to shapes does not consume any slots at all.
It may also be helpful to note in the description of mounting that mounted objects also inherit the scale of the object they are mounted to, and that there appears to be no limit on how many nested mounts can happen.
For example, I've modified the chain link fence from one of the content packs so that only one side has a pole, and the other end has three mount points going to the right, straight ahead, and to the left. I can construct a chain link fence from code by simply interpreting a string describing the desired perimeter, and linking fence to fence to fence in a long chain as below, and then mount the whole chain onto the object it surrounds. Using this method I get precise and repeatable joints between the segment, and as a bonus I only need to move the root segment to position the entire thing:
$wh1Fstr = "11111111111111211111101111111111111011111111111111111111111101111111111111111111111111111";
function mkFence(%posn, %rot)
{
// note that the position and rotation are actually irrelevant since this shape
// will go where it is mounted, and face the direction defined by the mount point
%block = new StaticShape() {
position = vectorAdd("0 10 0", %posn);
rotation = %rot;
scale = "1 1 1";
datablock = "chainLink";
receiveSunLight = "1";
hitSound = "FenceHitSound";
};
return %block;
}
function whFences(%fstr)
{
%dir = 0;
%rot = "0 0 1 0";
%posn = "0 0 0";
%rblock = mkFence(%posn, %rot);
%fblock = %rblock;
for(%x = 0; %x < strlen(%fstr); %x++)
{
%block = mkFence(%posn, %rot);
// the number in the string defines which mount point to use
// mount point 0 is a left turn, mount 1 goes straight, and mount 2 is a right turn
%dd = getSubStr(%fstr, %x, 1);
%rblock.mountObject(%block,%dd);
%rblock = %block;
}
return %fblock;
}
whFences($wh1Fstr);
#15
*green="!)!!!?&!
*yellow=)!1!!!?&!
*red=1!9!!!?&!
I tried to export it using the Torque DTS Plus however it is not functional. Is the =1!9!!!?&! done intentionally or am I missing something?
10/01/2006 (7:20 pm)
The *.ms3d file demonstrated the IFL feature I got from the CD seems to be corrupted ( trafficLight.ms3d ) in the Materials tab it displays :*green="!)!!!?&!
*yellow=)!1!!!?&!
*red=1!9!!!?&!
I tried to export it using the Torque DTS Plus however it is not functional. Is the =1!9!!!?&! done intentionally or am I missing something?
#16
10/10/2006 (2:18 pm)
@ Pete: Interesting technique... You should consider creating a full resource with this. Are there any performance hits with this vs. building it out in the mission editor?
#17
I didn't notice a perceptible frame rate hit just eyeballing it with FPS showing. Intuitively, it's just a difference between the fence segments being part of a 'global' list of objects, or linked into a list as a child of something else, so it shouldn't make much difference. The main question I had was how deeply nested you could make the chain, but from a quick look at the source code, it seems that it's just a linked list so there is probably no real limit.
There is a potential to use the technique to boost the frame rate. If you have something like a streetlight, you can break it into pieces and assemble it using mountpoints. If you do this, the bounding box for each piece is a lot smaller than the bounding box of the entire object, and you're more likely not to draw things. When you look down a street with streetlamps, you can often see lamps and the arms they hang on even if you can't see the poles that are out of your viewing frame. Another example would be to slice a tall building into floors, and link them together using mounts. I've tried this, and you do get a good performance boost when you're close enough to the building that you only see the bottom floors.
Breaking something into pieces also gives you the opportunity to tune the LOD for each piece independent of the whole. You can make the small details degrade very quickly while leaving the large pieces intact until much farther away. Breaking an object up has little to do with mounting, but mounting allows for much easier and completely precise reassembly.
So the biggest performance boost is the productivity you get by avoiding having to precisely lay something like this out in the mission editor. Imagine if you tweaked the fence segment to make it a bit longer. Using a chain like this, the entire perimiter will get bigger, but it's easy to adjust the root position. Laying the segments out individually, if you change the fence size, you have to go fix every joint.
In practice, I only need to lay out some markers in the mission editor, and then I have some functions that build 'compounds' based at those markers. The artist (me in this case) can put markers in the model that determine where things like fences, streetlights, air conditioners, roof vents, flower beds, etc. go, without having to do anything in the mission editor.
Hadn't thought of making the post a full resource. If I did I would want to expand it with some other examples.
10/11/2006 (8:01 am)
@Kevin:I didn't notice a perceptible frame rate hit just eyeballing it with FPS showing. Intuitively, it's just a difference between the fence segments being part of a 'global' list of objects, or linked into a list as a child of something else, so it shouldn't make much difference. The main question I had was how deeply nested you could make the chain, but from a quick look at the source code, it seems that it's just a linked list so there is probably no real limit.
There is a potential to use the technique to boost the frame rate. If you have something like a streetlight, you can break it into pieces and assemble it using mountpoints. If you do this, the bounding box for each piece is a lot smaller than the bounding box of the entire object, and you're more likely not to draw things. When you look down a street with streetlamps, you can often see lamps and the arms they hang on even if you can't see the poles that are out of your viewing frame. Another example would be to slice a tall building into floors, and link them together using mounts. I've tried this, and you do get a good performance boost when you're close enough to the building that you only see the bottom floors.
Breaking something into pieces also gives you the opportunity to tune the LOD for each piece independent of the whole. You can make the small details degrade very quickly while leaving the large pieces intact until much farther away. Breaking an object up has little to do with mounting, but mounting allows for much easier and completely precise reassembly.
So the biggest performance boost is the productivity you get by avoiding having to precisely lay something like this out in the mission editor. Imagine if you tweaked the fence segment to make it a bit longer. Using a chain like this, the entire perimiter will get bigger, but it's easy to adjust the root position. Laying the segments out individually, if you change the fence size, you have to go fix every joint.
In practice, I only need to lay out some markers in the mission editor, and then I have some functions that build 'compounds' based at those markers. The artist (me in this case) can put markers in the model that determine where things like fences, streetlights, air conditioners, roof vents, flower beds, etc. go, without having to do anything in the mission editor.
Hadn't thought of making the post a full resource. If I did I would want to expand it with some other examples.
#18
- Thanks
@Pete - Yes. You can mount as many shapes to shapes as you wish. I apologize for the confusion. The slot information does in fact apply to images.
Thanks for looking into this and posting your findings here.
I'll keep this on my list for future updates to the guide.
@SpaceTun - Yes and no. The 'Torque DTS Plus' exporter encodes values and re-uses some fields which are then visible to you in the MS3D editor. Be sure you edit settings via the export dialog that is provided by 'Torque DTS Plus'.
Also, have you been able to use this, or is it still not working for you. I used a relatively old version of the exporter to make this and I'm not sure if backward compatability was maintained. (Note: I am not disparging the tool. It is awesome and opens doors that were previously closed to MS3D users.)
I know this is frustrating, but I hope that you have taken questions you have about specific tools to the Art forums. I tried not to put anything art-oriented in my guide because I'm not an artist.
Regardless, I'd love to hear if you have made any headway on this.
Hall Of Worlds - For Gamers
EdM|GPGT
10/27/2006 (11:56 am)
@All - I'm starting to answer ALL of my oustanding GPGT questions. It will take me a few days, so please bear with me over the weekend.- Thanks
@Pete - Yes. You can mount as many shapes to shapes as you wish. I apologize for the confusion. The slot information does in fact apply to images.
Thanks for looking into this and posting your findings here.
I'll keep this on my list for future updates to the guide.
@SpaceTun - Yes and no. The 'Torque DTS Plus' exporter encodes values and re-uses some fields which are then visible to you in the MS3D editor. Be sure you edit settings via the export dialog that is provided by 'Torque DTS Plus'.
Also, have you been able to use this, or is it still not working for you. I used a relatively old version of the exporter to make this and I'm not sure if backward compatability was maintained. (Note: I am not disparging the tool. It is awesome and opens doors that were previously closed to MS3D users.)
I know this is frustrating, but I hope that you have taken questions you have about specific tools to the Art forums. I tried not to put anything art-oriented in my guide because I'm not an artist.
Regardless, I'd love to hear if you have made any headway on this.
Hall Of Worlds - For GamersEdM|GPGT
#19
Nevermind ... it was so transparent I couldnt see it.
Im having trouble cloaking an object after making it (and mounting it). I made a new object:
and a texture (i tried without a texture also), and it doesnt show up when I do:
I just dont see it at all, unless its completely transparent, but my texture is the skin at 50% opacity.
11/13/2006 (4:12 pm)
Im having trouble cloaking an object after making it (and mounting it). I made a new object:
// test shape
datablock StaticShapeData( myObject )
{
shapeFile = "~/data/shapes/player/player.dts";
cloakTexture = "~/data/shapes/player/player_cloaked.png";
};and a texture (i tried without a texture also), and it doesnt show up when I do:
%myObject = new StaticShape() {
dataBlock = myObject;
position = %player.position;
};
%myObject.setCloaked(true); // without this line it mounts the object fine.
%player.mountObject(%myObject,2);I just dont see it at all, unless its completely transparent, but my texture is the skin at 50% opacity.
#20
mCloakLevel.
11/14/2006 (9:45 am)
I was using a texture and 50% opacity and still could barely see the texture. I was wondering is there a field to change the amount of the cloak. I saw something in the engine like
Torque Owner Roto
The following sentence reads...
The path is wrong, the sentence should read....
New, edit the function onServerCreated() in the file C:\MazeRunner\prototype\server\scripts\game.cs to look like the following.