Custom Controller v2

So a while back I tried to make my own kind of Humanoid in an effort to get around some of the limitations I had with the default Humanoids, it worked reasonably well but there were a few issues. Namely me not being able to properly figure out collisions, being stuck with one form of movement, and ramps/stairs behaving fine while ascending, but the player would “fall” every time they tried to go down them.

I’ve been busy. (and pestering @EgoMoose for help with vector maths pretty frequently too :stuck_out_tongue: )

So far here is my new little controller;

Features :
  • Mild acceleration, not a static movement
  • Ladder movement, we snap to ladders and are locked into the Z axis for movement.
  • Ramps, we no longer fall/bounce on our way down ramps
  • Delta & Game Speed dependant movement
  • Teleporting
  • nearly bhopping

With the added bonus of me being able to control time on the fly :smiling_imp:

Theres still a lot I want to add into this and a few issues I’d like to resolve.
If you’re interested, you can check it out here

If you want to see what my first attempt was like; check it out here, it features roughly 50 npcs all while running at 60 fps, but not really doing much.

Biggest issue at the moment: characters have no width.
You can’t pass through objects, but you can also walk through gaps of roughly .01
I’ve got a few ideas of how to fix this, one is to do a quick region3 check and find the closest points to my character’s centre and the surfaces around it.

This is also entirely local. Theres no replication at the moment, but this should be pretty easy to add as I managed it with the previous iteration with little issue.

The added bonus of this being local is that I can make a plugin to run this without the need for a server. Meaning that you could potentially run a solo-visible test while in TeamCreate.
After solving the width problem, I’d be really up for open-sourcing this to see what people can come up with!

Anyway, thanks for reading mateys :slight_smile:

34 Likes

How did you end up handling on the original?

Just interested.

1 Like

I’ve actually been going over this for the last hour or so. Its interesting to go back over and understand why they behave so differently with such similair code!
Both controllers use input and camera rotation to create a velocity, but the ordering is slightly different between versions:

  • In V1; I start with the player’s input and add it to the player’s velocity. I perform all my necessary frame calculations here. I then take this velocity and rotate it in the same angle as the camera’s Y axis.

  • In V2; I start with the player’s input and create a velocity. I then take this velocity and rotate it in the same angle as the camera’s Y axis. I now perform all my necessary frame calculations.

So whats the difference?
Well, due to the order on my first version, any direction the camera faces is the direction of “forwards” for our player’s movement and will not accelerate/decelerate in the turning of the camera, only when using opposite inputs. But in our second version, it really matters where the camera faces, because now if we pull a really tight turn, our player slows down to begin travelling a different direction.

Heres a visual representation, in both I hold only the W and A/D keys:
V2: https://www.youtube.com/watch?v=Z_vSkLCqbnI
V1: https://www.youtube.com/watch?v=bqqcdGH84QY

Personally, I actually really like the movement in V1, its a LOT easier to turn with and I think would make combat really interesting! However, I am aware that it’d also reduce some skill in terms of movement.

Which do you prefer, and why?

2 Likes

I’ve moved into using BodyMovers to make a cheaper radial collision detection, however I’ve noticed a pretty big error at the moment. Changing the games running time results in rapidly different results.
While this is fine for what it is, possibly even usable to make certain areas only reachable via this time change ability, it results in this being near un-usable for its intended purpose.

3 jumps normal speed, 3 jumps speed *.3, 3 jumps normal, 3 jumps speed * 3

What makes things worse, the calculations are correct for the CFrame use;

I now have to go through all my calculations to figure out what on earth is going on :confused:
If anyone has any suggestions for possible causes/fixes, I’m more than happy to hear!

1 Like

2am, nearly fixed it…
gotta sign off for tonight;

3 Likes