• 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

668 Good

About jmakitalo

  • Rank
  1.   I have similar topic http://www.gamedev.net/topic/662559-entity-component-system-data-locality-vs-templates/ and I was directed to this bitsquid blog that I found very helpful. Making a manager for each type of component avoids problems with storing inhomogeneous data in arrays. I also liked their idea not to constrain the component managers that much. Different type of components may benefit from different type of component storage and entity<->component indirection. I personally would create base component manager classes for some most typical situations to avoid code dublication.     Use the "swap and resize": move the last item to the place of the removed one and reduce the array size by one. Of course if entities refer directly to component arrays, the one moved component will no longer point to the correct entity. You need to add a layer of indirection: one array stores components, the other maps entities to the components.
  2.   This limits entities of having only one component of a given type. Not necessarily that bad constraint, but kind of unnecessary.     At least in C++, I would try to achieve data locality and avoid such storage.     This is reasonable, but you need to have space for all entities in all component arrays. Some components may be used by only a few entities.   I'm currently experimenting with an approach inspired by the bitsquid blog linked above, where component managers may implement different types of component<->entity indirections. For widely used components, the manager stores a vector of indices to components. For infrequently used components, the manager uses a map. I implemented base component manager classes for these two cases, but nothing prevents component managers from implementing some different indirection.
  3.   This is strange. If you just interpolate the original measurement points to create more data, you are creating data that is linearly dependent on the original data. No new information should emerge.   Did you take the original measurements at the correct quadrature points, i.e., the points where the integration weights are defined? Keep in mind that you don't "integrate over sample points". Surface integral over a set of isolated points vanishes. What you do is make and approximation to a surface integral in the form   int_S f( r ) dS = sum_n w_n*f(r_n)   where w_n are the weights and r_n the nodes of the quadrature rule.   For 2D surface integrals with smooth surface S, you can use the Fubini's theorem to write your spherical integration as   int_0^pi int_0^2pi f(theta, phi)*sin(theta) dphi dtheta = sum_n sum_m w_n*w_m*f(theta_n, phi_m)*sin(theta_n) + E   where E is some error that we are willing to neglect and the weights and nodes are now for some integration over finite 1D interval (trapezoidal, Simpson's, Gaussians, etc.)   The nodes theta_n and phi_m should coincide with your measurement points. If you can choose your measurement points, you should choose them to match the nodes of the quadrature rule.
  4. OpenGL

      The code looks fine to me as far as I can interpret it without further information. Are you sure that your uniform ids are properly resolved? Are you binding the shaders before calling glUniform etc?
  5.   Ok, replying to this goes somewhat off topic, but this is very timely for me.   So you do store the parameters as name-value pairs like I suggested. It's a map. I guess that the Parameter class stores some union of admissible parameter types? Anyway, if you don't cache the values to some C++ types, each time you request a parameter from a resource you will need to make O(logN) lookup of the map, performing string comparisons. This may be neglible in some simple 2D game with a few resources, but I would not use it for rendering complex 3D scenes with hundreds of resources (with multitude of parameters) accessed each frame.   Storing the names may not take more than a few kilobytes, but usually such degeneracy suggests that the design could be improved.
  6. OpenGL

      The value for glUniform1i() maps to the active texture unit, i.e., glUniform1i(textureUniformLoc, 4); corresponds to glActiveTexture(GL_TEXTURE4); This works the same for all types of textures. Only difference is how you access the texture data in the shaders. I usually set the uniform once during initialization when setting up the shaders.
  7.   Do you specifically need interpolation property, i.e., that the approximate representation will take on the sample values at their original locations? Or do you want to get a good overall representation of the function of which you have some limited set of samples?   Technically speaking, to get better approximation when increasing the order of the expansion, the original function needs to be in the L2 function space over a sphere.
  8.   It is normalized by the r in the denominator. In the given formula, the unit vector is given explicitly in the form r/r.
  9. OpenGL

    As NumberXaero suggested, you bind the array to one location, say 1: glActiveTexture(GL_TEXTURE1); glBindTexture(GL_TEXTURE_2D_ARRAY, texturearray); glUniform1i(location, 1); In shaders you use uniform sampler2DArray arrayTex; /* ... */ void main() { float index = 0.0; vec4 color = texture(arrayTex, vec3(texCoord.xy, index)); /* ... */ } The third component of the second argument to texture is the array index. Arrays are great for overcoming texture image unit limitations, although the layers will need to have the same properties
  10.   If I understand correctly, the resources derive from a base class that stores parameters as some name-value pairs.   I have also been thinking a lot how to associate parameters with resources so that they could be easily read from/written to files and perhaps used to automatically generate in-game menus for editing. However, storing the name literals is wasteful. For example, probably most "sprites" contain "frames" parameter. Each resource then stores this same literal for nothing. Also, searching parameters by name is slow, so the values should be cached in actual variables for run-time use.   I think I found a rather good way to overcome these issues. I only store parameters as proper typed variables. For bulk actions (serialization etc.), the resource creates a collection of generic variable objects, which act as mediators. For example: class CSprite { private: int frames; std::string name; public: std::vector<CVar> getParameters() { std::vector<CVar> p; p.push_back(CVar("name", &name)); p.push_back(CVar("frames", &frames)); return p; } }; The generic variables (type CVar) store pointers to the actual data. To construct a resource from a datafile, the getParameters() is called to get a routing to the data. These parameters are only used temporarily. My actual implementation uses a base class CVarBase for CVar<T> and vectors of base class pointers are returned, so this was a simlified example.
  11.   Practically, yes. In the continuous formalism, the expansion factors a for function f are obtained by <img src="http://www.codecogs.com/eq.latex? a_{lm} = \int_0^{2\pi}\int_0^\pi Y^*_{lm}(\theta,\phi)f(\theta,\phi)sin(\theta)d\theta d\phi" /> Where the sin factor is the Jacobian. You can use which ever numerical integration you find most fit. For smooth functions, you could use the Simpson rule for both angles in a nested way. This is enabled by the Fubini theorem for smooth integrands. You might also use Gauss family of quadrature (e.g. Gauss-Legendre) to reduce the number of evaluation points.     I don't know the precise answer to this, but what you are most likely doing with SH basis is not interpolation, but approximation. When you evaluate your function in the truncated SH basis, there is no guarantee that it will interpolate your sample points. If you have only a few samples, you probably get aliasing issues as with the more traditional Fourier series.
  12.   I strongly agree. Storing inhomogeneous data typesafely and without unnecessary typecasting is difficult in C++. The most natural way is to make one manager per type of resource. This also works in other similar problems, such as in entity component schemes (one manager per component).   You may want to check my recent thread http://www.gamedev.net/topic/663222-resource-manager-for-open-world-game/ . I'm still in the process of making a generic resource manager framework myself.   Depending on your requirements, you may want to consider the use of handles to mediate resource usage.     I discourage this approach. It's the "C way" and is not typesafe.
  13. Fluid dynamics can be quite heavy on vector analysis. I strongly recommend that you pick some book on the fundamentals on the matter. Otherwise you are relying on copy-pase process and will start many topics in the future for no good reason. I dont have time right now to dig into how eq 9 results, but I can answer the trivial questions. The two vertical lines denote a norm, most probably the L^2 norm. It is a scalar. Subscript pk just refers to which variable grad operates on. Now that there are several possibilities, this is mandatory. However, I find it a bit bad notation that the gradient is with respect to some specific particle positions. The equations could be written more simply with just generic gradient function.
  14. How is your game map different from a collection of objects? Is it a terrain or some unstructured mesh? Anyway, why not split the map into smaller pieces. Then determine the four most important lights for each pice. Do you anticipate that there will be more than four lights that significantly influence small portions of the map?
  15.   Assuming that the math routines do what I think they do, this seems fine. How do you know it is not working? Have you plotted the result to see if it looks like you might expect from the geometric interpretation of the gradient?   A word of warning: I once tried out particle hydrodynamics for some fluid simulations. I never got good results, because there are alot of parameters to play with and it requires a lot of iteration to get things work reasonably. Worst of all, usually the behaviour depends sensitively on the number of included particles and the chosen timestep. Change the timestep and all other parameters may need to be revisited.