Game Development Community

How to convert FPS to RTS?

by Joseph · in Torque Game Engine · 06/29/2005 (7:08 pm) · 6 replies

Hi there,

I'm trying to make a RPG game out from the Troque First Player Shooting application. I'm able to click and select my character like what the RTS application does (my game is currently in 3rd person view), but i couldn't enable my character to move to the designated destination. Can someone teach me how to solve this problem?

Also, I've setup bots in the game to assist my character during the mission. How do I enable friendly forces so that my bots will onli attack specific targets/opponents?

#1
06/29/2005 (7:34 pm)
Take a look at what the aiPlayer class does, you will want to generate moves for getting to the desired click destination. You can simply get the destination using unProject() calls for converting gui coordinates to world coordinates, then casting a ray to hit the terrain and you have your destination. Of course that will only let your character move in a straight line, not avoiding stuff, if you want that you will have to look for some sort of fast path finding solution.

As for attacking enemies, just set a variable on your objects that identify them as friendly or foe, and make your AI attack only objects with the foe setting.
#2
06/29/2005 (8:35 pm)
Thanks for the advices but is there any reference codes which i can refer for the click destination? I'm quite loss while trying to convert the FPS to RTS.
#3
06/29/2005 (8:47 pm)
Yes, the RTS Starter Kit.
#4
06/29/2005 (9:08 pm)
Urrmm..sorry to say it but I'm not an expert in C++, so can you kinda post up the codes that i should change to achieve the clicked destination method. I'm not sure which are the codes necessary for converting the FPS to RTS. Will be most greatful if you are able to show me the steps of converting. Thanks alot.
#5
06/29/2005 (9:43 pm)
Oh, that's a different issue. I would recommend Learning C++ in 21 days and OpenGL Game Programming. Also check out nehe.gamedev.net, and only then come back to something as big as Torque.