diff --git a/README.md b/README.md index fd96346..1b1825a 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,46 @@ -# Fabric Example Mod +# Audaki Cart Engine -## Setup +## Brief +Audaki Cart Engine offers well designed and properly balanced, competitive and viable cart-based passenger transportation. -For setup instructions please see the [fabric wiki page](https://fabricmc.net/wiki/tutorial:setup) that relates to the IDE that you are using. +## Foundation +This was mod was created since every mod I found that increased the speed of minecarts broke stuff and didn't +work with existing rail lines. Additionally most redstone stuff breaks when your cart moves with more than 10m/s. -## License +## Quality Engineering +This mod is currently a huge overhaul of the minecart movement engine to support higher speeds (up to 34m/s) +while still supporting existing lines with curves, ascending and descending rail pieces are no problem. -This template is available under the CC0 license. Feel free to learn from it and incorporate it in your own projects. +Additionally redstone rails like detector and activator rail still work. + +The Cart Engine was tested under a lot of different conditions but if you find an edge case it'll be fixed + +## Engine Methodology +The engine travels along the expected path of the rail line and will temporarily slowdown to cross important parts +like curves and ascending/descending track pieces. But the engine is coded in a way that the momentum is kept +and after the curve/hill or redstone piece is crossed the movement speed is mostly restored. + +## Game Design / Balancing +The goal for this mod is not just to implement a new Cart Engine of course, but also to provide good game play! + +To support this goal a whole lot of stuff was tweaked so the powered rail (i.e. Gold) required to reach certain +speeds is well balanced, so creating a high-speed railway is actually a proper end-game goal. + +Additionally the speed is balanced in a way that riding the railway is a lot of fun and it's better than packed ice. + +Due to the balanced acceleration curve railways can still be used early-game with lower speeds and less gold investment + +## Features / Balancing +- Fixed a long-standing vanilla bug that doubles the Cart Movement Speed when a block is skipped in a tick +- Raised maximum speed from 8m/s to 34m/s for carts with passengers (achievable when there are 8 straight rail + pieces behind and in front of the cart) +- Raised fallback maximum speed from 8m/s to 9.2m/s for carts with passengers +- Tweaked powered rail acceleration to factor in fewer spent ticks on higher speeds and multiply the acceleration accordingly +- Tweaked acceleration to be require more powered rails on higher speeds +- Tweaked acceleration to feel good and somewhat train-y. +- Tweaked achievable momentum for the new high-speed +- Tweaked breaks to handle the higher speed and momentum properly +- Tweaked "kick-start" speed when starting from a standing block with a powered rail +- Cart Engine simulates travel along the railway and dynamically adjusts allowed speed based on rail conditions around the cart +- High-Speed Cart temporarily slows down for slopes and curves +- High-Speed Cart temporarily slows down for Detector Rails and Activator Rails diff --git a/gradle.properties b/gradle.properties index 1918486..e4f64d5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,7 +10,7 @@ org.gradle.jvmargs=-Xmx8G # Mod Properties mod_version = 1.0.0 maven_group = audaki - archives_base_name = mc-train-test + archives_base_name = audaki-cart-engine # Dependencies fabric_version=0.38.2+1.17 diff --git a/src/main/java/audaki/mc_train_test/mixin/AbstractMinecartEntityMixin.java b/src/main/java/audaki/cart_engine/mixin/AbstractMinecartEntityMixin.java similarity index 99% rename from src/main/java/audaki/mc_train_test/mixin/AbstractMinecartEntityMixin.java rename to src/main/java/audaki/cart_engine/mixin/AbstractMinecartEntityMixin.java index e7529aa..0838d22 100644 --- a/src/main/java/audaki/mc_train_test/mixin/AbstractMinecartEntityMixin.java +++ b/src/main/java/audaki/cart_engine/mixin/AbstractMinecartEntityMixin.java @@ -1,4 +1,4 @@ -package audaki.mc_train_test.mixin; +package audaki.cart_engine.mixin; import com.mojang.datafixers.util.Pair; import net.minecraft.block.AbstractRailBlock; @@ -11,7 +11,6 @@ import net.minecraft.entity.MovementType; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.vehicle.AbstractMinecartEntity; -import net.minecraft.server.MinecraftServer; import net.minecraft.util.math.*; import net.minecraft.world.World; import org.spongepowered.asm.mixin.Mixin; @@ -158,7 +157,6 @@ private void modifiedMoveOnRail(BlockPos pos, BlockState state) { return new ArrayList<>(); RailShape n1RailShape = n1State.get(((AbstractRailBlock) n1State.getBlock()).getShapeProperty()); - if (n1RailShape != railShape) return new ArrayList<>(); @@ -350,7 +348,7 @@ private void modifiedMoveOnRail(BlockPos pos, BlockState state) { Vec3d vec3d8 = this.getVelocity(); double ah = vec3d8.x; double ai = vec3d8.z; - final double railStopperAcceleration = basisAccelerationPerTick * 12.0D; + final double railStopperAcceleration = basisAccelerationPerTick * 16.0D; if (railShape == RailShape.EAST_WEST) { if (this.willHitBlockAt(pos.west())) { ah = railStopperAcceleration; diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 257cff3..5ef1870 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -1,16 +1,17 @@ { "schemaVersion": 1, - "id": "audaki_mc_train_test", + "id": "audaki_cart_engine", "version": "${version}", - "name": "Audaki's usable minecart Transport", - "description": "Usable minecart Transport", + "name": "Audaki Cart Engine", + "description": "Audaki Cart Engine offers well designed and properly balanced, competitive and viable cart-based passenger transportation.", + "authors": [ "Audaki" ], "contact": { "homepage": "https://audaki.de/", - "sources": "https://github.com/audaki/mc-train-test" + "sources": "https://github.com/audaki/minecraft-cart-engine" }, "license": "CC0-1.0", @@ -20,14 +21,10 @@ "mixins": [ "modid.mixins.json" ], - "depends": { "fabricloader": ">=0.11.6", "fabric": "*", "minecraft": "1.17.x", "java": ">=16" - }, - "suggests": { - "another-mod": "*" } } diff --git a/src/main/resources/modid.mixins.json b/src/main/resources/modid.mixins.json index 16fe62c..0e0ae13 100644 --- a/src/main/resources/modid.mixins.json +++ b/src/main/resources/modid.mixins.json @@ -1,7 +1,7 @@ { "required": true, "minVersion": "0.8", - "package": "audaki.mc_train_test.mixin", + "package": "audaki.cart_engine.mixin", "compatibilityLevel": "JAVA_16", "mixins": [ "AbstractMinecartEntityMixin"