Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

Conoktra

Member Since 31 Aug 2010
Offline Last Active May 02 2013 11:09 PM
-----

Topics I've Started

Template specialization and class references

15 March 2013 - 09:16 AM

Consider the following:

 

class Vector3 {
public:
	f64 x, y, z;
};

// pass an unkown userdata type to lua
template<typename T> inline void luaPushArg(lua_State * const LuaState, T arg) {
	tolua_pushusertype(LuaState, (void*)&arg, typeid(T).name() + 6);
}

void testFunction(const Vector3 &v) {
	luaPushArg(LuaState, v);
	luaCallFunction("TestFunction"); // CRASH (only sometimes though!)
	luaPop();
}

 

 

What went wrong here?  Can you spot the bug?  This one was a real pain in the tush.  luaPushArg() would work with all my specialized types (int, float, etc) that I was passing to Lua, but when I passed classes it would sometimes crash.  Turns out that luaPushArg() is taking a T arg instead of a T &arg.  This means that a new copy of 'v' is created inside testFunction() when it calls luaPushArg().  luaPushArg() then pushes the newly created object onto the Lua stack.  Upon luaPushArg()'s return, the pointer too the class object that was just pushed onto the lua stack is now invalidated.  Sometimes it would crash, sometimes it wouldn't.  This one was a real nightmare.

 

 

Hehehe biggrin.png.  I can't wait for C11 support in GCC, that way bugs like this can be avoided using type-generic expression macros.


Pay someone without PayPal

04 September 2012 - 09:11 AM

Hi Posted Image

I need to make payments to a freelancer who lives in Sweden. He has requested that we not use PayPal (eg "paypal is stealing my money!"). Ive looked into doing an International Wire Transfer but it would add a 15% overhead to my costs. I looked into Western Union and it didn't work out for many reasons (very poor customer support being one of them). Money Gram only supports physically going to an agent and picking it up but that's not an option because I would prefer to just do it electronically (minimal hassle on the client). The US post office doesn't do money orders to Sweden. I have no clue if I could send him a check (or a prepaid visa) and if it would work over there.

Does anyone know what the best way would be to pay someone in Sweden? Maybe I will pay him in fruit-baskets from an online gift shop xD.

Assimp only importing some bones?

10 July 2012 - 10:59 AM

Hello!

I have written a tool based off of Assimp that converts collada/fbx models to a custom format. For some reason assimp is omitting some of the mesh's bones from the aiMesh::mBones list, but they still appear in the aiScene::mRootNode node tree. This causes my converter to mangle the bone tree structure, because some of the bone's parent bones don't appear in the aiMesh::mBones list!

Here is an example. The "RiggedModel_Final_FootNull" gets omitted from the aiMesh::mBones list but its children are not. Why does assimp do this and how would I fix it? It would be great if assimp would store all bones in the bone list.
<node name="RiggedModel_Final_FootNull" id="RiggedModel_Final_FootNull" sid="RiggedModel_Final_FootNull" type="JOINT">
				  <matrix sid="matrix">-0.059679 -0.519840 0.852176 6.103344 -0.147692 0.848900 0.507499 -0.000000 -0.987231 -0.095573 -0.127438 -0.000000 0.000000 0.000000 0.000000 1.000000</matrix>
				  <extra>
					<technique profile="FCOLLADA">
					  <visibility>1.000000</visibility>
					</technique>
				  </extra>
				  <node name="RiggedModel_Final_Outtue_L" id="RiggedModel_Final_Outtue_L" sid="RiggedModel_Final_Outtue_L" type="JOINT">
					<matrix sid="matrix">0.922692 0.327107 -0.204061 1.479940 -0.312313 0.944503 0.101859 0.000000 0.226055 -0.030253 0.973645 0.000000 0.000000 0.000000 0.000000 1.000000</matrix>
					<extra>
					  <technique profile="FCOLLADA">
						<visibility>1.000000</visibility>
					  </technique>
					</extra>
				  </node>

I really appreciate any and all help!

Thanks.

3D model format nightmare

14 June 2012 - 10:40 PM

... Someone please wake me :(.

I have an artist who is providing me 3D content that I then need to import into my custom video game engine (screenshot bellow). The engine is writting in C, uses OpenGL and has all the bells and whistles modern games have.

I went ahead and implemented support for the Doom 3 model format (*.md5mesh and *.md5anim) because I have had experience with it in the past. But, it seems to be a relatively dead format because no matter what I try there seems to be no way to get the models from Maya to the MD5 format my engine supports (short of writing my own converter, which takes time and money, both of which nobody has enough of :P). I can't seem to find documentation, source code, or anything that would provide me with alternative formats, exporters, or model loading libraries that would solve this problem.

(very) long story short, this is where you guys come in. I am looking for some way to get a model from Maya into my game with minimal effort. Should I be using a different format? Is there a C library capable of loading common formats? If I could just plop in "X" library that loads/animates/etc a model format Maya can export too, I would be extatic. (keeping in mind it needs to support skeletal animation)

I'd also go for a good code reference if someone can point me in the right direction. Regardless, I appreciate any help in the area!

Thanks.

Best practices for 3D video game art

24 May 2012 - 10:41 AM

Hello!

I have a few questions regarding how 3D art should be developed for a video game.  I was hoping someone with experience in this area could help me out.

First some background information - this is for a RTS game.  The game engine uses Skeletal Animation via the MD5 model format.  My artist is providing the model in the COLLADA format (I then convert it to the MD5 format the engine needs).  Our aim is for high quality graphics but we keep performance in mind since it is a RTS game with large-scale battles.

  • For an animation do you need a begin animation, loop animation, and end animation?  So for a worker mining resources would it need a "begin mining", "mining loop", and "end mining" animation?  I wouldn't think so, because the skeletal animation should smooth the transitions, right?
  • When rigging the model, do you want to minimize joints or do you want to create a complete rig with all the support bones?  And what is the difference?  The engine does use a physics simulator for unit deaths, so when they die they fall into pieces on the ground, if that makes any difference in the answer.
  • How is the best way to organize animations in the COLLADA format?  Is it best to export each animation as a separate model, or is there a way to organize them inside a single model file?  Keeping in mind that I am converting it to the MD5 format afterwards.
  • Around what polycount would you recommend for an RTS game?  I am telling my artists < 2500 polys atm.

I really appreciate any advice you can give me - I really don't know what the best practices are for developing 3D game art!

Thanks.

PARTNERS