RTS unit question

Df0edc8d0f85d69e84fcab7c5fabfcb7
0
rego 101 Apr 19, 2009 at 02:34

Hi guys
i’m making an RTS…
i just wanted to know whether i have to initialise all the possible units that will be created during game time by the player as soon as the game starts somewhere off the screen so the player can’t see? and then as the player ‘builds’ the units in game, they are translated into the correct position at the barracks for instance?
is this the right way to be going about things?
many thanks!

5 Replies

Please log in or register to post a reply.

A8433b04cb41dd57113740b779f61acb
0
Reedbeta 167 Apr 19, 2009 at 02:46

Typically, when a new unit is built you would allocate some memory and initialize it at the same time the unit is created.

Fd80f81596aa1cf809ceb1c2077e190b
0
rouncer 103 Apr 19, 2009 at 07:53

Yeh, your thinking too literally, if a guy is inactive in the game, it means hes not in the game entirely, he wouldnt even have a drawing position yet and his ai isnt being updated at all.

But strange you should bring it up in such a way. :)

9cd1fa8d4bb45c93065544fe45c285ce
0
Rubicon 101 Apr 19, 2009 at 10:48

Strange that you need to ask something like that but think you’re going to make an RTS.

Df0edc8d0f85d69e84fcab7c5fabfcb7
0
rego 101 Apr 19, 2009 at 10:58

Thanks to the supportive responses :)
as for the negative one…pffff

9cd1fa8d4bb45c93065544fe45c285ce
0
Rubicon 101 Apr 19, 2009 at 13:12

Yeah, I get a lot of that. Good luck.