Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


storm33229

Member Since 09 Feb 2010
Offline Last Active Mar 22 2013 02:49 PM

Topics I've Started

Procedural Level Generation

21 December 2012 - 10:30 PM

I am working on creating a procedural dungeon generator. I'm off to a decent start, but it seems that AAA titles like Diablo 3 and Torchlight use some fairly complex systems to achieve their results. For where I am at now, this is very evident when I use my current algorithm in 3D instead of a simple 2D grid.

 

In the 2D example, the algorithm looks promising - this is deceiving; when viewed in 3D it is obvious that this algorithm will work only for throwback RPG's (think Might & Magic, Doom 98, or more recently Legend of Grimrock). There's nothing wrong with that, but it's not near the level of complexity I want to achieve.

 

I'm looking into this: http://www.uoguelph.ca/~jbrown16/Vvaltchanov_c3s2e12.pdf

 

Any suggestions, articles, papers, etc. are greatly appreciated.


How do I keep enemies from walking over each other?

02 November 2012 - 07:10 PM

How do I keep enemies from walking over each other? If I look at games like Torchlight, Diablo, etc. where there is clear view of the surrounding monsters, I notice that the enemies never walk over each other. I have just implemented the Simple Path scripts in my Unity3D game, but I want to make it so that my enemies do not ever occupy the same space. I cannot simply enable physics collisions; this would result in enemies potentially getting stuck. What is the most common way of achieving enemy/obstacle avoidance while correctly path finding?

Custom Vertex structure

08 August 2011 - 06:37 PM

I am using OpenGL and C to create a 2D rendering engine. I am learning about VBOs and how to use them for non-immediate mode rendering. I have been reading from: http://www.opengl.org/wiki/Vertex_Buffer_Object

The tutorial suggests the following:

struct MyVertex
{
float x, y, z; //Vertex
float nx, ny, nz; //Normal
float s0, t0; //Texcoord0
float s1, t1; //Texcoord1
float s2, t2; //Texcoord2
float padding[4];
};

I do not need the Normal values, and I am unsure how or why there are three texture coordinates for a single vertex.

I think all I should need is Vertex (XYZ), and one Texcoord (s0, t0 <-- still do not know what those mean).

Using Vertex Buffer Objects in OpenGL 2.1 and C

08 August 2011 - 08:43 AM

(I specified 2.1 because my laptop won't go past that version. I would have probably done this anyway since 3.x and on introduces shaders as mandatory?).
Thanks to Wikipedia: http://en.wikipedia.org/wiki/Vertex_Buffer_Object I am starting to grasp how simple it can be to use VBO's (I am still not positive about IBO's?). What I have understood so far is the primary reason to use them is a performance boost gained due to the fact that data is now stored in video memory.

What I would like to know is how I am supposed to use them in a practical context. For instance, all of what I have seen has been setting up one Vertex Buffer Object and drawing one triangle or one cube, etc. What if I want to draw 2 or more? Do I set up a new VBO for each entity that I want to draw? Or do I magically append to some static VBO that I setup early on?



2D Animation in OpenGL

06 August 2011 - 02:23 PM

I've done a little searching on the forums here, but couldn't quite find any one post that outlined how to animate 2d sprites in OpenGL. I have figured out how to clip a part of a texture and assign it to a quad. This would give me a single frame of a spritesheet, and obviously knowing how to do this would make it rather simple to make sprites animate. The trouble is that because I am using TexCoords I do not know how to select certain pixel rects of a sprite sheet to draw. For example:



glClear(GL_COLOR_BUFFER_BIT);
glLoadIdentity();
glBindTexture(GL_TEXTURE_2D, tex);
glBegin(GL_QUADS);
glTexCoord2f(0.5, 0.5);
glVertex3f(0.25, 0.25, 0.0);
glTexCoord2f(1.0, 0.5);
glVertex3f(0.5, 0.25, 0.0);
glTexCoord2f(1.0, 1.0);
glVertex3f(0.5, 0.5, 0.0);
glTexCoord2f(0.5, 1.0);
glVertex3f(0.25, 0.5, 0.0);

glEnd();

This code will draw a texture that starts halfway through and displays the other half so:
OOOO
OOOO
OOXX
OOXX

(or at least that is how I imagine it)

Anyway using TexCoords like this does not seem to be a good way to select which part of a sprite sheet i would like to draw. Are there better ways of doing this?

PARTNERS