Skip to content

Commit

Permalink
Ready for publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
audaki committed Aug 25, 2021
1 parent 1f92b97 commit 23f516c
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 19 deletions.
47 changes: 42 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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<>();

Expand Down Expand Up @@ -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;
Expand Down
13 changes: 5 additions & 8 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -20,14 +21,10 @@
"mixins": [
"modid.mixins.json"
],

"depends": {
"fabricloader": ">=0.11.6",
"fabric": "*",
"minecraft": "1.17.x",
"java": ">=16"
},
"suggests": {
"another-mod": "*"
}
}
2 changes: 1 addition & 1 deletion src/main/resources/modid.mixins.json
Original file line number Diff line number Diff line change
@@ -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"
Expand Down

0 comments on commit 23f516c

Please sign in to comment.