Plan for David "Fulcrum" Wyand
by David Wyand · 01/14/2005 (3:05 pm) · 6 comments
Working towards my next couple of projects, I found that I needed to learn how to integrate TNL with the TGE (as an extension to an existing product and for an enhanced old-but-new-again-soon-to-be-released product) and become reacquainted with Quark et al (for a hush-hush product). So, what's the best way to learn about something without messing up your original code? Attempt to use it in a prototype! :o)
Beginnings of The Space Game
I've thought about putting together a space-based combat game to test out some networking technology for a long time now (a couple of years). Here's my thesis: To allow for multiplayer crews to pilot multiple space ships into combat while keeping the bandwidth costs down at my end. To work towards this (and I've only just begun over the last two days), here's my approach:
- Have a Galaxy Server that tracks the space ships' positions, orientation, velocity, RPG-style statistics, etc. This is hosted at my end.
- Space ships are controlled in a Star Trek-like manner (pushing buttons to issue commands) rather than a flight-sim manner. This makes them more AI-like than player controlled. This is to keep the bandwidth down to the Galaxy Server.
- A Space Ship Server is hosted by a player and represents a single space ship in the galaxy. There would be multiple Space Ship Servers (one for each ship on each team) and they communicate with the Galaxy Server.
- Players connect to the Space Ship Server that they want to perform crew duties on. These could include commander, pilot, tactical officer, engineer, etc. as appropriate for the game that could come from this technology demo.
- The Space Ship Server and the player's client are TGE (could be TSE) based and operate as the starter.fps demo i.e.: are like an FPS (although the bandwidth could be optimised from the standard TGE as not all of the FPS functionality would be required).
- The Galaxy Server to Space Ship Server uses TNL. The main reason I'm doing this is to learn TNL and how to integrate it with TGE at the Space Ship Server end. It also allows me to use the TNLTest and Zap games as the basis for the Galaxy Server. :o)
Here's a diagram showing the connections:

For my technology test, I decided to use the TNLTest application that comes with the OpenTNL.org version of TNL. In fact, I used an unmodified TNLTest executable as my Galaxy Server. All it does is allow players to connect and move in straight lines about a square playing field while it moves about a number of AI players. It also provides scoping for each player so they only see those other players (AI or real) that are nearby think of this as a ship's scanner range.
On the TGE side, I added in a network connection using TNL that would automatically connect to the Galaxy Server when the TGE mission was started and collect information about the given ship and its surroundings on a periodic basis. To present this information to the player, I coded up a new GameBase object (initially based off of the fxRenderObject resource thanks Melv!) that renders the playfield on the client as if they were looking at a hologram projection table showing a Commander's view. I then build an enclosed space ship in Quark (using a number of textures from TheWadFather site); built a Commander's hologram table in LightWave and placed it on the "bridge"; added my new GameBase object on top of the table; and added everything to a mission that represents the space ship (Whew!). To start in a different styled space ship, you'd just start a different mission (although I only have one right now).
Here's a screen shot from a test:

In the upper left is the user interface from the stock TNLTest application. The dark blue squares are the AI players, the white square is the player that started the server, and the light blue square is the TGE space ship. To the right is the TGE Orc looking down on the Commander's table. Here the light blue cube represents the Orc's space ship, the green cube is another space ship (the white square on the TNLTest app) and the red cubes are the AI players. These cubes are DTS files loaded by the Commander's table at run time so they could be anything such as actual space ships.
Here's another shot of the table with the little cubes from the Galaxy Server (TNLTest app) being rendered on the table, and the Orc standing in the rather sparse bridge:

And to test this all out with another player on the same space ship (making it a crew of two), I used my spare Windows 98SE computer:

So, what did I finally end up with? I had my Galaxy Server running on one computer using an unmodified TNLTest application. I had a TGE client/server (Space Ship Server) running on another computer acting as the space ship which connected to the Galaxy Server to retrieve all of the space ship's positions in real-time and present it to the user in a custom TGE object. Finally, I had a TGE client connect to the Space Ship Server as another crew member on the ship with the Space Ship Server passing along the appropriate information on the other ships as necessary.
Were there any real issues with this? Yup. I have two outstanding issues (and a ton of optimisation that could be done in the future):
1. I can't get the TNLTest application to communicate from my PC to my Mac. I wrote about this here: www.garagegames.com/mg/forums/result.thread.php?qt=24887 and am hoping that someone will get back to me.
2. It was difficult to get TNL and the TGE memory manager to work together. I'm not satisfied with my current solution as it feels like it's held together with twine and the twine is fraying. Before I use what I learned in my commercial product, I'll have to work this out.
So, there ya go. Now its time to move back to what I should be really working on and apply everything I've learned here. Hopefully I'll be able to come back to this at a later date and continue to refine the idea. From a technology standpoint, I'd like to replace the TNLTest server with an implementation of Zap and take advantage of all its goodness and allow the player to pilot their ship. And it would be neat to include the gameplay elements that are in my design doc! :o)
- LightWave Dave
Beginnings of The Space Game
I've thought about putting together a space-based combat game to test out some networking technology for a long time now (a couple of years). Here's my thesis: To allow for multiplayer crews to pilot multiple space ships into combat while keeping the bandwidth costs down at my end. To work towards this (and I've only just begun over the last two days), here's my approach:
- Have a Galaxy Server that tracks the space ships' positions, orientation, velocity, RPG-style statistics, etc. This is hosted at my end.
- Space ships are controlled in a Star Trek-like manner (pushing buttons to issue commands) rather than a flight-sim manner. This makes them more AI-like than player controlled. This is to keep the bandwidth down to the Galaxy Server.
- A Space Ship Server is hosted by a player and represents a single space ship in the galaxy. There would be multiple Space Ship Servers (one for each ship on each team) and they communicate with the Galaxy Server.
- Players connect to the Space Ship Server that they want to perform crew duties on. These could include commander, pilot, tactical officer, engineer, etc. as appropriate for the game that could come from this technology demo.
- The Space Ship Server and the player's client are TGE (could be TSE) based and operate as the starter.fps demo i.e.: are like an FPS (although the bandwidth could be optimised from the standard TGE as not all of the FPS functionality would be required).
- The Galaxy Server to Space Ship Server uses TNL. The main reason I'm doing this is to learn TNL and how to integrate it with TGE at the Space Ship Server end. It also allows me to use the TNLTest and Zap games as the basis for the Galaxy Server. :o)
Here's a diagram showing the connections:

For my technology test, I decided to use the TNLTest application that comes with the OpenTNL.org version of TNL. In fact, I used an unmodified TNLTest executable as my Galaxy Server. All it does is allow players to connect and move in straight lines about a square playing field while it moves about a number of AI players. It also provides scoping for each player so they only see those other players (AI or real) that are nearby think of this as a ship's scanner range.
On the TGE side, I added in a network connection using TNL that would automatically connect to the Galaxy Server when the TGE mission was started and collect information about the given ship and its surroundings on a periodic basis. To present this information to the player, I coded up a new GameBase object (initially based off of the fxRenderObject resource thanks Melv!) that renders the playfield on the client as if they were looking at a hologram projection table showing a Commander's view. I then build an enclosed space ship in Quark (using a number of textures from TheWadFather site); built a Commander's hologram table in LightWave and placed it on the "bridge"; added my new GameBase object on top of the table; and added everything to a mission that represents the space ship (Whew!). To start in a different styled space ship, you'd just start a different mission (although I only have one right now).
Here's a screen shot from a test:

In the upper left is the user interface from the stock TNLTest application. The dark blue squares are the AI players, the white square is the player that started the server, and the light blue square is the TGE space ship. To the right is the TGE Orc looking down on the Commander's table. Here the light blue cube represents the Orc's space ship, the green cube is another space ship (the white square on the TNLTest app) and the red cubes are the AI players. These cubes are DTS files loaded by the Commander's table at run time so they could be anything such as actual space ships.
Here's another shot of the table with the little cubes from the Galaxy Server (TNLTest app) being rendered on the table, and the Orc standing in the rather sparse bridge:

And to test this all out with another player on the same space ship (making it a crew of two), I used my spare Windows 98SE computer:

So, what did I finally end up with? I had my Galaxy Server running on one computer using an unmodified TNLTest application. I had a TGE client/server (Space Ship Server) running on another computer acting as the space ship which connected to the Galaxy Server to retrieve all of the space ship's positions in real-time and present it to the user in a custom TGE object. Finally, I had a TGE client connect to the Space Ship Server as another crew member on the ship with the Space Ship Server passing along the appropriate information on the other ships as necessary.
Were there any real issues with this? Yup. I have two outstanding issues (and a ton of optimisation that could be done in the future):
1. I can't get the TNLTest application to communicate from my PC to my Mac. I wrote about this here: www.garagegames.com/mg/forums/result.thread.php?qt=24887 and am hoping that someone will get back to me.
2. It was difficult to get TNL and the TGE memory manager to work together. I'm not satisfied with my current solution as it feels like it's held together with twine and the twine is fraying. Before I use what I learned in my commercial product, I'll have to work this out.
So, there ya go. Now its time to move back to what I should be really working on and apply everything I've learned here. Hopefully I'll be able to come back to this at a later date and continue to refine the idea. From a technology standpoint, I'd like to replace the TNLTest server with an implementation of Zap and take advantage of all its goodness and allow the player to pilot their ship. And it would be neat to include the gameplay elements that are in my design doc! :o)
- LightWave Dave
About the author
A long time Associate of the GarageGames' community and author of the Torque 3D Game Development Cookbook. Buy it today from Packt Publishing!
#2
Neat.
-edit-
found the link:
http://www.garagegames.com/mg/forums/result.thread.php?qt=539
01/14/2005 (3:54 pm)
That's pretty cool. Sounds a bit like a distributed MMO architecture I was arguing with Phil about some time ago.Neat.
-edit-
found the link:
http://www.garagegames.com/mg/forums/result.thread.php?qt=539
#3
I used to play Star Raiders on the Atari, and love space games even though I hardly ever play them any more... what I like about this idea is the fact that you still have an FPS game running as the base level of the space game, rather than just looking at a spaceship from the outside. Does anybody else do this?
It would be nice to have flight sim controls for the fighters though.
Nice work!! And thanks again for the Show Tool, still using it every hour of every day.
01/14/2005 (7:07 pm)
Jeezus Dave, do you ever SLEEP?? This is REALLY COOL!!I used to play Star Raiders on the Atari, and love space games even though I hardly ever play them any more... what I like about this idea is the fact that you still have an FPS game running as the base level of the space game, rather than just looking at a spaceship from the outside. Does anybody else do this?
It would be nice to have flight sim controls for the fighters though.
Nice work!! And thanks again for the Show Tool, still using it every hour of every day.
#4
01/14/2005 (7:10 pm)
Damn, Dave. This is very cool.
#5
01/14/2005 (8:00 pm)
I don't think he does sleep. Dave you kickass.
#6
01/14/2005 (8:40 pm)
Thats awesome, Ive often wished I could play a multiplayer space sim where its a crew on a single ship instead of the standard dogfight scenario. looking good! 
Torque Owner Max Thomas
Max