Page 1 of 3

[Mod] Monorail [0.1.2] [monorail]

PostPosted: Thu Jan 05, 2012 14:38
by sapier
I've updated pushable block now finaly supporting full featured monorails.

License: WTFPL
Dependencies: default

Image
Image
Image

Craft recipe's:
Image

Actions
Punch (transport)cart (standing next to it) --> accelerate cart
Punch cart from distance --> enter cart
Rightclick cart --> take cart
Rightclick transport cart --> open rightclick menu
*take -->take cart
*content --> show content inventory

Settings:
monorail_carts_mimicry=false (If you're addicted to carts mod set to yes)

Changes:
0.1.2
-fixed crash on using mesecons (thanks polletfa)

0.1.1
-fix bug all transport carts having same inventory
-disallow taking transport cart while inventory not empty

0.1.0
-internal rename to monorail
-fix bug carts not moving correct on some situation where a curve was right after up

0.0.18
-add carts mimicry mode

0.0.17
-fixup for 0.0.16

0.0.16:
-broken

0.0.15:
-add workaround for carts stopping randomly on slow servers

0.0.14:
-fix crash on riding cart
-fix cart orientation problems (up/down/direction)
-fix carts loosing track on load/unload of cart object

0.0.13:
-improve graphics
-add rightclick menu
-reduce reciep prices

0.0.12:
-add workaround for mesecon support

0.0.11:
-added smooth entity riding support
-added transport cart for item movement

0.0.10:
-added mese puncher
-added mese cart detector
-fixed bug if switches were on higher level but attached rails on lower
-fixed bug curve going to lower level
-fixed craft recieps

0.0.9:
-added mese switches
-added mese accelerators/breaks

Version 0.0.1 (block only)
Version 0.0.2 (sliders and boosters too)
Version 0.0.3 (rideable moveblocks)
Version 0.0.4 this version doesn't work with master
Version 0.0.6 this version doesn't work with master
Version 0.0.7 (monorails)
Version 0.0.8 (switches)
Version 0.0.9 (mesecon)
Version 0.0.10
Version 0.0.11
Version 0.0.12
Version 0.0.13
Version 0.0.14
Version 0.0.15
Version 0.0.18
Version 0.1.0
Version 0.1.1
Version 0.1.2

PostPosted: Thu Jan 05, 2012 15:10
by jordan4ibanez
+3 thats cool!

PostPosted: Tue Jan 10, 2012 11:42
by sycam
it doesn't seem to work the debug said

ebug streams initialized, disable_stderr=1
20:06:21: ACTION[main]: minetest with SER_FMT_VER_HIGHEST=21, VER=0.4.dev-20111209-1 RUN_IN_PLACE=1 USE_GETTEXT=0 INSTALL_PREFIX=//Vboxsvr/home-celeron55/minetest_install_win32 BUILD_TYPE=Release
20:06:21: INFO[main]: Parsing configuration file: "C:\Users\sean\Documents\minetest-0.4.dev-20111209-1-win32\bin\..\minetest.conf"
20:06:21: INFO[main]: Settings: Setting not found: "enable-unittests"
20:06:21: INFO[main]: Settings: Setting not found: "server"
20:06:21: INFO[main]: Settings: Setting not found: "speedtests"
20:06:21: INFO[main]: Settings: Setting not found: "random-input"
20:06:21: INFO[main]: text_height=18
20:06:21: INFO[main]: Created main menu
20:06:36: INFO[main]: Dropping main menu

PostPosted: Tue Jan 10, 2012 13:00
by sapier
you need to get the latest official build 9th december is quite old

PostPosted: Tue Jan 10, 2012 14:31
by jordan4ibanez
glitch..if block is punched multiple times it will actually take flight and crash the game..it is quite hilarious but it is a bug...im on windows right now btw

PostPosted: Tue Jan 10, 2012 19:10
by sapier
punching it multiple times (left mouse button) does work for me but still could be a race condition in your case can you provide the crash log?

I'll try to fix it but honestly this mod really needs some minetest addons I've just finished as early implementation but don't seem to be accepted by celeron (at least not the way I wrote it). Probably I can fix it so that he's happy with it but I cant promise.

Have a look at this video to see what it looks like Video

But there's still major problems NOT fixable:

1) mb staying on track can't be ensured
2) mb sometimes crashes surface before lifted up on upwards sliders (same reason as 1)
3) mb stops in case of corner with directly attached block in original movement direction same reason as 1)

PostPosted: Tue Jan 10, 2012 22:08
by jordan4ibanez
WAIT A SECOND...that track..YOU JUST MADE MINECARTS!

PostPosted: Tue Jan 10, 2012 22:21
by sapier
They won't stay on track if accelerated too much so it isn't really a working implementation.
And they won't relyable go up either.

PostPosted: Thu Jan 12, 2012 00:30
by sycam
when i place move blocks minetest stops working

PostPosted: Thu Jan 12, 2012 06:00
by Calinou
Are you using the latest version of Minetest? The latest 0.4 dev version is 20120106-1.

PostPosted: Thu Jan 12, 2012 17:16
by sapier
version 0.0.3 does NOT support everything shown in the video the patches needed to achiev this aren't in master.

but 0.0.3 shouldn't stop minetest so please supply additional error information.

PostPosted: Sun Jan 15, 2012 22:15
by sapier
Added github link to fork supporting all the nice features in video

PostPosted: Tue Jan 31, 2012 18:33
by RAPHAEL
So what's the progress on this? Curious.

PostPosted: Tue Jan 31, 2012 19:00
by RAPHAEL
Well I just tried the fork with latest rideable blocks mod. Can't seem to actually ride the blocks or keep the block on the track lol.

PostPosted: Tue Jan 31, 2012 19:37
by sapier
You need to use the git tree I added it isn't updated to latest minetest. I'll do another try to get those changes into master as soon as sound changes are in ... probably combined with mob removal patches.

Progress is that it was working ... at least kind of. Riding was implemented as linking different CAO/SAO together making movement of one override/disable movement handling of the linked child. This is a change in sao and cao handling but there have been other changes recently in those too. So these patches need to be rebased.

The last open issue was handling movement in lua isn't possible for "high" speeds as there isnt guaranteed that the on_step handler gets called within time to change directions. For example if your track goes right but when the onstep handler gets called next time you already moved 2 blocks forward you won't be able to decide which track to take. Thats the reason why this mod is experimental as I don't see an easy solution to this issue.

PostPosted: Fri Feb 03, 2012 19:28
by sapier
I've just updated my branch with current master changes.

PostPosted: Fri Feb 03, 2012 19:56
by Temperest
sapier wrote:The last open issue was handling movement in lua isn't possible for "high" speeds as there isnt guaranteed that the on_step handler gets called within time to change directions. For example if your track goes right but when the onstep handler gets called next time you already moved 2 blocks forward you won't be able to decide which track to take. Thats the reason why this mod is experimental as I don't see an easy solution to this issue.


Maybe the speed could be limited to about 1.999999 blocks per step, so this issue doesn't show up? I think that's plenty fast enough for things like minecarts and similar.

PostPosted: Sat Feb 04, 2012 12:31
by sdzen
reccomendations remove sliders add rails instead then change the booster to look like real tracks!
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
function is_slider(name)

    if     name == "default:rail" or
        name == "pushable_block:booster" then
        return true
    end

    return false
end

PostPosted: Sat Feb 04, 2012 16:07
by sapier
@Temperest limiting speed would reduce chance the problem would happen but it wouldn't fix it ... btw speed is already kind of limited by physics as air resistance as well as friction are handled like in real world. But back to why it wouldn't fix the problem. Movement depends on on_step handler as soon as you've got enough load at the server it may be delayed beyond any limit you've arbitrary set.

And I've forgotten another open issue too running up sometimes stops as collision with the block is detected before on_step handler has increased y position enough for it to pass.

@sdzen I've already had a discussen because I've implemented a mod that someone else thought was to close to his mod and don't want another one. Especialy not for a mod that doesn't work as expected. And of course it isn't even operational with master minetest version too.

PostPosted: Sat Feb 04, 2012 17:21
by Temperest
sapier wrote:@Temperest limiting speed would reduce chance the problem would happen but it wouldn't fix it ... btw speed is already kind of limited by physics as air resistance as well as friction are handled like in real world. But back to why it wouldn't fix the problem. Movement depends on on_step handler as soon as you've got enough load at the server it may be delayed beyond any limit you've arbitrary set.

And I've forgotten another open issue too running up sometimes stops as collision with the block is detected before on_step handler has increased y position enough for it to pass.


How about this:

For each call of the handler:

  1. Add the current delta to the accumulated delta, which is initialized to 0.
  2. If the accumulated delta is not too small, move to the stored block position if it is present in the metadata and set the accumulated delta to 0, otherwise don't move at all.
  3. Current velocity is used to find the next node the movable block is to go to, and it is clamped such that the speed does not exceed 1.999999 blocks.
  4. The block location is stored in the movable block's metadata.

Would this work? If I thought it through correctly, this would merely slow down and lag when the server is under heavy load, instead of continuing to move.

I would love to see minecart-like means of transportation in MineTest.

PostPosted: Sat Feb 04, 2012 17:36
by sapier
Your suggestion is exactly how the minecart mod is doing movement. Having the effect that movement looks a little bit "choppy". This is the due to on_step handlers aren't called fast enough to create a smooth movement from lua.

Pushable blocks just uses acceleration and speed and "movement" itself is done by client/server which is much more efficient and smooth. But causes the other problems to happen.

So either way it's not better than minecart mod.

The other feature "riding blocks" isn't exactly related to this mod, if the patches are aplied to minetest adding it to minecart mod wouldn't be much work at all.

PostPosted: Tue Mar 13, 2012 17:53
by Arwym
Is this mod stable enough to use in a production server? I am so looking forward to it!

PostPosted: Tue Mar 13, 2012 18:28
by sapier
this mod is only working on my branch of minetest, so you most likely won't want to run it on a production server

PostPosted: Tue Mar 13, 2012 19:31
by IPushButton2653
Made a few new textures for it with the LOZ textures. It looks epic. Will be testing soon!

PostPosted: Mon Mar 19, 2012 18:13
by Jordach
I wonder if this code can be used under the new release..I might get the carts working.

PostPosted: Mon Mar 19, 2012 18:27
by sapier
I'm going to try it but as far as I know the entity linking wasn't added to core.

EDIT1:
no the link/unlink feature didn't make it to core. As there are lots of changes for this release I can't provide a date when those changes will be merged to my branch atm either.

PostPosted: Mon Mar 19, 2012 19:07
by Jordach
Hmm, I will try be hand and see what comes of this experiment.

PostPosted: Fri Apr 13, 2012 16:25
by InfinityProject
How to ride it?

PostPosted: Fri Jun 22, 2012 01:52
by SegFault22
They won't stay on track if accelerated too much so it isn't really a working implementation.

So...What happens if you take a minecart, bolt a jet-propulsion engine to it and aim it at a 90* turn in the tracks? It runs off the tracks >:D Even on some straight-sections in the track, if moving too fast, any minecart will begin to ''gain lift'' and destabilize off-track.
Now, all you have to do is come up with a way to animate the crash-scene...lol

PostPosted: Mon Sep 10, 2012 20:35
by sapier
As there ain't a cart mod supporting up and down movement (at least none I know) I've had a look at my old sliders mod. And guess what? I've managed to fixed the bug's beeing the reason to discontinue development.

1) up/down movement often threw cart out of track
2) cart stopped in corners if wall was directly ahead in movement direction

EDIT1:
link unlink feature, making movement smooth, still haven't found it's way to core movement is still choppy