Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 24 Oct 2012
Offline Last Active Yesterday, 08:41 AM

Posts I've Made

In Topic: FBX model load

10 August 2014 - 01:56 AM

Tell me what format 3D models for games is better to choose?


Games usually have their own model formats to keep runtime dependencies low and loading performance high.

In Topic: half life 2 / source engine shadowS?

17 June 2014 - 07:42 AM

If the shadow edge is jumping, you should move the shadow casting light in texel-size increments. See the following link, especially chapter Moving the Light in Texel-Sized Increments:

Common Techniques to Improve Shadow Depth Maps

In Topic: What happens if I don't deallocate dynamic memory on application exit?

11 June 2014 - 12:48 AM

Operating system frees it, but does not necessarily overwrite it, so if you have passwords etc. in memory, you should overwrite them.

In Topic: how to design my programs and games structure?

06 June 2014 - 11:20 AM

Separation of Concerns

Separate different parts of your code into logical units. For example, file system access could be in its own module so it can be replaced more easily when porting to another platform. Also, don't mix low-level UI code and game logic so it's easier to replace UI libs if needed.


DRY (Don't Repeat Yourself)

If you find using a chunk of code in several places, extract a method and replace usages with a call to that method.


Tell, Don't Ask

If you find some object getting various data from another object and performing logic on it, consider moving the logic into the target object's method instead.


Avoid magic numbers

Unnamed numbers are confusing and if a certain value is used in many places, updating it will easily lead to mistakes when you forget to update all occurrences. Use well-named variables instead.


Avoid excessive branching

Control flow is hard to follow if there are many nested branches. Some branches can be converted into methods.


Declare variables close to their usage

The smaller the scope, the easier is your mental load.


Express intent

If you find yourself doing a for-loop to find a value from a collection, use a specific find-method instead. It makes it clear to the reader what you're doing.


Comment "why" instead of "what"

Don't write in comments things that can be seen from the code.

In Topic: better 3d model file

03 June 2014 - 04:24 AM

You should write your own model format to keep engine runtime dependencies and loading times to the minimum.