Page 1 of 1

How to set game version in Debian from Git?

Posted: 07 Apr 2021 22:10
by waynee
Hi,
I want to set u an OTTD dedicated server and did following steps:

To obtain the source code from GitHub, type from command line:

git clone https://github.com/OpenTTD/OpenTTD.git openttd

In openttd 1.11 cmake has replaced .configure

mkdir build
cd build
cmake ..
make
./openttd (to start the game)

All good until this point but my game verision is set to "OpenTTD 20210407-master-g1529403584"

Where can i set it to version 1.11.0?

Re: How to set game version in Debian from Git?

Posted: 07 Apr 2021 23:14
by ChillCore
Compile the 1.11.0 branch instead of master and it will do it automatically?


There are ways to display your own version but it will not be that one and so I will not tell you what, where nor how .. nothing but troubs when doing that and not what you asked for ... just saying ...

^^^ I've been out of the loop for a while so I assume 'master' means the good old SVN 'Trunk' which is not the latest released 'stable' version at all .... what you want is a few versions back of 'master' and then (possibly) some sideways ...

in short ... get your source here, https://www.openttd.org/downloads/opent ... atest.html , instead of compiling the nightly or point to the correct revision instead when cloning the source.
^^^ In shorter ... you've compiled the nightly version instead of the stable release ;)

Re: How to set game version in Debian from Git?

Posted: 08 Apr 2021 11:22
by Eddi
when you "git clone", you get a copy of all the game versions so far, but it will default to the current development version ("master"), and all other versions will be in "branches"

so if you now "git checkout 1.11.0" you will get the correct release branch. then run "make" again.

Re: How to set game version in Debian from Git?

Posted: 08 Apr 2021 13:53
by waynee
Hi,
thanks for the tips, so I tried it but somehow following error occurs on the last part of compiling:

Code: Select all

[ 99%] Building CXX object CMakeFiles/openttd.dir/src/viewport_gui.cpp.o
[100%] Building CXX object CMakeFiles/openttd.dir/src/void_cmd.cpp.o
[100%] Building CXX object CMakeFiles/openttd.dir/src/water_cmd.cpp.o
[100%] Building CXX object CMakeFiles/openttd.dir/src/waypoint.cpp.o
[100%] Building CXX object CMakeFiles/openttd.dir/src/waypoint_cmd.cpp.o
[100%] Building CXX object CMakeFiles/openttd.dir/src/waypoint_gui.cpp.o
[100%] Building CXX object CMakeFiles/openttd.dir/src/widget.cpp.o
[100%] Building CXX object CMakeFiles/openttd.dir/src/window.cpp.o
[100%] Linking CXX executable openttd
/usr/bin/ld: CMakeFiles/openttd.dir/src/industry_cmd.cpp.o: in function `GetNumberOfIndustries':
/home/pi/Downloads/openttd/src/industry_cmd.cpp:2219: undefined reference to `Pool<Industry, unsigned short, 64u, 64000u, (PoolType)1, false, true>::MAX_SIZE'
/usr/bin/ld: CMakeFiles/openttd.dir/src/town_cmd.cpp.o: in function `GenerateTowns(TownLayout)':
/home/pi/Downloads/openttd/src/town_cmd.cpp:2247: undefined reference to `Pool<Town, unsigned short, 64u, 64000u, (PoolType)1, false, true>::MAX_SIZE'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/openttd.dir/build.make:5992: openttd] Fehler 1
make[1]: *** [CMakeFiles/Makefile2:1118: CMakeFiles/openttd.dir/all] Fehler 2
make: *** [Makefile:163: all] Fehler 2
Any ideas why this happens ?

EDIT:
I managed to install it now but it seems like the version is still wrong:
Image
https://imgur.com/B9xcYqH

Re: How to set game version in Debian from Git?

Posted: 08 Apr 2021 20:49
by Eddi
if in doubt, run "cmake .." again.

also, looks like you checked out "1.11", not "1.11.0"

Re: How to set game version in Debian from Git?

Posted: 09 Apr 2021 14:01
by waynee
i did run cmake .. several times again but it seems like after the first time compiling its broken...

how do i know the correct branch will be compiled?

It gives following output:

Code: Select all

pi@raspberrypi:~/Downloads/openttd/build $ git checkout 1.11.0
Hinweis: Checke '1.11.0' aus.

Sie befinden sich im Zustand eines 'losgelösten HEAD'. Sie können sich
umschauen, experimentelle Änderungen vornehmen und diese committen, und
Sie können alle möglichen Commits, die Sie in diesem Zustand machen,
ohne Auswirkungen auf irgendeinen Branch verwerfen, indem Sie einen
weiteren Checkout durchführen.

Wenn Sie einen neuen Branch erstellen möchten, um Ihre erstellten Commits
zu behalten, können Sie das (jetzt oder später) durch einen weiteren Checkout
mit der Option -b tun. Beispiel:

  git checkout -b <neuer-Branchname>

HEAD ist jetzt bei bd80ec7cf Fix: [CMake] if the regex for STABLETAG is empty, it means it is stable
pi@raspberrypi:~/Downloads/openttd/build $ git branch
* (HEAD losgelöst bei 1.11.0)
  master
EDIT:

The problem was the Raspbian OS. I installed a fresh Ubuntu on it and voila its working...

Re: How to set game version in Debian from Git?

Posted: 10 Apr 2021 10:01
by ChillCore
waynee wrote: 09 Apr 2021 14:01 how do i know the correct branch will be compiled?
Whatever revision/branch(or revision thereof) you checked out will be compiled ... if memory fails you on what you did before ... there should be an indication of that in Git and after a succesful compile it will show in the version displayed in OpenTTD when running it (provided you did not do naughty stuffs like trying to display your own version nr. :P ).


EDIT:

The problem was the Raspbian OS. I installed a fresh Ubuntu on it and voila its working...
Glad you figured that out ... enjoy your game ;)

ps: maybe report this to the Raspbian OS guys? Most likely it's an easy fix for them by adjusting/updating their default dependencies or flipping some switch or whatever.