Advertisement Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

282 Neutral

About matrisking

  • Rank
  1. Thanks for all the help/feedback.  You guys have given me a lot to think about and consider when designing this.   As far as Hodgman's point that there are different reasons to pursue ECS, I'd have to admit that my reason seems more basic than any of the ones he listed.  It simply seems like a nice, clean alternative to rigid inheritiance heirarchies or potentially problematic multiple inheritance situations.  Does this seem like a strong enough justification for the system in and of itself?   Also, in light of this fairly general goal, what are the pros and cons of storing the components within entities as opposed to in containers or structures that exist outside of the entities?   I'll keep hackin away and update this thread if more questions surface.
  2. Hey everyone, I've been reading up on the Entity Component System paradigm ( has been very helpful) and I think I understand everything I need to implement it except for one thing: Where do the components "live"? Getting into implementation specifics, I'll be writing this in C++. So, for the sake of example, let's say I have a position component, a velocity/movement component, and a motion system which acts on both components. Would it make sense for each entity to have a data member container consisting of pointers to components? If so, how would the motion system keep track of which entities have position and velocity/movement components? Or maybe a better way of phrasing the question is: How does the motion system keep track of which components it needs to iterate over when it runs? When I look at diagrams and read articles about ECS, everything seems to make sense to me. But when I sit down with a pen and paper and try to map out the class relationships, my level of understanding starts to break down. Thanks! Edit: I've thought about this a little bit more, and maybe the a good approach would be to have each system contain a container of pointers to entities that contain a matching set of components. This would mean that every time an entity adds or removes a component, it would have to be examined by each system to determine if it contains the right components to be used by that system. However, this also means that each system doesn't have to go through and check EVERY entity to see if it has the right components in every iteration of the game loop. Thoughts? Am I heading down the wrong path?
  3. What is the long term goal of this series?  I'm in the process of learning Win32 and DX11, so I was excited to see the headline of this article.  However, as I'm skimming through it, it looks to me like the format is geared more towards providing a code sample for people to look at rather than writing a comprehensive explanation of the concepts.     The only explanations I can find in any level of detail are in the code's comments. While some may find that useful in its own right, I don't know if I would really call this an "article" as much as I'd call it a "code sample"
  4. matrisking

    creating Enemy Bots

    It's tough to say without knowing a little bit more about how things are structured, but my first thought would be to do something like this:   Set a variable that represents the odds a bot should appear in a given game frame, let's say it should be 0.1%, so:   BOT_SPAWN_CHANCE = 1   Then, somewhere in your main game loop, just run pick a random number between 0 and 999, let's call it "r", and spawn a bot if r is less than the spawn chance:   if ( r < BOT_SPAWN_CHANCE )   spawn_bot()   This is a pretty basic way of doing it but maybe it will work for you. 
  5. matrisking

    Starting without wanting to find a job

      In my opinion, this is somewhat subjective advice and should be taken with a grain of salt.  Programming languages are tools, and I agree with the sentiment that if you already know how to use a tool to accomplish your goal, it might be a good idea to just go ahead and start hacking away.  Game development is difficult enough without throwing the complexities of C++ into the mix at the same time.   However, if you're thinking long term and you have the patience, building super basic games in C++ as you learn the language might not be a bad way to start.  It's a pretty powerful tool to have in your belt for a number of reasons.  Just my 2 cents.
  6.   I'm the words of Bill Lumbergh: "Yyyyyeahhhh... I'm going to go ahead and sort of disagree with you."   It's interesting advice, but highly subjective and probably better suited for a thread on game design than one on game programming.  Not every game is meant to be highly immersive, so unless immersion is your top priority I personally would just go with whatever's most fun.   (ugh and sorry, I just can't help myself: sure it makes sense for a thief to attack you with a rusty dagger if that's the only weapon he knows how to use and/or is able to equip  )
  7. matrisking

    Coding Style: Curly Braces

    I prefer the first one as well.  Like you said, I think it's much easier to quickly visualize how blocks are nested.  I tend to use curly braces even for one line blocks just because I find it easier to read.  The biggest counter-argument I've heard is that you can fit more lines of code on your screen using the latter.     However, as you seem to be aware, it's a highly subjective topic that will cause a flame war as often as not.  Here's the most "objective" answer you're going to get:   If you're programming by yourself, use whatever is easiest for you to read. If you're creating something new that involves other people, agree on a set of standards when you're planning the project and stick to them. If you're working with an existing code base, adapt to the existing code standards for that project.  
  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!