Giter Site home page Giter Site logo

rails's Introduction

Build Status

Rails

Rails is a Terasology module that adds rail transport into the game. It helps the player to travel far distances faster and easier than ever before.

Items

Rails

Rails are the most fundamental part of this module. They are the tracks on which carts can travel.

Carts

A cart is a vehicle that can travel on rails. This module contains a simplistic cart which can be ridden by the player. It moves only when pushed by the player or dragged by a connected cart.

Wrench

The wrench is a tool that can be used to perform specific actions like connecting carts with each other or changing the direction of a tee joint.

For additional items like locomotives and special rails to use with Rails, please take a look at the AdditionalRails module.

Getting Started

  1. Create a new world with the Rails module enabled
  2. You should see a wrench and a cart item in your inventory.
  3. Press F1 to open up the console and type in give rails:rails to obtain rail blocks, which will be available in the inventory. Repeat this step when you need more rail blocks.
  4. Place rail blocks on top of other blocks to build a track.
  5. To place a cart on a track, select the cart item in your inventory and place it (right-click) on a rail block as you would place a normal block. The cart will automatically align itself with the track.

Creating Tracks

Tracks are built by placing rail blocks. When a rail block is placed, it automatically connects to nearby rail blocks to form contiguous track segments. Rail blocks can be straight or sloped and can form a corner, T (tee) junction, or an intersection.

Connecting Carts

You can connect two carts as follows:

  1. Place two carts on two adjacent rail blocks such that they are very close to each other.
  2. Select the wrench in your inventory and right-click on a cart
  3. You now have a connection between the two carts. On pushing one cart, the other cart should follow suit.

Testing

You can verify whether or not all of the functionality in Rails is working perfectly by following the Test Plan that has been written in the repository's wiki.

rails's People

Contributors

4denthusiast avatar anuar2k avatar cervator avatar darkweird avatar eviltak avatar iaronaraujo avatar jdrueckert avatar keturn avatar manumafe98 avatar mayant15 avatar meta-maxim avatar msteiger avatar pandacontron avatar pollend avatar qwertygiy avatar rzats avatar skaldarnar avatar skysom avatar small-jeeper avatar ujjman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rails's Issues

Explosive cart in multiplayer works but is invisible

  • give ExplosiveCartItem
  • Place the cart on some rails, ideally going downhill so it'll move
  • Have an activator rail on the track somewhere - give ActivatorRail
  • Observe that the cart never becomes visible, but server logging indicates it is created. It'll roll down the hill, trigger off the activator, and explode a few seconds later

Probably something isn't marked right for the cart to become visible on clients

Edit: Seems to be the case with several newer carts (all from AdditionalRails?)

Rail Flipped Straight Segment

Sometimes when laying down track, a segment will sometimes be flipped in the wrong direction. The track itself is correct but the component data that describes the track is incorrect. This only happens occasionally so tracking this down is fairly difficult.

cartstraight

Carts inch along when nothing is pushing them

After carts are pushed, they will inch along when they should have slowed down to a stop.

This is due to the velocity magnitude not being clamped to zero when the magnitude of friction impulse is greater than the speed.

Reproduction

Place a cart on a rail and push it. More often than not you will notice that the cart keeps inching forward even after a long time.

Trying to place a loco in multiplayer results in a denial

  • Request a loco - give locoItem
  • Try to place it on some rails
  • Get 14:19:17.093 [main] INFO o.t.logic.characters.CharacterSystem - Denied activation attempt by Cervator861 since at the authority another entity would have been activated

support different friction coefficients for rail segements

At the moment there is a java file in rails called Constants with a value called FRICTION_COFF. It should be possible to define other rail segments with different amounts of friction.

Add a friction coefficient value to RailComponent. This also involves tweaking the CartMotionSystem and using the friction coefficient of the current rail segment that the cart is currently on rather then using a fixed coefficient for all segments.

Cart Joining

In the legacy branch of this repository; It used to be possible to link to carts together and push it as a train. It would be an improvement to add an extension to the solver that allowed carts to be linked and pulled together.

Carts Intersecting Blocks at End Segments

Carts, When they hit an end segment will pop off and act like a bullet rigid body. The problem is when the end segment leads straight into a block. The cart will pop off the segment and be immediately embedded in the block. This causes the cart to launch back onto the track.

Instead The cart should hit the block at the end of the segment and roll back. This behavior is because Rails Implements its own impulse solver that is separate from Terasology. This means that the cart will only respond to intersections with the world after it leaves the rail segment and changes from a kinematic body to a non-kinematic body.

output

Connecting Carts

The old implementation of Rails let the user connect one cart to another. This was dropped with the rework of rails. The new impulse solver will need to be extended to support connecting two carts together.

The current implementation of the impulse solver is fairly simplistic and for the mod this works really well. This will require tweaking the impulse solver to allow carts to be connected to each other. Collisions between carts should be ignored to prevent unintended jumping.

There are some basic elements provided but beyond that this requires extending the impulse system. There are some nice resources on the subject but translating those details is not easy.

Old Implementation: https://www.youtube.com/watch?time_continue=22&v=_SwESByZtZg

Reworking Tracks

To Re-implement

  • implement collisions again
  • Implement cart joints
  • implement a way to specify seats in the prefab

Stretch Features and fixes

  • use Two axises instead of one for cart rotation
  • carts speed up and slow down slightly due to how Bezier Curves works
  • multi-block functionality for curves
  • curve tilt rotation (not sure what is the usage for this would be? Rollercoasters?)

Re-enable or delete MTE tests

The MTE test was disabled in b5d421d because it was failing on CI.

However, the test seems to work fine when run locally. We should figure out what is going wrong in CI, and this can be fixed.

image

The following WARN only pops up during CI runs but not locally for me - maybe that gives a clue...

14:34:23.811 [Thread-8] WARN  org.reflections.Reflections - could not create Vfs.Dir from url. ignoring the exception and continuing
    org.reflections.ReflectionsException: could not create Vfs.Dir from url, no matching UrlType was found [file:/home/jenkins/agent/workspace/Terasology_Modules_R_Rails_PR-78/build/resources/test]
    either use fromURL(final URL url, final List<UrlType> urlTypes) or use the static setDefaultURLTypes(final List<UrlType> urlTypes) or addDefaultURLTypes(UrlType urlType) with your specialized UrlType.

Feature request: Extended rail & cart type system.

The idea

(Note, that this request would make locomotives obsolete and so hence I have not mentioned them anywhere in my proposal)
Whilst currently the system works as intended. It provides a cart you can move and a locomotive you can use to pull it. However, this is a very basic functionality which eliminates large amounts of gameplay options. I propose a system to allow for a much more extended choice and array of carts and rails.
This system would change the carts and rails to work on a modular system. When a rail or cart is crafted it would be the same as it is now. A basic item with basic functionality. The key part is being able to then attach components to this item.
For rails these components could be things that enable it to switch directions on signal, speed up the cart, slow down the cart, jump the cart. They would be creatable through a prefab and a new java class containing the logic for the functionality. The component would then be able to be added to a track via a tool (ie, screwdriver) which would open a screen to edit the components of that rail. If said tool is used on empty space it would open a screen that would allow for stacks of multiple rails to be altered at once, making it easier for large use cases. Components could also be removed via the same screen.
The same method would be used for carts, reusing the same tool and method of altering, albeit without the option to edit multiple stacks of carts.
Interacting with a rail or cart without the screwdriver would open a screen where the setting of each component could be edited or interacted with.
Each component would also be able to come with a visual change that would be applied atop the existing texture allowing for easy identification of the components in a quick manner.

Potential Additions

To avoid visual issues and to assist in gameplay balancing there would be a set number of slots that are mapped to a physical point on the item, with only one item in each of these slots. There could also be a limit on the number of components that could be added.

Cannot place sloped rail

What you were trying to do

Replace a sloped rail.

What actually happened

I could not place the sloped rail

How to reproduce

  • Step 1: Place a rail on a 1 high block
  • Step 2: Place another rail at the base level 2 blocks away from the raised rail
  • Step 3: Place another rail 1 to the right of where the space that would hold the sloped rail
  • Step 4: Try to place the sloped rail

image

Log details and game version

2,250 alpha 2018-11-23T19:47:46Z

Computer details

Windows 10
Modules:
Core
ModuleTestingEnvironment
SegmentedPaths
Rails

Server crash on joining carts

During a play test

14:04:29.701 [main] INFO  o.t.n.internal.NetworkSystemImpl - Component class org.terasology.entitySystem.entity.internal.EntityInfoComponent added to EntityRef{id = 1813470, netId = 685, prefab = 'Rails:rail'}
14:04:29.701 [main] INFO  o.t.n.internal.NetworkSystemImpl - Component class org.terasology.entitySystem.entity.internal.EntityInfoComponent added to EntityRef{id = 1813470, netId = 685, prefab = 'Rails:rail'}
14:04:29.701 [main] INFO  o.t.n.internal.NetworkSystemImpl - Component class org.terasology.entitySystem.entity.internal.EntityInfoComponent added to EntityRef{id = 1813470, netId = 685, prefab = 'Rails:rail'}
14:04:29.701 [main] INFO  o.t.n.internal.NetworkSystemImpl - Component class org.terasology.entitySystem.entity.internal.EntityInfoComponent added to EntityRef{id = 1813470, netId = 685, prefab = 'Rails:rail'}
14:04:29.810 [main] INFO  o.t.m.controllers.CartJointSystem - Joint created between: EntityRef{id = 676868, netId = 508, prefab = 'Rails:minecartVehicle'} and EntityRef{id = 676868, netId = 508, prefab = 'Rails:minecartVehicle'}
14:04:29.815 [main] ERROR o.terasology.engine.TerasologyEngine - Uncaught exception, attempting clean game shutdown
java.lang.NullPointerException: null
	at org.terasology.minecarts.controllers.CartJointSystem.applyImpulseOnSocket(CartJointSystem.java:118)
	at org.terasology.minecarts.controllers.CartJointSystem.update(CartJointSystem.java:105)
	at org.terasology.engine.modes.StateIngame.update(StateIngame.java:175)
	at org.terasology.engine.TerasologyEngine.tick(TerasologyEngine.java:437)
	at org.terasology.engine.TerasologyEngine.mainLoop(TerasologyEngine.java:400)
	at org.terasology.engine.TerasologyEngine.run(TerasologyEngine.java:376)
	at org.terasology.engine.Terasology.main(Terasology.java:143)
14:04:29.815 [main] INFO  o.terasology.engine.TerasologyEngine - Shutting down Terasology...
14:04:30.084 [main] INFO  o.t.p.i.ReadWriteStorageManager - Saving - Creating game snapshot
14:04:30.087 [main] INFO  o.t.p.i.ReadWriteStorageManager - Saving - Snapshot created: Writing phase starts
14:04:30.199 [main] INFO  o.t.n.internal.NetworkSystemImpl - Client disconnected: Cervator861
14:04:30.201 [main] INFO  o.t.n.internal.NetworkSystemImpl - Client disconnected: Pparter

Add a button to cycle through possible rail blocks

The priority system in RailBlockFamily's getClosestMatch function picks any rotation of the block with the highest priority from the set of possible blocks. We could add a hotkey (say e) or add a feature to the wrench which rotates a placed track or replaces it with a block of lower priority, allowing players to manually choose which blocks they want to place.

One way to do it would be to just follow the getClosestMatch function and run it again, going lower than the track already placed.

Tweak needed for recent engine changes (gestalt)

I'm trying to get all the "stable" modules compiling again :-)

Rails is just triggering a single and simple looking error in RailsUpdateFamily that might be fixable simply with:

byte connections = Byte.parseByte(blockUri.getIdentifier().toString());

(the identifier became a "Name" instead of a String)

@small-jeeper - mind taking a look and making sure that doesn't break anything?

Rail Block Placement Problems

The Rail family does not choose the right block when it's placed. For the slope case it should pick a turn block over a straight segment. For the corner segment the rail should be a straight segment and not a turn.

screenshot from 2017-10-30 15-07-28

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.