Jump to content

  • Log In with Google      Sign In   
  • Create Account


Dave

Member Since 22 Mar 2004
Offline Last Active Today, 10:10 AM
-----

Posts I've Made

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

In Topic: IMGUI

05 December 2012 - 07:14 AM

Thanks for the replies guys, i think given that there is still so much doubt over how some of the issues i mentioned might be solved im just going to revert back to a retained GUI. I know however is solved in there.

PARTNERS