Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark Physics & Dark A.I. & Dark Dynamix / Character Controller Coods?

Author
Message
culmor30
16
Years of Service
User Offline
Joined: 16th Jun 2007
Location: In my head.
Posted: 8th Apr 2008 02:54
Hey, I'm really aggravated at the character controller right now. Because the rest of my team DEMANDS that I have a working demo that includes the ability to walk up stairs/ramps, I decided to switch to the character controller from my previous self-made "character box."

Well, I found that the char controller is very, VERY lacking in commands to get info about it, and to position it. I'd love to get som help with the following:

-Be able to strafe (with my current WASD setup)
-Find some way to position the camera at the X,Y+2.5,Z of the controller, and
-Keep the change relatively unnoticeable, so it behaves very similarly to the way my previous code would.

I don't think a full media download is necessary, so I'll just post my code. I'm just inexperienced and have no idea what I'm doing



I created the char controller right after the remmed out char obj creation at the beginning. Now I have nothing, and I don't really know where to start to get this to work. Do I need an object to link it to? After all that's sorted out, I need to work on the above.

And TIME IS OF THE ESSENCE. I only have about 6 days until deadline, and this deadline is not changeable. D: *very nervous*

Thanks in advance
culmor30
16
Years of Service
User Offline
Joined: 16th Jun 2007
Location: In my head.
Posted: 8th Apr 2008 06:10
New version:

Well, I looked at the demos and realized how to get my controller to move forward and back, and steer with mouselook. So I've come to this:



I still can't strafe though. And another odd thing was, I could walk through my level walls. As you can see, my level is set up with DP. I decided to look into it a bit more, and started the debugger to check the collisions. It runs VERY slowly on this ancient laptop, but I managed to see that my capsule was falling directly through the level at the beginning instead of staying on the ground where it should. For some reason, my camera and the actual player object stayed within the level, but I was able to walk through all the boundaries. Any help?
hinged shinobi
16
Years of Service
User Offline
Joined: 3rd Apr 2008
Location:
Posted: 9th Apr 2008 11:29
I've had a quick glance over your code, but I'm no expert having only started using Darkbasic professional a couple of days ago. I have no idea how to get the character controller to strafe, I tried all day yesterday (well not all day, like an hour maybe), so I can't help you on that one.

Here's what I think might work for the collision problem:

I don't know why but sometimes, for me at least, making an object a static mesh doesn't actually work and the character controller would just fall through the floor and other times it would work fine. To fix this I just changed it to a static box, but obviously this won't work for your .x level model. Maybe, and I'm only saying this because I've never tried Sparkys collision DLL, but maybe you should get rid of it. I'm not sure how but it might be interfering with DarkPhysics collision detection.

Also, have you tried positioning where the player starts a bit higher, it might be that the character controller is created in the floor a bit and falls through it?


I expect none of that will help, hopefully some expert will post and be able to sort it out for you.

Let me know if you get strafing to work because I am at a complete loss as to how to do it.
Pixel Perfect
17
Years of Service
User Offline
Joined: 21st Feb 2007
Location: UK
Posted: 9th Apr 2008 15:18
The normal method adopted by most people on here for strafing is to rotate the character contoller through 90 degrees, move forwards a bit and rotate back again.

There are plenty of examples of code in this forum if you search for them including various attempts at including code for jumping.

Good luck.

No matter how good your code is, someone will improve on it
hinged shinobi
16
Years of Service
User Offline
Joined: 3rd Apr 2008
Location:
Posted: 9th Apr 2008 17:05
I did a bit of a search for strafing and character controller, it seems people don't like it that much. It is quite annoying how it can't push dynamic objects, but I figure this can't be too hard to do it yourself.

Anyway. Incase culmor30 or anyone who needs to know how to strafe and doesn't want to go through miles of code finding the movement bit here is what I did:



Object 1 is the player object, p_ay# is the angle of the object. So it rotates the player 90 degrees to the left or right and then moves it. When it's finished it rotates it back to whatever angle the object is at.

When I was looking for examples on how to do it all the code seemed over complex, so this should be easier to understand.
culmor30
16
Years of Service
User Offline
Joined: 16th Jun 2007
Location: In my head.
Posted: 10th Apr 2008 02:25
Hmm... what about a W and A combination, or W/D, S/A, or S/D? Would I rotate it 45 degrees?

And in your code, shouldn't you rotate using wrapvalue? Or does it matter?
culmor30
16
Years of Service
User Offline
Joined: 16th Jun 2007
Location: In my head.
Posted: 10th Apr 2008 04:38
Ugh... well, here's how far I am as of now:



As you can see, I did the 90degree turning thing, but at random times I'll curve off in a random direction. And they don't work right, they usually move in some random diagonal direction.

And it made a mess of my mouselook script as well. My camera was tied to my object in a way that when you turned the mouse, the whole object turned. So I took off the constraints, but that doesn't work too well either. The camera rotates independently of the object, and I don't know what to do about it.

Any more help?
hinged shinobi
16
Years of Service
User Offline
Joined: 3rd Apr 2008
Location:
Posted: 10th Apr 2008 12:42
I have no idea why it doesn't work for you so I'll just post my entire movement and mouselook thing so you can pick it apart or steal it whole. It works absolutely fine for me.



Hopefully it should work for you.

Login to post a reply

Server time is: 2024-05-19 20:14:01
Your offset time is: 2024-05-19 20:14:01