Game Development Community

Torque 3D 1.2 RTS Prototype - suggestions please.

by Richard Ranft · in Torque 3D Professional · 05/17/2012 (11:40 am) · 56 replies

I am reviewing and revising this document and I would appreciate any input that any of you have on the topic.

In order to bring it more in line with the FPS Tutorial I am adding some additional clarification to file locations and multi-step processes, but I have been wanting to bring this up to speed with full functionality in multiplayer as well in both hosted and dedicated server modes.

Thanks everyone!

About the author

I was a soldier, then a computer technician, an electrician, a technical writer, game programmer, and now software test/tools developer. I've been a hobbyist programmer since the age of 13.

Page «Previous 1 2 3 Last »
#1
05/17/2012 (12:00 pm)
Omg sounds awesome! *Drool*
Great intiative Richard! Indeed very much welcome! Too bad i haven't completed the RTS tutorial so can't come with input for you.
But i would love to read it when you get the multiplayer bits up!
#2
05/17/2012 (1:48 pm)
As it stands right now it should work in multiplayer except for the target marker decals - The camera code worked in hosted and dedicated server modes when I wrote the Adventure Prototype. I know one of the community members found a way to handle the decals across networks, but I'm thinking I don't want to broadcast my movement target to all players so I haven't decided on how to proceed with this feature....
#3
05/18/2012 (1:47 am)
I'll be doing that very soon Richard. Maybe as early as tonight. So I'll post any suggestions here if I have any. No promises though. I was going to integrate the UAISK to my new project before doing the RTS tutorial, but I guess you'd prefer we do this on a clean project?
#4
05/18/2012 (10:03 am)
@Dan - Either way is good. If you integrate UAISK first it will point out potential issues for others who may want to do the same thing. This would let me tweak it to be more generic - so that you could plug in UAISK or GuideBot or whatever with less hassle.
#5
05/18/2012 (5:21 pm)
Okay here's quick progress report.

Everything seems to implement normally even though a few of the scripts we're editing are already changed by UAISK there ws no problem.

However I have run into a general problem. In the section Mouse Cursor Toggling after

Quote:The function call being modified is GameCore::spawnPlayer(%game, %this, %spawnPoint, %noControl), located in game/core/scripts/server/gameCore.cs. The last two arguments determine the location of spawning (%spawnPoint) and whether or not the actor object controls the camera (%noControl). We need to address that next.

Immediately below the %game.spawnPlayer() function, add the following code:

// Set camera to Overhead mode
commandToServer('overheadCam');

I run into hurdle. I run the game but am faced with the default FP view. Not the orbit cam. That's after deleting the DSOs and mking sure there is no config.cs.

That side, there's a line that follows this saying

Quote:Once we add the server command serverCmdorbitCam() this will set us up to correctly control the camera from the new fly mode.

Which doesn't make sense to me at all. There's nothing following to do this.

Anywy I'm now stuck. I'll start again later and see if I made mistake somewhere.
#6
05/18/2012 (7:11 pm)
Okay, this is embarrassing. I only now noticed that one of the scripts I'd edited was still open. ie; I hadn't saved the changes. So a big facepalm for me.

I'm still curious to see why serverCmdOrbitCam() was mentioned in this particular place in the doc. I'm guessing I'll get to that, but it's still a bit weird just appearing here.

So to recap: I have the orbit cam working fine now, and just need to implement the mouse pointer stuff. So yeah, no problem using this tutorial, as is, even with UAISK.
#7
05/18/2012 (8:03 pm)
Everything's been going swimmingly, with the following exception; in game/scripts/gui/playGui.cs I made this change

function PlayGui::onRightMouseDown(%this, %pos, %start, %ray)
{
// find end of search vector
%ray = VectorScale(%ray, 2000);
%end = VectorAdd(%start, %ray);

// only care about terrain objects
%searchMasks = $TypeMasks::TerrainObjectType;

// search!
%scanTarg = ContainerRayCast( %start, %end, %searchMasks );

if( %scanTarg )
{
ClientGroup.getObject(0).player.setMoveDestination( getWords(%scanTarg, 1, 3) );
}


But when I go into the game I have no rmb functionality, and seem to have lost my (previously working) lmb building placement. BoomBot spawns with no problem. It's AIPlayer class and BoomBotData datablock. I'm really confused here, as everything looks to be sweet. I just don't get it. Maybe we've run into a possible discrepancy here? I don't know.
#8
05/18/2012 (8:14 pm)
Richard, sorry about the mess of posts here, but I need to report as things happen. It's just how I work.

It seems that when we implemented the building-on-clicked-terrain it was bound to the RMB. But later we're making the RMB the go-here command. Surely we need this to be the LMB? Maybe alt+rmb? I believe the rmb go-here command was working earlier, but I was clicking on terrain that the player/aiplayer can't traverse. Seems to walk where I tell him now. Go figure. Still, are we meant to be able to build the orc house as well as move our bot?
#9
05/21/2012 (6:03 am)
This is something that I thought was odd when I reviewed it the first time - September 2011 - but left as it was because it did show how to do things. But now that you bring it up (shows that I'm not the only one who finds it odd) I will add that to my list of things to change.

I am trying to avoid making this a huge document, so perhaps I'll add another that explains how to make some UI additions like clicking a button to spawn an object as a "ghost" (ie half-alpha) and then place the object on the next click (sort of a prequel to the RTS Prototype I guess). Or maybe I'll combine it.

Anyway - no worries; that's the point of this. I wanted some feedback on this so that I can make it clearer and more useful. So thanks for taking the time to go through it!
#10
05/22/2012 (9:51 am)
Ok, I've decided to replace the initial right-click to place a burrow with a segment explaining how to get a GUI element hooked up to start the placement and handle the onMouseDown() appropriately. So there will be a "button" added to the GUI in the bottom right corner; if you click it you will enter 'placement' mode and your next left click will drop a burrow.

To get a placement reticle or other feedback requires at the least a small source edit, so I'll save that for another time. There is a resource (or maybe it was a thread) that explains how to do this for spell effects anyway, and it was in the last few months so it shouldn't be too hard to find.
#11
05/22/2012 (2:37 pm)
There are still some irregularities with multiplayer -

If you try to run it under a dedicated server there seems to be an issue with the camera initialization that causes a hang.

If you host and someone joins your game the host's camera will be centered over his head.

If the guest is killed and respawns, the host's camera will be centered over his head.

Occasionally there is an issue with loading one of the shader files - probably something to do with them being procedurally generated....

The movement marker only shows up on the host's side for the host. The guest can't see his own marker.

However, in a single-player setup it appears to be working fine and it mostly works in multiplayer as well - you can place buildings, kill each other, move around, etc. I'll keep looking for a way to correct the issues I've found so far and I'd appreciate any input on features or fixes. The document should be updated shortly, so please give it a quick read if you have time.

I'm also exploring "rubberband" selection options. The functionality is in the editor code, but is not exposed in game without some tinkering in source as far as I know. I was considering manually constructing a volume based on mouse input and then selecting the objects withing via script, perhaps using a bitmap control for visual feedback during selection. I think it would not be too hard to implement the shift-click selection add though - just add the units to a simgroup as you go and then give them all the same final command.

#12
05/22/2012 (5:51 pm)
Quote:
The guest can't see his own marker.
How about using an object instead of a decal - can't objects have per client visibility?
(thinks he had a conversation about this with someone many moons ago, but can't remember the answer)
#13
05/22/2012 (5:54 pm)
I think that if you create an object on the client it's only visible to that client - I had it working with an object on the server, but then everyone knows where you're headed....

My latest problem is that Boom Bot doesn't seem to have the correct blend animations for proper aiming ( or something, it seems to aim upwards when its backing up, but otherwise appears to have a fixed aim point ) - makes it tough to get the aim offset to work.
#14
05/25/2012 (10:09 am)
This thread discusses how to fix AFX to work with the RTS Prototype. If you have AFX you know that it uses the right mouse button for its free-look behavior. This is a source change, so you'll need to own AFX to apply the fix.

Of course, you could always just add the move code to the left mouse button - just tell the AI to move to the spot clicked if there is nothing to attack.
#15
05/29/2012 (5:54 pm)
Ok - small update - Clicking on the "burrow" button allows you to left-click to place a burrow. Left-clicking the burrow spawns a new bot equipped with a rifle and the standard ammunition loadout. I have multi-selection working and the bots will move together, attack together and can be de-selected by clicking anywhere away from the units or by selecting a single unit.

However, I seem to be having an issue getting shift-left-click to work. Right now ctrl-x enables multi-selection and left-click selects. Not very cool, really.

Next, the decals get confused as to which bot they belong to. I'm fiddling with several weird options....

The thing is, I'm keeping this all in script so that the people with the Demo can follow along if they want. It's a little limiting, though....
#16
06/28/2012 (7:28 pm)
Was wondering if there was any movement on this Richard. I'm really interested in seeing the updated RTS Prototype tutorial. Been messing with the existing tutorial as well as the new engine. Thanks for all the hard work on the old tutorial!
#17
06/29/2012 (9:23 am)
Well, I thought I had a good thing going there, but as it turns out I will have to make another pass at it. I'm still working on it, but at the moment we're shy of QA resourcess - so I have to try to find people who can devote some time when they're not busy to try to run through the revised tutorial. As you may surmise, it's tough to QA your own documentation. It is a matter of perspective; I wrote it so I slide right back into the frame of mind I was in when I read it and can follow along easily, where someone else will miss a turn and end up hopelessly lost because of an odd phrase I used.

Anyway, TL/DR: Still working on it, hoping to have it done soon.
#18
07/26/2012 (10:29 pm)
Still on it - Making a third pass and trying to get some more input. I did notice this time around that I have a bit of code that is out of sequence - It breaks the game until significantly farther down the page. I'm going to correct that and try to finish my last pass over the weekend. Then hopefully I can get a little QA time and get it posted to the site.
#19
07/27/2012 (6:53 am)
Good going Mr. Ranft. :)
#20
08/15/2012 (8:50 am)
Just out of curiosity, is the tutorial gonna be only for multiplayer?
Page «Previous 1 2 3 Last »