Jump to content

  • Log In with Google      Sign In   
  • Create Account


Norman Barrows

Member Since 04 Apr 2012
Offline Last Active Yesterday, 01:20 PM

Posts I've Made

In Topic: comdat folding

16 September 2014 - 12:37 PM


In other words, the actual machine code for the two functions are identical.

 

that's what i thought. i thought it might point out places where i accidentally coded some little routine twice.


In Topic: comdat folding

16 September 2014 - 12:30 PM


Why do your POD structs have constructors? A real POD struct would not need any constructor - all of its members would be left uninitialized.

 

i thought these were weird too.

 

here's zdrawinfo:

 

struct Zdrawinfo
{
int type,         // 0=mesh, 1=model, 2=2d billboard, 3=3d billboard
meshID,       // for models: modelID 
texID,        // for models: aniID 
alphatest,cull,clamp,materialID,rad,cliprng,data[5];
float sx,sy,sz,x,y,z,rx,ry,rz,range;       // range is rng to camera. not currently used.
D3DXMATRIX mWorld;
};
 
its used as a parameters list for drawing calls.
 
and drawrec:
 
// drawlist record
struct drawrec
{
int meshID,texID,alphatest,cull,clamp,materialID;
D3DXMATRIX mWorld;
float range;
};
 
this is an actual entry in the render queue.
 
to draw, you fill in the info in a zdrawinfo struct, then call  a drawing method:
Zdraw - adds mesh to render queue, creates world mat from eulers in the zdrawinfo struct
Zdraw2 - adds mesh to render queue, uses world mat from the zdrawinfo struct
Zdraw_immediate  - draw_indexed_primitive mesh, creates world mat from eulers in the zdrawinfo struct
Zdraw_immediate2 - draw_indexed_primitive mesh,  uses world mat from the zdrawinfo struct
Zd - adds item to render queue, based on type specified in the zdrawinfo struct (mesh, model, 2d billboard, 3d billboard)
 
when an item is added to the render queue, the info in the zdrawinfo is used to fill in the info in the drawrec. the render queue is an unordered static array of drawrecs, and uses a 2d bucket sorted index for drawing. as drawing calls are made, they are added to the queue and to the index.
 
and the two structs are not identical....   most strange.
 
"Indeed, most curious", as Spock would say...

In Topic: Feeling lost with motivational issues in relation to game development

14 September 2014 - 05:39 PM


things happened that seemed to suck out that naive "innocence" of programming and game development for me.

 

perhaps, having worked in the industry, its now old hat?

 


At home, in my spare time, I've still attempted to start game projects and finish them. However it just seems to fail. I have a hard time finding the "spark" anymore.

 

and thus, its no longer play, just gruntwork ?

 


An evil circle of feeling the pressure to have to make something so I can prove to myself that I'm still the developer that I was when I was younger. An increasing need to produce results so others can see that I am indeed a good programmer. This, coupled with the fact that I never seem to be able to finish even simple projects because I just lose the want to do it, have just made me lose all motivation and drive.

 

there's a big difference between being able to do something and wanting to do it.

 


If I have to develop more games, it shouldn't be because I feel like I need to. It should be because I feel I want to.

 

perhaps you subconsciously feel pressure to meet work level production quality on your "for fun" projects?

 

 


I still feel like I have an inner, desperate want to be creative and make games

 

figure out what sounds like the most fun to make and make it. to heck with everything else.

 

you might also try a google on:

 

"7 causes of procrastination and what to do about them"

 

you might also apply the typical post-mortem analysis to your unfinished projects, as to why they were abandoned.


In Topic: forget c++

14 September 2014 - 05:23 PM

programming language skills are like human language skills, they grow with use, and get rusty with disuse.

 

when coding in two or more different languages on a daily basis, its possible for the syntax from one to slip into the code of the other, especially if the two have similar but distinct syntaxes.  But just like being bi-lingual in human speech, eventually you'll find yourself equally comfortable thinking in your native langauge (such as english or whatever) or in C++, or C#.

 

learning two at the same time means it will take longer to learn each, since you're dividing your study time between two subjects. unless you only do c++ when you can't or wouldn't normally do the c# work.


In Topic: How do you manage object pools in your engine/game?

13 September 2014 - 08:14 AM

the old school way:

 

a statically allocated array of structs.  each struct has an "active" field (boolean).

 

allocate: findfirst inactive, return index, use it.

 

deallocate: active=0;

 

there is one array for active entities, and a second for active projectiles.

 

very clean code.  runs very fast.

 

runtime memory allocations are limited to local variables created on the stack, and perhaps one explicit malloc and free of a huge buffer for reading in the exe file and calculating a checkcsum.


PARTNERS