Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 19 Nov 2005
Offline Last Active Jul 15 2013 08:20 AM

Posts I've Made

In Topic: Question about the Entity Component System architecture

17 May 2013 - 10:29 AM

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.

In Topic: creating Enemy Bots

23 April 2013 - 02:18 PM

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:




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:





This is a pretty basic way of doing it but maybe it will work for you. 

In Topic: Starting without wanting to find a job

23 April 2013 - 12:25 PM

especially since C++ is a very poor choice of first language (and if you already know another language, you could be using that instead to start building games now)


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.

In Topic: Calculating RPG Loot Drop Chance?

16 April 2013 - 09:14 AM

One should however note that if you give an enemy a weapon to drop, then unless the enemy is entirely braindead, he should actually use it against you, too (99% of all games don't work that way, but I find it a terrible immersion breaker, only topped by skeletons dropping coins (the hell, in which pocket do they keep them?!) and rats dropping pole axes and swords). It just doesn't make sense that a thief dies attacking you with a rusty dagger and then drops a +2 longsword and a wand of fireballs.


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 biggrin.png )

In Topic: Coding Style: Curly Braces

15 April 2013 - 02:16 PM

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.