Marble_Test

Programming Reality Factory and Genesis3D.
User avatar
federico
RF Dev Team
Posts: 443
Joined: Tue Jul 05, 2005 3:14 pm
Contact:

Post by federico » Thu Jul 19, 2007 12:18 am

I merged the physics code in the 075C source plus I added some commands for bone manipulation using 075C as base.
If some physics entity is used, then RF crashes on ShutDown or Reset (when you launch a New Game), otherwise RF works exactly in the same way no crash at all). QoD is the only one I know who can debug and solve this problem. All the troubles are in the physics shutdown or restart.
QoD, would you like to have this source? (please say yes)

There are other problems to solve for a complete physics integration, starting from scale, ragdolls (I have new interesting ideas to have a "skinned ragdoll") vehicles, deformations... but without a stable release those ideas and improvements are useless.

User avatar
federico
RF Dev Team
Posts: 443
Joined: Tue Jul 05, 2005 3:14 pm
Contact:

Post by federico » Fri Jul 20, 2007 9:02 pm

RF075C + Tokamak as it is 20-07-07:

http://files.filefront.com/RealityFacto ... einfo.html

Please, QoD take care of the stability part of the project.

This release is the standard 075C. It adds toka physics and some other interesting commands such as :

- 3 additional parameters to the FireProjectileBlind command
FireProjectileBlind(char *Projectile, char *BoneName, float OffsetX, float OffsetY, float OffsetZ, char *Attribute, float Pitch_Angle, int Accurancy );
Pitch_Angle is the X angle for the shot, if Pitch_Angle is the string "Camera" than the camera pitch is used.
Accurancy is a number that is used to calculate the loss of accurancy while the pawn is shooting a random(-accurancy, accurancy) value is added to the Yaw, Pitch shooting angle.

- new variable added: camera_yaw: self-explanatory

- New bone command: SetRelBoneRotation(EntityName, BoneName, RotX, RotY, RotZ); Rotate the bone to the desired relative angle. (relative to the reference pose bones rotation).

- SetWeaponActorName(string NameMyWeapon); Gives an EntityName to the actor WeaponActor. Useful to apply SetRelBoneRotatation to the third person weapon actor.

- ChangeEntityName(oldEntityName, newEntityName); Give the pawn a new EntityName. Dangerous...

- EnableStencilShadows(EntityName); self-explanatory

- I also changed the code related to the DrawFlipBookImage low-level command. Now Depth really works I turned GE_DO_NOT_OCCLUDE_SELF to the proper genesis z-sort command.

User avatar
QuestOfDreams
Site Admin
Posts: 1520
Joined: Sun Jul 03, 2005 11:12 pm
Location: Austria
Contact:

Post by QuestOfDreams » Sun Jul 22, 2007 9:46 am

Thx, Federico. Since Tokamak is now open source (BSD license) there's a better chance of completing this project, however, my priority this year is the update of the engine to DX9.

firelord
Posts: 90
Joined: Sat Jun 16, 2007 12:47 am

Re: reply

Post by firelord » Sun Jul 22, 2007 8:03 pm

quest of dreams when do you think rf will be upgraded to direct x9 i can't wait. to be able to make better models etc
thanks firelord.

User avatar
federico
RF Dev Team
Posts: 443
Joined: Tue Jul 05, 2005 3:14 pm
Contact:

Post by federico » Sun Jul 22, 2007 8:34 pm

Nice suggest QoD. Anyway, I'm not asking you to pick up the entire project. I would like to have some suggestion about the procedure for debugging the error that comes out when the physics simulation is restarted or stopped. It's a problem more related to RF than to Tokamak. Your experience and knowledge could take some minute to understand what's wrong while my lacking of skills could take months.
If that problem is solved the code could be integrated without troubles in the next release... physics for all!

P.S. Even now if no physic Entity is initialized, the crash doesn't occur...

Landix
Posts: 10
Joined: Sat Jul 14, 2007 10:50 am
Contact:

Post by Landix » Sun Jul 22, 2007 9:28 pm

federico wrote: If that problem is solved the code could be integrated without troubles in the next release... physics for all!
/vote yes :)

User avatar
federico
RF Dev Team
Posts: 443
Joined: Tue Jul 05, 2005 3:14 pm
Contact:

Post by federico » Mon Jul 23, 2007 1:05 am

I never debugged an application to find and solve a memory leak, and I don't how to start. I used the debug version and that's the error I got.
Image
I mean, that is a memory leak, right? It appears on level loading/restarting or exiting the app. If I press "Ignore" the level is correctly re-initialized (in debug, the release build simply crashes).

User avatar
paradoxnj
RF2 Dev Team
Posts: 1328
Joined: Wed Mar 01, 2006 7:37 pm
Location: Brick, NJ
Contact:

Post by paradoxnj » Mon Jul 23, 2007 2:44 pm

Federico, this error simply means that you allocated something with geRam_Allocate() but didn't call geRam_Free() on it. So yes...it's a memory leak. IIRC, there is a flag that you can turn on to have it tell you what line of code and what file it's in. I will research a bit and get back to you.

User avatar
federico
RF Dev Team
Posts: 443
Joined: Tue Jul 05, 2005 3:14 pm
Contact:

Post by federico » Mon Jul 23, 2007 3:08 pm

Thanks alot. This will save our day! :D

User avatar
federico
RF Dev Team
Posts: 443
Joined: Tue Jul 05, 2005 3:14 pm
Contact:

Post by federico » Thu Jul 26, 2007 11:35 am

I think that the genesis function is geRam_ReportAllocations

http://www.genesis3d.com/~kdtop/geRamIn ... llocations

but I don't know how to use it and in the Physics part there isn't any geRam_allocate command but only new/delete. I tried to solve in the destructor but no way: there's something I can't understand and much more that i don't know.
I wonder how sirkorgan get a clean physics shutdowin his toka+g3d demo... :?:

User avatar
paradoxnj
RF2 Dev Team
Posts: 1328
Joined: Wed Mar 01, 2006 7:37 pm
Location: Brick, NJ
Contact:

Post by paradoxnj » Thu Jul 26, 2007 4:11 pm

Yes...you need the DbgView tool from SysInternals to view that information. I have almost tracked down the leak. Give me a few more days.

User avatar
federico
RF Dev Team
Posts: 443
Joined: Tue Jul 05, 2005 3:14 pm
Contact:

Post by federico » Thu Jul 26, 2007 9:18 pm

music for my ears.... :D

Post Reply