3 Questions..
by Nathan Cox · in Torque Game Engine · 01/22/2011 (1:14 am) · 3 replies
Ok so here goes!
1. Is it plausible (and possible) to make it so the scene only lights what is in draw? This way I can add the possibility of creating your own houses out of different rooms and retain lighting.
2. I'm currently learning milkshape, would it be possible to use the mesh swapping resource on models made in milkshape?
3. Finally, how, in milkshape, do I make those animations that don't play through but are static at one frame. For example, in one game I play (made in torque) you can adjust the player's posture. The posture is an animation and you essentially choose which frame you want your player to play (is this making sense?). I want to add a slider to my character creation process for muscle definition and several facial sliders such as nose size or mouth width. Which will use this system.
Hope this all made sense and you can answer my questions!
1. Is it plausible (and possible) to make it so the scene only lights what is in draw? This way I can add the possibility of creating your own houses out of different rooms and retain lighting.
2. I'm currently learning milkshape, would it be possible to use the mesh swapping resource on models made in milkshape?
3. Finally, how, in milkshape, do I make those animations that don't play through but are static at one frame. For example, in one game I play (made in torque) you can adjust the player's posture. The posture is an animation and you essentially choose which frame you want your player to play (is this making sense?). I want to add a slider to my character creation process for muscle definition and several facial sliders such as nose size or mouth width. Which will use this system.
Hope this all made sense and you can answer my questions!
#2
This isn't really going to be something you can do easily... TGE uses a pre-baked lighting model for DIF's and anything you add will be unlit until a scene relight is performed. While you could set up scripts to trigger a relight during gameplay, it would certainly cause some very noticable freezes (especially if the environment got especially complex). Similarly, anything which had already been lit and was removed would leave behind a shadow until a relight. Finally, while I don't really use TGE anymore and may be wrong, I recall there being performance issues with placing multiple DIF's directly next to/overlapping each other.
Anyway, there's no way around this system that I'm aware of (and most of the people who would have been interested in building something to handle this have since migrated to T3D, which has full dynamic lighting/shadowing).
As a workaround I'd suggest your building pieces be static DTS shapes instead of DIF's. Unlike Interiors (which appear 100% black when spawned since they have no lightmap), Static Shapes are lit using the standard DTS dynamic lighting. While they still need a relight to cast shadows (and can never self-shadow) they're probably the best option. Just skip the relight and you at least have properly-shaded models that can be freely added/removed during gameplay.
Since they aren't convex hulls like DIF Interiors you'll need to give them some decent collision hulls when modeling (you can add quite a few collision mesh objects per model -- can't recall the limit but it should be enough to model the basic collision of a small room).
If you're concerned about the loss of shadows, remember that Oblivion, Fallout 3, and even Fallout New Vegas use absolutely no shadows in their environments and no one ever really seems to notice or care. A dynamic player-buildable environment is a cool feature and your players will certainly forgive the lack of proper shadowing for these structures.
As a final note, I don't know for sure whether or not TGE's StaticShape objects broadcast their creation to clients if it happens after the mission load phase. I would imagine they do, but this would be something you'd have to test (or ask someone who still works with TGE regularly). This is only an issue if you're planning a multi-player game.
01/25/2011 (12:51 am)
I'll take a crack at #1... If I'm correct the question is about being able to add/remove DIF interiors and have them be lit appropriately without having to reload the mission or do a full relight. Hopefully that was the issue or this is going to be a long completely unrelated answer. ;)This isn't really going to be something you can do easily... TGE uses a pre-baked lighting model for DIF's and anything you add will be unlit until a scene relight is performed. While you could set up scripts to trigger a relight during gameplay, it would certainly cause some very noticable freezes (especially if the environment got especially complex). Similarly, anything which had already been lit and was removed would leave behind a shadow until a relight. Finally, while I don't really use TGE anymore and may be wrong, I recall there being performance issues with placing multiple DIF's directly next to/overlapping each other.
Anyway, there's no way around this system that I'm aware of (and most of the people who would have been interested in building something to handle this have since migrated to T3D, which has full dynamic lighting/shadowing).
As a workaround I'd suggest your building pieces be static DTS shapes instead of DIF's. Unlike Interiors (which appear 100% black when spawned since they have no lightmap), Static Shapes are lit using the standard DTS dynamic lighting. While they still need a relight to cast shadows (and can never self-shadow) they're probably the best option. Just skip the relight and you at least have properly-shaded models that can be freely added/removed during gameplay.
Since they aren't convex hulls like DIF Interiors you'll need to give them some decent collision hulls when modeling (you can add quite a few collision mesh objects per model -- can't recall the limit but it should be enough to model the basic collision of a small room).
If you're concerned about the loss of shadows, remember that Oblivion, Fallout 3, and even Fallout New Vegas use absolutely no shadows in their environments and no one ever really seems to notice or care. A dynamic player-buildable environment is a cool feature and your players will certainly forgive the lack of proper shadowing for these structures.
As a final note, I don't know for sure whether or not TGE's StaticShape objects broadcast their creation to clients if it happens after the mission load phase. I would imagine they do, but this would be something you'd have to test (or ask someone who still works with TGE regularly). This is only an issue if you're planning a multi-player game.
#3
For the animation one, I'll take a look.
01/25/2011 (11:09 am)
Ah so it would be best to create the different parts of the house as DTS. Worth a try!For the animation one, I'll take a look.
Torque Owner Daniel Buckmaster
T3D Steering Committee
2. Yep, as long as you have the correct structure in your DTS file, any exporter should work fine. I used that resource a long time ago, though, so I don't remember the specifics.
3. This isn't something you do in your animation tool; this has to be handled in C++ code in the engine. Take a look at Player::updateLookAnimation(). In short, it comes down to creating a TSThread on your shape instance, setting its timescale to 0, and setting its position to wherever you want.