Giter Site home page Giter Site logo

Comments (35)

LynxAbraxas avatar LynxAbraxas commented on May 27, 2024 1

I might find some time in the next days (no guaranty though) to test the situation with a docker-image based on the current ubuntu.

see #385

from civctp2.

LynxAbraxas avatar LynxAbraxas commented on May 27, 2024

Welcome to the civctp2 source code project!

I also installed various other deps that were needed which I am listing here (I simply sudo apt-get installed these):

You seem to be missing tiff and sound libs. Did you follow https://github.com/civctp2/civctp2#building-on-linux, in particular:
sudo apt install libsdl2-dev libsdl2-mixer-dev libsdl2-image-dev libtiff-dev libavcodec-dev libavformat-dev libswscale-dev byacc flex

The install instructions from the DF work for Ubuntu, see e.g.

civctp2/Dockerfile

Lines 18 to 20 in 5c67aa3

RUN apt-get update && apt-get install -y --no-install-recommends \
libsdl2-dev libsdl2-mixer-dev libsdl2-image-dev libtiff-dev libavcodec-dev libavformat-dev libswscale-dev \
byacc gcc g++ automake libtool unzip flex git ca-certificates

from civctp2.

justinfarrelldev avatar justinfarrelldev commented on May 27, 2024

I also installed various other deps that were needed which I am listing here (I simply sudo apt-get installed these):

You seem to be missing tiff and sound libs. Did you follow https://github.com/civctp2/civctp2#building-on-linux, in particular: sudo apt install libsdl2-dev libsdl2-mixer-dev libsdl2-image-dev libtiff-dev libavcodec-dev libavformat-dev libswscale-dev byacc flex

The install instructions from the DF work for Ubuntu, see e.g.

civctp2/Dockerfile

Lines 18 to 20 in 5c67aa3

RUN apt-get update && apt-get install -y --no-install-recommends \
libsdl2-dev libsdl2-mixer-dev libsdl2-image-dev libtiff-dev libavcodec-dev libavformat-dev libswscale-dev \
byacc gcc g++ automake libtool unzip flex git ca-certificates

I followed that part of the guide and have those libraries installed already:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
automake is already the newest version (1:1.16.5-1.3).
ca-certificates is already the newest version (20211016).
flex is already the newest version (2.6.4-8build2).
g++ is already the newest version (4:11.2.0-1ubuntu1).
gcc is already the newest version (4:11.2.0-1ubuntu1).
libtiff-dev is already the newest version (4.3.0-6).
libtool is already the newest version (2.4.6-15build2).
unzip is already the newest version (6.0-26ubuntu3).
byacc is already the newest version (1:2.0.20220114-1).
libsdl2-image-dev is already the newest version (2.0.5+dfsg1-3build1).
libsdl2-mixer-dev is already the newest version (2.0.4+dfsg1-4build1).
git is already the newest version (1:2.34.1-1ubuntu1.4).
libavcodec-dev is already the newest version (7:4.4.2-0ubuntu0.22.04.1).
libavformat-dev is already the newest version (7:4.4.2-0ubuntu0.22.04.1).
libsdl2-dev is already the newest version (2.0.20+dfsg-2ubuntu1.22.04.1).
libswscale-dev is already the newest version (7:4.4.2-0ubuntu0.22.04.1).
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.

Welcome to the civctp2 source code project!

Thank you so much! I'm just glad the game's modding scene is alive, it was one of my favorite childhood games and it's nice seeing people keeping it alive

from civctp2.

LynxAbraxas avatar LynxAbraxas commented on May 27, 2024

Hm, either the compiler does not look where the libs are installed, or they have changed in some of the later upgrades. I just noticed the DF still uses ubuntu:18.04 not the newest ubuntu available

FROM ubuntu:18.04 as system

I always played and debugged the game run from a docker-image. I might find some time in the next days (no guaranty though) to test the situation with a docker-image based on the current ubuntu.

from civctp2.

LynxAbraxas avatar LynxAbraxas commented on May 27, 2024

If you are not bound to building the game locally you could try to just develop using GL-CI, see e.g. the latest DEB-package (see #351):
https://gitlab.com/civctp2/civctp2/-/jobs/2687671624/artifacts/browse/deb/

from civctp2.

justinfarrelldev avatar justinfarrelldev commented on May 27, 2024

If you are not bound to building the game locally you could try to just develop using GL-CI, see e.g. the latest DEB-package (see #351):
https://gitlab.com/civctp2/civctp2/-/jobs/2687671624/artifacts/browse/deb/

Thank you so much for the info! I'll definitely see about trying the CI later. I'll also let you know if I can get it to work locally

from civctp2.

justinfarrelldev avatar justinfarrelldev commented on May 27, 2024

So I've been trying for a few days to get it running with Docker, but after running this:

docker build -t ctp2 .

it fails on the 15th step with:

Step 15/20 : COPY ctp2CD/ /opt/ctp2/
COPY failed: file not found in build context or excluded by .dockerignore: stat ctp2CD/: file does not exist

I'm not using the CD version which is probably the issue.

I commented out the line for the COPY in the Dockerfile, and then had this also crop up (makes sense, I'm on Lubuntu):

Step 15/19 : COPY deb/ /deb/
COPY failed: file not found in build context or excluded by .dockerignore: stat deb/: file does not exist

After commenting that out, I finally got fairly close to the end when I had this issue:

 ---> Running in c97200b0617f
Get:1 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Get:2 http://archive.ubuntu.com/ubuntu bionic InRelease [242 kB]
Get:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:4 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Get:5 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 Packages [1533 kB]
Get:6 http://archive.ubuntu.com/ubuntu bionic/multiverse amd64 Packages [186 kB]
Get:7 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages [11.3 MB]
Get:8 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages [2937 kB]
Get:9 http://security.ubuntu.com/ubuntu bionic-security/restricted amd64 Packages [1100 kB]
Get:10 http://security.ubuntu.com/ubuntu bionic-security/multiverse amd64 Packages [22.8 kB]
Get:11 http://archive.ubuntu.com/ubuntu bionic/restricted amd64 Packages [13.5 kB]
Get:12 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages [1344 kB]
Get:13 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [2311 kB]
Get:14 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [3369 kB]
Get:15 http://archive.ubuntu.com/ubuntu bionic-updates/restricted amd64 Packages [1141 kB]
Get:16 http://archive.ubuntu.com/ubuntu bionic-updates/multiverse amd64 Packages [29.9 kB]
Get:17 http://archive.ubuntu.com/ubuntu bionic-backports/universe amd64 Packages [12.9 kB]
Get:18 http://archive.ubuntu.com/ubuntu bionic-backports/main amd64 Packages [12.2 kB]
Fetched 25.8 MB in 14s (1792 kB/s)
Reading package lists...

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists...
E: Unsupported file /deb/ctp2-.deb given on commandline
The command '/bin/sh -c apt-get update && apt install -y --no-install-recommends     /deb/ctp2-${BTYP}.deb &&     apt-get clean &&     rm -rf /var/lib/apt/lists/*' returned a non-zero code: 100

If I remove those lines, it builds successfully but running the Docker container it made fails (it can't find "./ctp2", which makes sense because I commented the last bit out).

I'm honestly not sure how to approach this or what would be considered best practices for this repo but I would love to talk out how to add support for Lubuntu somewhere. Is there some sort of Discord or group chat for contributors?

Thank you again!

from civctp2.

LynxAbraxas avatar LynxAbraxas commented on May 27, 2024

ctp2CD/needs to be populated with the files of the game that are not included in the open source repo (due to the specific release license of activision at that time). Thoes do not have to come from CD, e.g. also those from the GoG versions do work but would need to exist in that folder. Also the DEP- package needs these, because so far we are not allowed to pack those files (due to the license).

see e.g. here for what the GL-CI does:

civctp2/.gitlab-ci.yml

Lines 43 to 62 in 5c67aa3

- docker run --rm
--volume $(pwd)/debian/:/debian/
--volume $(pwd)/deb/:/deb/
--volume $(pwd)/tools/build-deb.sh:/tools/build-deb.sh:ro
$IMAGE_TAG:builder-latest-${CI_JOB_NAME}
tools/build-deb.sh ${CI_JOB_NAME} # create deb-package from pre-compiled files
## 3rd stage build using system-latest and builder-latest for caching
- apk add --update --no-cache curl
- 'curl -sS -f -L --header "Private-Token: ${ARTIFACTKEY}" -o ctp2CD.zip "${CI_API_V4_URL}/projects/${CI_PROJECT_NAMESPACE}%2Fctp2CD/jobs/artifacts/master/download?job=ctp2CDpack"'
- mkdir -p ctp2CD/
- unzip ctp2CD.zip -d ctp2CD/
- docker pull $IMAGE_TAG:test-${CI_JOB_NAME} || true
- docker build --pull
--cache-from $IMAGE_TAG:system-latest
--cache-from $IMAGE_TAG:builder-latest-${CI_JOB_NAME}
--cache-from $IMAGE_TAG:test-${CI_JOB_NAME}
--tag $IMAGE_TAG:test-${CI_JOB_NAME}
--build-arg BTYP=${CI_JOB_NAME}
--target install
.

from civctp2.

justinfarrelldev avatar justinfarrelldev commented on May 27, 2024

ctp2CD/needs to be populated with the files of the game that are not included in the open source repo (due to the specific release license of activision at that time). Thoes do not have to come from CD, e.g. also those from the GoG versions do work but would need to exist in that folder. Also the DEP- package needs these, because so far we are not allowed to pack those files (due to the license).

see e.g. here for what the GL-CI does:

civctp2/.gitlab-ci.yml

Lines 43 to 62 in 5c67aa3

- docker run --rm
--volume $(pwd)/debian/:/debian/
--volume $(pwd)/deb/:/deb/
--volume $(pwd)/tools/build-deb.sh:/tools/build-deb.sh:ro
$IMAGE_TAG:builder-latest-${CI_JOB_NAME}
tools/build-deb.sh ${CI_JOB_NAME} # create deb-package from pre-compiled files
## 3rd stage build using system-latest and builder-latest for caching
- apk add --update --no-cache curl
- 'curl -sS -f -L --header "Private-Token: ${ARTIFACTKEY}" -o ctp2CD.zip "${CI_API_V4_URL}/projects/${CI_PROJECT_NAMESPACE}%2Fctp2CD/jobs/artifacts/master/download?job=ctp2CDpack"'
- mkdir -p ctp2CD/
- unzip ctp2CD.zip -d ctp2CD/
- docker pull $IMAGE_TAG:test-${CI_JOB_NAME} || true
- docker build --pull
--cache-from $IMAGE_TAG:system-latest
--cache-from $IMAGE_TAG:builder-latest-${CI_JOB_NAME}
--cache-from $IMAGE_TAG:test-${CI_JOB_NAME}
--tag $IMAGE_TAG:test-${CI_JOB_NAME}
--build-arg BTYP=${CI_JOB_NAME}
--target install
.

Once again, thank you so much. I will try zipping my edition up into a ctp2CD.zip later and try again. I really appreciate all of your help!

from civctp2.

justinfarrelldev avatar justinfarrelldev commented on May 27, 2024

Okay, I managed to get the build to be successful (I built with docker build -t ctp2 --build-arg BTYP=plain .), however when I used docker run ctp2 it crashed immediately (and silently) with the exit code 139 (Seg fault).

Here was the output of the Docker build (at the bottom, as I said it was completely successful):

Successfully built 95f32251b10a
Successfully tagged ctp2:latest

Any ideas on what could segfault it? I'm also trying to build locally (hopefully should work now with the same steps as Docker) and trying a debug build.
Thank you!

from civctp2.

justinfarrelldev avatar justinfarrelldev commented on May 27, 2024

Built debug version, error for the segfault:

Assertion (dir) Failed in File:ctp/ctp2_utils/c3debug.cpp, Line:113
Messagebox(Assert): Assertion (dir) Failed in File:ctp/ctp2_utils/c3debug.cpp, Line:113

Edit: tried saving the image's filesystem but the find command couldn't find any files with the name "c3debug.cpp" when I extracted the tars for the layers

from civctp2.

LynxAbraxas avatar LynxAbraxas commented on May 27, 2024

Your error probably comes from a missing volume/mount into the docker container, like

civctp2/tools/run-DI.sh

Lines 60 to 63 in 5c67aa3

-v $HOME/.civctp2/save/:/opt/ctp2/ctp2_program/ctp/save \
-v $HOME/.civctp2/logs/:/opt/ctp2/ctp2_program/ctp/logs \
-v $HOME/.civctp2/maps/:/opt/ctp2/ctp2_program/ctp/maps \
-v $HOME/.civctp2/Scenarios/:/opt/ctp2/Scenarios \

The docker run command needs some extra work due to the graphics. I use
https://github.com/civctp2/civctp2/blob/5c67aa3eabfb0829335a942a32d20d576ea641d7/tools/run-DI.sh
for playing the game from the DI with e.g.
tools/run-DI.sh -v ~/civctp1-music/:/opt/ctp2/ctp2_program/ctp/music/:ro -v ~/videos/:/opt/ctp2/ctp2_data/default/videos/:ro --env="ALSA_CARD=1" ctp2 ./ctp2

from civctp2.

justinfarrelldev avatar justinfarrelldev commented on May 27, 2024

Your error probably comes from a missing volume/mount into the docker container, like

civctp2/tools/run-DI.sh

Lines 60 to 63 in 5c67aa3

-v $HOME/.civctp2/save/:/opt/ctp2/ctp2_program/ctp/save \
-v $HOME/.civctp2/logs/:/opt/ctp2/ctp2_program/ctp/logs \
-v $HOME/.civctp2/maps/:/opt/ctp2/ctp2_program/ctp/maps \
-v $HOME/.civctp2/Scenarios/:/opt/ctp2/Scenarios \

The docker run command needs some extra work due to the graphics. I use
https://github.com/civctp2/civctp2/blob/5c67aa3eabfb0829335a942a32d20d576ea641d7/tools/run-DI.sh
for playing the game from the DI with e.g.
tools/run-DI.sh -v ~/civctp1-music/:/opt/ctp2/ctp2_program/ctp/music/:ro -v ~/videos/:/opt/ctp2/ctp2_data/default/videos/:ro --env="ALSA_CARD=1" ctp2 ./ctp2

Okay awesome, I'll try that out!

I might find some time in the next days (no guaranty though) to test the situation with a docker-image based on the current ubuntu.

see #385

That's literally awesome news, thank you! 😁

from civctp2.

LynxAbraxas avatar LynxAbraxas commented on May 27, 2024

Built debug version, error for the segfault:

Assertion (dir) Failed in File:ctp/ctp2_utils/c3debug.cpp, Line:113
Messagebox(Assert): Assertion (dir) Failed in File:ctp/ctp2_utils/c3debug.cpp, Line:113

Edit: tried saving the image's filesystem but the find command couldn't find any files with the name "c3debug.cpp" when I extracted the tars for the layers

BTW: The source files are not part of the final DEP nor in the final DI. The message comes from the info the compiler left in the built files for debugging, i.e. the source files are to be found in the source repo (or in case of the records, those are generated during compile time from the record files).

from civctp2.

justinfarrelldev avatar justinfarrelldev commented on May 27, 2024

Built debug version, error for the segfault:

Assertion (dir) Failed in File:ctp/ctp2_utils/c3debug.cpp, Line:113
Messagebox(Assert): Assertion (dir) Failed in File:ctp/ctp2_utils/c3debug.cpp, Line:113

Edit: tried saving the image's filesystem but the find command couldn't find any files with the name "c3debug.cpp" when I extracted the tars for the layers

BTW: The source files are not part of the final DEP nor in the final DI. The message comes from the info the compiler left in the built files for debugging, i.e. the source files are to be found in the source repo (or in case of the records, those are generated during compile time from the record files).

Thank you for this, I see the files now (under ctp2_code). That honestly gives a ton of insight.

Also, I have amazing news!
ctp_running

It boots into the menu and the game as a whole! :D I used tools/run-DI.sh -v ./ctp2CD/ctp2_program/ctp/music ctp2 ./ctp2 as my command to run it

It feels so good to have gotten this far. I do have some issues actually loading into a map though:

ALSA lib pcm.c:8306:(snd_pcm_recover) underrun occurred
[swscaler @ 0x564dfdfda820] Warning: data is not aligned! This can lead to a speed loss
ALSA lib pcm.c:8306:(snd_pcm_recover) underrun occurred
Messagebox(Map Generator Error): Plugin  is not a valid map generator

Continue?
Assertion (firstPass) Failed in File:wldgen.cpp, Line:371
Messagebox(Assert): Assertion (firstPass) Failed in File:wldgen.cpp, Line:371

Assertion (index >= 0) Failed in File:../ctp2_code/gs/newdb/CTPDatabase.h, Line:122
Messagebox(Assert): Assertion (index >= 0) Failed in File:../ctp2_code/gs/newdb/CTPDatabase.h, Line:122

This occurs when I simply click singleplayer->launch and when things start to load (after clicking ignore twice, it simply crashes). I've tracked that error message down to wldgen.cpp line 2591, and I'ma see what the value of name is and how that all loads to see if I can't debug the solution out (and if it's a simple fix or something I forgot haha).

I'm also noticing that there are no scenarios which makes me think maybe there is code that isn't being added somehow.

from civctp2.

LynxAbraxas avatar LynxAbraxas commented on May 27, 2024

underrun occurredisn't critical (have that too, could probably improved)
The other errors I never had (as far as I can remember). Perhaps try building a non-debug DI and check if that works. Concerning the scenarios there are some threads here, which might have extra info I can't remember right now, but even scenarios should work under linux with current master, perhaps @MartinGuehmann has some ideas on what might be going wrong here.

from civctp2.

LynxAbraxas avatar LynxAbraxas commented on May 27, 2024

Hm, just noticed in your screen shot that the compilation date shown is 2022-07-06. Either your system date is off or you have a compilation that is not from your recent attempts.

from civctp2.

justinfarrelldev avatar justinfarrelldev commented on May 27, 2024

Hm, just noticed in your screen shot that the compilation date shown is 2022-07-06. Either your system date is off or you have a compilation that is not from your recent attempts.

Oh wow I didn't even notice that. My system date is correct (just checked) so that is really interesting, I took that screenshot the same night as I made the comment

I think I'ma try cloning into another folder and doing the steps again, just to make sure my fiddling around didn't mess anything up, I'll let you know when I do that how it works out

from civctp2.

justinfarrelldev avatar justinfarrelldev commented on May 27, 2024

Okay, I just re-cloned and got the same results. Here are the exact commands I ran to get this to happen (copy pasted from my terminal history):
git clone https://github.com/civctp2/civctp2
cd civctp2

From there, I moved the ctp2CD and deb folders into the top level of the project. The deb files were found from GitLab runs.

From there, I built and ran:

docker build -t ctp2-test --build-arg BTYP=debug .
tools/run-DI.sh -v ./ctp2CD/ctp2_program/ctp/music ctp2-test ./ctp2

Here is the output:

ALSA lib pcm.c:8306:(snd_pcm_recover) underrun occurred
[swscaler @ 0x56216fa01820] Warning: data is not aligned! This can lead to a speed loss
Messagebox(Map Generator Error): Plugin  is not a valid map generator

Continue?
Assertion (firstPass) Failed in File:wldgen.cpp, Line:371
Messagebox(Assert): Assertion (firstPass) Failed in File:wldgen.cpp, Line:371

Assertion (index >= 0) Failed in File:../ctp2_code/gs/newdb/CTPDatabase.h, Line:122
Messagebox(Assert): Assertion (index >= 0) Failed in File:../ctp2_code/gs/newdb/CTPDatabase.h, Line:122

It also, notably, still says 2022-07-06 on the title screen (I definitely did not have this copy of CTP2 at that time, I purchased it 2 weeks ago, so I'm really not sure where it could come from - maybe the .deb files I got?).

Lastly, I added the video folder into the run command (forgot it last time):
tools/run-DI.sh -v ./ctp2CD/ctp2_program/ctp/music -v ./ctp2CD/ctp2_data/default/videos ctp2-test ./ctp2

Still the same result sadly :(

Thank you guys so much for helping though, I know this is a long one

from civctp2.

MartinGuehmann avatar MartinGuehmann commented on May 27, 2024

I guess you did not build CTP2 yourself but are using the version from the deb file, @justinfarrelldev. 2022-07-06 is the day when I merged the last time something into master. Anyway, when I build it myself as debug version and start a new game than I get this:

Could not load library dll\\map\\geometric.dll, using builtin map generator: dll//map//geometric.so: cannot open shared object file: No such file or directoryAssertion (firstPass) Failed in File:wldgen.cpp, Line:391
Messagebox(Assert): Assertion (firstPass) Failed in File:wldgen.cpp, Line:391

Assertion (index >= 0) Failed in File:../ctp2_code/gs/newdb/CTPDatabase.h, Line:122
Messagebox(Assert): Assertion (index >= 0) Failed in File:../ctp2_code/gs/newdb/CTPDatabase.h, Line:122

Speicherzugriffsfehler (Speicherabzug geschrieben)

It is a bit wired why it is looking for the Windows map plugins first. But then it looks for the Linux map plugins. However, there is no geometric.so generated even not in the wrong folder.

from civctp2.

LynxAbraxas avatar LynxAbraxas commented on May 27, 2024

I guess you did not build CTP2 yourself but are using the version from the deb file, @justinfarrelldev. 2022-07-06 is the day when I merged the last time something into master.

True, didn't think of that. So you got the DEB from the GL-CI built? That's fine, it wouldn't contain any of your changes though (if you already made any).

It is a bit wired why it is looking for the Windows map plugins first. But then it looks for the Linux map plugins. However, there is no geometric.so generated even not in the wrong folder.

Odd, it gets built and copied here:
https://gitlab.com/civctp2/civctp2/-/jobs/2687671624#L7179

from civctp2.

MartinGuehmann avatar MartinGuehmann commented on May 27, 2024

It is a bit wired why it is looking for the Windows map plugins first. But then it looks for the Linux map plugins. However, there is no geometric.so generated even not in the wrong folder.

Odd, it gets built and copied here: https://gitlab.com/civctp2/civctp2/-/jobs/2687671624#L7179

That line says:
[7179](https://gitlab.com/civctp2/civctp2/-/jobs/2687671624#L7179) inflating: ctp2_program/ctp/dll/map/geometric.dll

I guess inflating means copying. Where does i copying it from and why is it a dll, that is a Windows library. So it should not build it.

That is during installation, which is also fine:
'/ctp2/ctp2_code/mapgen/.libs/geometric.so' -> '/opt/ctp2/ctp2_program/ctp/dll/map/geometric.so'

However, the map plugins are not generated at the position or copied to the position where the development version expects them. That would be: ctp2/ctp2_code/ctp/dll/map/geometric.so

from civctp2.

LynxAbraxas avatar LynxAbraxas commented on May 27, 2024

That line says: [7179](https://gitlab.com/civctp2/civctp2/-/jobs/2687671624#L7179) inflating: ctp2_program/ctp/dll/map/geometric.dll

I guess inflating means copying. Where does i copying it from and why is it a dll, that is a Windows library. So it should not build it.

Sorry, got the wrong line in the long logs. It's where the content of the CD is deflated from the ZIP, so that's the old original windows DLL.

That is during installation, which is also fine: '/ctp2/ctp2_code/mapgen/.libs/geometric.so' -> '/opt/ctp2/ctp2_program/ctp/dll/map/geometric.so'

That's the right one.

However, the map plugins are not generated at the position or copied to the position where the development version expects them. That would be: ctp2/ctp2_code/ctp/dll/map/geometric.so

Odd, could it be that it does not matter? The GL-CI tests for the development version pass all fine.

from civctp2.

LynxAbraxas avatar LynxAbraxas commented on May 27, 2024

docker build -t ctp2-test --build-arg BTYP=debug . tools/run-DI.sh -v ./ctp2CD/ctp2_program/ctp/music ctp2-test ./ctp2

@justinfarrelldev have a try wit --build-arg BTYP=plain, that might be better for a start. It's odd you face so much problems on Lubuntu.

from civctp2.

MartinGuehmann avatar MartinGuehmann commented on May 27, 2024

Odd, could it be that it does not matter? The GL-CI tests for the development version pass all fine.

What is the directory the GL-CI is running from? I guess it is not ctp2/ctp2_code/ctp/.

from civctp2.

justinfarrelldev avatar justinfarrelldev commented on May 27, 2024

docker build -t ctp2-test --build-arg BTYP=debug . tools/run-DI.sh -v ./ctp2CD/ctp2_program/ctp/music ctp2-test ./ctp2

@justinfarrelldev have a try wit --build-arg BTYP=plain, that might be better for a start. It's odd you face so much problems on Lubuntu.

Will do as soon as I can! Sorry I haven't replied much, I have been very busy and haven't gotten to try out anything since my last reply

Edit 9/4/22: I'm still gonna try it out, I'm just absolutely busy at the moment.

from civctp2.

LynxAbraxas avatar LynxAbraxas commented on May 27, 2024

Edit 9/4/22: I'm still gonna try it out, I'm just absolutely busy at the moment.

Did it work for you? I'll be off again soon (till at least Christmas).

from civctp2.

justinfarrelldev avatar justinfarrelldev commented on May 27, 2024

Edit 9/4/22: I'm still gonna try it out, I'm just absolutely busy at the moment.

Did it work for you? I'll be off again soon (till at least Christmas).

I'll try it again tonight (I've been quite busy, sorry!).

Edit: still have not gotten around to it. Honestly been a wild month, I haven't forgotten

from civctp2.

LynxAbraxas avatar LynxAbraxas commented on May 27, 2024

Sorry, I'll be off for the time being now. Hope you can get it to work, in any case please let us know, either how you got it to work (and what was the problem) or if it is still not working for you (I'll probably be back some time around Christmas to continue helping). Running the game either directly or from the DI only needs an Xserver instance (like during the smoke tests, SDL even supports to avoid that by unsing fbdev), so it should not matter weather Ubuntu/Lubuntu/Kubuntu or the like is used.

from civctp2.

LynxAbraxas avatar LynxAbraxas commented on May 27, 2024

@justinfarrelldev So what's the status?

from civctp2.

justinfarrelldev avatar justinfarrelldev commented on May 27, 2024

@justinfarrelldev So what's the status?

Just got access to a Windows computer so I'm just giving it a shot on there. Was never able to get it working on Lubuntu or Mint when I tried that

from civctp2.

justinfarrelldev avatar justinfarrelldev commented on May 27, 2024

I'm still completely unable to build on Windows or on Lubuntu (even after following #379 and checking out #348 thoroughly). I'd love to contribute to the repo, I just can't figure out how to build for the life of me. Is there any chance that we could have the documentation updated?

I'm not the only person struggling with the build process at the moment (as shown by #348 never being resolved) and I really think that the game would be in a much better place overall if the build instructions and readme were up-to-date and clear for Windows as well as Linux.

At the moment, they're full of loads of technical details and not very easily digestible (and, importantly, lack a clear process for building for Linux and especially Windows). It should probably be mentioned in the readme as well that the only verified build is g++ on Ubuntu (and mention which Ubuntu version - is it latest, 18.04, 14.04? New devs won't want to dig into the CI or issues to find out. Also, which version of g++?).

Maybe someone who can build and has in-depth knowledge of the repo can step through the process with a clean slate in a VM? That way, they could note every step of the process, their thought process behind stuff, GitLab downloads and everything necessary to get the edition working properly.

I'm not meaning to come off snarky or pushy in any way, I just really care about the game and would love to play an up-to-date version of the Apolyton Edition. Apolyton Edition has always been the pinnacle of CTP2 gameplay (and, in the last few years, has been the only way to play multiplayer at all). Having it more easily accessible, buildable and editable is crucial for CTP2's playerbase to stick around. We're practically an endangered species haha. What are your thoughts @LynxAbraxas @MartinGuehmann?

from civctp2.

justinfarrelldev avatar justinfarrelldev commented on May 27, 2024

I should also follow that up with that I really, genuinely appreciate the work you guys have put in over the years. Don't get me wrong, I think you are all doing brilliant work!

from civctp2.

LynxAbraxas avatar LynxAbraxas commented on May 27, 2024

I'm still completely unable to build on Windows or on Lubuntu (even after following #379 and checking out #348 thoroughly). I'd love to contribute to the repo, I just can't figure out how to build for the life of me. Is there any chance that we could have the documentation updated?

Sure, but for me so far it is not clear what is missing for you in the documentation and where your problems currently lie.

I'm not the only person struggling with the build process at the moment (as shown by #348 never being resolved) and I really think that the game would be in a much better place overall if the build instructions and readme were up-to-date and clear for Windows as well as Linux.

Sorry, so far I've ever only built and played CTP2 on Linux.

At the moment, they're full of loads of technical details

Hm, how about contributing a modified Readme in a new PR by You? Then we can discuss Your suggested changes there;-)

which Ubuntu version - is it latest, 18.04, 14.04?

Since #385 is merged (7eb2091) it is

FROM ubuntu as system

which means ubuntu:latest (ubuntu:latest tag points to the "latest LTS" (https://hub.docker.com/_/ubuntu) so currently latest is 22.04 (jammy))

which version of g++?

The default that comes with ubuntu:latest:

byacc gcc g++ automake make libtool unzip flex git ca-certificates

Maybe someone who can build and has in-depth knowledge of the repo can step through the process with a clean slate in a VM?

Well, that is basically what is done in the Dockerfile:

  1. civctp2/Dockerfile

    Lines 18 to 21 in 9cd7c30

    RUN apt-get update && \
    DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get install -y --no-install-recommends \
    libsdl2-dev libsdl2-mixer-dev libsdl2-image-dev libtiff-dev libavcodec-dev libavformat-dev libswscale-dev \
    byacc gcc g++ automake make libtool unzip flex git ca-certificates
    install all necessary tools and libraries as dev-packages for building the game from source.
  2. if you compile in the base dir of the git-repo, you just need

    civctp2/Dockerfile

    Lines 40 to 44 in 9cd7c30

    && ./autogen.sh && \
    CFLAGS="$CFLAGS -Wno-misleading-indentation $( [ "${BTYP##*debug*}" ] && echo -O3 || echo -g -rdynamic ) -fuse-ld=gold" \
    CXXFLAGS="$CXXFLAGS -Wno-misleading-indentation -fpermissive $( [ "${BTYP##*debug*}" ] && echo -O3 || echo -g -rdynamic ) -fuse-ld=gold" \
    ./configure --prefix=/opt/ctp2 --bindir=/opt/ctp2/ctp2_program/ctp --enable-silent-rules $( [ "${BTYP##*debug*}" ] || echo --enable-debug ) \
    && make -j"$(nproc)" \
    which generates the configure script runs it with params for installing to /opt/ctp2 either for the debug version or the plain version and then compiles the code with make.
  3. if you do not want to create a DEP-File (as done in

    civctp2/.gitlab-ci.yml

    Lines 44 to 50 in 67532c1

    - mkdir -p deb/ # create artifacts folder
    - docker run --rm
    --volume $(pwd)/debian/:/debian/
    --volume $(pwd)/deb/:/deb/
    --volume $(pwd)/tools/build-deb.sh:/tools/build-deb.sh:ro
    $IMAGE_TAG:builder-latest-${CI_JOB_NAME}
    tools/build-deb.sh ${CI_JOB_NAME} # create deb-package from pre-compiled files
    and used in

    civctp2/Dockerfile

    Lines 65 to 69 in 9cd7c30

    ## apt install installs local deb-file with its dependencies: https://unix.stackexchange.com/questions/159094/how-to-install-a-deb-file-by-dpkg-i-or-by-apt#159114
    RUN apt-get update && apt install -y --no-install-recommends \
    /deb/ctp2-${BTYP}.deb && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*
    ) you have to copy the game-files from the original CD or the files obtained from GoG
    COPY ctp2CD/ /opt/ctp2/
    to the install destination before
  4. running

    civctp2/Dockerfile

    Lines 45 to 48 in 9cd7c30

    && make -j"$(nproc)" install \
    && cp -r /ctp2/ctp2_data/ /opt/ctp2/ \
    && mkdir -p /opt/ctp2/ctp2_program/ctp/dll/map/ \
    && cp -v /ctp2/ctp2_code/mapgen/.libs/*.so /opt/ctp2/ctp2_program/ctp/dll/map/
    which copies the newly built game and new/replacement game-files from the repo over the corresponding old files in /opt/ctp2
  5. then changing into
    WORKDIR /opt/ctp2/ctp2_program/ctp/
    and running
    ./ctp2 $CTP_PARAMS &
    (can be without any params) should start the game (if done from a running X-session).

That way, they could note every step of the process, their thought process behind stuff, GitLab downloads and everything necessary to get the edition working properly.

A download of a DEP-file from GitLab is only needed if you do not want to compile the game yourself. It works like other DEP-Packages with binaries except that again you need to provide the original game files prior to installing the DEP-file, which is what is done in

civctp2/Dockerfile

Lines 58 to 67 in 9cd7c30

## ctp2CD/ copy done in install stage such that stages before are compatible with travis docker build, results in one additional layer in the final DI (incr. DI download size)
COPY ctp2CD/ /opt/ctp2/
## ctp2 install has to be after ctp2CD/ to overwrite with newer versions from civctp2
## deb-file has to be copied first, sadly this adds a layer (which is not necessary with COPY --from=builder): https://stackoverflow.com/questions/52211895/docker-build-avoid-adding-files-only-needed-at-build-time
COPY deb/ /deb/
## apt install installs local deb-file with its dependencies: https://unix.stackexchange.com/questions/159094/how-to-install-a-deb-file-by-dpkg-i-or-by-apt#159114
RUN apt-get update && apt install -y --no-install-recommends \
/deb/ctp2-${BTYP}.deb && \

I'm not meaning to come off snarky or pushy in any way, I just really care about the game and would love to play an up-to-date version of the Apolyton Edition. Apolyton Edition has always been the pinnacle of CTP2 gameplay (and, in the last few years, has been the only way to play multiplayer at all). Having it more easily accessible, buildable and editable is crucial for CTP2's playerbase to stick around.

Sady, building the game was never tuned to be user-friendly (since it originally was closed source) and still is not like FOSS due to the given EULA. That's why I introduced the DEP-files from GL-CI Artifacts, so that user that only want to play the newest version of the game on linux do not need to cope with the built-process at all.

We're practically an endangered species haha.

That's why we are very happy about everyone trying out the current CTP2 and in particular contributing issues or PRs here;-)

from civctp2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.