laztrezort

Members
  • Content count

    428
  • Joined

  • Last visited

Community Reputation

1058 Excellent

About laztrezort

  • Rank
    Member
  1. Draw simple stars like in galaga

    Personally I would take the easy way and just use regular sprites (alpha blended texture-mapped quads). With a simple batching technique, there should be no need to optimize further, even when drawing many thousands of small sprites per frame.
  2. Best engine for developing a 2D roguelike

    Have you looked through the rogue basin articles (http://www.roguebasin.com/index.php?title=Articles) yet?  There are quite a few tutorial/articles for writing an RL in various languages, such as C#: http://www.roguebasin.com/index.php?title=C_Sharp   I've never used those libraries (except for libtcod mentioned above many years ago), but I did roll my own using OpenTK as the rendering backend, using the aforementioned libtcode as an API inspiration.  An older version of my lib can be found here if you're interested (at least until Google Code goes away): https://code.google.com/p/sharprl/.   Note that all of this assumes you are going for a more "old school" roguelike (ASCII or simple tile art, etc.).
  3. Searching for life simulation communities

    Academic artificial life projects tend to be rather niche and based around studying/simulating specific aspects of biology, ecology, etc. Most of them incorporate some sort of evolutionary process and multiple agents. That said, starting at the "alife" page on Wikipedia might point you to some resources. I'm not familiar with Creatures, but briefly skimming the link reminded me somewhat of Framsticks, which uses neural networks to simulate agents.
  4. For the map structure, it can be the same as a typical top-down maze or dungeon game (similar to a rougelike game). Each map cell represents a feature (open space, wall, well, chest, etc.), like each square on a piece of graph paper.   Some old school games represented walls as divisions between cells (the lines between squares on graph paper), so you can have thin walls separating two cells.  This is a bit harder to implement, and it doesn't look like the linked video uses this method.   There are basically 2 ways to go about drawing this, the truly old school way and to fake it using modern techniques.   For the old school approach, each feature (wall, door, chest) that appears at a certain location in the player's view needs is pre drawn on a sprite sheet.  Perspective needs to be baked into the assets.  It gets a bit complicated working out the walls in particular, probably need to work it out on piece of graph paper.  Here is an example "template" where the player is at * and looking north, each number/letter is a wall cell in the player's field of view: 02431 57986 ACB D*E When drawing a view, you will need to take the player location and facing direction and build a list of walls and features in the view, then draw them in the order of the template.  You will also need to have a static list of coordinates to know what and where to draw each wall sprite, depending on where it is in the player's view.  As a made up example: 9 ... A 100,50 80,160 0,20 B ... This might mean that if wall "A" needs to be drawn, copy a rectangular region from the sprite sheet at  position 100,50, size 80,160 to screen position 0,20.  Drawing them in order (1,2,... D, E) and using transparency on the sprites allows use of the painter's algorithm.   This works fine but is a bit tedious to implement (especially creating the wall sprites and getting them to line up in a pleasing way).  That said, I've implemented such system a couple times and had fun doing it.   The other approach, which can be easier to implement (depending on your skill set) and much more extendable, is to fake it using 3D triangles.  Going this route means you just need to have a texture for the walls.  Field of view, lighting, animating movement and turning, fog - all these things are massively easier to add or tweak if using modern techniques.
  5. Text rendering - Minification?

    I don't have the complete code base in front of me, but I believe these are the settings that worked fine for my rendering implementation (likely I was using texture clamping).  That said, the exact settings depend on the rendering methods used.
  6. Text rendering - Minification?

    I implemented BMFont rendering in an OpenTK project, and remember having to tweak the output settings a bit to get the text to look good.  I don't have the config file I ended up using handy, but I remember it taking some experimentation.  The end result is pleasing to me, with both min- and mag- (I just let OpenGL create the mipmaps).  Of course, I suppose it depends on how much scaling you are doing.   Maybe you can post some screen shots of your results, maybe someone might see something there?   EDIT: ah, found the config I'm using: # AngelCode Bitmap Font Generator configuration file fileVersion=1 # font settings fontName=Open Sans fontFile= charSet=0 fontSize=24 aa=1 scaleH=100 useSmoothing=1 isBold=0 isItalic=0 useUnicode=1 disableBoxChars=1 outputInvalidCharGlyph=0 dontIncludeKerningPairs=0 useHinting=1 renderFromOutline=1 useClearType=0 # character alignment paddingDown=0 paddingUp=0 paddingRight=0 paddingLeft=0 spacingHoriz=1 spacingVert=1 useFixedHeight=0 forceZero=0 # output file outWidth=256 outHeight=256 outBitDepth=32 fontDescFormat=1 fourChnlPacked=0 textureFormat=png textureCompression=0 alphaChnl=0 redChnl=4 greenChnl=4 blueChnl=4 invA=0 invR=0 invG=0 invB=0 # outline outlineThickness=0 # selected chars chars=32-126 # imported icon images
  7. Technically, most of the answers to your question depend on what you are doing - but for efficiency, it's better to limit transfering from client to server (or vice versa) as much as possible.   Really, I suggest going through some tutorials, look up "modern OpenGL tutorials" or similar.  Make sure the tutorials are "modern" or at least version 3 or later.  For example, this one http://www.opengl-tutorial.org/ seems good, I believe it was one of the tutorials I skimmed through it when moving from XNA to OpenGL a year or two ago and found it helpful.   After you get the basics, going through the OpengGL wiki is helpful on the nuts & bolts aspects of OpenGL.
  8. Merging textures into one (or as few as possible) larger textures (usually called a "texture atlas") is a standard technique, precisely so the number of draw calls can be reduced.  You just need to give each vertex an appropriate texture coordinate.  Same thing can be done with other material data - the more you can reduce the number of calls, the better performance you will see.  This is the most important optimization you can probably make at this point.   I believe dpadam450 was referring to the same thing with "batching."  This is basically just putting as many vertices in a VBO as you can, to reduce the amount of state changes and draw calls.  In fact, a good amount of rendering optimization is based around sorting data intelligently into batches.   Million triangles is nothing for any modern hardware - as long as you are not making thousands of separate draw calls.  You will find that the difference in rendering speed between batching vs. not-batching is huge.
  9. For the OP:   I assume you are attempting something like shown in this tutorial: http://en.wikibooks.org/wiki/OpenGL_Programming/Glescraft_1   If so, go through that and the following pages and see how they handle rendering.  Notice that they build an entire chunk (16x16x16 or whatever) of cubes all at once an put them in a VBO, and draw each chunk with one draw call.  You can optimize even more (and reduce z-fighting and artifacts when you get to doing lighting) by not building faces that are adjacent to opaque blocks.  Only rebuild chunks when something has changed.   Doing what is shown in that tutorial, you can render a very large amount of cubes without any problem.  Unless I'm misunderstanding something, I don't think instancing is going to help at this point.
  10. Just throwing out some guesses:   Are you using a texture atlas?  Try messing with the texture wrapping modes, and possibly mipmapping settings - the sampler may be catching neighboring pixels in the atlas when scaling down.   Are you alpha blending and the borders of the sprites are (semi)transparent?  Check your blending settings, IIRC XNA uses premultiplied blending by default.
  11.   This is the question I personally would ask before doing this type of optimization.  Depending on the hardware targeted, and what calculations are being done CPU side, I could even believe it would be slower.   The best way to know for sure is to profile, even a quick & dirty "stress test" with FRAPS running (if on PC) in the background could tell you if the easier solution (just let the GPU cull pixels) is fast enough.   I often found that iterating over sprites or other data structures CPU side (for large collections) is usually the bottelneck; pushing everything to the GPU (properly batched) is pretty fast, on modern PC hardware.  However, culling sprites can be important if you are doing heavy calcs on a large set, e.g. physics or collision detection.
  12. Best living engineer?

    you would be surprised how much things can be off in construction, and still work without issues, just cause an architect draws something one way, doesn't exactly mean it'll end up that way.     Speaking for at least civil engineering, this is exactly true.  I always wondered, however, how much pressure the structural engineer endures when he has to give the thumbs up/down on whether that pile for the new bridge/building that is off by 2' is going to be a problem, or worth the ungodly amount of money to tear it all up and redo it...   Also, for the OP, my vote is Dijkstra.  Or, if we widen the definition away from "modern software engineering", then Turing, with honorable mentions to Von Neuman and Shannon.
  13. API's or low-level programming

    "Professional looking" games can be made using just about any level of abstraction, ranging from DirectX to GameMaker or Unity.  The more critical factor, I think, is having a professional art team at your disposal ;)
  14. I was under the impression that Draw Lists were the fastest. I am using shaders, just not for textures. I'm using program 0 to render just textures. As for not using other aspects of modern OpenGl, I want to have this run on lower end computers.I'm not familiar with fixed mode, so I couldn't say on improving performance if you are sticking with that. Be aware, however, that display lists were deprecated way back in 3.1 (or maybe 3.0?), I'd hazard a guess that they are probably 'emulated' somehow by hardware nowadays.
  15. Sorry I'm not going to directly answer your question, but is there a specific reason you are not using "modern" OpenGL? E.g. hardware constraints, portability, or something? It seems to me that the most effective path to optimization is to use a more modern approach - VBOs, Shaders, etc, if at all possible.