Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 28 Jun 2011
Offline Last Active Apr 25 2016 05:19 AM

Posts I've Made

In Topic: In terms of engine technology, what ground is left to break?

05 April 2016 - 04:12 AM


Unity and UE4 are very flexible, very generic, friendly, very powerful & very portable. But this has come at price of performance where they pale against a custom tailored engine (by several orders of magnitude, I'm talking between 4x & 10x difference)


That's really interestering.  Could you give an example or two where another engine is that much faster than Unity or UE4?



Fox engine seems superior to both Unity and UE4 performance wise.

In Topic: C++11 lambda, modifying copied value

08 September 2015 - 03:02 AM


Also, it's advisable not to store lambdas in std::function objects. 


As you saying, don't store lambdas in std::function unless you need to (i.e. passing a lambda into a function that takes std::function as a parameter), or are you saying never use std::function to store a lambda?


I store lambdas in std::function all the time. Ofcourse if the lambda doesn't need to be stored for later calling, I just use auto, but since I still use std::function alot, I'd like to know if there's a problem with that that I'm not aware of.


Are you saying that std::function's member vars takes a few extra bytes to hold the object, which requires a separate allocation (definitely worth pointing out), or are you warning about something more dangerous? mellow.png



You are right I didn't put that correctly. It's totally fine storing them in std::function objects if there is no alternative to the task at hand.


The problem with std::function is that its the same size for every kind of function it could store, so it does extra allocations if its memory is not enough to store bookkeeping information about the lambda.


Imagine having a game with tons of those small allocations each frame because you just define and store some lambdas. It could hinder performance.

In Topic: C++11 lambda, modifying copied value

07 September 2015 - 04:20 PM

Also, it's advisable not to store lambdas in std::function objects. It might cost extra memory allocation.


The type of each different lambda is known only to the compiler, so use auto instead.

In Topic: Game programming architecture

01 April 2013 - 09:03 AM

A good reading people often recommend is Game Coding Complete by Mike McShaffry. I've read it myself too and I suggest that it is a great one! It covers a lot of introductory topics on game development and game code architecture as well as some advanced ones. It has some great advice on how you can decouple your game's subsystems.


Another good one is Game Engine Archtecture by Jason Gregory. It covers a lot of ground on game engines but in a more abstract manner than the previous one.

In Topic: Any faster way to calculate prime number?

07 December 2012 - 07:29 AM

On a side note, if an integer can't be divided by 2 then it also can't be divided by any other even number, so you can try 2 and then only try odd numbers from 3 to sqrt(x), where x the integer that you check for primality.