Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 25 Aug 2009
Online Last Active Today, 06:10 AM

Posts I've Made

In Topic: _CrtSetBreakAlloc() not breaking

25 September 2016 - 12:10 PM



Pointers are 8 bytes on a 64 bit system.  :)

I don't know why you'd dynamically allocate the pointer variable itself though, rather than the memory it points to, but that seems more likely than a single wchar_t.



That was my initial thought(that they were pointers), but sizeof(int*) returned 4, so it threw me for a bit.


I have since found that since they are all created outside of main, they are allocated before the call to _CrtSetBreakAlloc() is executed, and this explains why there is no breakpoint in the debugger. This makes me think they are false positives, as they are global state objects. (I use them sparingly so i can quickly implement new ideas, which are then refactored so that the objects they require to function are passed in arguments in their constructors.)


However i still have no method to test this hypothesis.

In Topic: Retrieving World Position in Deferred Rendering

22 June 2016 - 09:44 AM

I'm amazed no one has replied to this yet, so I'll take a stab. Can you debug the shader? If so, try pushing the world space position from the vertex shader to the pixel shader, in the VSOUTPUT,  and then compare results of your depth reconstruction to the WSP you pushed through. It should at least give you an idea of what is going wrong.


I've not worked with linear depth, so i can't comment on #1, but #2 should be using the InverseViewProjection, I can't see the shader but i don't think that's what your variable describes. So it could be you are getting a position in Viewspace. Maybe post the full vertex and pixel shaders so we can see the whole routine?

In Topic: Water rendering

06 November 2015 - 10:44 AM

Damn. That's almost an article-worthy "water rendering 101" right there.

I think the same, and actually just followed this thread so i can digest Promit's excellent reply when i have more time

In Topic: Inversion of control across libraries

06 November 2015 - 10:34 AM

Why can EngineLib not be dependant? Would you ever use engine without graphics and physics? If so, perhaps the stuff that is common to both graphics and physics can be broken out into it's own lib?


I'm not an expert by any means, but i have dealt with an issue similar to what i think you are describing. I bundled up anything math related into it's own library. The graphics library objects includes the headers it needs from this, and the physics library behaves the same way. The engine includes the graphics, physics, and math headers, and the application being worked on includes the engine headers. Since the actual translation units exist only once in their respective libs, I have no issues including each library into the application.


I've even kept the graphics library as agnostic as possible, and created one library that implements a dx9 version(which is what all of my existing code was based on), and another for DX11(which i have slowly been implementing), and yet another for gl4(which i've barely done anything with. The engine only knows about the base graphics library, while the app has the choice of including/linking to the implementation it wants.

#include "GraphicsDX9.h"
App game(new GraphicsEngineDX9( ... ), new PhysicsEngine(...), new InputEngine(...));

GraphicsEngineBase * renderer = game.GetGraphics();

// or

#include "GraphicsGL4.h"
App game(new GraphicsEngineGL4( ... ), new PhysicsEngine(...), new InputEngine(...));

GraphicsEngineBase * renderer = game.GetGraphics();

// etc

Yes it's a bit of the PITA, but it works well enough for what i need.


In Topic: Is the use of path finding algorithms a good idea for dribbling in sport games

28 October 2015 - 03:21 PM

I seem to be doing this often as of late, but i second the recommendation to check out "AI game programming by example" by buckland. In fact, it's probably one of the best "game dev" books i have seen on the subject. Matt actually does a soccer pitch as a multi agent sim. It would definitely give you a good starting point. the key points are that agents use steering behaviors (such as seek, interpose, and wall avoidance) to navigate the pitch.