Drawing circle on terrain
by Mak Andrew · in RTS Starter Kit · 11/19/2004 (4:22 pm) · 7 replies
Here the scenerio :
When i select the unit in the game and press move, there will be circles in green, purple and red indicting the movement area in which the unit can move til. the circle must be on the terrain itself
Currently the solution that may work is to directing affect the terrain texture like the terrain editor, but i believe that not the right, is it
so anyone has a better solution???
thank
When i select the unit in the game and press move, there will be circles in green, purple and red indicting the movement area in which the unit can move til. the circle must be on the terrain itself
Currently the solution that may work is to directing affect the terrain texture like the terrain editor, but i believe that not the right, is it
so anyone has a better solution???
thank
About the author
#2
11/20/2004 (10:15 am)
Hi Zepp, would like to ask a separate question? where will you code in the ai of the rts unit? currently i have done them all in renderimage but quite sure it should not be there
#3
I suggest you look at how AI (very basic) is handled in stock Torque 1.3 (look at the AIManager.cs I believe), and follow through how it accomplishes it's very basic operations.
11/20/2004 (10:25 am)
@Mak: you want to either build your own C++ RTSAiManager class, or write it all in scripts. You are correct, it most definitely does not belong in rendering!I suggest you look at how AI (very basic) is handled in stock Torque 1.3 (look at the AIManager.cs I believe), and follow through how it accomplishes it's very basic operations.
#4
11/20/2004 (10:44 am)
I have create a RTSAiManager myself. But still not to sure of where the ai and the rtsUnit interact hope for your advise thank
#5
AI can query the units and the world for the state of things it cares about
AI decides what to do, given the state of things
AI tells the units what to do.
So, when you issue a (validated) command to a unit, the AI queries units and the world and figures out how best to achieve the command, then tells the units what to do so that the command is achieved.
That's about as high-level as it can get, I think. :) How you want to work this system depends on your game and what you feel comfortable doing. Most RTS games use a multi-tiered system where individual units have very lite movement and attacking AI, then squad management AI directs units in individual squads, and higher-level AI controls more global unit movement and strategy (and perhaps unit production, base building, resource gathering, etc, depending on whether the game has the usual trappings).
As to the original question... the current terrain selection circles utilize code from the projectile light terrain rendering, you could pull from there. You could also look at the shadow-generation code and genk from its routine to draw on the terrain.
I know these answers aren't as detailed as you'd probably like, but time is always the enemy. :) Hopefully this at least is a decent little starting point for ya.
Again, I wouldn't get too hung up or discouraged about implementing any of this stuff. If you find you're having a really hard time working on a particular feature, see if you can pair up with someone who knows more about that particular area and work with them on it. Maybe you'll be able to help them with something in their project in exchange.
11/20/2004 (6:13 pm)
Mak, coding AI is pretty tough for most people, and you might want to hook-up with somebody who's more experienced with it. But to quickly answer your question, you'll most likely want to set it up like so:AI can query the units and the world for the state of things it cares about
AI decides what to do, given the state of things
AI tells the units what to do.
So, when you issue a (validated) command to a unit, the AI queries units and the world and figures out how best to achieve the command, then tells the units what to do so that the command is achieved.
That's about as high-level as it can get, I think. :) How you want to work this system depends on your game and what you feel comfortable doing. Most RTS games use a multi-tiered system where individual units have very lite movement and attacking AI, then squad management AI directs units in individual squads, and higher-level AI controls more global unit movement and strategy (and perhaps unit production, base building, resource gathering, etc, depending on whether the game has the usual trappings).
As to the original question... the current terrain selection circles utilize code from the projectile light terrain rendering, you could pull from there. You could also look at the shadow-generation code and genk from its routine to draw on the terrain.
I know these answers aren't as detailed as you'd probably like, but time is always the enemy. :) Hopefully this at least is a decent little starting point for ya.
Again, I wouldn't get too hung up or discouraged about implementing any of this stuff. If you find you're having a really hard time working on a particular feature, see if you can pair up with someone who knows more about that particular area and work with them on it. Maybe you'll be able to help them with something in their project in exchange.
#6
Unfortunately, AI isn't on our development plate for another couple of months, so I'm probably not the best person to discuss with you the "best" places to set up your AI hooks and controls.
11/21/2004 (4:51 am)
There appears to be a very good discussion on various AI implementation ideas in this thread.Unfortunately, AI isn't on our development plate for another couple of months, so I'm probably not the best person to discuss with you the "best" places to set up your AI hooks and controls.
#7
thank in advance
11/21/2004 (4:20 pm)
Actually the biggest problem that i have now, is to place my Ai class(finish written to a certain degree) into torque engine. However as i'm still new with torque, i'm not too sure of where i can create/change. Hence i will need to know where i can interact the RtsUnit class with my AiManager in Torque engine...thank in advance
Torque 3D Owner Stephen Zepp