• 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.

karpatzio

Members
  • Content count

    38
  • Joined

  • Last visited

Community Reputation

143 Neutral

About karpatzio

  • Rank
    Member
  1. I realize that. I do keep all vertex data packed together, and can render an entire model using it. However, I now need several more models that share most of the data of the original vertex buffer, but require more data to be loaded and unloaded dynamically since I cannot realisitcally have it all loaded at the same time.
  2. Thanks for your answer! I do keep all vertex related data together, but I also load\unload more data such as bone animations, texture coordinates on the fly when needed which I prefer to do in separate buffers. What I would like to do is alert when there is inconsistency in the mesh due to errors whille updating such data. I was wondering what patterns or mechanisms others use to find such inconsistencies and handle them.
  3. In my game I wrapped all vertex buffers, index buffers, textures etc in separate classes which make updating, reading and activating more convenient and API independant. Now, meshes are constructed from combinations of all of these buffer objects that can be shared by more than one mesh so buffers are managed in separate containers and are not owned by the meshes.   This raises issues when buffers are changed in such a way that could break the mesh, e.g. having one buffer with position, color with N vertices and anoter buffer with texture coords that was changed to contain M vertices which is different. I was wondering how you guys are dealing with this in your  games\engines.
  4. Thank you both! I guess i'll just have to experiment with my code and walk into dead ends a couple of times until i do find some balanced scheme (for linux\windows\android\iOS at least).
  5. When designing for multiple APIs\platforms, basically there are two options for abstracting differences between the APIs: 1) Defining the low level constructs such as buffers, textures, devices/contexts. And define the basic functioins such as drawing, uploading data to buffers etc. Then have a different implementation file for these constructs per API. 2) Managing these low level details in higher level classes such as perhaps VertexBuffer and Model classes and such, and also have per API implementation files. Which option pays off more in the long run?
  6. Great! I better understand what you're saying now. The main reason i went down the path that i did was the idea that a renderable shouldn't be allowed to render itself in the context of a whole scene. But really optimizations like avoiding unnecessairy state changes, grouping for instancing and all that stuff don't really require me to centeralize my rendering code. Thanks!
  7. I read your blog post, i think thats [i]sort of [/i]what im doing now. Entities, nodes in the scenemanager and the scenemanager themselves dont actually have any API specific code other than "Entity" storing the API agnostic data needed for rendering (position, bounding volume stuff like that) but also the api specific stuff like buffers and textures in the form of say a list of "vertex elements" and "Texture" classes like youv'e talked about in your post that i extend with the information that each API, the handles, sizes and all that. So the general idea is like this: [source lang="C++"]enum ElementType { Position, Normal, TextureCoords }; class VertexElement { .... protected: ElementType m_type; Array m_data; }; typedef std::list<VertexElement, Element Type> ElemetList; class glVertexElement: public VertexElement { .... public: gluint getHandle(); private: GLuint m_handle; GLSizei m_size; .... }; class glTexture: public Texture { ... private: GLuint m_texture; }; class Entity { ... VertexElement* getElement(unsigned int index); Texture* getTexture(); private: Texture m_texture; ElementList m_elements; }; class RenderingQueue { public: std::vector<Entity> entities; } [/source] Then these Entities are attached to nodes in the scenemanager which collects them every frame to dispatch to the API specific renderer in the form of a queue of vertexelements and materials, possibly arranged, sorted and grouped for instancing. Creating an entity and rendering it might go something like this (at the lowest level): [source lang="cpp"]ElementList *elemList = ElementList::create(); elemList.push_back(VertexElement::create(Position, someBufferOfData)); elemList.push_back(VertexElement::create(Normal, someOtherBufferOfData)); elemList.push_back(VertexElement::create(TextureCoords, yetAnotherBufferOfData)); Texture *texture = Texture::create("./texture.tga"); Entity someEntity(elemList, texture); SceneManager manager(...); manager.addNode(someEntity); Renderer renderer = Renderer::create(); RenderingQueue queue = manager.getQueue(); renderer.render(queue);[/source] I guess that what i was more specifically asking is that once the renderer does recieve the entities to be rendered, how do i avoid casting the VertexElements and Textures to the glTexture and glVertexElement. But looking at your code i guess i can subclass this.
  8. Ive been spending the last couple of days making drafts of a directx+opengl abstraction layer and Ive run across some points that make me want to get input. So basically, all the drawing data is stored in an "Entity" class as an abstract VertexDecleration class and some of the data like position and orientation are stored in an EntityInstance class. Drawing data is API specific so i have a glVertexDecleration + dxDecleration etc..... I have a "mesh loader" class that reads a file, creates buffers (on system memory) along with some semantics and stuff. Then the mesh goes through an API specific class, lets call it "mesh\texture binder" that handles VBO, indexing and details like that. Then the entity is stored in a "cache" class. something like this: class Entity { public: Entity(vec3 position, box boundingVolume, .....); private: vertexDecleration m_decl; } template <class BINDER, class CACHE> class Meshloader { typedef shared_ptr<Entity> EntityPtr; public: EntityPtr loadEntity(const std::string &filename); void destroyEntity(EntityPtr); private: BINDER m_binder; CACHE m_cache; } Now, scenes are managed with a scenemanager that handles instances of Entities and is oblivious of the rest of the system, especially to the underlying VertexDecleration type and API. So FINALLY my question is: how do i elegantly collect entities to be drawn and propegate them to the API specific renderer? I know i can just cast upwards and stuff but that feels flakey to me... So, id just like input on how you handle stuff like this in your own code... THANKS!
  9. Thank you alvaro, i like that solution. About the angles what i meant is that i have a container in which i store images keyed by angles. When i want to fetch an image i request an angle and the container will retrieve the image whose angle (key) is closest to the angle i asked for. [Edited by - karpatzio on November 18, 2010 2:21:24 PM]
  10. I would like my animation class to store the frames, but also store a duration or timestamp of each frame. Then i would like to be able to fetch frames according to the elapsed time. I would love any advice on how to approach this efficiently. While at it i would also like to store animations and images at different angles using the same principles only returning the images stored in the closes matching or lower/upper bounding angles. Thanks in advance to anyone who helps.
  11. I would like my animation class to store the frames, but also store a duration or timestamp of each frame. Then i would like to be able to fetch frames according to the elapsed time. I would love any advice on how to approach this efficiently. While at it i would also like to store animations and images at different angles using the same principles only returning the images stored in the closes matching or lower/upper bounding angles. Thanks in advance to anyone who helps.
  12. Quote:Original post by Captain P Quote:Original post by shuwo Now I've got a new problem. Where do I put all my objects? For example, if I have a lot of game objects (sprites) like Enemy, Player, Fish, etc, where do I "create" them? I usually make a Game class of some sort and put them there. It may be useful for certain game objects to have a reference back to the Game object - this would allow your characters to create Bullet objects and add them to the Game, or to ask the Game which other characters are nearby. No need to use globals here, though. If some code needs to know about the Game object, just pass it a reference or pointer to the Game object. This would create unnecessary dependencies, game logic should be handled by other classes. For example create a sprite collection class that would handle collisions, movement and creation/destruction instead!
  13. I played the series and also some earlier games like pool of radiance and such, and if i remember correctly the game asked the player if he wants the clerics to heal party. The clerics would use their current healing spells and gained them again after resting, it also used spare spell slots to memorize healing spells if any are available. I guess the algorithm should take into account which spells have the highest time to HP ratio but thats about as sophisticated i think it could get.
  14. I sent you a pm with a good book that will help you get over your hurdle.
  15. If you use a forward declaration you need not include the header file, fix that in IO.h. Include the tile header file in IO.cpp.