• Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

841 Good

About lauris71

  • Rank

Personal Information

  1. Determining steep rise ahead from heightmap

    I have done something similar by casting ray vertically down one step ahead of player. You record where will the ray hit ground and what will be the inclination. Now if the dH (difference of heights) at hitpoint is less than vertical step limit AND the inclination there is small (i.e. not steep) go ahead and move. If the dH is bigger than vertical step you have hit steep rise. If the dH is smaller but the inclination is high you have potential steep rise and have to test two steps ahead.
  2. Creating GUI **Without** Using Microsoft API

    Which programming laguage(s) are you using? How heavy-duty will this GUI be? Will it just be some forms, lists, buttons or do you need to implement your own specific controls? Qt is good choice. I personally prefer Gtk+. WxWidgets is also free cross-platform widget set.
  3. Virtual Resolution, Scaling, and Assets

    You do not need to create your sprites on 1280x1024 document. You only have to PLAN them on proper resolution. This can be done even with pen and paper - scetch your level layout, scetch the sprites and mark down pixel sizes. Then you will simply draw your sprites marked size and copy them to screen 1:1. As of how should the scaling to be done - it really depends on the graphics library you plan to use. If you are directly or indirectly (through library) using GPU acceleration thrn EVERYTHING is scaled in every frame anyways (just sometimes the scale may be 1:1). But even if you are directly drawing everything with CPU, you should not worry about it now.
  4. Uphill Struggle

    [quote name='3Ddreamer' timestamp='1353716909' post='5003611'] I feel strongly that strategic risk management is always in effect. The sooner the programmer drops a very bad spaghetti source code, then the sooner such person will succesfully finish the next much better program. Sometimes there is a borderline situation which would allow a good decision in either case - stay or move - but Silgen's source code sounds too complicated to salvage in a reasonable time, especially under frustration. The risks of staying with a failed program to repair it are far greater than the risks in the next new project in general. Some things can not be realized in staying with the failed code. Some bad coding habits likely will remain by staying. A new program with the desire to learn things such as [u]modulizing under certain interfaces, inheritance vs encapsulation, discrete variables[/u], and so forth - should be the very next stage of learning for Silgen. [/quote] Agree. But that was exactly what I was suggesting - to abandon code but not abandon game. Even if one starts programming from scratch it usually makes sense to keep the existing non-programming design. Also - even if you start programming from scratch you will normally end using many bits and pieces of previous codebase. The general design may be unreadable spaghetti code but simple parts and algorithms may still be well written.
  5. Unless you are professional modeler and your art is reasonably generic I doubt that you will sell much. Prepackaged game content market is not as big as people may think. Usually the best suggestion is - focus on what you are best at first. If you are programmer, start with programming + placeholders. If you are modeler start with modeling + some quick prototyping in Unity or some other similar tool. Once you have reached to certain stage and are confident that your idea works, it will be the time to think how to organize other aspects of game development.
  6. Uphill Struggle

    It is impossible to tell wether you have undertook too big task without knowing more about you and your game ;) I have been in similar situations where I see how my code has grown into unmanageable mess. But usually at that moment I have already "seen the light" - i.e. what should have been done differently from the beginning. I suggest not abandoning your current project - you have most probably already invested much time into the design of concept, gameplay etc. But be no afraid of starting over - as long as you consider it your learning project. Of course finishing crappy game is usually better than not finishing clean and elegant one - but on the other hand rewriting everything is better than abandoning it.
  7. Installing Linux Right Now, And I Have Some Questions.

    1) I have mostly used Code::Blocks and Emacs. C::B is easier, especially if you have used other IDEs before. 2) I always install mc (file manager for terminal). Most useful things come preinstalled, but you have to manually add development packages - starting from C++ and SVN and ending with development versions of basic libraries. 3) It is very useful, especially if you want to peek "under the hood" of working Linux system. Once you feel comfortable with it, it is usually much faster to do simple file operations in shell than using mouse.
  8. I think there is JFrame.removeAll() But how is your game logic and display implemented? Do you really have to create new JPanel subclass for each game level? I think usually the GUI simply creates canvas (or similar) object and game levels draw onto it.
  9. Blob Shadow

    You can get fragment coordinate (in viewport system) with glFragCoord. Player position can be given with uniform. The problem is that with this approach you are comparing each fragment with player. Depending on your scene complexity this may be complete overkill. Such shadow is basically spotlight with negative luminosity. Drawing quad on ground under the feet of player may be faster solution, especially if you can reuse some other shader.
  10. Shadowmapping in Camera-Space

    When calculating shadowmap coordinates you have to exactly replicate the "light-camera" transformation. In your case you have to perform perspective division: Shadow.xyz = shadow.xyz / shadow.w Then you have to do the viewport transformation to get proper texture coordinates and depth value: Shadow.xyz = vec3 (0.5, 0.5, 0.5) + 0.5 * shadow.xyz
  11. [quote name='bigdilliams' timestamp='1353181211' post='5001820'] I nearly parsed md5 completly, but than I tought about loading a much easier format like collada. I am writing in C++ and iqm/ iqe seems to me much more complex than md5. [/quote] MD5 is so much easier to parse than COLLADA. Do you understand that COLLADA is interchange format that is designed to support many very different applications and pipelines? Thus the format is VERY generic - so generic that using it for simple tasks is often overkill. Have you successfully implemented static mesh loader and renderer? And scene graph wit (animated) hierarchical transformations. You should feel yourself comfortable in transformation matrices before you start doing skeletal animations.
  12. [quote name='mk1x86' timestamp='1353168344' post='5001775'] Indeed I don't need proper refraction, just the illusion. But ordering transparent and refractive objects is certainly an issue. I expect to have refractive objects on top of everything else most of the time but specifically for water planes this is an issue :-( [/quote] At least you can usually avoid transparent objects behind water plane. And you never need two water planes behind each other ;-)
  13. I do not know any other way. Even worse - to have proper refraction it is not enough to simply render all your scene to texture, because you have to render it using "refracted" camera viewpoint. There may be areas that are not directly visible to camera but become visible via refraction. Normally such problems are solved via level design - avoid placing too many semitransparent objects in such way that they need expensive processing.
  14. picking in 2d

    Mathematically speaking you cannot find the intersection of mouse and point/line because the latter do not have an area. What you probably need is finding the distance between mouse cursor and your object - line or point. And if the distance is below certain value you treat your object as "selected". To find distance between two pints you can simply use Euclidean distance formula. Here is an example (in C) how to find distance between line segment and point. You have to test for three possible cases - the closest point to cusrsor is one endpoint, other endpoint or certain mid-line point. [code] static double nr_line_point_distance2 (float Ax, float Ay, float Bx, float By, float Px, float Py) { double Dx, Dy, s; double dist2; Dx = Bx - Ax; Dy = By - Ay; s = ((Px - Ax) * Dx + (Py - Ay) * Dy) / (Dx * Dx + Dy * Dy); if (s <= 0.0) { dist2 = (Px - Ax) * (Px - Ax) + (Py - Ay) * (Py - Ay); } else if (s >= 1.0) { dist2 = (Px - Bx) * (Px - Bx) + (Py - By) * (Py - By); } else { double Qx, Qy; Qx = Ax + s * Dx; Qy = Ay + s * Dy; dist2 = (Px - Qx) * (Px - Qx) + (Py - Qy) * (Py - Qy); } return sqrt (dist2); }[/code]
  15. freeing pointer to const

    The semantics of your key and value is that they are mutable, just not in arbitrary ways. You can free them but not modify them otherwise. Thus the "evil" part is declaring them "void const *" - not casting them to "void *" in free(). But usually you do not worry about such things in C. It is not perfectly type-safe language and was never intended to be. Thus whatever works and is closest to the actual semantics (without inventing too many hacks) is usually the best.
  • Advertisement