• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.


  • Content count

  • Joined

  • Last visited

Community Reputation

106 Neutral

About mazelle

  • Rank
  1. Quote:Original post by snake5 mazelle: Sure, I'm not asking you to argue. Looks like this is a "bitangent vs binormal" thing anyway. :D Btw, that article you gave says that an entity is one object in the game world. Actually, with real time applications, this is not always the case - for example, no one would want to store each particle as a different entity.. that would really slow everything down... of course, everyone knows that when we talk about particles but there are really more things like that which cannot be divided like that... I absolutely agree. The article I gave is just for sharing, though. It's another way of implementing the system. Actually, I was quite surprised when I read it. I haven't thought of it that way. The way they did it is just much more appropriate for MMOGs (because of the needed database backend).
  2. Quote:Original post by snake5 Quote:If a certain programmer needs to, the design of his system must be poor. Not always. Many hacks are created because programmers just think differently and one needs to make his code work with the other one's code. P.S. Why does everyone keep calling it "entity system", it's not even close to a good definition.. :D I did say (whatever you call it). I wouldn't waste time arguing what it should be called. I would use the term that which more people would attach the idea to when they see or hear the name. I guess for me, many people refer to it as entity system or entity-component system. I also find this very informative: http://t-machine.org/index.php/2007/09/03/entity-systems-are-the-future-of-mmog-development-part-1/ It makes you think of the system as a relational database (data only) instead of classes (data and methods).
  3. I'll just relate to you my experiences when I introduced 'entity systems' (whatever you call it) to our new game. I was a new employee, but I already have experience working with entity systems on my personal game projects. I was tasked to do the physics management of the game and since there was no game object management system yet, it was up to me on how to make those game objects. Looking at the code of the company's previous games, I could say that they are heavy users of static hierarchy. And based on what I saw in their code, there were lots of hacks just to get a certain type to do what it's supposed to do. I'd like to avoid that so I implemented an entity system as the game object management system. At first, they were very confused. They could not comprehend how I was making unique entities. They couldn't see a MinionEntity class or a HazardEntity class which they expected. All they see are a bunch of // prepare a minion entity Entity* entity = entityManager.request(); Transform* transform = entity.addComponent<Transform>(); ... // prepare transform RigidBody* rigidBody = entity.addComponent<RigidBody>(); ... // prepare rigid body MeshRenderer* renderer = entity.addComponent<MeshRenderer>(); ... // prepare the renderer There were many questions, many objections. I got a fight with my lead. I did a lot of explaining. I gave them links to read about. Then out of the blue, someone was able to finish his task using the entity system and defended me. From then on, everyone was using the system. Eventually, they got the hang of it and they found that it's simple and flexible, too. It was smooth sailing from then on. From these experiences, I could say that using entity systems is a lot better than the traditional static hierarchy. Making changes, adding features, removing features are easier (we had a lot of changes). We could delegate tasks to someone else with less worry. For example, a certain programmer would be assigned to code a particular system. All we have to do is request a component from his system, add to our entities, make some preparations for it using its interface, and should be working fine. If that component does not work, or breaks, we knew who to ask or whom to assign for fixing. We also avoided the hack tricks (why do game programmers love them). Most of the time, there's no need to hack. If a certain programmer needs to, the design of his system must be poor.
  4. That is what you call encapsulation. When you make use of member functions, you will have less trouble updating the internal implementation of your class. For example, in your current Wizard class, the mArmor member may be moved or changed (say you change the internal representation or concept of 'armor' such that it can no longer be represented by mArmor alone) but the purpose of SetArmor() will still be the same, to set an armor value.
  5. You should probably look into animation first then. Learn more about the game loop, timing and interpolation.
  6. Most software development companies give you a problem in which you provide a solution using code or pseudo code. What kinds of problems should I expect?
  7. But then some devs (like me) might already be using that construct and they don't know that it's harmful because the compiler didn't say so.
  8. BTW, I just had my proficiency this afternoon. They just let me code a simple game with OOP concepts and such. I think I did very well, though. I hope they call me for the tech interview. This thread has shed light to me to the inner workings of C++. I never cared before. I just use what works. This seems to be a thread ender post already, but I don't want this thread to end. I hope you could still add some mind blowing stuff that most programmers don't know. I wanted to ask this: void doSomething( SomeClass& instance ) { ... } SomeClass returnsByValue() { ... } doSomething( returnsByValue() ); This should be illegal based from C++ Primer because the parameter in doSomething() can't hold unnamed variables. But it works fine in VC9. Is this one of those undefined stuff?
  9. Quote:Original post by Washu Quote:Original post by Kwizatz Quote:Original post by Washu Uh, what on earth are you going on about? The the valid range of pointers within p is [p, p+10]. Note the brackets are "INCLUSIVE" not exclusive. Exclusive would use (). Fair enough, so do you consider k to be in range? does k point to a valid address? *** Source Snippet Removed *** Provided k is within the range of valid values for a pointer derived from p, that is [p, p+10], k is valid. You do not have to be able to DEREFERENCE a pointer for it to be valid. The pointer ONE PAST THE END is valid. Just not dereferenceable. The problem is that you've made the assumption that for a pointer to be valid it must also be dereferenceable, which it does not. I am enlightened. Thank you. Quote: Yeah, the C++ idiom of iterators is based on having a begin and an end marker. For the iterator type for an array, the "end iterator" is the "one past the end of the array pointer". Noted. C++ is hard.
  10. I see. I wish it were possible to access var args like in Java (var args are passed internally as an array). float average( float... values ) { float sum = 0; // say values is std::vector<float> int size = values.size(); for( int i = 0; i < size; ++i ) { sum += values[ i ]; } return sum / size; } Is there something like these being introduced for future C++ standards?
  11. Quote: There's no reason templates have to come into your entity class. All I'm talking about is literally a component type ID. // getComponent() definition, overloaded once per concrete component type template <typename ComponentType> ComponentType* getComponent() { // Use the class's static id value which you've defined as something unique IComponent* c = this->componentMap.get(ComponentType::id); return static_cast<ComponentType*>(c); } Why haven't I thought of that? That's a great idea. All that is left then is to generate a unique ID for every component type. That should be fairly easy to come up with.
  12. My take on this: don't use multiple inheritance to more than one concrete classes. You should only derive from at most ONE concrete class. Others should be pure virtual classes. And my other take: prefer composition over inheritance. For problems like these, inheritance shouldn't be your first solution. Consider if you could compose them. class Sprite { public: // to be maintained in your list (or whatever) of GameObject instances GameObject* getGameObject() { return &this->game; } // to be maintained in your list (or whatever) of PipelineObject instances PipelineObject* getPipelineObject() { return &this->graphics; } private: GameObject game; PipelineObject graphics; }; If you want a customized GameObject for your Sprite, you could have: class SpriteGameObject : public GameObject // inherit from one concrete class only { void update( float timeElapsed ) { // customized update() routines for sprite here } }; // then you can have class Sprite { public: // to be maintained in your list (or whatever) of GameObject instances GameObject* getGameObject() { return &this->game; } // to be maintained in your list (or whatever) of PipelineObject instances PipelineObject* getPipelineObject() { return &this->graphics; } private: SpriteGameObject game; PipelineObject graphics; }; // you could also do the same for your PipelineObject.
  13. void varargReview( int count, ... ) { va_list args; va_start( args, count ); for( int i = 0; i < count; ++i ) { std::cout << va_arg( args, int ) << std::endl; } va_end( args ); } Is there a better way of identifying the number of variable arguments or the last argument other than relying on count? I was thinking if I could do something like this: template <typename BeforeVarArgType, typename VarArgType> class VarArgs { public: VarArgs() { va_start( this->args, BeforeVarArgType ); } virtual ~VarArgs() { va_end( this->args ); } bool hasMore() { // code to identify if there are more variables here } VarArgType getNext() { return va_arg( args, VarArgType ); } private: va_list args; }; so I could do this: void varargReview( int count, ... ) { VarArgs<int, int> args; while( args.hasMore() ) { std::cout << args.getNext() << std::endl; } }
  14. I don't quite get it yet: Quote: Here is the complete list of all sequence points in C++: * at the end of a full expression * after the evaluation of all function arguments in a function call and before execution of any expressions in the function body * after copying of a returned value and before execution of any expressions outside the function * after evaluation of the first expression in a&&b, a||b, a?b:c, or a,b * after the initialization of each base and member in the constructor initialization list Quote: Function calls. The sequence points before and after a function call mean that execution of the invoked function and the calling context is not intermingled: all statements before the function call are executed, the function arguments are evaluated (in undefined order), and then the function body is executed. Similarly on return from the function: all statements of the function body are executed; the return expression is evaluated, and then control flow continues in the calling context with the statement after the function call. Is this a defined behaviour then? int i = 0; int p = i++ + f() + ++i; // sequence points before and after a function call Although, I've got a gut feeling that it is not.
  15. Quote:Original post by Fenrisulvur Quote:Original post by mazelle What do you mean undefined? It prints 0 2 And I got: 1 2 I fed it to Digital Mars C++, though not an up-to-date version. You? VC9 (VC 2008). No warnings either. Weird.