by date
SunBurn Multiplayer and T2D Networking TDN Article
SunBurn Multiplayer and T2D Networking TDN Article
| Name: | Tom Bampton | ![]() |
|---|---|---|
| Date Posted: | Mar 07, 2006 | |
| Rating: | 4.0 out of 5 | |
| Public: | YES | |
| Comments: | YES | |
| RSS Feed: | or Subscribe with . | |
| Profile Page: | View profile page for Tom Bampton |
Blog post
Here we have a multiplayer game of SunBurn. First, the host:

And now, the client:

There are a number of things to note here.
On the map
* Networked Randomly Generated Map and Fog of War, with MakeItLookShit(TM) technology (patent pending).
* Server based (e.g. it gets the valid moves from the server) silly move indicator to indicate valid moves
* Nifty unit active tiles. Everything either comes from datablocks or the unit and map data. The flag comes from the player's nation info, the number is the number of units on the tile and the left health bar is for health. The other bar is currently unused, but will be used for food once that code is implemented. The unit image is just a frame from an image map.
On the HUD
From the left:
* Currently selected unit, with health bar. This is a custom GuiControl that renders any given sbUnit. It's basically a Torque GUI version of the old unit rendering code.
* The crappy move rate, attack rate, view radius and defend rate placeholder stats.
* The units in the currently selected unit stack. Yes, I finally got around to implementing unit stacking. This is a single custom GuiControl that renders all the units on a specified map tile. It also provides simple UI to select units. Yellow highlight is the currently selected unit, red is the mouse over. When clicking on the unit, the C++ code just calls a script callback to do the grunt work of selection.
The nice thing about the extra GUI controls is all the data comes from the same, single place. That means I only have to have one copy of each unit image in an image map, rather then having the image map for within T2D and a separate image for the GUI.
There is one quite obvious thing in the above screenshots that is different from stock Torque. I don't think anybody will notice it, though. A cookie to the first person that spots it.
TDN Article
I finally got around to putting up an early version of a write up on getting TGE style networking into T2D. You can read it here if you're interested.

And now, the client:

There are a number of things to note here.
On the map
* Networked Randomly Generated Map and Fog of War, with MakeItLookShit(TM) technology (patent pending).
* Server based (e.g. it gets the valid moves from the server) silly move indicator to indicate valid moves
* Nifty unit active tiles. Everything either comes from datablocks or the unit and map data. The flag comes from the player's nation info, the number is the number of units on the tile and the left health bar is for health. The other bar is currently unused, but will be used for food once that code is implemented. The unit image is just a frame from an image map.
On the HUD
From the left:
* Currently selected unit, with health bar. This is a custom GuiControl that renders any given sbUnit. It's basically a Torque GUI version of the old unit rendering code.
* The crappy move rate, attack rate, view radius and defend rate placeholder stats.
* The units in the currently selected unit stack. Yes, I finally got around to implementing unit stacking. This is a single custom GuiControl that renders all the units on a specified map tile. It also provides simple UI to select units. Yellow highlight is the currently selected unit, red is the mouse over. When clicking on the unit, the C++ code just calls a script callback to do the grunt work of selection.
The nice thing about the extra GUI controls is all the data comes from the same, single place. That means I only have to have one copy of each unit image in an image map, rather then having the image map for within T2D and a separate image for the GUI.
There is one quite obvious thing in the above screenshots that is different from stock Torque. I don't think anybody will notice it, though. A cookie to the first person that spots it.
TDN Article
I finally got around to putting up an early version of a write up on getting TGE style networking into T2D. You can read it here if you're interested.
Recent Blog Posts
| List: | 08/20/07 - GID23 and NPC Editor 07/25/07 - Fun with Lua 06/11/07 - How NOT to make a game 11/18/06 - Thinking Outside the Box 11/03/06 - Alive and Ticking: Now with exploding ants 10/28/06 - Fun with zips 10/02/06 - Alive and Ticking gets to Beta .... err, almost. (Warning: Screenshot Heavy) 09/08/06 - Internal Name Operator |
|---|
Submit your own resources!| Jason "TGB BOY" Cahill (Mar 07, 2006 at 09:28 GMT) |
| Tom Bampton (Mar 07, 2006 at 10:19 GMT) |
Here's your cookie:
winWindow.cc, ~line 978 in CreateOpenGLWindow(), change the windowStyle for a non-maximized window to:
windowStyle |= ( WS_SYSMENU | WS_OVERLAPPED | WS_CAPTION );
Since this is public I wont post the whole function. It should be pretty obvious once you see the code, though.
If you want the icon too, in InitWindowClasses() (same file) ~line 935, change the icon resource ID:
wc.hIcon = LoadIcon(winState.appInstance, MAKEINTRESOURCE(IDI_ICON1));
In stock it was set to IDI_ICON2 which wasnt defined in the .rc.
BTW, this is all standard Windows stuff, so you can read about it in the Platform SDK if you want to tweak it some more.
T.
| Dave D (Mar 07, 2006 at 15:31 GMT) |
| Tom Bampton (Mar 07, 2006 at 15:53 GMT) |
T.
| Adam deGrandis (Mar 07, 2006 at 16:30 GMT) |
You must be a member and be logged in to either append comments or rate this resource.



4.0 out of 5


