6 registered members (AndrewAMD, Ayumi, degenerate_762, 7th_zorro, VoroneTZ, HoopyDerFrood),
1,268
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
CCT PhysX 2.0
#457618
01/24/16 20:24
01/24/16 20:24
|
Joined: May 2009
Posts: 5,370 Caucasus
3run
OP
Senior Expert
|
OP
Senior Expert
Joined: May 2009
Posts: 5,370
Caucasus
|
UPDATE!Simple cct (character controller) made with PhysX (SDK 2.8.4) plugin. I've modified ackphysx.dll community version plugin, to get more PH_CHAR features. Tested on several machines, it should work out of the box! This template works only with CAPSULE hull! I don't recommend using BOX hull! It currently supports: It currently supports: - collision masks (GROUP_NON_COLLIDABLE, GROUP_COLLIDABLE_NON_PUSHABLE, GROUP_COLLIDABLE_PUSHABLE) - pXent_updateCharacterExtents for crawling/standing - pXent_setCharacterSettings for changing skinWidth, stepOffset and slopeLimit for all ccts - gravity + jumping - inertia - sliding on slopes - 3d camera with collision detection and zooming - kinematic platform (following the path) + elevator (moving to target position and back) - added helper functions to check, if props have smashed the cct - terrain support Known issues: - cct can (rarely) fall through kinematic elevator, if it's moving upwards and cct is falling on it - problems with normal detection (can be seen in the video), on polygon edges normal.z can't glitch... this causes some weird movement on slopes if sliding is enabled, to void this problem, disable sliding also in screenshot folder you can see that 'Use Tesselation' flag in Map Compiler makes even more polygons/edges thus that will cause a lot of jittering on slope movement (cause on edges normal.z goes beyond the slope limit - can be seen in video) You can see cct in motion on my youtube channel: https://youtu.be/mfTzt57JoAwHOW TO USE ?There are lots of limitations to this movement template, mainly caused by physX itself (old SDK). But by learning how the demo scene is made and setup you'll be able to get (more or less) suitable results. - Mainly I would advice to keep the same size and don't increase/decrease world scale! Currently 40quants = 1 meter, NPC is 64 quant height. - To make sure that correct .dll was loaded, there is a function called ackphysxHelloWorld(); - To make slope slidable, set it's FLAG8 in WED
CREDITS: Download link: https://github.com/3RUN/Acknex-CCTScreenshots: If any bugs will be found, report them. I'll try to fix them in my spare time. Any feedback is (as always) welcome. Best regards.
Last edited by 3run; 05/31/20 10:24.
|
|
|
Re: CCT PhysX 1.0
[Re: 3run]
#457623
01/24/16 22:06
01/24/16 22:06
|
Joined: May 2009
Posts: 5,370 Caucasus
3run
OP
Senior Expert
|
OP
Senior Expert
Joined: May 2009
Posts: 5,370
Caucasus
|
To make you understand why I'm having difficulties with implementing crawling... CCT doesn't change it's hull like usual entities in Acknex do, first of all I need to unregister and register CCT back in physX everytime I change it's size (when I go crawling and back to standing, with physX 3.x you don't need to do this, but native Acknex physX is only 2.x), plus when I lower 'max_z' to decrease the size of the bbox, CCT instead of lowering the upper 'max_z' only, makes the whole hull smaller, take a look at this screens: Standing (max_x, y, z = 16, 16, 32): Crawling (max_x, y, z = 16, 16, 5): So the thing is, that I need to update the Z position of the CCT shape, but it's different to the one we see in the Acknex (model's position with it's bbox size). I found out that with the CCT setting that I have in my demo, I need to lower bbox model with 10.8 quants when I go to crawling (so it actually looks like only the upper side of the bbox goes down). In 3dgs_snakes plugin there was that nice function called 'pX3ent_getfootposition' which used to return the foot position of the CCT hull (independent to it's size, cause foot position did not change!), native Acknex physX misses such useful function... (maybe cause it's outdated, and 2.x SDK did not support things like this? hard to believe, but it might be the answer). Even after changing the Z position manually 'by hand', I found out that it ruined the whole gravity movement that I have... CCT just falls through the ground after going to crawling state and then back to standing. So currently I'm having some difficulties with all this crap (this is why I hate Acknex native physX! it's too outdated and not flexable, and I don't really want to mention all the bugs it has). Anyway I'll try to sort things out and handle this situation, then I'll realise updated version with crawling and some tweaks. Best regards!
|
|
|
Re: CCT PhysX 1.0
[Re: Steempipe]
#457693
01/26/16 18:14
01/26/16 18:14
|
Joined: May 2009
Posts: 5,370 Caucasus
3run
OP
Senior Expert
|
OP
Senior Expert
Joined: May 2009
Posts: 5,370
Caucasus
|
That addition is pretty cool! I don't know crap about what you are coding, so to me it is pretty outstanding. Good luck with the workarounds. Thank you very much, for your kind words and wishes! I have an idea for crawling, let's see how it's turns out. Best regards!
|
|
|
Re: CCT PhysX 1.0
[Re: 3run]
#457695
01/26/16 21:20
01/26/16 21:20
|
Joined: May 2009
Posts: 5,370 Caucasus
3run
OP
Senior Expert
|
OP
Senior Expert
Joined: May 2009
Posts: 5,370
Caucasus
|
GREAT NEWS! I GOT CRAWLING TO WORK! I used two different shapes (two different models, one for standing hull and one for crawling! it's almost same as pXent_addshape, but CCT!), and I switch between them while moving (each of those shapes have pointers and I have one main pointer, that 'points' to the current hull, this way I can handle movement, camera, animations and whatever!). Maybe tomorrow I'll upload a new demo, which will show all results! Edit: my happines did not last for too long, cause somehow this little fuc*er doesn't fit this little whole... lubricant/vaseline didn't help here... I guess most of community users who used to ask me "why don't I just use physX instead of OBB" now can see a materialized answer to their question. Problem is, that as far I as understood I need to keep stand and crawl hulls symmetrical somehow (32x32x64 and 32x32x32), other ways it will result falling trough ground crawl hull (maybe I could make some dirty workaround, but I'm really pissed off right now... and I don't really want to publish something dirty and too tricky to use at the end). Tomorrow I'll continue on copulating with lovely Ackenex and it's lustful physX... Best regards!
|
|
|
Re: CCT PhysX 1.0
[Re: 3run]
#457705
01/27/16 13:27
01/27/16 13:27
|
Joined: May 2009
Posts: 5,370 Caucasus
3run
OP
Senior Expert
|
OP
Senior Expert
Joined: May 2009
Posts: 5,370
Caucasus
|
AND IT WORKS! Here is a little demo (I'm still working on it, but the fact that I got swaping hulls correctly made me happy!): Download linkPress C or CTRL to toggle CRAWLING! When everything will work correctly, I'll upload a source code. Edit: shit... I faced another trouble, now with c_trace detecting the celling above the CCT. All troubles caused by the position of CCT hulls, cause I need to move crawling hull down (it's centered in MED) to match standing hull's lowest point, but when I switch to crawling hull (actually when crawling), then I need to update standing hull's positions, I do exactly the same but with positive value (for crawling hull offset from standing hull is -24, for standing hull offet from crawling hull is 24). This causes some shit for 'c_trace', even it actually looks correct (I debug from to positions of the trace via 'draw_point3d', and they are always the same, as it should be). Trace detects the celling at first when CCT only starts penetrating the hole in the wall (where CCT crawls in), then it doesn't see celling till CCT fully enters the hole. I don't know what to do with this right now. physX plugin from 3dgs_snake had very useful function called 'pX3ent_getfootposition' or something like this, I really miss that one now... Edit2: I'm opened for ideas. Best regards!
|
|
|
Re: CCT PhysX 1.0
[Re: 3run]
#457718
01/28/16 10:22
01/28/16 10:22
|
Joined: May 2009
Posts: 5,370 Caucasus
3run
OP
Senior Expert
|
OP
Senior Expert
Joined: May 2009
Posts: 5,370
Caucasus
|
I've got my problem solved. Now I need to add ladder climbing, platforms and some tweaks before releasing the source code (it will be dirty but yet useful). Edit: added ladder! it's still not finished yet, so no source code, just a demo for you guys to give it a try. If you'll find any issues, please let me know. Here it is: Download link Best regards!
|
|
|
Re: CCT PhysX 1.0
[Re: 3run]
#457720
01/28/16 11:11
01/28/16 11:11
|
Joined: Dec 2011
Posts: 1,823 Netherlands
Reconnoiter
Serious User
|
Serious User
Joined: Dec 2011
Posts: 1,823
Netherlands
|
It works very well, well done! I could only detect 1 tiny problem is that when you jump while crawling through something, the camera goes through the roof. But perhaps this is a pain to solve and a simple c-trace could fix this I quess. Also would be cool if you could implement that if you are on the ladder and jump, you can jump towards a certain direction a bit with by holding down a move key while jumping. (hope that makes sense ) Anyway, I look forward to the code. My current move code is still a pain with certain ramps and keeping a smooth camera/view.
Last edited by Reconnoiter; 01/28/16 11:11.
|
|
|
|