If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Re: noob error: spawning entities from file.

Not really related to your question, but since you are clearly making a game, you might want to google component based entities and data-oriented design. A rigid hierarchy of entity classes and arrays of structures can be a performance and programming nightmare when it comes to video games.

Re: noob error: spawning entities from file.

@Deyili
thank you very much

@D Drmmr
thanks, apparently I need to do some more research on how std::vectors work.

@Chris F
thanks, yeah I had heard about component based Entities. Is it simply for the sake of minimizing inheritance? All the stuff I've found on DOD is for people who already know how to make an OOP engine, and I don't really know enough yet (obviously)

Re: noob error: spawning entities from file.

Originally Posted by UVmatician

@Chris F
thanks, yeah I had heard about component based Entities. Is it simply for the sake of minimizing inheritance? All the stuff I've found on DOD is for people who already know how to make an OOP engine, and I don't really know enough yet (obviously)

It's meant to avoid the pitfalls of inheritance as it is often implemented in game object hierarchies. Using the traditional approach, you inevitably end up with either a lot of redundant code or you end up with an oversized base class. It's really an anti-pattern, and component based systems alleviate some of that, although they can still use inheritance to accomplish it.

OOP isn't necessarily bad for games, but the traditional OOP approach is not good for performance. Here is a good article from Sony on the subject.