Some idea of SimpleCarts #27


  • Enhancment
  • Started
Open
Assigned to xpikamug
  • _ForgeUser8734186 created this issue Apr 13, 2012

    What is the enhancement in mind? How should it look and feel?

    Please provide any additional information below.

    1.booster and brake
    We can use some equations below instead of constant speed.
    Example:
    for booster: speed = acceleration * ( 1.0 - speed / speed_max );
    or for brake: speed = speed - acceleration; if(speed<speed_min) speed = speed_min;
    normal track: speed =speed - acceleration; if(speed<0.0) speed = 0.0;
    speed unchanged for power track because minecraft will speed up or slow down automatically.
    And I found that a minecart on the slope seems to set its velocity to (0,0,0) when speed>0.8

    2.better control
    The original method is use the Event"onVehicleDamage" ,and decide the direction by (Player).getLocation().getDirection(); But this vector changed only when players stop moving their mouse. If we punch the cart without stare at one point first ,the cart won't move to the direction we want.

    Thus I found another function to improve the control. The function (Player).getVelocity() return vector when player move mouse or press key instantly.
    So ,we can use this function in Event"onVehicleUpdate" to accelerate or decelerate minecart by press a key.

    Similarly,we can use this function to implement intersection without stopping the minecart.For example , if we look forward and hold the key A ,the rail and cart will turn left ,then stop calling intersection function in the next cycle;And if player don't press any key or hold the key W ,the cart will keep the direction. But we still can change direction if we did't leave the intersection.And intersection should still work if we stop on the intersection by a T-shape intersection.

    More advanced,
    We can use this method to control a minecart which is not on the track.The minecart will become a racing car on the ground.And we can make jump function by (Player).isSneaking() ,etc.

  • _ForgeUser8734186 added the tags New Enhancment Apr 13, 2012
  • xPikaMug posted a comment Apr 15, 2012

    1. I've experimented with change in acceleration before. I might consider offering a choice of equations in the future, but for now I've decided to keep a constant speed. This is mostly because I believe the Booster would become somewhat unnecessary compared to Powered Rails. They would function too similarly.

    2. This is very interesting! I'm surprised that player velocity returns anything while in a Minecart. Like you said, this seems like it'd be useful as a sort of manual control option. Thanks for the info - I'll experiment with this when I get the chance!

    Thank you for the well thought-out ticket. It's rare I see someone post code along with their suggestions!

    EDIT: That problem you're experiencing on slopes at speeds > 0.8 is a conflict with Minecraft. See this ticket: http:dev.bukkit.org/server-mods/simplecarts/tickets/8-minecarts-moving-upstairs-fails-with-boosters/


    Edited Apr 15, 2012
  • xPikaMug removed a tag New May 27, 2012
  • xPikaMug added a tag Started May 27, 2012

To post a comment, please login or register a new account.