RF and physics

Programming Reality Factory and Genesis3D.
Post Reply
Guest

Post by Guest »

@Nout
I'm trying to re-compile the source but I have several warnings and two errors:

Code: Select all

source\CActorManager.cpp(703) : error C2065: 'geActor_GetTransform' : undeclared identifier
then:

Code: Select all

C:\Documents and Settings\Cesare Pitto\Desktop\PhysicsRFdemo\source\source\CInventory.cpp(710) : warning C4101: 'szText' : unreferenced local variable
C:\Documents and Settings\Cesare Pitto\Desktop\PhysicsRFdemo\source\source\CInventory.cpp(711) : warning C4101: 'x' : unreferenced local variable
C:\Documents and Settings\Cesare Pitto\Desktop\PhysicsRFdemo\source\source\CInventory.cpp(712) : warning C4101: 'Selx' : unreferenced local variable
C:\Documents and Settings\Cesare Pitto\Desktop\PhysicsRFdemo\source\source\CInventory.cpp(711) : warning C4101: 'y' : unreferenced local variable
C:\Documents and Settings\Cesare Pitto\Desktop\PhysicsRFdemo\source\source\CInventory.cpp(712) : warning C4101: 'Sely' : unreferenced local variable
C:\Documents and Settings\Cesare Pitto\Desktop\PhysicsRFdemo\source\source\CInventory.cpp(713) : warning C4101: 'county' : unreferenced local variable
C:\Documents and Settings\Cesare Pitto\Desktop\PhysicsRFdemo\source\source\CInventory.cpp(713) : warning C4101: 'countx' : unreferenced local variable
and

Code: Select all

C:\Documents and Settings\Cesare Pitto\Desktop\PhysicsRFdemo\source\source\CPhysicsManager.cpp(234) : warning C4101: 'EntBodyIdB' : unreferenced local variable
C:\Documents and Settings\Cesare Pitto\Desktop\PhysicsRFdemo\source\source\CPhysicsManager.cpp(234) : warning C4101: 'EntBodyIdA' : unreferenced local variable
C:\Documents and Settings\Cesare Pitto\Desktop\PhysicsRFdemo\source\source\CPhysicsManager.cpp(433) : warning C4244: 'initializing' : conversion from '__int64' to 'int', possible loss of data
C:\Documents and Settings\Cesare Pitto\Desktop\PhysicsRFdemo\source\source\CPhysicsManager.cpp(435) : warning C4244: 'argument' : conversion from '__int64' to 'unsigned int', possible loss of data
C:\Documents and Settings\Cesare Pitto\Desktop\PhysicsRFdemo\source\source\CPhysicsManager.cpp(875) : error C2065: 'geWorld_GetWorldGeometry' : undeclared identifier
C:\Documents and Settings\Cesare Pitto\Desktop\PhysicsRFdemo\source\source\CPhysicsManager.cpp(3133) : warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data
C:\Documents and Settings\Cesare Pitto\Desktop\PhysicsRFdemo\source\source\CPhysicsManager.cpp(3133) : warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data
C:\Documents and Settings\Cesare Pitto\Desktop\PhysicsRFdemo\source\source\CPhysicsManager.cpp(3133) : warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data
have you some idea about how to fix it?
What version of directx and engine libraries use?
User avatar
federico
RF Dev Team
Posts: 443
Joined: Tue Jul 05, 2005 3:14 pm
Contact:

Post by federico »

previous post by be, scuse me.

I only add that I can perfectly compile rf071 and 072A.
I'm using the last genesis lib and directx 8.1
Nout
Posts: 136
Joined: Tue Jul 05, 2005 5:14 pm

Post by Nout »

hmm. two things: one, alot of the time cubes went below the floor,
The reason for this can be 2 things:
a) the actor's root-joint in not the middle of the boundingbox
b) the geometry BBOX is not aligned with the actors BBOX.
In the rigidbody entity + in the script comand, you can give an offset to the geometry BBOX, of better is to correct the actor. This might solve it.
and two, i found it odd because when you shot them, they reacted perfectly; however, when they bounced off the far wall, they started spinning through the air like tops.
I don't know yet what the reason is, but I know that y-rotation is not yet correctly working.
I mean that i want to apply a force to an object in a direction (for example, forward) and then, using the keyboard or the mouse, I want to rotate that object mantaining the force. Like a wheel that steers.
I want to try the reations of a ball on a terrain so I want to "Run" that terrain...
What os the issue to use the script commands ApplyImpulse and ApplyTwist ? They do this??
i forgot how to fix begin frame errors cause that is what i get from it
If you in a RidigBodyEntity fill in an actor file that does not exist, it can create a BeginFrame error without any warnings. The same for StaticBody + the script commands
I'm trying to re-compile the source but I have several warnings and two errors:
The warnings are normal. It's some code I need to clean up. Please don't forget this is an ALPHA release!!
The error you get is linked to Genesis. I've added some new code in Genesis to be able to read the BSP + the matrix. The compiled genesis lib + dll should be included in the download. You need to link to these versions of genesis to get the code compiled.
User avatar
federico
RF Dev Team
Posts: 443
Joined: Tue Jul 05, 2005 3:14 pm
Contact:

Post by federico »

The problems are:

1) Using a PhysicsForce Entity or scripting the command, the rotation of an actor around his Y axis is buggy. When the object is -180 or +180 immediatly reset his orientation

2) Try this: place a ball object (Bbox Sphere) and enable ShowBBox. Apply a force in a direction, for example 6000 torque on Z axis (like a wheel that rotating moves forward). All works ok. Now try to apply a twist on that physic body. You can see that the bounding box don't rotate with the actor (using a bounding "Box" you can see it better) . So when you apply again the first force the body moves again in the first direction (in the example forward) and the orientation of the object hasn't changed. At least you can see that s the ball moves forward rotating in a irregular way, but when you push your "forward" button the ball keeps on moving in the same direction indipendently from which twist you apply.
A good example of a correct behaviour is, instead, the front wheel of the physicsVehicle entity. The front wheel keeps his torque modifying his orientation.

Think about it slowly 8). I understand that this alpha is an enormous brain storm for you and all the community is waiting for your explanations.

A note: Your new mouse and video script commands GetScreenWidth() GetScreenHeight() ShowMouse(ShowIt) GetMousePosX() GetMousePosY() SetMousePos(ScreenPosX, ScreenPosY) are simply wonderful! Great work again, Nout!

P.S. the genesis lib included aren't enough. I tried to link it but I've got the same errors...
primalsac
Posts: 6
Joined: Wed Jul 06, 2005 6:11 am

Post by primalsac »

i downloaded your physics demo and installed what said was version 80 of rf. I cant find the rigid body entities mentioned in your docs or any physics stuff. Where can I find it?
User avatar
federico
RF Dev Team
Posts: 443
Joined: Tue Jul 05, 2005 3:14 pm
Contact:

Post by federico »

@primalsac
you will need to know how basically RF works:
1) set up the work directories and the path in the editor.
2) using the correct executables and the correct source (GameEntityDataTypes.h)
3) Create a simple level with all the correct entities (the basic entity triad, how to place these correctly)
4) build and run your levels.

@all
To know exactly how to do this steps, read the docs and some basic tutorial accessible in the main page. To use this alpha release, instead, you will have to add a copy of the standar tool directory and then add the GameEntityDataTypes.h file (that you find in the source archive in the source folder) to the source directory then locate it in the editor going to Project--> Level Options in the source part of the preferences. Probably you have also to add the Tokamak.h file located in the Tokamak folder in the source archive.
Guest

Post by Guest »

The demo is outstanding, Nout! I'd be happy if you just got the
box shooting part to integrate with mainstream RF, I suppose there's a way to texture the boxes?
Nout
Posts: 136
Joined: Tue Jul 05, 2005 5:14 pm

Post by Nout »

1) Using a PhysicsForce Entity or scripting the command, the rotation of an actor around his Y axis is buggy. When the object is -180 or +180 immediatly reset his orientation
Yes, I know, but I didn't find out yet how to solve it. My intension was directly read an write into the 4*4 matrix, but a first attemt to do so is not working, so I uses Euler-rotation, which seems not to match with Tokamak? I do not know uch of Genesis yet and I hope QuestOfDreams can have a look to this.
2) Try this: place a ball object (Bbox Sphere) and enable ShowBBox. Apply a force in a direction, for example 6000 torque on Z axis (like a wheel that rotating moves forward). All works ok. Now try to apply a twist on that physic body. You can see that the bounding box don't rotate with the actor (using a bounding "Box" you can see it better) .
Note that the code to visualize the BBoxes does not yet support rotation (See comments in the source)
So when you apply again the first force the body moves again in the first direction (in the example forward) and the orientation of the object hasn't changed. At least you can see that s the ball moves forward rotating in a irregular way, but when you push your "forward" button the ball keeps on moving in the same direction indipendently from which twist you apply.
A good example of a correct behaviour is, instead, the front wheel of the physicsVehicle entity. The front wheel keeps his torque modifying his orientation.
Think about it slowly . I understand that this alpha is an enormous brain storm for you and all the community is waiting for your explanations.
OK, I understand the idea. The PhysicsForce indeed keeps putting the force in a given direction, independent of twist, and it was intended like that. The Vehicle entity has a builds in force and torque algortihm that handles forces and torque like a vehicle, and you can use this to "steer" an object.
A note: Your new mouse and video script commands GetScreenWidth() GetScreenHeight() ShowMouse(ShowIt) GetMousePosX() GetMousePosY() SetMousePos(ScreenPosX, ScreenPosY) are simply wonderful! Great work again, Nout!
You can easy build a menu system, or trace back what actor is under the mouse etc... I fou like these, you might also like the conversation commands with sound and the mouse controlled reply.
P.S. the genesis lib included aren't enough. I tried to link it but I've got the same errors...
Did you add the geneis.lib to your library path and to the libraries to search for? Do you include the genesis header from the RF source?
The demo is outstanding, Nout! I'd be happy if you just got the
box shooting part to integrate with mainstream RF, I suppose there's a way to texture the boxes?
You can make any pawn (textured etc...) part of the physics system. The boxes you see are normal actors, which can be textured. It's not my intension to make any pawn, actor etc... part of the physics system, as this can slow down the frame rates significantly. Instead I choose for assigning physics to the pawns that need it.
Where to find the docs for physics?
See included in this post
Attachments
NoutsChangesToRF.zip
(21.48 KiB) Downloaded 90 times
User avatar
federico
RF Dev Team
Posts: 443
Joined: Tue Jul 05, 2005 3:14 pm
Contact:

Post by federico »

thanks nout, i'll try to see the algortihm in the source for steer.

:cry: I can't really find a way to compile it succesfully... can you post somewhere (or FTP upload) the modified genesis lib and header?


about the mouse and screen commands I'm thinking to use it to fine control a pawn. Tracking the position of the mouse, I mean, to evaluate the relative steer of a car or of an aeroplane: something like an old "analogic" joystick (a fligh simulator?)...
Jay
RF Dev Team
Posts: 1232
Joined: Fri Jul 08, 2005 1:56 pm
Location: Germany

Post by Jay »

It seems to have problems with doors because everytime it crashes at the point where it initalizizes the doors...i mean they did work before. and now it doesn't even load the level. :(
Everyone can see the difficult, but only the wise can see the simple.
-----
Nout
Posts: 136
Joined: Tue Jul 05, 2005 5:14 pm

Post by Nout »

federico wrote:I can't really find a way to compile it succesfully... can you post somewhere (or FTP upload) the modified genesis lib and header?
File is too big to upload, so I send it in 2 parts. In the second part you also find a tool to assemble things again into 1 zip
Attachments
Part2.ZIP
(148.54 KiB) Downloaded 81 times
Part1.ZIP
(243.53 KiB) Downloaded 85 times
User avatar
federico
RF Dev Team
Posts: 443
Joined: Tue Jul 05, 2005 3:14 pm
Contact:

Post by federico »

I still get this error compiling the source:

Code: Select all

Compiling...
CActorManager.cpp
c:\documents and settings\cesare pitto\desktop\nout\physicsrfdemo\source\source\cactormanager.cpp(703) : error C2065: 'geActor_GetTransform' : undeclared identifier
Error executing cl.exe.

RealityFactory.exe - 1 error(s), 0 warning(s)

Any idea, my friend?

----

Are you still working on the physic? QoD is helping you in some way?... no one seems to have the will to try to make something with it. I'm plnning something... 8)
Nout
Posts: 136
Joined: Tue Jul 05, 2005 5:14 pm

Post by Nout »

OK, the easiest way that will help you out is:

Search for 'geActor_GetTransform function, and just comment it out.
This is OK, as the code today does not require this function to work.

I hope this solves it
Nout
Posts: 136
Joined: Tue Jul 05, 2005 5:14 pm

Post by Nout »

Status:

- I'm making a demo that shows how you can script physics
Includes things like collision control, Motor, defining joints, breaking a joint etc... Release will be somewhere next week
- Added more code to the ragdoll entity. It's still not that flexible... you will see
- Added some more script commands. For example EnablePhysics: it enable and disable the physics loop. Besides frame rate optimization it allows you to freeze the physics world, while the player, pawns, platforms etc... stay working normal around... Nice for fantasy games.
- Made the PhysicsScript able to work without a StartOrder
- Solved a few small bugs
User avatar
federico
RF Dev Team
Posts: 443
Joined: Tue Jul 05, 2005 3:14 pm
Contact:

Post by federico »

I've tried to comment out the two geActor_GetTransform lines.

VC6++ compile successful but the rf executables won't work with any level. The engine starts with an enourmous number of error at the start of the level. it doesn't render anything and shut down...
Post Reply