Torque X 3D Soccer Game
by Sharpie · in Torque X 3D · 02/23/2010 (12:53 pm) · 18 replies
Hi all,
I'm new here, and new to Torque. I'm not new to programming, but I am to game programming. So I thought I'd drop in here and see if any of you guys would be willing to help me out on my first project.
Just to explain what resources I currently have: I've bought the XNA membership, which includes Torque X 3D. So I have the XNA Game Studio 3.1, Torque X 3D, and Blender. I'm not sure what else I'll be needing at this point, so that's where it stands for now.
Since I really don't know too much at this point, though I'm excited to learn as much as I can, I suppose I'll just ask the one question that's been bugging me the most. I'm interested in creating a 3D soccer game, but as simple a soccer game as possible. I'd just like a player to be able to run around on the field and kick the ball realistically. Rather, I'd like for the ball to respond realistically. The player would also be able to score points by kicking the ball into a goal, and a goalie would be a nice additional feature, although that's not necessary at this point, as I'm not focusing on AI to start. Somewhere down the line I'd love to add actual gameplay, with multiple players and such, but for now I'd just like to focus on the one player and the ball.
So my first question is this: Do you guys have any tips/advice on soccer/sports balls in general, and the physics that go into making them move correctly? I've heard that Torque X was originally created for FPS games, not for sports games, and that it would be hard to implement. But this is what I already have and have already paid for, so it's what I would like to use if at all possible.
Anyway, I'm just getting started creating/building models and such, so I haven't really begun any of the coding for the game itself. It's kind of hard to figure out where to start...
But for now I just wanted to establish a base here in hopes that I could get some help/advice as the game progresses. Any help would be awesome and greatly appreciated. Thanks so much! :)
I'm new here, and new to Torque. I'm not new to programming, but I am to game programming. So I thought I'd drop in here and see if any of you guys would be willing to help me out on my first project.
Just to explain what resources I currently have: I've bought the XNA membership, which includes Torque X 3D. So I have the XNA Game Studio 3.1, Torque X 3D, and Blender. I'm not sure what else I'll be needing at this point, so that's where it stands for now.
Since I really don't know too much at this point, though I'm excited to learn as much as I can, I suppose I'll just ask the one question that's been bugging me the most. I'm interested in creating a 3D soccer game, but as simple a soccer game as possible. I'd just like a player to be able to run around on the field and kick the ball realistically. Rather, I'd like for the ball to respond realistically. The player would also be able to score points by kicking the ball into a goal, and a goalie would be a nice additional feature, although that's not necessary at this point, as I'm not focusing on AI to start. Somewhere down the line I'd love to add actual gameplay, with multiple players and such, but for now I'd just like to focus on the one player and the ball.
So my first question is this: Do you guys have any tips/advice on soccer/sports balls in general, and the physics that go into making them move correctly? I've heard that Torque X was originally created for FPS games, not for sports games, and that it would be hard to implement. But this is what I already have and have already paid for, so it's what I would like to use if at all possible.
Anyway, I'm just getting started creating/building models and such, so I haven't really begun any of the coding for the game itself. It's kind of hard to figure out where to start...
But for now I just wanted to establish a base here in hopes that I could get some help/advice as the game progresses. Any help would be awesome and greatly appreciated. Thanks so much! :)
#2
And that's great to hear about TX3D, I was a little worried about that. Thanks much for the info! :)
02/23/2010 (6:57 pm)
Thanks for that link! I didn't realize that about the FBX files. And that's great to hear about TX3D, I was a little worried about that. Thanks much for the info! :)
#3
I've been following The Complete Guide to Torque X book to get me started, and I'm very happy to announce that I have Bob (the player provided along with the book) running around on screen. Since I'm creating a soccer game, though, I wanted to practice adding a soccer field, so I was trying to add the maze that's mentioned in Chapter 13, but it's not available with the downloadable code like Bob is. Does anyone know where I can get a static .dts model that I can play around with? I don't have a soccer field yet (not in .dts format, anyway), but I'd like to practice in the meantime. Thanks!
03/06/2010 (12:38 pm)
Okay, so here's my newest question:I've been following The Complete Guide to Torque X book to get me started, and I'm very happy to announce that I have Bob (the player provided along with the book) running around on screen. Since I'm creating a soccer game, though, I wanted to practice adding a soccer field, so I was trying to add the maze that's mentioned in Chapter 13, but it's not available with the downloadable code like Bob is. Does anyone know where I can get a static .dts model that I can play around with? I don't have a soccer field yet (not in .dts format, anyway), but I'd like to practice in the meantime. Thanks!
#4
Check out:
Meshbox Soccer Stadium and search for Soccer Poses at Content Paradise,
with the free Michael 3 Reduced Resolution
and the Low Resolution Soccer Ball from Sport Balls
or Higher Resolution Soccer Ball with fine bump details from
Sports Balls Pack as well as Soccer Form and Shoes (Save 30% through 04/02/2010) at Daz 3D.and do not forget to download Google SketchUp with online access to an overwhelming library of 3D COLLADA models.
03/08/2010 (6:01 am)
Hi there.Check out:
Meshbox Soccer Stadium and search for Soccer Poses at Content Paradise,
with the free Michael 3 Reduced Resolution
and the Low Resolution Soccer Ball from Sport Balls
or Higher Resolution Soccer Ball with fine bump details from
Sports Balls Pack as well as Soccer Form and Shoes (Save 30% through 04/02/2010) at Daz 3D.and do not forget to download Google SketchUp with online access to an overwhelming library of 3D COLLADA models.
#5
But now my question is, what to do with them? I was able to convert a soccer ball model from a 3DS format to a DTS and get it into the game. It works wonderfully as far as movement goes. When Bob runs into it, it shoots away from him. However, I'm having trouble figuring out how to tie it to the terrain (or the same plane) like Bob. Currently when it moves it drops below Bob's level, though it never actually goes through the terrain. It's just that Bob is, in reality, floating above the terrain. It just doesn't appear that way.
Also, I bought the meshbox soccer stadium, but I can't get it into the game! I used Milkshape to convert the soccer ball to DTS, but the soccer stadium is too large. Blender will open it, but Blender and DTS exports are not good friends. I've never been successful in exporting anything in DTS format from Blender. Well...I can export, but I never get the textures with it. I did find a tutorial on doing just that, but I was unable to get it to work.
What I was able to add successfully, though, was a splash screen and a startup/in-game menu. The menu displays after the splash screen, and you can access it from within the game. I also added some in-game text that I'll use in the future for the score. So all that was pretty cool. :)
But, I was mainly wondering if there was any advice on two things:
1. Converting the soccer stadium to DTS so as to be imported into the game
2. Getting the soccer ball to stay on the same plane as Bob
Any help would be awesome, thanks! :)
03/27/2010 (10:02 am)
Thanks so much for the models!But now my question is, what to do with them? I was able to convert a soccer ball model from a 3DS format to a DTS and get it into the game. It works wonderfully as far as movement goes. When Bob runs into it, it shoots away from him. However, I'm having trouble figuring out how to tie it to the terrain (or the same plane) like Bob. Currently when it moves it drops below Bob's level, though it never actually goes through the terrain. It's just that Bob is, in reality, floating above the terrain. It just doesn't appear that way.
Also, I bought the meshbox soccer stadium, but I can't get it into the game! I used Milkshape to convert the soccer ball to DTS, but the soccer stadium is too large. Blender will open it, but Blender and DTS exports are not good friends. I've never been successful in exporting anything in DTS format from Blender. Well...I can export, but I never get the textures with it. I did find a tutorial on doing just that, but I was unable to get it to work.
What I was able to add successfully, though, was a splash screen and a startup/in-game menu. The menu displays after the splash screen, and you can access it from within the game. I also added some in-game text that I'll use in the future for the score. So all that was pretty cool. :)
But, I was mainly wondering if there was any advice on two things:
1. Converting the soccer stadium to DTS so as to be imported into the game
2. Getting the soccer ball to stay on the same plane as Bob
Any help would be awesome, thanks! :)
#6
03/27/2010 (12:29 pm)
Poser Pro and Torque 3D supports COLLADA which is a collaborative 3D data standard initially established by Sony Computer Entertainment America and currently administered by the Khronos Group. COLLADA enables the interchange of 3D data between a number of third party 3D authoring applications, permitting software tools to be combined into a powerful production pipeline.
#7
In other words, don't I still need to convert the format for TorqueX to be happy with it? And that's what I'm not sure how to do. I'm having trouble finding programs that will export to DTS correctly. Milkshape did it for me with the soccer ball, but again, it gave me an error every time it tried to export the stadium.
I don't believe TorqueX supports COLLADA, but even if it did, what is it, exactly? I don't really understand. :|
03/27/2010 (1:08 pm)
What does that mean for me, exactly? Sorry, I'm just a little confused. And I have TorqueX 3D, not Torque 3D, which I know they're quite different. So does that make a difference concerning the Poser format?In other words, don't I still need to convert the format for TorqueX to be happy with it? And that's what I'm not sure how to do. I'm having trouble finding programs that will export to DTS correctly. Milkshape did it for me with the soccer ball, but again, it gave me an error every time it tried to export the stadium.
I don't believe TorqueX supports COLLADA, but even if it did, what is it, exactly? I don't really understand. :|
#8
DAE to DTS
Torque’s native model format, DTS, is much faster to read than COLLADA, so once a DAE file has been imported, the loader automatically saves the 3space model to a DTS file. For example, importing myShape.dae will generate myShape.cached.dts.
The next time Torque attempts to load the DAE file, it compares the timestamps of the two files, and if the cached DTS is newer, then it loads that instead. Re-exporting the DAE (or modifying it by hand) will cause the DAE to be re-imported, and the cached DTS overwritten with the latest model.
Demos and released games can ship only the cached DTS files if desired. Torque will automatically load the cached DTS if the DAE is missing. Datablocks and mission files should continue to refer to the DAE file.
03/27/2010 (1:35 pm)
You are right TorqueX 3D has no COLLADA support as Torque 3D yet if you load a DAE file with Torque 3D it will be converted to a DTS file that you can use with TorqueX 3D as explained at:DAE to DTS
Torque’s native model format, DTS, is much faster to read than COLLADA, so once a DAE file has been imported, the loader automatically saves the 3space model to a DTS file. For example, importing myShape.dae will generate myShape.cached.dts.
The next time Torque attempts to load the DAE file, it compares the timestamps of the two files, and if the cached DTS is newer, then it loads that instead. Re-exporting the DAE (or modifying it by hand) will cause the DAE to be re-imported, and the cached DTS overwritten with the latest model.
Demos and released games can ship only the cached DTS files if desired. Torque will automatically load the cached DTS if the DAE is missing. Datablocks and mission files should continue to refer to the DAE file.
#9
Now of course I know you can scale the model so it's the correct size, but I have no clue how to go about that. Realize also that I've never actually used the TorqueX Builder. I've coded everything in XNA itself, as that's how the book was doing it, and I just stuck to doing it that way. I have no experience with the Builder, and the few times I've tried to use it, it does whacky things to my game. :(
Also, the book does mention that you can scale a mesh by changing the size of all the vertices. Problem #1, how do I know how many vertices my model has? Problem #2, do I have to know how to access each one? Or is Torque smart enough to realize what's going on by just calling them vertexA, vertexB, etc?
So scaling the model is the next big step. Any advice would be awesome! Thanks for everything so far! :)
03/30/2010 (7:22 pm)
Ah, okay, that makes a little more sense. And here's the good news! I've gotten the field into the game. Yay! But now for the bad news. It's smaller than the soccer ball. :|Now of course I know you can scale the model so it's the correct size, but I have no clue how to go about that. Realize also that I've never actually used the TorqueX Builder. I've coded everything in XNA itself, as that's how the book was doing it, and I just stuck to doing it that way. I have no experience with the Builder, and the few times I've tried to use it, it does whacky things to my game. :(
Also, the book does mention that you can scale a mesh by changing the size of all the vertices. Problem #1, how do I know how many vertices my model has? Problem #2, do I have to know how to access each one? Or is Torque smart enough to realize what's going on by just calling them vertexA, vertexB, etc?
So scaling the model is the next big step. Any advice would be awesome! Thanks for everything so far! :)
#10
You can also change the scale before exporting if you need to simplify the model and reduce the number of polygons and vertexes it is made of you will need a Vertex Modeling software that can Smooth more/less like Hexagon 2.5 or Carrara Pro that can also read Poser files and export them to COLLADA it is better than Poser Pro as a modeling and photo realistic renderer but the best solution by far that can do so much more is Vue 8 Infinite compeering to other well known professional 3D photo realistic Softwares like 3DS Max, Cinema 4D, Maya, LightWave & Softimage XSI.
03/31/2010 (2:11 am)
There should be a very straight forward way to proportionally scale the model using the GUI arrows of the TorqueX Builder.You can also change the scale before exporting if you need to simplify the model and reduce the number of polygons and vertexes it is made of you will need a Vertex Modeling software that can Smooth more/less like Hexagon 2.5 or Carrara Pro that can also read Poser files and export them to COLLADA it is better than Poser Pro as a modeling and photo realistic renderer but the best solution by far that can do so much more is Vue 8 Infinite compeering to other well known professional 3D photo realistic Softwares like 3DS Max, Cinema 4D, Maya, LightWave & Softimage XSI.
#11
Okay, I got the model converted happily to DTS (finally!), and I've figured out how to size it in the TorqueX Builder. But here's my next question:
What do I do with it after that? The way I've been coding so far, I haven't touched the Builder. I've been following the TorqueX book, and it never uses it (or not that I'm aware).
So I've now got a field that's the correct size, but I also have a camera that's no longer attached to the player, and a player that no longer responds to the keys or even shows up in the vicinity of the field. So...it's like the Builder overwrites (or takes precedence) over what you manually code in XNA?
My point is that I don't understand how to code Bob now to actually walk on the field, or how to give the field any code whatsoever. I was already importing a smaller version of the field manually, so I now have two fields. A static one that is the correct size, and a little one that's in the wrong spot.
Any advice on how to proceed from here would be wonderful. Thank you!
04/06/2010 (10:46 pm)
Hi again,Okay, I got the model converted happily to DTS (finally!), and I've figured out how to size it in the TorqueX Builder. But here's my next question:
What do I do with it after that? The way I've been coding so far, I haven't touched the Builder. I've been following the TorqueX book, and it never uses it (or not that I'm aware).
So I've now got a field that's the correct size, but I also have a camera that's no longer attached to the player, and a player that no longer responds to the keys or even shows up in the vicinity of the field. So...it's like the Builder overwrites (or takes precedence) over what you manually code in XNA?
My point is that I don't understand how to code Bob now to actually walk on the field, or how to give the field any code whatsoever. I was already importing a smaller version of the field manually, so I now have two fields. A static one that is the correct size, and a little one that's in the wrong spot.
Any advice on how to proceed from here would be wonderful. Thank you!
#12
04/07/2010 (6:08 am)
I think you should start over using only TorqueX Builder and other TorqueX tools to link all the objects. You should make eventing work out for you without coding at all and the code up from there.
#13
But that aside, say I did start over with the objects. Again, where would I go from there? You have to understand that I've never done this before, and I'm having trouble finding any tutorials having to do with the Builder. Once I place an object in the Builder and position it where I'd like, how do I attach manual code to it via XNA? Like, for instance, when I place a field into the game via the Builder, I now have two fields. The one I placed using the Builder, and the one I coded manually (according to the book's instructions). Why can't I access the field that I manually coded, and reposition it? That confuses me quite a bit. What good is importing an object into the game if you can't then access it from within the Builder? :|
But anyway, like I said, if I did start over and place my objects into the game via the Builder, how do I code them after that? For instance, how do I attach movement code to Bob like I did the first time? I placed him into the scene via a CreatePlayer method originally. But now that won't exist. Do I add a MovementComponent via the Builder? Same with the camera, how do I ensure that the camera follows Bob wherever he goes, instead of staying fixed on the field?
Last thing, the Builder tends to freeze up. For instance, when I import my soccer field into it and get it to the size that I'm happy with, I can no longer delete it or move it (many times). It just freezes. And if I try to get rid of it, the Builder crashes. Agh!
Anyway, thanks for your help so far! Forgive my frustration...it's just confusing figuring all of this out for the first time! :)
04/07/2010 (9:20 am)
Okay, well that's a little scary to think about. I would have to wonder why the book would code the way it did if you were supposed to use the Builder from the start. There must be a reason it doesn't find it necessary to use it. Or, there must be a way to link the code from the book to the objects in the Builder. :|But that aside, say I did start over with the objects. Again, where would I go from there? You have to understand that I've never done this before, and I'm having trouble finding any tutorials having to do with the Builder. Once I place an object in the Builder and position it where I'd like, how do I attach manual code to it via XNA? Like, for instance, when I place a field into the game via the Builder, I now have two fields. The one I placed using the Builder, and the one I coded manually (according to the book's instructions). Why can't I access the field that I manually coded, and reposition it? That confuses me quite a bit. What good is importing an object into the game if you can't then access it from within the Builder? :|
But anyway, like I said, if I did start over and place my objects into the game via the Builder, how do I code them after that? For instance, how do I attach movement code to Bob like I did the first time? I placed him into the scene via a CreatePlayer method originally. But now that won't exist. Do I add a MovementComponent via the Builder? Same with the camera, how do I ensure that the camera follows Bob wherever he goes, instead of staying fixed on the field?
Last thing, the Builder tends to freeze up. For instance, when I import my soccer field into it and get it to the size that I'm happy with, I can no longer delete it or move it (many times). It just freezes. And if I try to get rid of it, the Builder crashes. Agh!
Anyway, thanks for your help so far! Forgive my frustration...it's just confusing figuring all of this out for the first time! :)
#14
Meshbox Soccer Stadium is an extremely high detailed model designed for full High Definition 3D animation I recommend keeping it for the opening sequence and using it to generate a low polygon version for your game.
04/07/2010 (10:05 am)
How about reading the Torque X Official Documentation?Meshbox Soccer Stadium is an extremely high detailed model designed for full High Definition 3D animation I recommend keeping it for the opening sequence and using it to generate a low polygon version for your game.
#15
04/07/2010 (10:09 am)
Thank you, and I have looked into that. But as far as I can tell, it doesn't explain the relationship between the Builder and the actual code in XNA. That's what I'm asking for help with. :|
#16
04/07/2010 (10:18 am)
I own Torque 3D and 2D and just starting to set up my super computer and development environment myself...
#17
I missed the bit about Meshbox Soccer Stadium that you posted earlier, you must have edited it. I did pick up a different soccer field, a very low definition one, that still looks quite nice. I was having trouble with the Meshbox version being too large, so I got a different one that was smaller. So the field is working rather well.
But I'm just asking for some guidance on transitioning between the Builder and the code in XNA. That's all I'd like to know at this point. I don't understand it, and I'd just like some advice. I apologize if I've ever sounded ungrateful, cynical, sarcastic, or smart. I only meant to ask for some help. There really are no tutorials on the TorqueX 3D Builder, and I just thought I'd come to here to seek some guidance. Thanks.
04/07/2010 (10:57 am)
I'm sorry, I can't tell if that's sarcasm or sincerity. So I'm not going to comment on it, just to be safe.I missed the bit about Meshbox Soccer Stadium that you posted earlier, you must have edited it. I did pick up a different soccer field, a very low definition one, that still looks quite nice. I was having trouble with the Meshbox version being too large, so I got a different one that was smaller. So the field is working rather well.
But I'm just asking for some guidance on transitioning between the Builder and the code in XNA. That's all I'd like to know at this point. I don't understand it, and I'd just like some advice. I apologize if I've ever sounded ungrateful, cynical, sarcastic, or smart. I only meant to ask for some help. There really are no tutorials on the TorqueX 3D Builder, and I just thought I'd come to here to seek some guidance. Thanks.
#18
You should get Torque X customer support to help you...
04/07/2010 (11:52 am)
Where did you get the low polygons soccer field?You should get Torque X customer support to help you...
Torque Owner Trent
http://www.jsgreenawalt.com/
To get the the DTS exporter for blender. TX3D doesn't fully support the FBX format.
As for sports games, I have no idea really, but the physics system should be able handle ball physics quite well. Use a Trigger component with a collision box in your goals to detect a goal and you should be right. It's not that different from an FPS really. TX3D is not as acutely tied to the FPS paradigm as TGE/TGEA were, the main things that will stop you are movement code, and you will have access to that in your project in the MovementComponent.cs file, so you can alter it to make whatever you like.