Page 1 of 2

Abstract class problem?

Posted: Tue May 12, 2009 7:31 pm
by ibly31
I'm making a 3D Game with C++, Irrlicht(Graphics), and Newton(Physics). I decided to make my main.cpp code simple, and I have a game.cpp, main.cpp, main.h, and a game.h. I am trying to use the "CGame" class from my game.cpp... and it's having problems...

MAIN.cpp CODE:

Code: Select all

#include "StdAfx.h"

// the game
CGame Game;

int main(int argc, char* argv[])
{
	// Init game
	Game.Init();

	// Create scene
	Game.Prepare();
 
	// Main Loop
	while(Game.device->run())
	{
		Game.MainLoop();
	}

	// Clean up memory
	Game.Finish();

	return 0;
}
And the Error I get is:

Code: Select all

1>c:\documents and settings\billy\my documents\visual studio 2008\projects\irrfps\irrfps\main.cpp(4) : error C2259: 'CGame' : cannot instantiate abstract class
1>        due to following members:
1>        'bool irr::IEventReceiver::OnEvent(const irr::SEvent &)' : is abstract
1>        c:\irrlicht-1.5\include\ieventreceiver.h(351) : see declaration of 'irr::IEventReceiver::OnEvent'

Re: Abstract class problem?

Posted: Tue May 12, 2009 10:18 pm
by ibly31
Well i rixed it, i iust moved a bunch of code around and into one file. Does anyone know an easy to use BSP map editor?

Re: Abstract class problem?

Posted: Wed May 13, 2009 2:49 am
by K-Bal
ibly31 wrote:Well i rixed it, i iust moved a bunch of code around and into one file. Does anyone know an easy to use BSP map editor?
I don't know if the good old hammer editor is still available ;) Last time I used it was about 7 yrs ago :D

Re: Abstract class problem?

Posted: Wed May 13, 2009 11:59 am
by MarauderIIC
I used to use QuArK (Quake Army Knife).

Re: Abstract class problem?

Posted: Wed May 13, 2009 6:47 pm
by ibly31
I think I'll try hammer.

I don't know what to use for a character, do people make the character in a 3D modeling program and animate it there too? Then when the character dies like in Halo 3, it turns into a ragdoll? Or GTA, the character is animated but then turns into a ragdoll when it's done...

My question is do people animate their character and turn it into a ragdoll when they want? Or do they make their character have the ragdolls joints and everything and animate it by moving the joints, and then just letting them go free when the character dies?

EDIT: I'm not asking about what most games do gameplay wise, I'm just saying for games that have ragdoll related deaths, how do they do it?

Re: Abstract class problem?

Posted: Thu May 14, 2009 11:22 pm
by Kros
ibly31 wrote:My question is do people animate their character and turn it into a ragdoll when they want? Or do they make their character have the ragdolls joints and everything and animate it by moving the joints, and then just letting them go free when the character dies?
The latter, I believe.

Re: Abstract class problem?

Posted: Fri May 15, 2009 6:38 am
by ibly31
Oh, really? I was completely sure it'd be the first one. Well, does anyone here have irrlicht or newton experience that can point me in the rught direction?

Re: Abstract class problem?

Posted: Fri May 15, 2009 10:26 am
by K-Bal
ibly31 wrote:Oh, really? I was completely sure it'd be the first one. Well, does anyone here have irrlicht or newton experience that can point me in the rught direction?
I guess the first one is more commonly used.

Re: Abstract class problem?

Posted: Fri May 15, 2009 11:05 am
by MarauderIIC
Well.. they're sort of the same. I mean, ragdoll implies loose joints. Models usually have joints that you move. So... when they die, they go out of forced movement and go to free.

Re: Abstract class problem?

Posted: Mon May 18, 2009 4:42 pm
by ibly31
Hmm, do you think they make the characters body out of joints and sticks and then apply the arm mesh and leg mesh and head mesh to it? That how i'd do it

Edit: I mean have a different mesh, and since each body part is its own bone, attach a mesh to each bone for graphixs purposes but still do collision using the low poly rectangle or cylinder bone. And by animating conpletely in an editor i mean like making a character with different animations you call like jump and walk. That would be really hard to turn into a ragdoll...

Re: Abstract class problem?

Posted: Tue May 19, 2009 9:08 am
by Falco Girgis
We know. What Marauder said is true.

Re: Abstract class problem?

Posted: Tue May 19, 2009 11:17 am
by MarauderIIC
You change what has control over the model when it dies. When it's alive, use animations on the model. When it's dead, use ragdoll physics on the model (and usually they reduce the weight of the model so that it can be launched around and stuff).

Re: Abstract class problem?

Posted: Tue May 19, 2009 11:38 am
by aamesxdavid
Ragdoll effects are used by basically turning each bone (or in some cases a set of bones) into it's own physics object (each one is a rigid body instance), rather than them going through keyframed animations. It's much harder to do than just having a death animation, but obviously more effective in a lot of cases. You are not playing an animation at all in the case of a ragdoll, as Marauder said, you are leaving the movement of these bones (joints) up to the physics system.

EDIT: In response to your last question, it seems like you're unsure about the whole animating (rigging and skinning) process. To clear a few things up, in most engines (as with Irrlicht I believe, in the small time I was looking into it), you have one file for the mesh. This file never changes, it's just your character model. You have another file for the skeleton, which contains all your animations. This skeleton consists of bones (referred to as joints by most API documentation), which are animated by keyframed movement. The skinning is what links the bones to the mesh, otherwise your character model will not animate at all. So, in the case of ragdolls, there is no animation call, but the skeleton is told to act like a bunch of linked rigid bodies by the physics engine. The skinning that links the model to the skeleton manipulates the character accordingly.

Re: Abstract class problem?

Posted: Tue May 19, 2009 10:15 pm
by ibly31
I have animated with blenser before and exported it, and like in an MD2 file you can call different animations with irrlicht, how do you apply the ragdoll physics once your character dies? Can you accees the armatures that you created inside the 3D modelling program?

Re: Abstract class problem?

Posted: Tue May 19, 2009 11:43 pm
by aamesxdavid
It really depends on the 3D and physics engines, but here's a quick answer on the Irrlicht wiki:

http://www.irrlicht3d.org/wiki/index.ph ... tionSystem

And about 2/3 of the way down this page is an example using PhysX:

http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=17669

The bottom line is that it's kind of a pain in the ass, and even if you get the basics working, making it so the character mesh doesn't clip into itself or the environment all over the place is even more complicated. You should only do this if you really want ragdolls.