Is using custom scene nodes for my diffrent "actors" (Towers, Enemys, etc) a good idea, or am I gonna cause trouble trying to do that?
Also, for clarification: My game is a Tower Defense game (its like an RTS, but without units for you, and no buildings for them...) however I'd like to reuse as much of my code as possible in the future. However, in particular with an Tower Defense game, there are a nearly infinite number of objects that are constantly being destroyed and created.
BTW> And actor is basically, anything in the scene. Although, certain things (EG: Skybox or the level terrain, and maybe some static elements) won't be considered actors.
--------------------------------------------------------
Ok, I've been spoiled by my long-time use of Game Maker and want some opinions here.
Game Maker has always managed objects for me; running them (like running thier step events every frame), destorying them, etc.
And I haven't done object management sutible for a game for a long long time (Blitz Basic, wooo...) and I want a second opinon (or third, fourth...) on wether my method is a good one.
Basically, I have the following system that I call the actor manager:
I have a base class called act_basic that all actors are based on.
In the actor manager I have a core::array<act_basic*> that is used to keep track of the actors.
The main job of the actor manager is to "run()" the actors.
run() is called in the main game loop and loops through the actor array and tells them all to execute thier run function to interpet thier individual functions.
Here comes the main part I am concerned about: In order to keep the game from slowing down when alot of actors are being destoryed (because this might involve actor_list.erase, which warns that it is slow in the API docs) I instead "drop" them (similar to Irrlicht's IReferenceCounted::drop function, except it simple deletes the class, no grab stuff.) then put NULL in that actor's slot.
Then, in special times I call a function called cleanup() that does two things: A) Destroys all of the old slots. and B) Updates the id variable of all the actors (I have some ideas on how to remove this.)
Then, after that night when I wrote all that code; I thought "Wait...can't I just use a custom scene node for all this?"
But then I remembered from my Game Maker days on how it is a sin to do any major logic code in the Draw Event (like the render() function in the CSNs are far as I know) but then I thought "Well, when does Irrlicht do its animation stuff?" (Ya know, like the Rotation Animator?)
--------------------------------------------------------
So, all these things and more are flying about my brain, so I figure I'll get opinions from a few other people...
Do you think I am overcomplicating it with the Actor Manager?
Do you think that I am going about all this the wrong way?
Do I need to go back to Game Design 101?

Can I use Custom Scene Nodes (or even something better) for my actors.
Sorry for the long post, and sorry if this seems stupid.
~DtD
PS> Also, I wasn't sure if this should go in the beginners forum or the game programming forum.
PS2> Also, I tried searching some things, but I can't seem to find something relavant...