My Train Mod

User avatar
indriApollo
Member
 
Posts: 144
Joined: Fri Sep 26, 2014 11:34
GitHub: indriApollo
IRC: indriApollo
In-game: SudoAptGetPlay

Re: My Train Mod

by indriApollo » Mon Jan 19, 2015 10:27

Good job, this is amazing ! (btw I've got trainloads of Ho trains at home, Märklin all the way :)
 

User avatar
jordan4ibanez
Member
 
Posts: 1865
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

Re: My Train Mod

by jordan4ibanez » Tue Jan 20, 2015 23:10

indriApollo wrote:Good job, this is amazing ! (btw I've got trainloads of Ho trains at home, Märklin all the way :)

Thank you! Hopefully you'll be able to relive them full size in minetest soon as well!
 

User avatar
jordan4ibanez
Member
 
Posts: 1865
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

Re: My Train Mod

by jordan4ibanez » Tue Jan 20, 2015 23:15

Hey guys, here's revision 20!
.tar.gz
.zip
There may not look like a difference between the last version and this one, but I rewrote a lot of the entity stuff. I tried to crash the game or cause a glitch for about a half hour and but I wasn't successful. So try it out, try to cause serious issues and if you find any, post them here! The output of 7 and a bunch of other numbers is debug for right now. See if you can get it to anything but 7 in a straightaway while the trains moving. Have fun!
 

User avatar
Nathan.S
Member
 
Posts: 679
Joined: Wed Sep 24, 2014 17:47
GitHub: NathanSalapat
IRC: NathanS21
In-game: NathanS21

Re: My Train Mod

by Nathan.S » Wed Jan 21, 2015 02:26

I downloaded the .tar.gz file and I'm getting this in my log file. Everything still runs alright, but this prints multiple times a second.
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
19:34:50: ACTION[ServerThread]: stack traceback:
19:34:50: ACTION[ServerThread]:    [C]: in function 'log'
19:34:50: ACTION[ServerThread]:    /usr/share/minetest/builtin/game/misc.lua:92: in function 'get_node_group'
19:34:50: ACTION[ServerThread]:    /home/nathan/.minetest/mods/trains/functions.lua:47: in function 'train_on_track'
19:34:50: ACTION[ServerThread]:    /home/nathan/.minetest/mods/trains/init.lua:156: in function </home/nathan/.minetest/mods/trains/init.lua:153>
19:34:50: ACTION[ServerThread]: Deprecated usage of get_node_group, use get_item_group instead


I managed to convert your .x format train to obj and then merged the objects, removed doubles, and recalculate normals, and even got my own custom texture. You can see most of the code that I changed in the left portion of the attached screen shot.
I changed the elevation of the model as well, just by lowering it in Blender before exporting. I didn't really look at all, but is there a method yet whereby we can change the distance between the front cart and rear. I was kinda thinking of making some simple train models, something a little like Thomas the Tank Engine (R) but of course I wouldn't make them exact duplicates.
I didn't try but I'm assuming that changing the cart.x file to a pair of train wheels would also greatly enhance things.

If you'd like me to make you a couple/few/several train models just let me know. I'd be happy to do it.

I'll shut up after this last question, are there any plans to make the engines need fuel, like coal or wood for steam trains, gas, diesel, or oil for other trains?

P.S.
FANTASTIC WORK!
Attachments
Screenshot from 2015-01-20.png
Screenshot from 2015-01-20.png (493.27 KiB) Viewed 2380 times
I record Minetest videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website.
 

User avatar
jordan4ibanez
Member
 
Posts: 1865
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

Re: My Train Mod

by jordan4ibanez » Wed Jan 21, 2015 05:53

Nathan.S wrote:I downloaded the .tar.gz file and I'm getting this in my log file. Everything still runs alright, but this prints multiple times a second.
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
19:34:50: ACTION[ServerThread]: stack traceback:
19:34:50: ACTION[ServerThread]:    [C]: in function 'log'
19:34:50: ACTION[ServerThread]:    /usr/share/minetest/builtin/game/misc.lua:92: in function 'get_node_group'
19:34:50: ACTION[ServerThread]:    /home/nathan/.minetest/mods/trains/functions.lua:47: in function 'train_on_track'
19:34:50: ACTION[ServerThread]:    /home/nathan/.minetest/mods/trains/init.lua:156: in function </home/nathan/.minetest/mods/trains/init.lua:153>
19:34:50: ACTION[ServerThread]: Deprecated usage of get_node_group, use get_item_group instead


I managed to convert your .x format train to obj and then merged the objects, removed doubles, and recalculate normals, and even got my own custom texture. You can see most of the code that I changed in the left portion of the attached screen shot.
I changed the elevation of the model as well, just by lowering it in Blender before exporting. I didn't really look at all, but is there a method yet whereby we can change the distance between the front cart and rear. I was kinda thinking of making some simple train models, something a little like Thomas the Tank Engine (R) but of course I wouldn't make them exact duplicates.
I didn't try but I'm assuming that changing the cart.x file to a pair of train wheels would also greatly enhance things.

If you'd like me to make you a couple/few/several train models just let me know. I'd be happy to do it.

I'll shut up after this last question, are there any plans to make the engines need fuel, like coal or wood for steam trains, gas, diesel, or oil for other trains?

P.S.
FANTASTIC WORK!

Ahhh, thank you, I will be sure to fix that.

Thanks for fixing my model. :D

And sure! But don't make a bunch, make one, that's all we need right now, here is an example of what I'm thinking we need for this mod to be above and beyond:
http://i.imgur.com/1Lwnqe1.jpg
http://i.imgur.com/UZrrbpX.jpg
Take a look at this 4449 taking off for the animation of it: http://youtu.be/-qZAlMC06i4
This shows how the coupling rod (The bar on the wheels) is supposed to move with the piston as well as how the piston goes inside the piston housing (The box on the front). Now in this example I did not include a piston, the coupling rod just goes straight into the piston housing, but on the actual model there would be a piston that is animated along with the coupling rod.

This model should be a 2-2-2, 2 wheeled truck in the back, 2 driving wheels, 2 wheeled truck in the front, this will be a nice place to start for simplicity sake. You should export the body/driving wheels separately from the trucks as well so I can replace the mine carts with them!

By the way, thanks for your help! Hopefully these instructions weren't too confusing, haha.

And finally yes, I don't know exactly how I'm going to do it, trains are going to require fuels. I want to include steam, electric, gasoline, and diesels (Especially the classic santa fe emd gp50). Trains are also going to include an out of the way gui so you can look out the window as you drive it. I also want to make some kind of on board gui for trains to show how fast they are going. What I mean by this is have actual gauges and such on the model that change with the speed. I don't know if this is going to be included though, as it would be extremely time consuming to create.

And thank you!
 

twoelk
Member
 
Posts: 1092
Joined: Fri Apr 19, 2013 16:19

Re: My Train Mod

by twoelk » Wed Jan 21, 2015 10:44

I got a model I could provide :-D
Would need some file converting of course as Irrlicht can not read the Ldraw format as far as I know.
Image
That is I am sure I still have it somewhere, just cant remember where ...
Had some others of old wooden toy train models, wouldn't know the copyright of those though as they are faithfull models of existing toys. Should probably make some more generic ones.
This mod seems to venture into interesting realms, seems I need to get out some of my old railway planing tool code to see if some of it can be adjusted for use in minetest.
 

User avatar
Nathan.S
Member
 
Posts: 679
Joined: Wed Sep 24, 2014 17:47
GitHub: NathanSalapat
IRC: NathanS21
In-game: NathanS21

Re: My Train Mod

by Nathan.S » Wed Jan 21, 2015 21:00

Hey, I created a new train, not sure if it's 100% what you were looking for. I did notice a few new problems with this though. The trucks don't rotate on the tracks, you'll notice what I mean when you see the screen shot. Also the trucks don't sit where they should under the train, not sure how to change that, I kept the overall size of my train about the same as yours was. I didn't do any animating with the pistons and stuff, but I wasn't sure how I'd do that, and I can always add it later, if you like the model.
I did some simple texturing, it could use a bit more work, but it's better than the black and pink image I was seeing before.
You can find the train .blend and .obj's and textures in this zip folder. https://dl.dropboxusercontent.com/u/29046539/train.zip
Image
Attachments
train-screenshot.png
train-screenshot.png (562.26 KiB) Viewed 2380 times
I record Minetest videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website.
 

User avatar
Melkor
Member
 
Posts: 285
Joined: Sat Sep 24, 2011 01:03

Re: My Train Mod

by Melkor » Thu Jan 22, 2015 06:52

jordan4ibanez wrote:Image

GPLV2

Test it - Do not build anything across the 0 node on the x or z I am currently fixing that
Check up on this regularly, I update this a lot (Revision 0020 currently)
tar.gz
.zip

I am currently creating a multi entity train mod, here is a video of the current state:
http://youtu.be/B5PP8k8KcIo


Yo, your video make me want to sing something like this:
https://www.youtube.com/watch?v=7lDlfDtJYF8
 

User avatar
kidmondo
Member
 
Posts: 130
Joined: Sun May 11, 2014 07:56
IRC: kidmondo
In-game: kidmondo

Re: My Train Mod

by kidmondo » Fri Jan 23, 2015 02:41

This is amazing! what i've been looking forward to for ages! i look forward to trying :3
 

twoelk
Member
 
Posts: 1092
Joined: Fri Apr 19, 2013 16:19

Re: My Train Mod

by twoelk » Sat Jan 24, 2015 14:28

I finally got around to play with this and I'm thrilled. I can hardly wait for more to come. Utilising pilzadam's mob code to simulate the connected movement is the part I never got around to when I played with similar problems trying to animate trains in svg files. Wish I had known stuff like this back then. I always had to simulate trains by animating movements with a time offset.

What we did though was to add an invisible line of movement to the track part descriptions. That way things like complicated switches or road pieces with multible movement patterns where easier to work out. As far as I understood your code, from the short glance I had time to take, you keep to the system of moving from node center to node center. This will keep the possabilities of points, curves and other stuff a little restricted and might never allow smooth movement. I may have missed something in your code and might be wrong but as far as I remember most train or track simulating programs use some sort of line of movement that is stored extra along the physical appearance of the track.

We used a system of "ports" that described how track pieces could be attached to allow the movement path to be combined in a valid way. For the animation the predictable movement-lines where combined and then animation was calculated. Speed was sort of calculated backwards by looking at pieces of the combined track. We planned to have movement calculated individually between switches or other predefined points but animation was not the prime interest at the time as the program rather started as a layout planner before we discovered we could easily export to svg which offered possabilities of animating.

So now I got to go and search for all them old files of that old project to see if something could be reused. ;-P
 

Hybrid Dog
Member
 
Posts: 2460
Joined: Thu Nov 01, 2012 12:46

Re: My Train Mod

by Hybrid Dog » Sat Jan 24, 2015 20:00

jordan4ibanez wrote:Here's a new video guys!
http://youtu.be/AU_6PdEjQ4Y

l like it.
You don't need to restart the server if you only want to change a variable.
viewtopic.php?f=11&t=10809#p165495
 

User avatar
kidmondo
Member
 
Posts: 130
Joined: Sun May 11, 2014 07:56
IRC: kidmondo
In-game: kidmondo

Re: My Train Mod

by kidmondo » Tue Jan 27, 2015 08:15

super basic question, how do you place a train and what is its inventory icon?
 

twoelk
Member
 
Posts: 1092
Joined: Fri Apr 19, 2013 16:19

Re: My Train Mod

by twoelk » Tue Jan 27, 2015 11:44

kidmondo wrote:super basic question, how do you place a train and what is its inventory icon?


right click on the 3d rails with the purple square ;-P
 

User avatar
kidmondo
Member
 
Posts: 130
Joined: Sun May 11, 2014 07:56
IRC: kidmondo
In-game: kidmondo

Re: My Train Mod

by kidmondo » Tue Jan 27, 2015 18:35

twoelk wrote:
kidmondo wrote:super basic question, how do you place a train and what is its inventory icon?


right click on the 3d rails with the purple square ;-P


Oh, thanks :)
 

User avatar
jordan4ibanez
Member
 
Posts: 1865
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

Re: My Train Mod

by jordan4ibanez » Fri Jan 30, 2015 14:19

Just taking a break from this so I don't get burnt out, I'm putting up a Github today. Might work on another not so big mod as well.
 

User avatar
jordan4ibanez
Member
 
Posts: 1865
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

Re: My Train Mod

by jordan4ibanez » Fri Jan 30, 2015 14:33

 

User avatar
Nathan.S
Member
 
Posts: 679
Joined: Wed Sep 24, 2014 17:47
GitHub: NathanSalapat
IRC: NathanS21
In-game: NathanS21

Re: My Train Mod

by Nathan.S » Fri Jan 30, 2015 15:58

Thanks for the github, this will make reporting errors and contributing code easier for others.
I record Minetest videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website.
 

User avatar
Minetestforfun
Member
 
Posts: 936
Joined: Tue Aug 05, 2014 14:09
GitHub: Darcidride
IRC: Darcidride + MinetestForFun
In-game: Darcidride + MinetestForFun

Re: My Train Mod

by Minetestforfun » Sat Jan 31, 2015 11:45

Your mod is awesome, many people eagerly await for this mod :D

keep up the good work !
 

ABJ
Member
 
Posts: 2344
Joined: Sun Jan 18, 2015 13:02
GitHub: ABJ-MV
In-game: ABJ

Re: My Train Mod

by ABJ » Mon Mar 23, 2015 18:39

jordan4ibanez wrote:Image

GPLV2

Test it - Do not build anything across the 0 node on the x or z I am currently fixing that
Check up on this regularly, I update this a lot (Revision 0020 currently)
tar.gz
.zip

I am currently creating a multi entity train mod, here is a video of the current state:
http://youtu.be/B5PP8k8KcIo


The main focus of this mod is so that you can haul a lot of stuff across great distances, transport things and generally have a great time. All of the trains and cars will be able to hook together and will work as one singular entity. There will also be weight to the cars and torque to the train, so you will be forced to hook together engines to pull the cars.

I am going to have:
Planned Things

-Steam trains with and without a tender
-Minecarts
-Storage cars


Possible Things
-Water stations that automatically refill your water
-Coal stations which automatically refill your tender
-Mining bore car which attaches to the front of the train
-Passanger cars
-Liquid cars
-Flatbed cars for storing vehicles from other mods if there are any
-A crane
-A caboose


I'm still working on bugs (ie serialization, or if only one part of the train spawns, which will force load chunks) and making the cars more modular, maybe I'll even work it into an API (unlikely though).
This will take quite a long time to get done, so if anyone can create meshes that would be awesome!

Hey man nice mod and looks promising but there are things to be done (for sure you'd know :D) fix the engine rendering because it's rendered so on one side the cab can be seen clearly but not the boiler and on the other side vice versa and the car itself is black on one side and white on other. And add some good texture and try to replace those minecarts with real wheel trucks and add some texture and make it so you will have to RIDE the cab to make the train move and add smoke and make this thing work on conventional rail instead of those white rails etc this mod has good hope and it's the most complete and promising train mod for MT I've come across and the engine look beautiful!! So plz keep this good work up man! :)
Best blocky regards
ABJ
 

dgm5555
Member
 
Posts: 244
Joined: Tue Apr 08, 2014 19:45

Re: My Train Mod

by dgm5555 » Tue Mar 24, 2015 13:33

+1 This looks great. How far will they go from players before stopping/returning (like minecarts do)? Could you have a trans-MT rail system?
 

twoelk
Member
 
Posts: 1092
Joined: Fri Apr 19, 2013 16:19

Re: My Train Mod

by twoelk » Tue Mar 24, 2015 14:01

dgm5555 wrote:+1 This looks great. How far will they go from players before stopping/returning (like minecarts do)? Could you have a trans-MT rail system?


nothing is supposed to happen in minetest in a block/chunk that is not loaded - hence the anchor-mods found in other places.

Maybe rails that include a map-anchor might be of use for such a mod in the future or maybe some sort of teleporting feature that only works if lines are considered connected and thus when the train approaches an unloaded part of the map it teleports the train to the next loaded part of the map on the line with a calculated delay of course. Stations could be places that are forced to loat when the train is calculated to pass that region.
 

dgm5555
Member
 
Posts: 244
Joined: Tue Apr 08, 2014 19:45

Re: My Train Mod

by dgm5555 » Sat Mar 28, 2015 08:34

The easiest option would be make the train itself a mobile anchor and it could forceload a couple of nodes around it and un-forceload them when it left. If a player causes loading of radius 32 nodes that's between 48 and 216 mapblocks. A train moves more, but even so should be a lot less load than quite a number of players. Even if forceloading means an entire mapblock of abms is activated, it might result in some unexpected local discrepancies, but probably wouldn't be a major glitch. It would also be a heck of a lot better than the current situation when you send off spaced carts and they return as a pack when they are re-activated.

Forceloading the rails, could quite quickly exceed forceload limits, so I would have thought not such a good idea. However if you kept a table of rails, you could build a timetable of when a train passes each point. The idea of having a station/junction/railend block is OK. The problem with this is if you stood next to a section of track where a train should pass it wouldn't do so without the rail table, and would still result in un-needed block loading. If I was setting it up a massive rail network, for efficient processing I think I'd use a table which could be generated/updated by a maintainance cart which travelled the network and mapped it, and possibly replaced every eg 32nd node with a monitoring node. These nodes could have abms to spawn a train at an appropriate direction and time when players were near tho this could have an issue with locally nodes spawning multiple trains if this process wasn't also recorded in the table. Finally allow the trains to also update the map if they happened to be active, but which vanished if in moving state but inactive. I don't think the server notifies when this will happen, but could occur on reactivation. The sl issue could be trains vanishing when singleplayer exits and re-enters the game but I think using mt time of day would be ok for maintaining this and would be a pretty small glitch.
 

ABJ
Member
 
Posts: 2344
Joined: Sun Jan 18, 2015 13:02
GitHub: ABJ-MV
In-game: ABJ

Re: My Train Mod

by ABJ » Fri Apr 03, 2015 04:07

Nice mod but do please make this run on ordinary rails or even if you can't, make those 3D rails look better :)
 

ABJ
Member
 
Posts: 2344
Joined: Sun Jan 18, 2015 13:02
GitHub: ABJ-MV
In-game: ABJ

Re: My Train Mod

by ABJ » Sat Apr 04, 2015 12:54

This topic is getting too quiet. Hope you haven't abandoned it.
 

User avatar
ExeterDad
Member
 
Posts: 1121
Joined: Sun Jun 01, 2014 20:00
In-game: ExeterDad

Re: My Train Mod

by ExeterDad » Sat Apr 04, 2015 14:42

by jordan4ibanez » Fri Jan 30, 2015 10:19 am

Just taking a break from this so I don't get burnt out, I'm putting up a Github today. Might work on another not so big mod as well.


Be patient. He just has other things to do for now.
٩(̾●̮̮̃̾•̃̾)۶

Kibbie and I have a beautiful public server now! HOMETOWN
 

ABJ
Member
 
Posts: 2344
Joined: Sun Jan 18, 2015 13:02
GitHub: ABJ-MV
In-game: ABJ

Re: My Train Mod

by ABJ » Sun Apr 05, 2015 15:38

Ooops I forgot :D
 

Mineman2022
New member
 
Posts: 9
Joined: Thu Mar 26, 2015 22:47

Re: My Train Mod

by Mineman2022 » Sun May 10, 2015 16:05

 

Mineman2022
New member
 
Posts: 9
Joined: Thu Mar 26, 2015 22:47

Re: My Train Mod

by Mineman2022 » Sat May 16, 2015 21:28

Is the topic abandoned.
 

ABJ
Member
 
Posts: 2344
Joined: Sun Jan 18, 2015 13:02
GitHub: ABJ-MV
In-game: ABJ

Re: My Train Mod

by ABJ » Sun May 17, 2015 06:38

No I don't think so.
Well, though I DO wonder what's happened to j4i. I know he took a break buuuuuuut................I hope he hasn't forgotten or what not :D
And anyway. someone else will do it if he doesn't. (I personally would once I learn enough :))
The topic is still active.
 

User avatar
jordan4ibanez
Member
 
Posts: 1865
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

Re: My Train Mod

by jordan4ibanez » Tue May 19, 2015 20:21

I'll be working on this again.
 

PreviousNext

Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 9 guests

cron