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,

subcon959

@!#?@!
Member
Joined
Dec 24, 2008
Messages
5,845
Trophies
4
XP
10,108
Country
United Kingdom
Oh wow, I was just thinking the other day that I wish Zod (from GP2X days) was part of this scene so we could get TTD..

You are a true gent for spoiling us with all these goodies.
 
  • Like
Reactions: rsn8887

m4xw

Ancient Deity
Developer
Joined
May 25, 2018
Messages
2,442
Trophies
1
Age
119
XP
6,958
Country
Germany
Oh wow, I was just thinking the other day that I wish Zod (from GP2X days) was part of this scene so we could get TTD..

You are a true gent for spoiling us with all these goodies.
He really deserves more recognition, in my honest opinion.

Go check out his Patreon if you like his work.
All these ports are a blessing for the community.
 

KyleHyde

Well-Known Member
Member
Joined
Dec 10, 2018
Messages
195
Trophies
0
Age
31
XP
451
Country
Puerto Rico
I've never played any Transport Tycoon games, but if RTC is anything to go by, I would probably end up loving this as well. Definitely going to give it a look later. Nice job on porting it to the Switch, btw.
 
  • Like
Reactions: rsn8887

Dutt

Well-Known Member
Newcomer
Joined
Jun 15, 2018
Messages
93
Trophies
0
Age
43
XP
2,176
Country
Australia
Very Nice work mate..
One question. Can you add the ability to adjust the font size so we can make it fit the screen better or is this possible already?
If i change the font option to Double size the menu goes outside of the screen.
Its fine in docked mode but my eyes arnt the best and would be better if i could make it slightly bigger for un-docked.
 

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
New update v1.01. I got the music to work. I also made several control enhancements: The pointer motion is much more smooth. The analog deadzone is better (smaller). USB keyboards also work better.

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

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

Note for some reason the mouse wheel on my Logitech mouse doesn't work for me, even though I enabled mouse wheel events. Maybe someone else can try? Maybe it is a limitation of the Switch operating system.
 

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
Had a quick play about, amazing work. My only complaints come from playing with a mouse and keyboard, where the arrow keys don't scroll the map, and the scroll wheel doesn't zoom in/out. Any way to alter the controls? Minor things in the grand scheme of things though, I'm blown away it runs so well in the first place lol

Newest release 1.01 is out. Cursor keys now scroll the map, music works etc. You can zoom with plus/minus keys on the keyboard, too. I tried to enable mouse wheel, but it looks like it doesn't work on my mouse. It might be a problem with the operating system or with my mouse. I am not sure.
 

steven89

Well-Known Member
Newcomer
Joined
Dec 17, 2016
Messages
97
Trophies
0
Age
34
XP
1,356
Country
thought i would try this out, using atmosphear 0.8.4 on fw 3.0.0, newest build 1.01 from album doesnt boot any suggestion?
 

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
EDIT: Never mind it boots just fine from album for me. Are you sure you copied all the data files, and no archive flag is set on the folders no exFAT filesystem (it corrupts) yadiyada, the usual.
 
Last edited by rsn8887,

Tebra

Well-Known Member
Member
Joined
May 18, 2016
Messages
109
Trophies
0
XP
2,159
Country
Belgium
Thanks for this great port of one of my favorite games.
Will it be possible to use LZ/RZ buttons to zoom in / zoom out ?

Envoyé de mon Pixel C en utilisant Tapatalk
 
  • Like
Reactions: 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
BTW I have compiled a Vita version running the exact same code. It works great. I will wait or Angguss to make an official release, but if anyone wants to try it (Vita version 1.0 "preview"), the preview version is here:

OpenTTD Vita 1.0 preview: https://www.patreon.com/posts/25176392

--------------------- MERGED ---------------------------

--------------------- MERGED ---------------------------

thought i would try this out, using atmosphear 0.8.4 on fw 3.0.0, newest build 1.01 from album doesnt boot any suggestion?

I just erased my game completely, downloaded the exact 1.01 release from GitHub, unzipped, ftp'd over to switch, started via album, and it works for me. Just had to wait 15 seconds for it to load.

I'd guess it is most likely file corruption, missing files (check all the files are on the Switch, including all language files. You cannot skip any). Or maybe archive flags being set on your end?

The only other thing I can imagine atm is firmware version and/or CFW version maybe? I am on 6.2.0, TX 2.5.3. Your 3.0.0 is quite a bit older. But usually that doesn't make any difference for homebrew. Unless you try to run Retroarch dynarec or such things.
 
  • Like
Reactions: Dutt

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
  • Like
Reactions: Tinnetju and Tebra

Scarlet

Onion Soup
Editorial Team
GBAtemp Patron
Joined
Jan 7, 2015
Messages
5,144
Trophies
2
Location
Middleish North-Right
Website
scarlet.works
XP
14,769
Country
United Kingdom
Newest release 1.01 is out. Cursor keys now scroll the map, music works etc. You can zoom with plus/minus keys on the keyboard, too. I tried to enable mouse wheel, but it looks like it doesn't work on my mouse. It might be a problem with the operating system or with my mouse. I am not sure.
you are my favourite human right now, bless you and all your efforts.
 
  • Like
Reactions: mathew77

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
Im have problem in 1.01. Randomly freeze games. Helps only restart game. Im not have this problem in 1.0

Running out of memory because of music? Are you starting via .nsp injection or via "album"? Don't start via album. Also try to disable music in the settings and see if it helps? Or stop the music inside the music player.
 

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
New update 1.02

http://www.github.com/rsn8887/openttd/releases/latest

Changelog:
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
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Xdqwerty @ Xdqwerty: i think im a bad person