Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!

We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Member Since 22 Mar 2004
Offline Last Active Nov 19 2014 03:01 AM

Posts I've Made

In Topic: Thread-safe weak pointers

07 August 2014 - 09:51 AM

I do something quite similar to this at the moment. It's in very early developmental stages but so far i've not noticed a performance hit from my approach. Have you thought about going lock-free and having a flag on each entry that is altered with compare and swap? It might be that you just need to get the cost of your lock down.

In Topic: c++ function pointers

11 July 2014 - 10:14 AM

Use http://www.codeproject.com/Articles/7150/Member-Function-Pointers-and-the-Fastest-Possible

In Topic: (Super) Smart Pointer

11 July 2014 - 10:12 AM

I probably wouldn't have any of this information inside the soldiers or the enemy. I'd probbaly have the GamePlay class store maps of soldiers to targets and a reverse of that map and then each frame (or at some other more appropriate time) have the GamePlay class evaluate the situation and update the maps based on targets going down or so on.


Just do it the easiest way you can because when you come back to debug it in 6 months time you won't be stumped.

In Topic: Engine architecture questions

16 May 2014 - 08:39 AM

The topic of whether it is a good idea to have global pointers to each manager in your engine is an open one. I worked on a commercial game for PC, PS3 and Xbox that had a global static pointer to each subsystem manager, so g_pRenderer, g_pScene etc. I now currently work on a commercial engine that doesn't have subsystem managers but does have lots of static data and a few singletons dotted around for good measure. There are many ways to skin a cat.


In some regards I would say don't worry about. Don't lose sleep over unnecessary architecture that you don't require. When writing an engine its easy to fall into the trap trying to write it too perfectly but at the end of the day no engine, no matter how well written or otherwise, is any good if it isn't being used to make games.


Anyways, to give you an idea for what I do in my engine is have it broken down into to two areas and these are separate libraries. I have Kernel and Engine. Kernel contains a the main interface that Main() deals with and contains the Command, Task, Core (utilities for platform access) and threading. The kernel class allows access to each of its subsystems. The second library has the engine code in it so resource loading, gui, scene management, physics, rendering etc. The engine class provides access to those subsystems. Nothing in the kernel area depends on the engine area, only the other way around.


Circular dependancies do happen and these are more easily identifable if each subsystem requires a pointer to its subsystem dependancies upon construction, for example:


GuiManager* guiManager = new GuiManager(pSceneManager, pRenderManager, pInputManager, pDataManager);


Being forced to pass in pointers rather than just using globals makes you realise something might be wrong more easily.



In short, it sounds like you're on the right track but just focus on it meeting your needs and not some unattainable goal of perfection that noone ever really achieves.

In Topic: C# Custom Popup for DropDown.

11 December 2012 - 11:05 AM

Winforms and .net 4.0