Abstract class problem?

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

User avatar
ibly31
Chaos Rift Junior
Chaos Rift Junior
Posts: 312
Joined: Thu Feb 19, 2009 8:47 pm
Current Project: Like... seven different ones
Favorite Gaming Platforms: Xbox 360, Gamecube
Programming Language of Choice: C++, ObjC
Location: New Jersey.

Abstract class problem?

Post 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'
Image
Twitter
Website/Tumblr
My Projects

The best thing about UDP jokes is that I don’t care if you get them or not.
User avatar
ibly31
Chaos Rift Junior
Chaos Rift Junior
Posts: 312
Joined: Thu Feb 19, 2009 8:47 pm
Current Project: Like... seven different ones
Favorite Gaming Platforms: Xbox 360, Gamecube
Programming Language of Choice: C++, ObjC
Location: New Jersey.

Re: Abstract class problem?

Post 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?
Image
Twitter
Website/Tumblr
My Projects

The best thing about UDP jokes is that I don’t care if you get them or not.
K-Bal
ES Beta Backer
ES Beta Backer
Posts: 701
Joined: Sun Mar 15, 2009 3:21 pm
Location: Germany, Aachen
Contact:

Re: Abstract class problem?

Post 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
User avatar
MarauderIIC
Respected Programmer
Respected Programmer
Posts: 3406
Joined: Sat Jul 10, 2004 3:05 pm
Location: Maryland, USA

Re: Abstract class problem?

Post by MarauderIIC »

I used to use QuArK (Quake Army Knife).
I realized the moment I fell into the fissure that the book would not be destroyed as I had planned.
User avatar
ibly31
Chaos Rift Junior
Chaos Rift Junior
Posts: 312
Joined: Thu Feb 19, 2009 8:47 pm
Current Project: Like... seven different ones
Favorite Gaming Platforms: Xbox 360, Gamecube
Programming Language of Choice: C++, ObjC
Location: New Jersey.

Re: Abstract class problem?

Post 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?
Image
Twitter
Website/Tumblr
My Projects

The best thing about UDP jokes is that I don’t care if you get them or not.
User avatar
Kros
Chaos Rift Regular
Chaos Rift Regular
Posts: 136
Joined: Tue Feb 24, 2009 4:01 pm
Current Project: N/A
Favorite Gaming Platforms: PC, Playstation/2/3
Programming Language of Choice: C++
Location: Oregon,USA
Contact:

Re: Abstract class problem?

Post 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.
Isaac Asimov wrote:Part of the inhumanity of the computer is that, once it is competently programmed and working smoothly, it is completely honest.
YouTube Channel
User avatar
ibly31
Chaos Rift Junior
Chaos Rift Junior
Posts: 312
Joined: Thu Feb 19, 2009 8:47 pm
Current Project: Like... seven different ones
Favorite Gaming Platforms: Xbox 360, Gamecube
Programming Language of Choice: C++, ObjC
Location: New Jersey.

Re: Abstract class problem?

Post 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?
Image
Twitter
Website/Tumblr
My Projects

The best thing about UDP jokes is that I don’t care if you get them or not.
K-Bal
ES Beta Backer
ES Beta Backer
Posts: 701
Joined: Sun Mar 15, 2009 3:21 pm
Location: Germany, Aachen
Contact:

Re: Abstract class problem?

Post 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.
User avatar
MarauderIIC
Respected Programmer
Respected Programmer
Posts: 3406
Joined: Sat Jul 10, 2004 3:05 pm
Location: Maryland, USA

Re: Abstract class problem?

Post 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.
I realized the moment I fell into the fissure that the book would not be destroyed as I had planned.
User avatar
ibly31
Chaos Rift Junior
Chaos Rift Junior
Posts: 312
Joined: Thu Feb 19, 2009 8:47 pm
Current Project: Like... seven different ones
Favorite Gaming Platforms: Xbox 360, Gamecube
Programming Language of Choice: C++, ObjC
Location: New Jersey.

Re: Abstract class problem?

Post 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...
Image
Twitter
Website/Tumblr
My Projects

The best thing about UDP jokes is that I don’t care if you get them or not.
User avatar
Falco Girgis
Elysian Shadows Team
Elysian Shadows Team
Posts: 10294
Joined: Thu May 20, 2004 2:04 pm
Current Project: Elysian Shadows
Favorite Gaming Platforms: Dreamcast, SNES, NES
Programming Language of Choice: C/++
Location: Studio Vorbis, AL
Contact:

Re: Abstract class problem?

Post by Falco Girgis »

We know. What Marauder said is true.
User avatar
MarauderIIC
Respected Programmer
Respected Programmer
Posts: 3406
Joined: Sat Jul 10, 2004 3:05 pm
Location: Maryland, USA

Re: Abstract class problem?

Post 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).
I realized the moment I fell into the fissure that the book would not be destroyed as I had planned.
User avatar
aamesxdavid
ES Beta Backer
ES Beta Backer
Posts: 347
Joined: Wed Jan 07, 2009 8:49 pm
Location: Bellevue, WA
Contact:

Re: Abstract class problem?

Post 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.
User avatar
ibly31
Chaos Rift Junior
Chaos Rift Junior
Posts: 312
Joined: Thu Feb 19, 2009 8:47 pm
Current Project: Like... seven different ones
Favorite Gaming Platforms: Xbox 360, Gamecube
Programming Language of Choice: C++, ObjC
Location: New Jersey.

Re: Abstract class problem?

Post 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?
Image
Twitter
Website/Tumblr
My Projects

The best thing about UDP jokes is that I don’t care if you get them or not.
User avatar
aamesxdavid
ES Beta Backer
ES Beta Backer
Posts: 347
Joined: Wed Jan 07, 2009 8:49 pm
Location: Bellevue, WA
Contact:

Re: Abstract class problem?

Post 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.
Post Reply