Giter Site home page Giter Site logo

ptitseb / ctp2 Goto Github PK

View Code? Open in Web Editor NEW
29.0 8.0 2.0 40.66 MB

Civ: CTP2 (Call to Power 2) port to Linux, Pandora and Pyra. Status: Working

HTML 1.47% Makefile 4.27% Shell 2.01% Awk 0.01% M4 0.22% C 28.30% C++ 61.62% APL 0.01% PHP 0.02% Batchfile 0.37% Lex 0.07% Yacc 0.17% Objective-C 0.14% Perl 0.40% Java 0.33% Max 0.26% Smarty 0.01% WebAssembly 0.01% Roff 0.30% R 0.03%
civilization ctp pandora linux game

ctp2's Introduction

ctp2 build status

Deprecated

Note that this repo is deprecated. You'll have a better chance to get this running with this repo: https://github.com/civctp2/civctp2 that integrate all the change from here plus many more.

About

This is the Apolyton version of Call to Power II source code based on the released source code of Call to Power II, without the patch. It has been stripped of comments, but is otherwise complete as far as Activision code goes. It was originally built using Microsoft Visual Studio 6.0. In the mean time the Apolyton code was modified so that it works with the .NET compiler as well. This version build on Linux (i386 and x86_64), Pandora and Pyra.

Note that datas are not include in this repo, you'll need to get it from Original CD or from GoG version.

screenshot

This version should support CD Audio music, and also support Ripped CD Audio compressed as ogg (like found in the GoG version). The Audio tracks should be Named Track02.ogg to Track11.ogg and be in the ctp2_program/ctp/music folder.

Building

You will probably need GCC 5.x or later to build. It doesn't seems to build on GCC 4.8.

You will need SDL 1.2, SDL_Mixer, SDL_Image and GTK 2.0 libraries. You will also need byacc On debian and friend it's sudo apt install libsdl1.2-dev libsdl-mixer1.2-dev libsdl-image1.2-dev byacc gtk+-2.0-dev to install all this.

The build itself is pretty classing and straight forward: ./autogen.sh ./configure make

You can look at ./configure for option, but there isn't much there.

Also, note that make -j4 may fail the first time. Some file are autogenerated and the make dependencies doesn't catch that.

Finaly, you may have to use gold instead of ld for link (add -fuse-ld=gold to your CFLAGS & CXXFLAGS if needed).

Installation

Beeing a CD Windows game initially, the installation process is bit complicated.

Prepare the datas

First you need the Data of the original game. If you have the CD version, it's better to install it on a Windows machine / using Wine and copy over the data. You need ctp2_data, ctp2_program and Scenarios folders.

If you have the GoG version, use innoextract to extract all the required datas (you can sudo apt install innoextract if you need) from the setup_call_to_power2_2.0.0.13.exe windows installer. For example innoextract -m -I app setup_call_to_power2_2.0.0.13.exe will extract the appfolder taht contains all game datas. The same ctp2_data, ctp2_program and Scenarios folders as with the CD are needed.

Put those folder in you home path or anywhere else, for example ~/ctp2

Use Apolyton datas

You then need to copy updated datas from this git over the original data. Simply cp -r ctp2_data/* ~/ctp2/ctp2_data should do the trick. Note that this is a Windows game, where file name is on a Case Insensitive file system. This version of the CTP2 handle this, and file name can have any case, but the cp command may not overwrite file that have different case. If you have strange behavour or think the data is not up-to-date, check that you don't have 2 copies of files, with different case (or lowercase everything if needed). Using the GoG version, no renaming is needed.

Copy Linux executable

When the build is over, you need to copy the main CTP2 executable, plus mapgen library to the program folder (wich is ctp2_program/ctp). for the executable, it will be something like: cp -v ctp2_code/ctp2 ~/ctp2/ctp2_program/ctp/ The mapgen libraries will go to ctp2_program/ctp/dll/map/ . So do something like cp -v ctp2_code/mapgen/.libs/*.so ~/ctp2/ctp2_program/ctp/dll/map/

Running

When everything is setup, simply go to the program folder, for example with cd ~/ctp2/ctp2_program/ctp and launch the game with ./ctp2. There are a few command line option like -fullscreen that can be usefull.

ctp2's People

Contributors

lynxabraxas avatar ptitseb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

isiks paulwratt

ctp2's Issues

How was the (git) history flattened?

Hi @ptitSeb,

Cool to see some work done on a linux port. I had worked on the svn linux branch some years ago and had that ported to git by github's svn import: https://github.com/LynxAbraxas/ctp2
It seems you did port to git somehow differently such that only the very first commit is the same in both repos. Furthermore your port somehow "flattened" the history of various branches all into one, where e.g. those from the original linux branch are empty commits (i.e. the changes to files got lost), compare e.g. these same commit messages, dates:
03a905a (0 changed files)
and
https://github.com/LynxAbraxas/ctp2/commit/29994a179e080b5a244411c2294d4b47a7a1b3bd (198 changed files)
So it seems you basically did a new port to linux, missing the changes already done on the original linux branch, which could e.g. be the reason for the missing resolutions (#1).

There have been quite a few tries to merge the original master and the linux branches ( https://github.com/LynxAbraxas/ctp2/branches), the latest was port-trunk. I once considered merging with git-imerge, but so far had not the time to try. I think a clean way of getting the old stuff and your new contributions together would be to do a merge (with e.g. git-imerge) of the original master and linux branch and then rebase your new commits on top of that. It seems imerge could even handle merging your current master with the original linux branch, but the resulting history would be very screwed then due to the different commit SHAs for the same commit content.
What do you think? Would you want to give it a try?

PS: There is one other github repos for ctp2 (https://github.com/talentlesshack/C2P2) which was also imported differently and lacks all branches except master but seems to have some more commits in common than only the very first, not sure how that git port was done.

missing file? "BuildingRecord.h"

Hi Ptit, I found this issue on compiling:

FeatRecord.cpp:23:10: error fatal: BuildingRecord.h: No existe el fichero o el directorio
#include "BuildingRecord.h"

I've searched and there is no BuildingRecord.h on ctp2/ctp2_code/gs/newdb

Great work

Great work. Dont have much time to play yet, but everthig compile end run great.
Only chenging screen resolution seem to be broken.

build fails

Using Ubuntu 18.04 build fails with follows:

/usr/bin/x86_64-linux-gnu-ld: os/nowin32/.libs/libosnowin32.a(nowin32.o): undefined reference to symbol 'g_type_check_instance_cast'
/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libgobject-2.0.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Makefile:2756: recipe for target 'ctp2' failed
make[2]: *** [ctp2] Error 1
make[2]: Leaving directory '../ctp2-master/ctp2_code'
Makefile:3333: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '../ctp2-master/ctp2_code'
GNUmakefile:467: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

that can be fixed by adding $(GTK_LIBS) to line:

libosnowin32.la: $(libosnowin32_la_OBJECTS) $(libosnowin32_la_DEPENDENCIES) $(EXTRA_libosnowin32_la_DEPENDENCIES)
$(AM_V_CXXLD)$(libosnowin32_la_LINK) $(libosnowin32_la_OBJECTS) $(libosnowin32_la_LIBADD) $(LIBS)

in ctp2_code/os/nowin32/Makefile

performing make clean && make we ended up with:

gfx/gfx_utils/.libs/libgfxgfx_utils.a(tiffutils.o): In function tiffutils_LoadTIF': ../ctp2-master/ctp2_code/gfx/gfx_utils/tiffutils.cpp:41: undefined reference to TIFFOpen'
../ctp2-master/ctp2_code/gfx/gfx_utils/tiffutils.cpp:45: undefined reference to TIFFGetField' ../ctp2-master/ctp2_code/gfx/gfx_utils/tiffutils.cpp:46: undefined reference to TIFFGetField'
../ctp2-master/ctp2_code/gfx/gfx_utils/tiffutils.cpp:49: undefined reference to _TIFFmalloc' ../ctp2-master/ctp2_code/gfx/gfx_utils/tiffutils.cpp:52: undefined reference to TIFFReadRGBAImage'
../ctp2-master/ctp2_code/gfx/gfx_utils/tiffutils.cpp:56: undefined reference to _TIFFfree' ../ctp2-master/ctp2_code/gfx/gfx_utils/tiffutils.cpp:57: undefined reference to TIFFClose'
../ctp2-master/ctp2_code/gfx/gfx_utils/tiffutils.cpp:64: undefined reference to _TIFFfree' ../ctp2-master/ctp2_code/gfx/gfx_utils/tiffutils.cpp:65: undefined reference to TIFFClose'
../ctp2-master/ctp2_code/gfx/gfx_utils/tiffutils.cpp:73: undefined reference to TIFFClose' gfx/gfx_utils/.libs/libgfxgfx_utils.a(tiffutils.o): In function TIF2mem':
../ctp2-master/ctp2_code/gfx/gfx_utils/tiffutils.cpp:87: undefined reference to TIFFOpen' ../ctp2-master/ctp2_code/gfx/gfx_utils/tiffutils.cpp:90: undefined reference to TIFFGetField'
../ctp2-master/ctp2_code/gfx/gfx_utils/tiffutils.cpp:91: undefined reference to TIFFGetField' ../ctp2-master/ctp2_code/gfx/gfx_utils/tiffutils.cpp:97: undefined reference to TIFFClose'
../ctp2-master/ctp2_code/gfx/gfx_utils/tiffutils.cpp:104: undefined reference to _TIFFmalloc' ../ctp2-master/ctp2_code/gfx/gfx_utils/tiffutils.cpp:107: undefined reference to TIFFReadRGBAImage'
../ctp2-master/ctp2_code/gfx/gfx_utils/tiffutils.cpp:117: undefined reference to _TIFFfree' ../ctp2-master/ctp2_code/gfx/gfx_utils/tiffutils.cpp:120: undefined reference to TIFFClose'
gfx/gfx_utils/.libs/libgfxgfx_utils.a(tiffutils.o): In function TIFGetMetrics': ../ctp2-master/ctp2_code/gfx/gfx_utils/tiffutils.cpp:135: undefined reference to TIFFOpen'
../ctp2-master/ctp2_code/gfx/gfx_utils/tiffutils.cpp:142: undefined reference to TIFFGetField' ../ctp2-master/ctp2_code/gfx/gfx_utils/tiffutils.cpp:143: undefined reference to TIFFGetField'
../ctp2-master/ctp2_code/gfx/gfx_utils/tiffutils.cpp:145: undefined reference to TIFFClose' gfx/gfx_utils/.libs/libgfxgfx_utils.a(tiffutils.o): In function TIFLoadIntoBuffer16':
../ctp2-master/ctp2_code/gfx/gfx_utils/tiffutils.cpp:159: undefined reference to TIFFOpen' ../ctp2-master/ctp2_code/gfx/gfx_utils/tiffutils.cpp:163: undefined reference to TIFFGetField'
../ctp2-master/ctp2_code/gfx/gfx_utils/tiffutils.cpp:164: undefined reference to TIFFGetField' ../ctp2-master/ctp2_code/gfx/gfx_utils/tiffutils.cpp:168: undefined reference to _TIFFmalloc'
../ctp2-master/ctp2_code/gfx/gfx_utils/tiffutils.cpp:172: undefined reference to TIFFReadRGBAImage' ../ctp2-master/ctp2_code/gfx/gfx_utils/tiffutils.cpp:216: undefined reference to _TIFFfree'
../ctp2-master/ctp2_code/gfx/gfx_utils/tiffutils.cpp:219: undefined reference to TIFFClose' gfx/gfx_utils/.libs/libgfxgfx_utils.a(tiffutils.o): In function StripTIF2Mem':
../ctp2-master/ctp2_code/gfx/gfx_utils/tiffutils.cpp:235: undefined reference to TIFFOpen' ../ctp2-master/ctp2_code/gfx/gfx_utils/tiffutils.cpp:249: undefined reference to TIFFGetField'
../ctp2-master/ctp2_code/gfx/gfx_utils/tiffutils.cpp:250: undefined reference to TIFFGetField' ../ctp2-master/ctp2_code/gfx/gfx_utils/tiffutils.cpp:251: undefined reference to TIFFGetField'
../ctp2-master/ctp2_code/gfx/gfx_utils/tiffutils.cpp:252: undefined reference to TIFFGetField' ../ctp2-master/ctp2_code/gfx/gfx_utils/tiffutils.cpp:253: undefined reference to TIFFGetField'
../ctp2-master/ctp2_code/gfx/gfx_utils/tiffutils.cpp:255: undefined reference to TIFFScanlineSize' ../ctp2-master/ctp2_code/gfx/gfx_utils/tiffutils.cpp:256: undefined reference to TIFFStripSize'
../ctp2-master/ctp2_code/gfx/gfx_utils/tiffutils.cpp:266: undefined reference to TIFFComputeStrip' ../ctp2-master/ctp2_code/gfx/gfx_utils/tiffutils.cpp:266: undefined reference to TIFFReadEncodedStrip'
../ctp2-master/ctp2_code/gfx/gfx_utils/tiffutils.cpp:282: undefined reference to TIFFClose' sound/.libs/libsound.a(soundmanager.o): In function SoundManager::InitSoundDriver()':
../ctp2-master/ctp2_code/sound/soundmanager.cpp:168: undefined reference to Mix_OpenAudio' sound/.libs/libsound.a(soundmanager.o): In function SoundManager::CleanupSoundDriver()':
../ctp2-master/ctp2_code/sound/soundmanager.cpp:202: undefined reference to Mix_CloseAudio' sound/.libs/libsound.a(soundmanager.o): In function SoundManager::CleanupRedbook()':
../ctp2-master/ctp2_code/sound/soundmanager.cpp:272: undefined reference to Mix_FreeMusic' sound/.libs/libsound.a(soundmanager.o): In function SoundManager::ProcessRedbook()':
../ctp2-master/ctp2_code/sound/soundmanager.cpp:298: undefined reference to Mix_PlayingMusic' sound/.libs/libsound.a(soundmanager.o): In function SoundManager::Process(unsigned int const&, unsigned int&)':
../ctp2-master/ctp2_code/sound/soundmanager.cpp:375: undefined reference to Mix_Playing' ../ctp2-master/ctp2_code/sound/soundmanager.cpp:400: undefined reference to Mix_Playing'
sound/.libs/libsound.a(soundmanager.o): In function SoundManager::AddSound(SOUNDTYPE const&, unsigned int const&, int const&, int, int)': ../ctp2-master/ctp2_code/sound/soundmanager.cpp:492: undefined reference to Mix_PlayChannelTimed'
sound/.libs/libsound.a(soundmanager.o): In function SoundManager::AddLoopingSound(SOUNDTYPE const&, unsigned int const&, int const&, int, int)': ../ctp2-master/ctp2_code/sound/soundmanager.cpp:538: undefined reference to Mix_PlayChannelTimed'
sound/.libs/libsound.a(soundmanager.o): In function SoundManager::TerminateLoopingSound(SOUNDTYPE const&, unsigned int const&)': ../ctp2-master/ctp2_code/sound/soundmanager.cpp:559: undefined reference to Mix_HaltChannel'
sound/.libs/libsound.a(soundmanager.o): In function SoundManager::TerminateAllLoopingSounds(SOUNDTYPE const&)': ../ctp2-master/ctp2_code/sound/soundmanager.cpp:589: undefined reference to Mix_HaltChannel'
sound/.libs/libsound.a(soundmanager.o): In function SoundManager::TerminateSounds(SOUNDTYPE const&)': ../ctp2-master/ctp2_code/sound/soundmanager.cpp:622: undefined reference to Mix_HaltChannel'
sound/.libs/libsound.a(soundmanager.o): In function SoundManager::SetVolume(SOUNDTYPE const&, unsigned int const&)': ../ctp2-master/ctp2_code/sound/soundmanager.cpp:678: undefined reference to Mix_VolumeMusic'
../ctp2-master/ctp2_code/sound/soundmanager.cpp:680: undefined reference to Mix_VolumeMusic' sound/.libs/libsound.a(soundmanager.o): In function SoundManager::StartMusic(int const&)':
../ctp2-master/ctp2_code/sound/soundmanager.cpp:932: undefined reference to Mix_FreeMusic' ../ctp2-master/ctp2_code/sound/soundmanager.cpp:935: undefined reference to Mix_LoadMUS'
../ctp2-master/ctp2_code/sound/soundmanager.cpp:937: undefined reference to Mix_PlayMusic' sound/.libs/libsound.a(civsound.o): In function CivSound::CivSound(unsigned int const&, int const&)':
../ctp2-master/ctp2_code/sound/civsound.cpp:90: undefined reference to Mix_LoadWAV_RW' sound/.libs/libsound.a(civsound.o): In function CivSound::~CivSound()':
../ctp2-master/ctp2_code/sound/civsound.cpp:103: undefined reference to Mix_FreeChunk' sound/.libs/libsound.a(civsound.o): In function CivSound::SetVolume(int const&)':
../ctp2-master/ctp2_code/sound/civsound.cpp:205: undefined reference to Mix_VolumeChunk' ../ctp2-master/ctp2_code/sound/civsound.cpp:207: undefined reference to Mix_VolumeChunk'
collect2: error: ld returned 1 exit status
Makefile:2756: recipe for target 'ctp2' failed
make[2]: *** [ctp2] Error 1
make[2]: Leaving directory '../ctp2-master/ctp2_code'
Makefile:3333: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '../ctp2-master/ctp2_code'
GNUmakefile:467: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

Look's like the build system is broken.

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.