OpenTTD (Transport Tycoon Deluxe) for Switch v1.0.

EDIT: New update v1.05. Fixes right click drag scroling.

Download and more information: http://github.com/rsn8887/openttd/releases/latest

# OpenTTD port for Switch

This is my Switch port of OpenTTD, a re-implementation of Transport Tycoon Deluxe.

Port by @rsn8887, based on the Vita port by @angguss. I made some control enhancements and I also enabled sound on the Vita port, too (pull request to @angguss made).

openttd_1.jpg


More Screenshots:
openttd_4.jpg openttd_2.jpg openttd_3.jpg

# Thanks

Thanks to the many developers who worked on this game.

Thanks to @angguss for his excellent Vita port, on which this Switch port is based.

Thanks to my supporters on Patreon: Andyways, CountDuckula, Jason Crawford, Greg Gibson, Jesse Harlin, Özgür Karter, Matthew Machnee, Milenko, and RadicalR.

# Installation

- Download (see `assets` below), and unzip openttd_switch.zip and copy the contents over to the `/switch/` folder on your sd card, so that you have a folder `/switch/openttd` with many folders and files inside.

- Use you favorite homebrew launcher to start the game. It comes with everything you need to start playing right away.

- Note: This game takes quite long to load (~15 seconds). But it is worth the wait!

- The public domain graphics and sound sets from www.openttd.org are included.

- If you want the choice to also use the original dos game graphics and sounds, copy over the files
```
SAMPLE.CAT
TRHCOM.GRF
TREND.GRF
TRTITLE.GRF
TRG1.GRF
TRGC.GRF
TRGH.GRF
TRGI.GRF
TRGT.GRF
```
from an original TTD game to `/switch/openttd/baseset/`.

- To install the original music, copy over all files
```
gm/gm_ttxx.gm (xx are numbers)
```

from the folder `gm` from the original windows version of the game to `/switch/openttd/gm/`.

You then get the choice to select `original dos` graphics, sounds, and music when you go to the game settings dialog.

# Controls

- Left analog stick = mouse pointer control
- D-Pad or right analog stick = scrolling the map.
- A/right trigger = left mouse click
- B/left trigger = right mouse click
- Y = zoom-in
- X = zoom-out
- Hold ZL = speed up analog joystick mouse
- Hold ZR = slow down analog joystick mouse, useful to precisely position the pointer
- Minus = switch button mappings between two presets: ZL/ZR = slow/fast mouse and Y/X = zoom, or ZL/ZR = zoom and Y/X = slow/fast mouse
- Double click A / double click right trigger over a text field = bring up on-screen keyboard
- The touch screen is used for indirect mouse input, like on a laptop touchpad. Move a single finger to move the mouse pointer. Use short tap for left click. Hold a single finger while tapping a second finger for right click. Drag with two fingers to drag and drop.

# Current Limitations

- No network support

# Building

libtimidity:
```
git clone https://github.com/rsn8887/libtimidity
cd libtimidity/src/
make -f Makefile.switch
cp libtimidity.a $DEVKITPRO/portlibs/switch/lib/
cp timidity.h $DEVKITPRO/portlibs/switch/include/
cp ../libtimidity.pc $DEVKITPRO/portlibs/lib/pkgconfig/
```

liblzo2:
Download https://www.oberhumer.com/opensource/lzo/download/lzo-2.10.tar.gz and extract, then
```
cd lzo-2.10
./configure CFLAGS='-fPIC' CXXFLAGS='-fPIC' --host aarch64-none-elf --prefix $DEVKITPRO/portlibs/switch/ --disable-shared --enable-static
make clean
make -j12
make install
```

liblzma:
Download and extract xz-5.2.4.tar.gz from https://tukaani.org/xz/ , then
```
cd xz-5.2.4
./configure CFLAGS='-fPIC' CXXFLAGS='-fPIC' --enable-threads=no --host aarch64-none-elf --prefix $DEVKITPRO/portlibs/switch/ --disable-shared --enable-static
cd src/liblzma
make clean
make -j12
make install
```

Then configure and build OpenTTD from my switch branch:
```
git clone https://github.com/rsn8887/openttd
git checkout switch
PKG_CONFIG_PATH=$DEVKITPRO/portlibs/switch/lib/pkgconfig ./configure --os=SWITCH --host aarch64-none-elf --enable-static --prefix=/opt/devkitpro --with-sdl="pkg-config sdl2" --without-fontconfig --disable-strip --without-threads --with-libtimidity --enable-debug=0
make -j12
cd os/switch
git clean -f
cmake ./ -D
make openttd_switch.zip
```

openttd_switch.zip can be found in __cmake/__


# Changelog
1.05

- fix right click drag scrolling

1.04

- re-compile with libnx v2.2.0 to fix potential crashes with firmware 8.0.x

1.03

- bundle with working AI compatibility script files (fixes AI crashing)
- bundle with pre-installed AI opponents and support library scripts

1.02

- compile with lzma and lzo2 compression libraries to allow loading old compressed savegames/scenarios
- hold ZR / ZL for slow / fast mouse to make it easier to position the pointer with the left stick
- correctly display free disk space in load/save dialogs
- press minus to switch button mappings between two presets: ZL/ZR = slow/fast mouse, Y/X = zoom, or ZL/ZR = zoom, Y/X = slow/fast mouse

1.01

- music is now working
- improve smoothness of mouse pointer motion
- reduce analog joystick deadzone for better mouse pointer control
- update graphics and sound files to latest freeware versions from www.openttd.org
- enable cursor key map scrolling on USB keyboard
- enabled mouse wheel zoom

1.00

- initial Switch release based on latest nightly
 
Last edited by rsn8887,

rsn8887

Well-Known Member
OP
Member
Joined
Oct 8, 2015
Messages
956
Trophies
1
Age
46
Website
www.patreon.com
XP
3,619
Country
United States
I just released a new update, version 1.03: It fixes AI problems and comes pre-bundled with all AIs. The problem was I didn't bundle the compat_xx scripts of the correct version. The ones in the bin folder of my own openttd repository are the correct ones that work.

Download link:
https://github.com/rsn8887/openttd/releases/latest

1.03
  • bundle with working AI compatibility script files (fixes AI crashing)
  • bundle with pre-installed AI opponents and support library scripts
 
Last edited by rsn8887,

Teddy312

Member
Newcomer
Joined
Apr 17, 2019
Messages
20
Trophies
0
Age
26
XP
156
Country
Netherlands
I just released a new update, version 1.03: It fixes AI problems and comes pre-bundled with all AIs. The problem was I didn't bundle the compat_xx scripts of the correct version. The ones in the bin folder of my own openttd repository are the correct ones that work.

1.03
  • bundle with working AI compatibility script files (fixes AI crashing)
  • bundle with pre-installed AI opponents and support library scripts

Awesome, thank you for your hard work. I will get the update when i come home from work. Thanks again!
 

Mc_Burt

Well-Known Member
Newcomer
Joined
Mar 7, 2019
Messages
68
Trophies
0
Age
45
XP
308
Country
France
I just released a new update, version 1.03: It fixes AI problems and comes pre-bundled with all AIs. The problem was I didn't bundle the compat_xx scripts of the correct version. The ones in the bin folder of my own openttd repository are the correct ones that work.

Download link:
https://github.com/rsn8887/openttd/releases/latest

1.03
  • bundle with working AI compatibility script files (fixes AI crashing)
  • bundle with pre-installed AI opponents and support library scripts

Many thanks your job is amazing !!!! So so happy to play this game on switch ! :) And the controllers are perfect ! Good job !
 

flugel1983

New Member
Newbie
Joined
Jun 10, 2019
Messages
1
Trophies
0
Age
40
XP
45
Country
Netherlands
i don't get it working. put the openttd folder in de switch folder but cannot launch the game. can anyone help me out

always getting a error
 
Last edited by flugel1983,

rsn8887

Well-Known Member
OP
Member
Joined
Oct 8, 2015
Messages
956
Trophies
1
Age
46
Website
www.patreon.com
XP
3,619
Country
United States
i don't get it working. put the openttd folder in de switch folder but cannot launch the game. can anyone help me out

always getting a error

Don’t use exfat, make sure the archive flag is not set on your folders.

How good is it? What version is it? Cheers.

The version is based on development version (github code) from March 2, 2019, before timidity music support was removed from the upstream repo.
 

rsn8887

Well-Known Member
OP
Member
Joined
Oct 8, 2015
Messages
956
Trophies
1
Age
46
Website
www.patreon.com
XP
3,619
Country
United States
I re-compiled OpenTTD Switch with latest toolchain. This fixed the crash on startup on FW 12.0.0. If you are on 12.0.0 or later, please make sure you use the re-compiled version (v1.07):

https://github.com/rsn8887/OpenTTD/releases/latest

Only the .nro has changed. The game still takes quite long to load, just like before.

I am working on re-compiling all my home-brew for 12.0.0 compatibility, but it will take a while.
 
Last edited by rsn8887,

Mc_Burt

Well-Known Member
Newcomer
Joined
Mar 7, 2019
Messages
68
Trophies
0
Age
45
XP
308
Country
France
Hello !
I just install the last version and it crashed.
At start, I have a message which say "not enough memoiries 128 mo etc put down your graphism or desiable zoom blablabla". And when I start a new game, atmosphere crash. Any idea to fix it ?
It work in 256x256 but soon after start to play it crash again.
If I go up in the size it automaticly crash. :(
Before it was working perfectly so I hope somebody will help me to fix it !
Thank you ! ^^
 
Last edited by Mc_Burt,

Mc_Burt

Well-Known Member
Newcomer
Joined
Mar 7, 2019
Messages
68
Trophies
0
Age
45
XP
308
Country
France
Problem fix ! I was in applet mod... What an idiot am I.. Sorry and thank you very much for the game !!!
 

greenchili2

Member
Newcomer
Joined
Nov 9, 2023
Messages
19
Trophies
0
Age
55
XP
64
Country
United States
I managed to get this mostly working. I cannot figure out for the life of me where the windows music ( .mid ) files go. I've tried all kinds of different places. Luckily I was able to get the DOS music going from which I understand is the same as the Windows except slightly lower volume.

Also the check online content screen seems to bring up nothing. Did this ever work?

What are the AI and Game Scripts all about? What do they give me?

Thanks in advance.
 

rsn8887

Well-Known Member
OP
Member
Joined
Oct 8, 2015
Messages
956
Trophies
1
Age
46
Website
www.patreon.com
XP
3,619
Country
United States
I could never get the online stuff to work on Switch, sorry.

For a while I thought it had something to do with missing DetachThread() functionality on Switch, but I am not sure anymore.
 
Last edited by rsn8887,

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Xdqwerty @ Xdqwerty: I'm back