[quote="lucid":324uqtj5]vectors in particular seem to have a bad reputation in game dev use
I keep reading that vectors, and the stl in general are very inefficient
and that they are strongly discouraged in game use, and forbidden in some studios altogether[/quote:324uqtj5]
I'm one of the complete-disagreers. The STL, especially vectors, are no slower
than the equivalent code with ordinary arrays and new/delete, and sometimes faster, because they are very cleverly written. In MSVC++, though, you need to define _SECURE_SCL as 0 otherwise it adds a lot of security checking to the STL containers, which is where the myth about the STL being slow may have come from. There's another define for iterator debugging, which is invaluable for debug builds, but should also be off in release builds. Then the STL runs perfectly fast, and it's so invaluable to writing code I honestly don't know what I'd do without it, so I wouldn't hesitate to use it thoroughly in games.
You do have to be careful sometimes though - there are some tricks for optimal performance. Vectors have to resize their internal memory if you insert too many items, which means allocating new memory, copying everything, and freeing the old memory. If you clear() a vector it frees all of its memory, then if you push_back 1000 times it will need to keep resizing its internal memory to fit in the new data. This can be slow, but a useful tip is calling resize(0) returns the vector to an empty state, but keeps the memory capacity, so you'll need to add at least as many items as it used to hold before it reallocates. So if you bear that in mind you'll find vectors are overall at least as fast as not using vectors - so use them!
C: what is sizeof(CRunObject*) can I make a thousand or 2 of these without a crippling ram impact?[/quote:324uqtj5]
The size of any pointer on a 32 bit system is 4 bytes! The size of CRunObject, on the other hand, is not specific - plugins have different sized classes and the runtime never assumes they have any particular size.
Creating a thousand Construct objects is almost universally a bad idea and I can't imagine why you'd want to do that. What are you trying to do?