Jump to content

  • Log In with Google      Sign In   
  • Create Account

rdragon1

Member Since 07 Feb 2001
Offline Last Active Sep 28 2014 12:06 PM

#4835861 What's the point of C++0x?

Posted by rdragon1 on 15 July 2011 - 07:43 PM

Here's a good reference for the new features/changes:

http://en.wikipedia.org/wiki/C%2B%2B0x

The "point" is simply that it's a next version of the language. It's not "extensions", it's simply an evolution of what C++ is from this point on. The C++ you know and love is "C++98" or "C++03". This version is expected to be "C++11".


I don't think a central focus is to make it easier for beginners to start with. C++ is a high performance systems programming language meant to be able to get "close to the metal", and there are simply tradeoffs to make where adding essential capabilities will indirectly make the learning curve steeper. That said, there are lots of other features (for example, lambda functions) that make obsolete current tedious conventions and replace them with something much more elegant, which will indirectly make the learning curve easier.

In short, it adds lots of stuff and changes the way lots of existing stuff is done. As a C++ developer for several years, I welcome the changes. It will result in less code that's more readable, and get rid of some of the nasty hacks that we've come to love. It will also enable expressing new things, and new idioms will appear, which will evolve over time and make C++ better.


#4835535 unresolved external symbol _IID_ID3D10ShaderReflection

Posted by rdragon1 on 14 July 2011 - 08:18 PM

That's the GUID for the shader reflection interface. You'll also need to link against dxguid.lib

This bit me too. Would be nice if it were in the docs


#4835122 Starting a custom physics engine.

Posted by rdragon1 on 13 July 2011 - 10:03 PM

Hopefully you realize that writing a physics simulation has nothing to do with OpenGL, which is used to draw triangles on the screen.

Christer Ericson's book is a great resource for detecting if objects collide


#4835120 Selecting an Object On Screen, any tips?

Posted by rdragon1 on 13 July 2011 - 09:58 PM

Yeah, loop through the squares and see if the mouse overlaps. Keep track of the nearest one. At the end of the loop, you know what was clicked on. Sounds good.

You have to define what 'better' means. There's lots of opposing ways to make something 'better', and making it better in one direction almost always means making it worse in some other direction.

If you want it "better" in terms of minimizing the number of squares you have to test against the mouse, there's several things you can do. One way is to split the screen into a coarse grid and have a list of squares per tile. Then you get the tile the mouse overlaps and only loop over those squares.

You could organize the squares into more complicated structures like quadtrees, etc. to minimize the number of intersection tests.

There's other ways you could want it to be 'better'. Maybe you want the algorithm to be more paralellizable so you can run the algorithm across multiple cpu cores. In that case I would split the squares into batches, and hand each batch off to a core. Each core will find the 'best' match out of their set. Then take that reduced number of squares and find the best out of that.

Maybe you want it 'better' in terms of memory usage (minimized). Maybe that means you store the rectangles in a compressed format in memory. That may end up having a profound impact on the speed at which you can iterate over and do the intersection tests, but it will take up less memory.


#4831682 Framework VS Engine

Posted by rdragon1 on 06 July 2011 - 02:22 AM

Good / mature engines don't dictate the genre of game you can create


#4829332 Textures will not draw

Posted by rdragon1 on 29 June 2011 - 06:25 PM

After some debugging I am back to "no clue." glGetError returns 1282 all over the place.


Which line is the very first time it reports an error?


#4829319 Textures will not draw

Posted by rdragon1 on 29 June 2011 - 05:58 PM

I think loading the texture is not the problem.


You think, or you know?


#4823536 C++ error with line of code

Posted by rdragon1 on 15 June 2011 - 02:49 AM

http://gcc.gnu.org/onlinedocs/gcc-3.1.1/cpp/Standard-Predefined-Macros.html


#4821919 Vertices, Normals and Indices

Posted by rdragon1 on 10 June 2011 - 05:54 PM

A better way to think of it is you have more normals than *positions*, and positions != vertices. A vertex is a unique combination of a postiion, normal, and whatever other attributes belong to the vertex (uv, color, etc)

Typically data formats (like collada) have a set of indices per vertex - so for a single vertex, it will index separately into the position stream, normal stream, etc. This is different than what GPUs support, which is a single index per vertex that indexes into every attribute stream (typically interleaved) with the same index.

When building an interleaved vertex buffer for a GPU, you'll end up duplicating attributes across vertices. My typical approach is to create an 'index tuple' per vertex when reading the collada data, the index tuple contains the index for each attribute into the source data for that vertex - from there it's easy to take each index tuple and create a unique vertex for the GPU.


#4819633 Super-Basic Physics Engine

Posted by rdragon1 on 04 June 2011 - 10:19 PM

You can do simple stuff by casting rays against the terrain mesh and seeing if the rays intersect the mesh, and where

For instance, take the object's current position, and the new position (that you'd like to try and move to). Start a raycast from some distance above the new position, and cast straight down. That'll give you the height of the terrain at the new position.

If your desired position ends up below the terrain, you're trying to walk up a slope, and the difference in height from your current position and new terrain height is the slope - if that difference is too great, you may want to not allow movement ("too steep").

If the terrain height ends up below your new desired position, you may have just walked off of a cliff (transition to "falling" state + animation?).

If the difference is within some small threshold, you might just want to snap to it, so as to instantly follow the curvature of the terrain

That should give you a pretty basic system to start with.

EDIT: I should mention this assumes your terrain is a heightmap. If that's not the case, you'll need something more complex.


#4738865 Best Game Engine for Beginners

Posted by rdragon1 on 28 November 2010 - 12:13 PM

Quote:
Original post by generic_username
First of all, what program language is most commonly compatible with popular engines like Unreal Engine and others?


Unreal has its own script language (kismet). Lua is a popular script language in other engines, and sometimes as a designer you'll need to involve a programmer, which typically means C++

Quote:
Original post by generic_username
I've only learned HTML so far


HTML is just a way to mark up documents to make them pretty, it has nothing to do with programming


Quote:
Original post by generic_username
Does the Unreal Engine work well for games that aren't shooters? What 3D engine would be good for a 3D side-scroller or game with an isometric view?


first-person vs side-scroller vs isometric are just different camera behaviors - unreal can do all of them, you have to define what happens to the camera when you press left/right/up/down etc. For example - pressing 'up' in a first person game probably moves the character forward, whereas in an isometric game you'd want 'up' to just scroll the camera along the map - the engine has nothing to do with this, it just exposes a generic way to script camera/player behavior to do whatever you want


Quote:
Original post by generic_username
It should be said that I'm more interested in game design than learning complicated programming stuff, but programming seems to be involved in all entry-level positions in the video game industry, so I'm assuming that it's something I need to learn.


There's a number of different types of designers in the industry. It wouldn't hurt to have some programming skill. Technical designers / scripters need programming skills by definition. That said, if you mess with the visual kismet editor in unreal, it might not feel like programming


#4579950 [HLSL] Reflect function and specular light.

Posted by rdragon1 on 29 December 2009 - 02:54 AM

This image shows what reflect() does

http://media.photobucket.com/image/reflect%20vector/jnosof/reflexion.png

In that image, reflect(R,N) returns L, which is exactly what it should return




PARTNERS