Share My Creation [B4J] A Virtual Train Set - The Video

It started as a simple idea and 'Eisenbahn-Lust'.

As a boy, I loved model train displays, but could not afford them.
As an adult I was too busy working and had no space.
As a retired adult I have lots of time but still no space.

I have a large screen monitor and thought that I would animate trains on it from a bird's eye view.
There would be tracks in a terrain with various types of trains running on them according to a specified schedule.
Perhaps some sound effects, whistle blowing, some background music. Peaceful and fascinating.

Steps:

1. Choose interesting train areas in world. I picked Interlaken, Jalpaiguri, and South Africa.
2. Get a sky image of each area (elevation map, colored road map, or satellite image).
3. Artify the image to make it look more like a painting which makes it less distractive to the action on the train tracks.

https://www.b4x.com/android/forum/t...ge-creating-an-impressionistic-effect.143149/

4. Superimpose the actual train grid on the map (sometimes you can trace a track from the image if the trains are electrical)
A good source is https://www.openrailwaymap.org/
[zoom/clip the image to match the satellite image.]
There are probably too many tracks, so only do the ones that seem interesting and balance the scene.
5. Sample the tracks manually by tracing along their paths, smooth the curves.

https://www.b4x.com/android/forum/t...h-curved-line-to-a-sequence-of-points.143178/

6. Specify critical stations, bridges, tunnels, and train types. Assign these objects to tracks.
7. Create a schedule for arrivals/departures for each station/track.
8. Designate one station as having a microphone and implement sound effects of train coming and going.
9. Implement a clock, schedule board and background music.
10. Animate the whole scene. Without 'sleep' and 'wait for' this would be impossible to do in one's lifetime.

For me the above development part was the most entertaining.

Below is a YouTube link for a three-minute movie clip of one of the three geographical areas I have implemented.
The setting is Interlaken, Switzerland. Make sure the sound is on. Sit back and relax.

 

cklester

Well-Known Member
Licensed User
Brilliant! I love it! This could be made into a great 2D or 3D simulation or even game. You could even have digital collectibles people could swap/trade/buy/sell of famous train cars/engines/cabooses (caboosen? cabeese?).

Well done!
 

josejad

Expert
Licensed User
Longtime User
It's great¡¡

It remains slightly to a game I played in the Spectrum for hours with my friend.

You should change the rails connections pressing a key, in such a way you have to guide the train to the stations to pick up the passengers the same color of your train before the station become full, while avoiding the train crashes.

Maybe you could make that game, but with the mouse this time

 
Last edited:

William Lancee

Well-Known Member
Licensed User
Longtime User
@José J. Aguilar
I did have a Sinclair ZX at one point, but I am not familiar with that particular game.
Thank you for the idea.

In my simulation, the trains don't crash. You can't see it, but they are on separate tracks (high speed, commuter, scenic)
 

William Lancee

Well-Known Member
Licensed User
Longtime User
Making it into a game would be the solution to one problem with the project.
While development was interesting and stimulating, after 5-10 minutes of running the animation, my mind would turn to something else.

Here is one possibility: "Train Crash" (name is probably taken)

Story line: Train traffic increases steadily over time.
At random intervals, new trains enter the scene.
Individual crashes are avoidable, but at some stage in the game the traffic is so heavy that a crash will occur.

There are four types of trains which enter the scene at different rates, from frequent to rare, respectively.
Yellow commuter trains, Red express trains, Blue scenic trains, and Gray freight trains.

Trains can't crash in stations which have multiple tracks and automatic track control.
Gray freight trains run on commuter tracks but don't stop in stations and can't be side-tracked, since they take too long to stop.
Red express trains have their own track, but stop only in some stations, and cannot be side-tracked between stations.
Therefore, they have to make unscheduled stops in non-express stations until the track is clear.
Blue scenic trains have their own track but can't be side-tracked (there is only one track between stations and only one moving train can be on that track.

Most of the action is with the Yellow commuter trains which share track space with other commuter trains.
They can be side-tracked anywhere, but it has to be timely since it takes time to slow down and stop on a side-track.

Goal: Prevent a train crash from occurring as long as possible.
When a crash occurs, some options might be "start a new game", "ignore the crash and incur a time penalty"

Player actions:
Click on a Yellow commuter train to side-track it.
Click on a Red or Blue train to stop and delay it in the next station available.

Almost all of these features are already implemented as part of the design, so it won't take too much time to convert it to a game.
I am no expert on psychology of games, what do you think?
 

aidymp

Well-Known Member
Licensed User
Longtime User
My Autistic twin boys love this video! Tbh i love it too!
 

William Lancee

Well-Known Member
Licensed User
Longtime User
@aidymp

I can understand the fascination.
If you PM me, I can send you the source code so you can play all three settings at will.
It is large so I may need to email it as a series of attachments.

All parameters are programable, so maybe you or your sons can modify at will or even create their own settings.
Each setting is like creating a train-centric world. The process is so addictive that I did three settings (interlaken, Jaipalguri, South Africa)
before considering posting to the community.
 
Last edited:
Top