Jump to content
Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.
Posted 20 November 2012 - 12:31 PM
Posted 21 November 2012 - 04:56 AM
Thanks. I havent used a graphics program yet so I didnt know this. Though I question if they will allow the same kind of flexibility and options I'm getting right now.
keeping track of limbs might be too much. Just use sprite sheets and animate that way, simple sometimes is better.
Posted 21 November 2012 - 12:16 PM
Posted 21 November 2012 - 03:05 PM
Edited by BeerNutts, 21 November 2012 - 03:36 PM.
Posted 22 November 2012 - 07:56 AM
Thank you so much for that link. I've read the article and have been implimenting the changes. It took me a couple reads to understand what was going on but I finally get it. I wanted to make sure I understood before I replied again.
There is no right or wrong answer. Whatever makes sense to you is the right way. Do it, and learn from your mistakes.
With that being said, i think your idea of composition is a little too textbook (Personal opinion). Maybe look at some tutorials of what other people are doing. I think this one does a good job of showing how you can use composition in a 2d engine (Obvious issues with the code, but you should be able to work past that) http://www.inverted-...entity-systems/ It's worth reading all the posted parts of the tutorial.
I've been into CBES (Component-Based Entity Systems) for a while. What you have would not be called a CBES. You're Character Object is a traditional object which has defined parts to it. Rather, you should have a totally Generic Entity which hold different components types, like:
Player: This Component is what makes your Player be the Hero.
Animation: This defines how your player animates based on the Player's State
PhysicalObject: This is what holds all the physical properties of your player; Location, Velocity, Mass, Size, etc.
Weapon: This handles the weapon the player uses
Then, there are 2 schools of though on how to control the component; One if the components have all the logic in them, but this requires communication between components (ie, the Weapon Component needs to know where the player is in the world from the PhysicalObject to fire a bullet form that location). It's doable (see my Journal for examples), but I believe I prefer the 2nd method
You can also have the components ONLY hold data, and design Systems that act on and modify the data. So, you would have a Weapon System that gets updated with the entity, and it handles firing the bullet for any entity that has the Weapon component.
You are welcome to look at my Journal (link in my sig) as I've detailed both methods of CBES. It takes a bit to get your head around to really thinking in Components making up the entities, but once you do, you'll be able to see the benefits.
BTW, here's a link to some articles about Entity Systems, and links to some externally developed Entity Systems
Posted 24 November 2012 - 09:15 AM
GameDev.net™, the GameDev.net logo, and GDNet™ are trademarks of GameDev.net, LLC.