Jump to content

  • Log In with Google      Sign In   
  • Create Account

Dave

Member Since 22 Mar 2004
Offline Last Active Yesterday, 11:12 AM

Posts I've Made

In Topic: Hi, Im Dave and I'm an Generic-aholic.

29 April 2016 - 08:25 AM

 

TL;DR: I always try and create generic systems in game, as a result things take longer than if it was a Specific implementation. How do you decide if something should be generic or specific.

There's an old saying that you should "write a solution from scratch once, copy/paste it the second time, and refactor it to be generic the third time". While not hard-and-fast rule, I do find it a useful guideline.

Make yourself always write the specific implementation the first time. When you realise you need the same functionality in another location, it's pretty likely that you now have a better idea of the problem constraints than if you'd have tried to make it generic right off the bat.

 

 

I think the other half of the issue is the mentality of trying to code something to cater for all possible future use-cases which is impossible. If you know of a future use-case then it just becomes a current use-case but one can waste alot of time trying to allow for them.


In Topic: In Game Console window using DirectX 11

26 March 2016 - 05:13 AM

 

The map / callback is much more flexible / extendable than a switch. It also lets many different systems add new console commands while remaining independent from each other (decoupled). Instead of function pointers, std::function lets the 'users' of the system bind lambdas as well, which is nice :)

void SystemA::RegisterConsoleCommands( Console& c )
{
  c.Add( "Foo", [&]( const char* param ) { m_foo += atoi(param); }
}

This is what I do, seconded.


In Topic: In Game Console window using DirectX 11

25 March 2016 - 06:38 AM

Thanks for the links ocornut, it's interesting to see what people have done with IMGUI.

In Topic: In Game Console window using DirectX 11

24 March 2016 - 03:54 AM

The quickest solution would be IMGUI as suggested. I was never convinced it looked that great though and had limited skinning possibilities. I could be wrong though. If my understanding is correct and you wanted to ship the console with your game, it might be better to roll your own.


In Topic: How do you go about a Property System for an Editor?

10 March 2016 - 08:58 AM

This is essentially what Maya does where you declare all attributes in the static initialize function. 

 

 

Just to clarify, my GetProperties() function is called every frame, 


PARTNERS