IrrlichtFPS

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
Mercior
Posts: 100
Joined: Tue Feb 24, 2004 1:53 am
Location: UK
Contact:

Post by Mercior »

Glad to see newton in use :)

Its looking good, but the movement is a tad strange.. EG you can look up and press forwards to "jump". This is because of the fps camera, I've been working on a FPS engine too with irrlicht and I found its better to code your own player class that handles movement - this way you can make a nicer movement model with extra features like air strafing :)

Also when you shoot the crate it seems a bit slow to react.. For my engine I cast a ray from the player when they shoot and pass damage into the world as a line. This way you can:

Code: Select all

				vector3df tvec = line.getVector().normalize() * 50; // 50 is the "force" of the bullets
				float dVec[3] = { tvec.X, tvec.Y, tvec.Z };
				float pVec[3] = { dPoint.X, dPoint.Y, dPoint.Z };
				NewtonAddBodyImpulse(newtonWorld ,objectsNewtonBody, (float*)dVec, (float*)pVec);
edit: dPoint is the location where the ray collides with the mesh. I use irrlichts triangle selectors to get this information.
anarkavre
Posts: 27
Joined: Mon Mar 08, 2004 9:57 pm
Location: PA
Contact:

Post by anarkavre »

Mercior, can you post the whole code to doing what you showed. I would like to fix my code and implement it into IrrlichtFPS.
"Without curiosity and knowledge, the mind is a vast void. Without the mind, curiosity and knowledge are nonexistent."
Mercior
Posts: 100
Joined: Tue Feb 24, 2004 1:53 am
Location: UK
Contact:

Post by Mercior »

Theres quite abit of code behind the method so I shan't post it all - but heres a brief desription:

I store all the world objects in a class called the objectmanager, when the player shoots I pass the damage into the objectmanager and it can determine if the ray of damage hits physics controlled objects, enemies, or whatever objects your game has.

My code for handling shooting newton controlled objects looks something like this:

Code: Select all


void ObjectManager::PassDamage(CGame *world, core::line3d<f32> line, int amt)
{
    if (objlist[i]->oGroup == GROUP_PHYSICS)
		{
			core::vector3df dPoint;
			core::triangle3df dTri;
			if (world->smgr->getSceneCollisionManager()->getCollisionPoint(line, ((CNewtonObject *)objlist[i])->GetSelector(), dPoint, dTri))
			{
				vector3df tvec = line.getVector().normalize() * 50;
				float dVec[3] = { tvec.X, tvec.Y, tvec.Z };
				float pVec[3] = { dPoint.X, dPoint.Y, dPoint.Z };
				NewtonAddBodyImpulse(world->nWorld, ((CNewtonObject *)objlist[i])->GetNewtonBody(), (float*)dVec, (float*)pVec);
			}

		}
	}
	
}

anarkavre
Posts: 27
Joined: Mon Mar 08, 2004 9:57 pm
Location: PA
Contact:

Post by anarkavre »

Now with better physics thanks to Mercior for the help. http://anark.unidoom.org/IrrlichtFPS.zip
"Without curiosity and knowledge, the mind is a vast void. Without the mind, curiosity and knowledge are nonexistent."
vermeer
Posts: 2017
Joined: Wed Jan 21, 2004 3:22 pm
Contact:

Post by vermeer »

HEY!

very nice.. :)

I think is the first time I see this model in realtime...I suppose I had bad luck with it, but seems someone has been able to load it ...


Some comments:

-Are u using the md2, or the md3? If it's the md2, you need the weapon.md2, which also made available at my site, you probably didn't see it, at the bottom of the page..is yet untextured...I may make a texture for it, and if I put my hands on that, surely will end the texture...it depends on if you are going to continue and if I find the time...
If you are using the md2 file, then you need to load with same position relative to model, the weapon.md2.It's done so to load in place.

The texture, as I see ur loading in a apart file, can be changed at any moment,just calling it same name. So u can exchange skins, as usual.. :)

Indeed, you must have by now 2 other weapons, non uvmapped non textures...but who know...I may work on that, if I see progress...

-I don't see animation -as you probably have not added yet, ok-

-Did you load it with ambient at 100% or something, is like overlit, no shading(like I see no volume, the texture looks well...the seams in the hair is my fault...I should have not left that texture at 50% ;) )...but that's maybe the typical bad shading of md2...

-It seems you are loading it without the unwelded problem, which actually rocks.Another reason why i want to know if used md2 or md3. Md3 has better shading, and is best...but if md2 is ok, allright :)

-If it is md3, I would not understand why the weapon does not appear...I thing all was included in the export I made from nMD3 compiler...


I think it's going quite good, congratulations :)
Finally making games again!
http://www.konekogames.com
anarkavre
Posts: 27
Joined: Mon Mar 08, 2004 9:57 pm
Location: PA
Contact:

Post by anarkavre »

I am using the md2, the reason you aren't seeing the weapon is I havn't added it in the code yet because I don't think it looks good without a texture. But if you can texture it then that would be great. I am also not using any lighting on the model because shadows looked bad with this model for some reason. Anyway, the model works well with animation too except missing animations.
"Without curiosity and knowledge, the mind is a vast void. Without the mind, curiosity and knowledge are nonexistent."
guest58

Post by guest58 »

All right. See, the weapon most likely will have its texture :)

The bad shading may be :

-md2 has bad shading itself, md3 is much better.

-SURE you have a problem with my model.Yesterday i dsicovered where the unwelding happened. Character Fx when it exports as md2 or 3DSs, a model that was welded, is exported unwelded exactly where the UV groups has it's borders, that's why a geometry seam appear in nose, middle of face (the face is mirrored in UV to save texture space) , also seen in legs, etc. Exactly where uv frontiers are.

Dam* it.... :evil:

So, as is also WAY hard to find a batch converter, for free, which even has weld command in batch mode, for do the fix to the 211 3ds frams, neither the md2tool (quite, quite cool free comand line tool, not from Id I think) does really weld the geometry, I have two options:

welding one by one the 211 meshes [which also brings me to a point...you're using 211 meshes heavy animation! of ~2k tris each...doesn't that beat the performance...?? maybe not in today's engines...a solution maybe picking some of em (ie: 1 of every 3, but depending on if movement is quicker, or needda keep more frames-meshes) and let the interpolation melt it all.. ] , and...the some more of the two animations yet missing (death, and straffe run animations -sorry, I didn't make walk cycle, and most surely, wont make it...at least till I have a working workflow with Blender, as I am not surely going to animate with CFX...is good tool, but I now want more...- ) that would mean opening each mesh-frame in Ultimate Unwrap or Milkshape, weld the model, save. and then open again the 3ds files in Quake Modeller, one by one again, and finally export as md2.And by past experiences, this wont end happily as I have a problem with Quake modeller keeping UVs.

With md3 I have more luck. I can import the fixed 3ds files, and then I am sure that I can output an md3 out of nmd3 compiler, ready to go (without cfg nor qc file, but I hope u don't need that)

another option would be importing into Gmax , the md2 or md3 that I already output, without fixing, and hope it's loaded there as vertex animation (I think I have md2 and md3 importers in maxscript) and then use the Mojo md3 fixed exproter, to output a perfect md3, as in Gmax (as is similar to Max) I can weld with weld target the vertices.

This by all means would be the safer, easier, problem free way.... And surely I could do with md2 and md3...

It'd not be anyway my common workflow; I am heading to Blender in almost everything for my amateur work... Already there's in the works md3 plugin, and indeed a working md2 one, but failed to import the other day...Surely I could weld the verts in Blender too... I dunno.

The prob with Gmac is I don't know how legal would it be...your project is not comercial, is it? and is not kept clear in the eula if stuff like this would be not allowed...

argh, if only there were a command line tool to weld and md2 duplicated vertices (vertices that indeed are in same position, were created in uv seams for a bad understanding of the mesh in certain software...)


The weapon texture is way easier for me than all this. I have all type of tools fo rit, and can bang it easily, but need some time. And that comes to my last point: these days I am crazily overloaded of work. SO I don't know when I will be able to get back to you with all this...

keep working in the project, is is how I think, u can work perfectly with the even untextured weapon, to make ur tests, maybe not to show to public, if you prefer not. And even I can quickly give u two unfixed -unwelded- exports in md2 format from cfx of the two remaining animations, death and straffe run -sorry again for no walk cycle, anyway, fps games like q3 is all time running...-

So that u can go testing ur coding and all.I'd use the untextured weapon in the meantime, orr u want be able to test ur code well if not.You gotta at least ensure u can load two md2 in place, and see the hand more or less matches the weapon, and that ur code support well an skin per model, and another per weapon, and does not mess it all...Use the uv crazy colored template...is just done so to make easier to a 2d texturer to make it. I use 3d painting, and end up 2d painting. The weapon texture is easy for me, you should count on that. As I told u at th ebeguining, I gave this model to more coders, so expect I give the texture and other advances also to othe rcoders. Anyway, in my experience, very few projects end up seing the light, in whatever, so I don't expect an overflood of projects with my model.. ;) and u can always change textures to look way different.


In an ideal world, after fixing the md2 export and weld it to look nicely, even exporting a correct md3 set, I'd texture the weapon, and even at last I could think of end and do a proper texture for the guy.

With the tools I use, the huge problem is always the same:animation, rigging .it takes me eons to do very simple tasks in max and cs , when I use Character fx and my set of freebies, mostly conversion problems, loads of features missing, etc...all workable and doable with freebies -my passion- but: a problem when ur really short of time, and getting shorter each day...

But texturing , is something I can do more easily as I purchased all I need.

The weld, animation, etc...with gmax would be surely way mor easier...

:roll:

The thing is I really hate seing bad shading and most of all unwelded crisp edges where I didn't put 'em...

:evil: :evil:

Ok, dont worry, one way or the other you'll have it :) (I hope)
vermeer
Posts: 2017
Joined: Wed Jan 21, 2004 3:22 pm
Contact:

Post by vermeer »

me again..


hey..I really need you be able to load md3 files...

As I think I have found a way to fix it all. And so , pass you the remain animations...

There's a tutorial for irlitch loading and md3 file :

http://irrlicht.sourceforge.net/phpBB2/ ... 3+tutorial

There's info , doc and a ready to use class or however you coders call it...

It would avoid me many problems I have fixing the md2 files.... If i can give you in md3 format, all solved.
And your engine gains on quality :)
Finally making games again!
http://www.konekogames.com
vermeer
Posts: 2017
Joined: Wed Jan 21, 2004 3:22 pm
Contact:

Post by vermeer »

oh, scroll down that thread till almost bottom, as I think he -madinality- went updating the md3 mesh loader (with animationsand all) as the thread grew.

madinality, feel free to pop up over here if have some hint.. ;)

believe me, with good shading, and no weird edge creases, this character will look way many times better :)
Finally making games again!
http://www.konekogames.com
vermeer
Posts: 2017
Joined: Wed Jan 21, 2004 3:22 pm
Contact:

Post by vermeer »

even more; I think site and newest versions are here :

http://aitolikon.sourceforge.net/downloads.html
Finally making games again!
http://www.konekogames.com
guest57

Post by guest57 »

is pretty weird the export in md2...

it deforms the human face, and also produce trembling in the mesh...is a well known problem in md2 format in general...

md3 looks waaay better.

but still fighting to solve the unwelded mesh problem...

I have found a batch 3d converter, which I could use to fix the problem..

I'll get you later if so...

Indeed, it'd give much more fredom also to add-remove frames, as would be working with a bunch of keyframe meshes, instead of a packed format, and at last, a button click on npherno md3 compiler would make it all...
vermeer
Posts: 2017
Joined: Wed Jan 21, 2004 3:22 pm
Contact:

Post by vermeer »

ARGH.

Now I get it...

I was suspecting it, though...I knew that once upon a time, but forgot...


3ds format, that glorious 90's format from msdos 3dstudio...has several isssues...

I already had in mind 65k tris limit... 8.3 texture names....but...forgot...1 vetex -> 1 texture coordinate...1 vertex can't have two... I use to map mirroring to better use the texture space.Well, everybody does it indeed...
Also, it tends to break think when it does not understand something...

for example, can't have normal per vertex, so it breaks it, so that you rebuild normals in whatever the software, and rejoin.

A question for experienced irllitch coders ;) :

is there a comand to weld an MD3 inside irrlitch? In that loader already made by ...madinality? or in self Irrlitch code...is there a command to weld coincident vertices, or like 0,0001 threshold (well, an small number so to not weld other vertices) in a whole md3?

That would weld all frames....May sound dumb, but i am not finding a way to melt them.... So, some ugly creases are seen in interior sides of legs, midst of the face (the worst) , back, and some othe rplaces, also in the weapon.

Already I can output perfectly the md3 weapon animation, independent of the human, or all together...But as I see it....wont be able to fix it with what I have. Accutrans is non nag shareware, and could make a batch conversion with it..EVEN MELTING THE VERTICES... for all the set...but of course, as wasn't realizing which the real problem was....it gets unwelded again as it gets exported as 3ds...as the problem...is in the format! heh.

So, exported as OBJ from accutrans, and no problem...problem is...argh...nPherno MD3 compiler only opens: md2, md3, ase, and 3ds. NO OBJ.... :cry: :cry:

And guess what. Accutrans does not save ASE (ascii scene export) , but asc, which also is from 3d studio (both) , but, at least this asc export, does not retain uv coords...argh.

Accutrans is an EXTREMELY good converter, quite good for the dirty stuff we all need often... i hope he gets purchases...
http://www.micromouse.ca/

well...At this point see no more options....I thought then if there some function you programmers now in Irrlitch or the md3 irrlitch loader to weld coincident unwelded vertices. Is just what is lacking...in othe raspects, the display that md3 gives totally rocks, compared to the deformed and trembling display of md2...

wanna give this guy a proper fps main player...

thanks!
Finally making games again!
http://www.konekogames.com
Rat
Posts: 51
Joined: Wed Mar 10, 2004 7:05 am

Post by Rat »

I have been watching this thread for awhile and seen the chat back and forth about this particular model. I would think that by now, you would simply forget the animations, and rerig this model to a skeleton that is compatable to output to something that the IRRLICHT engine expects. From what I have read thus far, you are having wierd erratic behaviour problems with the present skeleton in certain portions of the animation. I believe you said this was caused way back when you applied the animations from Character FX. Trash it! There are literaly millions of animations out there that are freely available for using, bvh, smd, etc. These can be imported in a number of modling packages and applied to your skeleton.

I think its time to let this go, and move on, from a professional point of view, you have to learn this the hard way. Otherwise a project would never get on the shelf for market.
guest32

Post by guest32 »

with the tools I have is weirdly slow to rig a model and even worse, to animate it, having it clear that that means a full set of animations.I have already one , and wanted to make some use of it for somebody instead of throwing to the paperbin...

I don't have the money for Max, neither really the time to make models and rigs, I am not enrolling into this project, he just asked for a model, and I thought he could use an already done and animated one I had in my hd...

I have worked at a company with max, and also with other one in another company. I do 3d now as a hobby, only.

But you are true, I am just messing too much with a model that is internally wrecked... And lately thinking in too crazy possibilities ;)

Even so, the time spent in trying conversions, is only a portion of animating in character fx, mostly as I like to be very accurate, and there's no way to pin a joint yet in Cfx...

Oh, well, lets get back to ..ehm..real problems.. ;)

btw, I think the project he is doing is well executed...
Rat
Posts: 51
Joined: Wed Mar 10, 2004 7:05 am

Post by Rat »

its noble to do this as a hobby and as well as to contribute and help someone else. I indeed appreciate your efforts and wasnt trying to discourage you. I have been down the same road as you, and presently out of work again. I have done work for freelance work for caligari and others. Maybe some day my ship will come in and those that I may have befriended along the way will slip in a good word for me.

In the meantime, I would honestly like to help you out. If you send the model as it is, in the various formats you have, I can try and figure out a way to get it in a form that the engine will understand and not screw it up.

I own my own copy of MAX, Milkshape, TrueSpace and gameSpace, plus a lot of funky converters. I could take your mesh and supply it with a full set of quake2 animations, or quake3 animations, since I have both.
Post Reply