fxStarfieldReplicator Object
by Brett Fattori · 12/11/2003 (6:06 am) · 8 comments
Download Code File
I've included a Read Me file (readme_fxSF.txt) that you should look into. Also, look at the fxFoliage replicator for more information about implementation.
First things first... Back up your code!! Not responsible if this totally annihilates your project... sorry.
Copy the fxstarfield.h and fxstarfield.cc files into engine/game/fx/ directory. Make the modifications to the .cc files and .cs files outlined in the readme file (also in fxstarfield.cc). Do a clean build on the engine to set up the system.
Remove the terrain from a mission and add the datablock supplied in the readme file to your mission. Make sure that the star3.png file is in the right place and fire up the engine. If all went well, you should now have a 3D starfield that you can fly through.
Note: Use F8 to separate the camera from the player and allow free-flight. Until you've set up the engine as a real space simulator, gravity will act on your player and you'll fall into an endless pit.
There is a bug whereby you fly below a certain point and the skybox goes away. This isn't a complete solution to making a space game in a snap... you still have a LONG way to go -- get coding!
- Brett
I've included a Read Me file (readme_fxSF.txt) that you should look into. Also, look at the fxFoliage replicator for more information about implementation.
First things first... Back up your code!! Not responsible if this totally annihilates your project... sorry.
Copy the fxstarfield.h and fxstarfield.cc files into engine/game/fx/ directory. Make the modifications to the .cc files and .cs files outlined in the readme file (also in fxstarfield.cc). Do a clean build on the engine to set up the system.
Remove the terrain from a mission and add the datablock supplied in the readme file to your mission. Make sure that the star3.png file is in the right place and fire up the engine. If all went well, you should now have a 3D starfield that you can fly through.
Note: Use F8 to separate the camera from the player and allow free-flight. Until you've set up the engine as a real space simulator, gravity will act on your player and you'll fall into an endless pit.
There is a bug whereby you fly below a certain point and the skybox goes away. This isn't a complete solution to making a space game in a snap... you still have a LONG way to go -- get coding!
- Brett
About the author
Recent Blogs
• A small hello• Recent Stuph
• So long and so out of touch...
• Plan for Brett Fattori
• Plan for Brett Fattori
#2
12/22/2003 (5:29 am)
Really nice ! Thanks Brett
#3
Very nice resource, but I cannot make it work... I cannot see the fxStarfieldReplicator object in the World Creator, and no stars around :)
I did all as it was described in the text file...
Thank you!
10/13/2004 (2:07 pm)
Hello, BrettVery nice resource, but I cannot make it work... I cannot see the fxStarfieldReplicator object in the World Creator, and no stars around :)
I did all as it was described in the text file...
Thank you!
#4
- Brett
10/19/2004 (3:28 pm)
Have you made the changes that were outlined in the C++ code comments? - Brett
#5
I did exactly as it's said in the resource, but it was not visible in the mission editor, anyhow, it appeared after 2-3 days :) Probably. DSO files were rebuild (that i forgot to check, as you know DSO files are not always refreshed)
Thank you a lot for this code example, great work!
10/21/2004 (8:39 am)
Strangely, it works now, after several recompiles :/I did exactly as it's said in the resource, but it was not visible in the mission editor, anyhow, it appeared after 2-3 days :) Probably. DSO files were rebuild (that i forgot to check, as you know DSO files are not always refreshed)
Thank you a lot for this code example, great work!
#6
04/24/2006 (9:07 pm)
Excellent resource, Brett. This is pretty much required for all of us doing space games- this should totally go into the head release.
#7
//
// Put this in /engine/console/simBase.h (around line 1300) in
//
// namespace Sim
// {
// DeclareNamedSet(fxStarSet) <-- ADD THIS (Note no semi-colon).
//
//------------------------------------------------------------------------------
changed from line 509 to 1300
03/28/2007 (2:15 am)
//------------------------------------------------------------------------------//
// Put this in /engine/console/simBase.h (around line 1300) in
//
// namespace Sim
// {
// DeclareNamedSet(fxStarSet) <-- ADD THIS (Note no semi-colon).
//
//------------------------------------------------------------------------------
changed from line 509 to 1300
#8
02/17/2009 (5:10 am)
any ports to TGEA?
Torque 3D Owner Phil Carlisle