Giter Site home page Giter Site logo

civctp2 / civctp2 Goto Github PK

View Code? Open in Web Editor NEW
67.0 11.0 24.0 86.01 MB

git svn import of http://ctp2.darkdust.net/anonsvn/

HTML 1.66% Makefile 2.37% Shell 2.31% Awk 0.02% M4 0.25% C 32.31% C++ 58.80% APL 0.01% PHP 0.01% Batchfile 0.42% Lex 0.07% Yacc 0.16% Perl 0.51% Java 0.38% Max 0.30% Smarty 0.01% WebAssembly 0.01% Roff 0.33% R 0.04% DM 0.05%
ctp2 civilization c c-plus-plus game windows linux

civctp2's Introduction

Build Status

CivCTP2

Original readme files

About

This is the Apolyton version of the Call to Power II (CTP2) source code based on the released source code from Activision, that did not include the patch. The code has been stripped of comments, but is otherwise complete as far as Activision's code goes. It was originally built with Microsoft Visual Studio 6.0. In the mean time the Apolyton code was modified so that it works with later versions. This version also builds on Linux (i386 and x86_64), Ubuntu, Pandora, and Pyra.

On Linux, CTP2 builds as 32 and 64 bit application, on Windows only as 32 bit application. To allow 64 bit builds on Windows, assembler code and the Miles Sound System library needs to be replaced.

Note that the game files are not included in this repository, you can get them from the original CD or from the GoG version.

screenshot Advance-Graph

Clone and complete your working copy

First, clone this repository into a directory of your choice. It will contain, beside some others, the following subdirectories:

  • ctp2_code
  • ctp2_data
  • Scenarios

The directory ctp2_code contains the source code and will contain the generated executable. The directory ctp2_data contains the data files, such as sounds, images, and the database text files that contain all data for the game objects such as move points for units.

Even so the source code of CTP2 has been published, CTP2 is not free software. That means, we cannot distribute CTP2 and its code as a standalone product. Therefore, you have to add in the missing components from your copy of CTP2.

If you already have a copy of CTP2 installed, you can just copy everything from this repository into your installation, which is typically found in C:\Program Files\Activision\Call to Power II\.

If you do not have a copy already installed, you can get the files from the CD. The CD contains two files civlang.ctp and civmain.ctp (the extensions might differ). These files are zip files. The file civmain.ctp contains all files that are common to all language versions, civlang.ctp contains all files specific to your language version. Unzip these files and copy their content over your working copy without replacing files that already exist.

If you have the GoG version, use innoextract to extract all the required files (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 that contains all the game files, which are in the same subfolders as in the CD version: ctp2_data, ctp2_program and Scenarios. Copy these folders over your working copy without replacing files that already exist. Now you should have those directories in your working copy.

  • ctp2_code
  • ctp2_data
  • Scenarios
  • ctp2_program

The folder ctp2_program is a stripped down version of ctp2_code without the source code and is the version that was shipped with the game. It is not needed for compiling and running the game. If it is an from a previous installation and you have some save games you want to use in your working copy then copy the folder /ctp2_program/ctp/save/ and all its content to /ctp2_code/ctp/save/.

Install the music and videos

The Windows version supports CD audio music, and the Linux version supports ripped CD music files compressed as ogg (like found in the GoG version). The Audio tracks in the GoG version are named Track02.ogg to Track11.ogg and in the ctp2_program/ctp/music folder, which should be copied to ctp2_code/ctp/music, if you want to use them in your working copy.

The music and the videos are not needed for the playing CTP2. However, if you want to use them you can just use the CD on Windows. However, the GoG audio tracks are not supported on Windows, but you can play them in anther player such as VLC, while playing the game.

As the Linux version does not support direct play from the CD-ROM, you need to rip the music-files from the CD and put them on your disk. The music-files can be ripped with crip (http://bach.dynet.com/crip/) or cdparanoia.

Alternatively, you can download the music-files from YouTube. For that, go in the terminal to the directory ctp2_code/ctp/music (create it if necessary) and run the following code:

youtube-dl  -x -t -i --audio-format vorbis --audio-quality 0 'https://www.youtube.com/watch?v=DtQBlVirrkU&list=PL5Z8d0ZfZ8SbHNEFnlR3jckHDmuZjBUaT'
mln -s 'Call to Power 2 - * - *' Track{#1+1}.ogg
i=11; files=(Track*.ogg); for ((f=${#files[@]}-1; f>=0; f--)); do track=$(printf "Track%02d.ogg" $i); mv "${files[$f]}" $track; ((i--)); done

You may have to install youtube-dl and mln.

If you want to play the videos in the game, copy them from the directory Setup/data/Max/ctp2_data/default/videos/ on the CD to ctp2_data/default/videos/ of your installation. You can also do this on Windows if you do not want to have the CD in your drive.

You may have to re-encode the videos, however we are not sure about that, because we do not have a CD and a working CD-ROM drive to test it. It might be enough to install the right codec. For re-encoding you can execute the following line from the ctp2_data/default/videos/ directory:

shell> for i in `ls /media/cdrom/Setup/data/Max/ctp2_data/default/videos/`; do mencoder -ovc lavc -lavcopts vcodec=mpeg4  -srate 44100 -af resample=44100 -oac lavc  /media/cdrom/Setup/data/Max/ctp2_data/default/videos/$i -o $i; done 

This will also copy the videos to that directory.

Building on Windows

CTP2 was originally built on Windows with Visual Studio 6. Today, the code compiles on Visual Studio 2017 and 2019 and probably also later. The code has not been compiled on Windows with any other compiler than the Visual Studio compiler. Beside a version of Visual Studio you need:

  1. The Windows SDK installed on your computer for DirectX support
  2. An environment variable named CDKDIR on your computer. In Windows XP/2000, go to Control Panel->System->Environment Variables, and add it, with it's value set to [your source path]/ctp2/bin, the directory with bison, flex, and other tools in it. On Windows 10 it is Control Panel->System->Advanced System Settings->Environment Variables or PC Settings->Info->Advanced System Settings->Environment Variables or press Windows+Pause ->Advanced System Settings->Environment Variables
  3. A tmp directory in the root directory of the hard drive where the code is. If your source code working copy is on drive C: then create C:\tmp. If you have the code on another drive such as E: than it is E:\tmp.

Once all these are in place, open the Visual Studio project file [your source path]/ctp2_code/ctp/civctp.sln in Visual Studio. The project comes with several configurations. The most important ones are:

  • Debug: Unoptimized debug build, with logging, asserts, and a memory leak detector. The leak detector makes it actually slow.
  • Final: The build that was shipped with the game.
  • Final with Logging: Like Final but with logging, which is very useful for AI debugging.
  • Release: Not needed for us, it is close to the Final version but does not include the CD check that the Final version originally included.
  • Debug Browse: Like Debug but seems allow also to browse the stack external Microsoft code. So far untested. It requires MSVCRTD.dll, which needs to placed into the folder ctp_code/ctp/ folder. It might be included in your copy of Visual Studio, but it can also be downloded from the internet, if you search for it.

The executables these configurations generate are in [your source path]/ctp2_code/ctp/ and called:

  • CivCTP_dbg.exe for Debug
  • ctp2.exe for Final
  • ctp2log.exe for Final with Logging
  • ctp2r.exe for Release
  • CivCTP_dbg_browse.exe

CTP2 can directly be run from Visual Studio, to do so press F5 if you want to run it on the debugger, which will be slow and does not make sense for a Final version. To run without debugging, press Ctrl F5. If necessary, CTP2 will be built, first. Some of the map plugins may fail to build the first time in a clean project. Just try compile those again.

Building on Linux

You will probably need GCC 5.x or later to build. The code doesn't seem to build on GCC 4.8.

You will need SDL 2.0, SDL_Mixer 2.0, SDL_Image 2.0. To be able to play movies you also need ffmpeg libraries (some). You will also need byacc and flex. On Debian and friends, use sudo apt install libsdl2-dev libsdl2-mixer-dev libsdl2-image-dev libtiff-dev libavcodec-dev libavformat-dev libswscale-dev byacc flex to install them all.

The build itself is pretty classing and straight forward:

./autogen.sh
CFLAGS="$CFLAGS -O3 -fuse-ld=gold" CXXFLAGS="$CXXFLAGS -fpermissive -O3 -fuse-ld=gold" ./configure --enable-silent-rules
make -j$(nproc)

If you want to build a debug version it is:

./autogen.sh
CFLAGS="$CFLAGS -O0 -fno-omit-frame-pointer -fuse-ld=gold" CXXFLAGS="$CXXFLAGS -fpermissive -O0 -fno-omit-frame-pointer -fuse-ld=gold" ./configure --enable-silent-rules --enable-debug
make -j$(nproc)

Most optimizations are completely disabled at -O0 even if individual optimization flags are specified. In case CTP2 becomes to slow to be useful you can use higher levels of optimization such as -O1, or -O2.

You can look at ./configure for options, but there aren't many.

Also, note that make -j$(nproc) may fail the first time. Some files are auto-generated and the make dependencies don't catch that.

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

When the build is over, you have to copy the mapgen libraries from ctp2_code/mapgen/.libs/*.so to ctp2_code/ctp/dll/map/. So do something like cp -v ctp2_code/mapgen/.libs/*.so ctp2_code/ctp/dll/map/ if you are in the base directory of your working copy. This must be done manually, even so the libraries should be created there, automatically (not implemented/bug).

If you get the message on the terminal: Failed to load module "atk-bridge". Install at-spi with sudo apt install at-spi.

Running

When everything is ready, simply go to the program folder, for example with cd ~/ctp2/ctp2_code/ctp and launch the game with ./ctp2. There are a few command line option like -fullscreen that can be useful. -fullscreen launches CTP2 into fullscreen, otherwise CTP2 runs in a window, which however you cannot resize.

Installation

CTP2 can be installed on your Linux computer for all users in principle. Just run make install in the root folder of your working copy. However, this is not tested and so it is unknown whether this installs everything needed.

Converting old Linux save-games to new unified format

The old format of Linux save-games was not compatible with that of windows save-games. The format is now unified such that each OS can open save-games from the other. However, due to this, old Linux save-games need to be converted to the new format if you want to continue with those under the new ctp2 version (after 22dd1804804). A game-converter-version was created for this purpose (see, #77), which can load the old format but saves games to the new format.

civctp2's People

Contributors

atsb avatar civctp2 avatar devoytas avatar henshall828 avatar laenion avatar lynxabraxas avatar madand avatar martinguehmann avatar ptitseb avatar williamd67 avatar williamdeurwaarder-tomtom 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

civctp2's Issues

Merging linux branch into master

Merging the linux branch into master is a long standing issue. @ptitSeb 's contributions (a998155) made it possible to compile and run the game under linux with all the fancy contributions and added features that were made to the original svn-trunk, now the master branch. Those contributions were either specific for the windows build or OS independent. On the other hand the linux branch since d78e78a exhibited no crashes or bugs any more but lacks most OS independent additions and new features. There have been attempts to merge contributions specific to the linux port into trunk/master but up to now are not finished.
For example, ctp2@97d6973e599eaf does not yet support saving user settings (e.g. screen resolution) and games in the user home path (e.g. ~/.civctp2, as common under linux) which is implemented in the linux branch since commit 1ae3e1381c39a8c. Other things like the possibility of entering a file name for saving a game, avoiding crashes when loading a game, videos in the game etc. are in the linux branch and are missing in master.
However, it seems that most code in the linux branch has either become obsolete due to (OS independent) changes in master or has already been merged/incorporated. Therefore, the least effort seems to be cherry-picking (parts of) commits from the linux branch instead of doing a full merge with e.g. git-imerge, which would be a good approach for a full merge.

Contributions are welcome! For that, just follow the common GitHub approach of forking https://github.com/civctp2/civctp2/ from within your user profile and experiment and commit to that until your code is ready for contribution by creating a GitHub Pull Request (PR) to draw attention to your work and to discuss merging.

Contributions to the linux branch of old (to SVN) were discussed on apolyton.net in the forum "COMPILE: Linux Port".

Tech tree and AI research choice

Regarding #119 (comment) and #119 (comment), let's put those into an own issue. Again the two comments:

In regard to #129, how about making some AI civs prefer some govs over others making them differ to other AI civs?

They actually do, however they research all the stuff in the same order, except for a minor variation. Even so all the different personalities have their own advance list, which are just copies of each other and somebody forgot to modify.

Actually, all the different governments have ranks, 1, 2, 3, and 4 matching the city limits. So in principle, it should be possible that you can research all the governments of the same rank without having any of them. I don't know whether the tech tree is designed like this, but in fact it should be designed like this, so that you really have a choice.

Right now the AI will research the governments and will use the one of the highest rank available, even so it has not researched its preferred government. And once it got its preferred government it will switch, even so it has been for quite long in a non-preferred government.

Even so all the different personalities have their own advance list, which are just copies of each other and somebody forgot to modify.

Would some random shuffeling suffice or do we need to take advance tree connections into account? I.e. only shuffle them if they are accessable at that stage.

Not really, you can put an advance at the top of list and they AI will research it if you have the prerequisites, but if you don't care to shuffle the prerequisites then the AI may research more than it needs to get to Theocracy or Monarchy.

The other idea is that for instance Theocracy, Monarchy or Republic are supposed to be on the same level, so you should need to research the same number of advances to get to them so that you really have a choice between them.

So I not only propose to make good advance lists for the AI but also to modify the tech tree so that the Governments are indeed on the same level in the tech tree, so that you have to decide what you go for and indeed that you have a choice.

Of course modifying the tech tree also asked the question whether we should do the different governments really belong here or there.

For instance, the Roman Republic ended let's say with Caesar or Augustus, then Rome had an emperor and before the Republic Rome had Kings. The difference between a Roman king and a Roman emperor was that the office of emperor wasn't inherited while the office of king was or maybe I have to look it up.

Anyway, even if the office of Roman king and emperor were similar. You couldn't call emperors kings, because the Romans viewed kings as evil tyrants.

So we could say we went from tyranny to republic to monarchy, but to some extend this are just names.

mouse pointer back ground not always updated with SDL

If the back ground changes (e.g. new window, change of map position) it sometimes happens that the background of the mouse pointer still has the old back ground, see image below where the start screen was already cleared but the bg of the mouse pointer is still showing some part of it. I observed this with the master and the linux branch (under linux) and expect that this is an SDL problem.

ss_2018-12-01_10 12 13

Commit f228215 broke the build

From the build history: https://travis-ci.com/civctp2/civctp2/builds it looks like commit f228215 is the one that broke the build: https://travis-ci.com/civctp2/civctp2/builds/97939556

Build logs:

@MartinGuehmann, I think that the reason it went unnoticed is because the commits were pushed directly to master branch. The better workflow is to create the pull requests that are verified by travis-ci and only merge them to master branch when they pass all the checks.
Alternatively, if one does want to push commits directly rather than creating PRs
for every single commit, it's better to have dedicated branch for this (maybe 'dev'), that is also verified by travis-ci, and only merge it back to master when it's in known good state.
Other workflows are also possible but I think the main goal should be to keep master in known healthy state, that can be always trusted to produce good binary.

Accepted diplomatic proposals seem to have no effect

It seems that diplomatic proposals that get accepted seem to have no effect, in the master branch under linux. They work as expected in the linux branch. While this should not be related to the linux port, it would be great if someone could confirm that this probem does not exist under windows. This might be the actual cause for #29.
Rejections seem fine, at least a message about the rejection is presented in the diplomatic proposals window, while the window just closes when the proposel seems accepted. (I also noticed that the processing of computer players already continues before I close the proposal window, though it seems to wait until I hit "send", which suffices for proper logic processing.)

@DarkDust Do you think you could drop an email to the ctp2 code masters of old (like Martin Gühmann, ctplinuxfan, Maquiladora, Fromafar, richardh, J Bytheway) to point them at the new repos and the issue?

Generated ltmain.sh file is stored in the repository

Currently generated file ctp2_code/libs/freetype-1.3.1/ltmain.sh is committed to the repository.
It's usually considered good practice to generate this kind of files during build time, rather than committing generated files to the repository.

This script has hard-coded following version info:

PACKAGE=libtool
VERSION="2.4.6 Debian-2.4.6-0.1"
package_revision=2.4.6

which, can potentially lead to the issues when different libtoolize version is installed in the system.

Specifically, it may be the root-cause of this failure:
https://travis-ci.com/civctp2/civctp2/builds/89882381#L4895
when trying to test docker builds in travis-ci.

Error message:

libtool: Version mismatch error.  This is libtool 2.4.6 Debian-2.4.6-0.1, but the
libtool: definition of this LT_INIT comes from libtool 2.4.2.
libtool: You should recreate aclocal.m4 with macros from libtool 2.4.6 Debian-2.4.6-0.1
libtool: and run autoconf again.

comes from ltmain.sh file:

# Ensure that we are using m4 macros, and libtool script from the same
# release of libtool.
func_check_version_match ()
{
if test "$package_revision" != "$macro_revision"; then
if test "$VERSION" != "$macro_version"; then
if test -z "$macro_version"; then
cat >&2 <<_LT_EOF
$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
$progname: definition of this LT_INIT comes from an older release.
$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
$progname: and run autoconf again.
_LT_EOF
else
cat >&2 <<_LT_EOF
$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
$progname: and run autoconf again.

Trade routes visible even in fog of war

Trade routes are visible even in fog of war, which gives city positions away of cities that are not know to the player otherwise. It would be great if trade routes would only be visible outside "fog of war", such that their full path especially start and end is not obvious and motivate discovery expeditions.

Convert civctp2 to an organisation

Not sure where this was discussed before (possibly in the issues of @ptitSeb archived repos, or when @DEVoytas created the civctp2 user) but it might be worth changing the civctp2 user account into an organisation, because that way it would be possible to give others rights for its management in case of "emergencies". @MartinGuehmann comment (#108 (comment)) made me realize that in the current state this central civctp2 project could suffer from the same unfortunate fate as makespr, in which case it would be good to have other possible (otherwise passive) maintainers in spare, such that at least the repo is not locked for eternity.

Effect of `ChangeOwner` in `Pillage`

I found ChangeOwner in Pillage:

g_theWorld->ChangeOwner(pos, cellOwner, m_owner);

which made me wonder if this implements that the tile is taken from the victim and assigned to the territory if the attacker?
I.e. in the case that a tile is in the radius of a city but is assigned to an adjacent city of another civ, would this allow to get a tile assigned to the other player?
In other civ games, it was possible to achieve this by placing a unit on that tile, but this does not work for ctp2.
Is there any other was to acquire a tile form another civs city?

Pirating state of trade routes not saved/loaded

Now that #127 is in, it seems that the pirating states of trade routes are not saved/loaded. E.g. when pirating in the test-game of #75, ending the turn then the trade manager shows the pirating color orange. However when saving and re-loading that game, the pirating column color is back to white.
Same holds for the action: pirating in the test-game then save and load before ending the turn will lead to no pirating for blue in the next turn.
I'd guess that the m_piratingArmy from

void TradeRouteData::SetPiratingArmy(Army &a)
{
m_piratingArmy = a;
}

is not saved, not sure about m_isPirating here
archive.PutUINT8(m_isPirating);

at least allown this would not be enough since IsBeingPirated needs m_piratingArmy
bool TradeRouteData::IsBeingPirated()
{
return m_piratingArmy.IsValid();
}

@MartinGuehmann What do you think?

SDL_ffmpeg for videos

Currently, we are using SDL_ffmpeg for videos. However, right now it an old version and it is not developed actively anymore. We have in pull request #62 some discussion about.

Probably, we need to update the code of SDL_ffmpeg and its use in CTP2 anyway. An alternative could be SDL since it has a header about videos.

Can not get docker builds passing travis-ci check

PR #15 is currently (commit bf01e6c) failing travis-ci checks during docker build, with the following error message[1]:

make[3]: Entering directory '/ctp2/ctp2_code/os/nowin32'
  CXX      nowin32.lo
libtool: Version mismatch error.  This is libtool 2.4.6 Debian-2.4.6-0.1, but the
libtool: definition of this LT_INIT comes from libtool 2.4.2.
libtool: You should recreate aclocal.m4 with macros from libtool 2.4.6 Debian-2.4.6-0.1
libtool: and run autoconf again.
make[3]: *** [nowin32.lo] Error 63
make[2]: *** [all-recursive] Error 1

[1] link to travis build: https://travis-ci.com/civctp2/civctp2/builds/89882381#L4893

I think it may be related to hard-coded libtool version 2.4.6 in generated ltmain.sh file (see issue #20).

To investigate it, I created a debug PR #19 that prints out libtoolize version used by travis-ci system, and used inside docker.

It turns out that travis-ci version is 2.4.2 (https://travis-ci.com/civctp2/civctp2/builds/89892005#L966)
and docker version is 2.4.6 https://travis-ci.com/civctp2/civctp2/builds/89892005#L2320

Docker version matches what is hard-coded in ltmain.sh.
Failure seem to be the result of mismatch with travis libtoolize version.

But why the travis libtoolize version appears during build inside the docker container?
Based on the above investigation, I would much rather expect direct build to fail (version mismatch) than docker failure (version match).

Convert old branches to tags

There are still quite a few branches on https://github.com/civctp2/civctp2/branches, some are very old and remainders of the SVN import. To avoid others basing contribution on those but to still keep a ref on them (to avoid loosing the commits), I would suggest to convert the branches:

RolandTaverner
ScottGrant
linux-merge
linux-rework
port-trunk
trunk

into tags (possibly without a message, such that they are not regarded as releases by GH). This might even be appropriate for:

SaveGameConverter
linux

as they can be converted back to a brach if necessary.

odd AI behaviour when encountering other player's stealth units

The AI always seems to attack other player's stealth units when encountered within its own borders without taking diplomatic actions and state into account. I often experienced that with e.g. clerics, the AI attacks (breaks standing peace contracts) and just in the following round the AI wanted to agree on peace again.

Documentation for newly implemented game concepts

In relation to #49 (#49 (comment)):

Do we have some place where newly implemented game concepts are documented?
If not, additions from mods should be documented in a kind of manual to not loos track of what has been done and to avoid that the code is the only "documentation".

Issues with master under linux after recent merges

In relation to #63, while playing up to 3450BC (22 turns) on linux from DI, I had about 6 dead-locks of the game (compiled at 9371b6c), which is far, far more often than I had crashes (no dead-locks) before (one in about 3 hours).
Also the OGG playing (that used to work with 74c4f07) is broken, game sounds and video (with audio) are functional though.
@MartinGuehmann any idea what commits could be the source for these changes?

screen cast from automated tests for debugging failures

In regard to #84 (comment), it would be desirable to have screen casts (as GL artifacts) from the automated tests in case failures need to be debugged (see also #105).

The GL job log does not always give a good idea where the sikuli interaction got lost, because screen-shots are only saved at particular situations. That is why I was trying to enable screen casting of the whole session (https://github.com/LynxAbraxas/ctp2DF/blob/e9fd0bb9e55c8f87bae81aafbdc460110154a208/.gitlab-ci.yml#L74) but had no luck so far with the combination of Xvfb, ffmpeg and ctp2 from DI run in GL-CI. Possibly Xvfb, ffmpeg and SDL-1.2 is the actual problem, because Xvfb, ffmpeg and Sikuli-GUI from DI works, as does X11, ffmpeg and ctp2 from DI on local PC. I also tried vlc and gstreamer but vlc has problems with the missing X11-dbus and gstreamer in alpine is too old.
So the screen casting addition is postponed until a possible solution pops up, like ctp2 with SDL-2 #92 or some magick options to https://github.com/LynxAbraxas/ctp2DF/blob/e9fd0bb9e55c8f87bae81aafbdc460110154a208/.gitlab-ci.yml#L74.

AI employ diplomats and take their success into account

So far I never observed that the AI tried to establish an embassy or hold a reception.
Due to this the AI does not know the scientific advances of other players and therefore cannot suggest diplomatic exchange of these.

AI able to employ special attack directly from (unit on) a ship but normal player not

After playing for a while I notice that ships (or loaded units) from the AI seem to be able to perform some special attacks directly from the water (i.e. without unloading any units like cleric, slaver etc). The only thing I could see are some special symbols during the execution of the AI moves (like $ sign on one of my towns) when an AI ship is just beside.
Is that correct? If so, how to do that as a normal player? Possibly, there is some porting to linux missing here.

OGG music playing is limited by audio CD settings

It seems the playing of the CD songs from OGGs (thanks to @ptitSeb contributions) works great, but is restricted by the old CD audio track settings in e.g. ctp2_data/default/gamedata/playlist.txt which limits track numbers to 1 up to 8, while @ptitSeb seems to skip track 1 (intro in GOG OGGs?) intentionally.
It would be great, if the play list would be set by just the number of OGGs found in the music folder, disregarding any unnecessary restrictions from old.

Use SDL 2.0 or higher

Currently, we use SDL 1.2, which handles non British keyboard layouts not very, well. I am trying to open the chat Window, but nothing happens. And the best is if I set the operating system to use a British keyboard layout then all programs do it, but not CTP2. I hit the ä-key, that is the key that is labled on a British keyboard with '. And still nothing happens. I hit + and I only get +, with shift, too.

It seems that SDL 2.0, can handle localized keyboards much better.

GL-CI integration for GH

Just recently learned that it is possible to integrate GL-CI into GH:
https://docs.gitlab.com/ee/ci/ci_cd_for_external_repos/github_integration.html

So in relation to the discussion of #84 this issue should be used to discuss pros and cons for changing to GL-CI integration into GH.

One pro for GL-CI integration into GH would be that we get GL-CI test executed automatically for each push to a PR even before its integration into the main repos.
One con would be the fact that this could possibly lead to early use-up of GL-CI minutes (currently 2000 per month for the free plan, see also #84 (comment)).

Remove vidplay.h and vidplay.cpp from the repository

The files
..\ctp2_code\ui\aui_utils\vidplay.cpp
and
..\ctp2_code\ui\aui_utils\vidplay.h
are two files from Microsoft and not needed. I needed to modify them to make the game compile on VS 2017. My solution was a bit different than the one in RolandTraverner's branch: I just commented out all the code except the header include. The game compiles fine without it.

If I had only needed to remove it from the VS project, I would have done it. Unfortunately, it is also build by the Linux version, which means I have to dig into makefiles.

Automated upload testing (CI)

New issue for side discussion of #55 (comment)

Ideally, we would like to have this for an upload test.

It already is. If you clone/push https://github.com/LynxAbraxas/ctp2DF/ to GitLab, create a private ctp2CD repos there with the necessary game files (see my corresponding GL repos) and change the ctp2/ submod URL to https://github.com/civctp2/civctp2/ GL will run all jobs including tests defined in https://github.com/LynxAbraxas/ctp2DF/blob/master/.gitlab-ci.yml whenever new commits are pushed to that GL ctp2DF repos.
The setup of ctp2DF can be transferred to be part of civctp2 directly. If GL is set up to mirror the GH repos it will test new commits to https://github.com/civctp2/civctp2/ automatically, similar to travis now but due to the private repos option, the test can cover not only building but also the game play with smoke-tests based on sikuli, and you end up with a docker image ready for playing.

map acquired in exchange with another player does not show

When requesting a map in exchange from another player in a diplomatic proposal and the proposal is accepted, the region of the new map part is not show, i.e. fog of war stays the same (master branch run under linux). This is likely an SDL/linux-port bug and not present in the windows version.

automated tests sometimes fail without any obvious reason

In regard to #84 (comment), see also #104:

GL-CI for ctp2 is configured such that each job is tried 3 times automatically

retry: 2

This is needed because sometimes sikuli events do not seem to get through to ctp2, so far the reason is unknown (RaiMan/SikuliX1#54). This problem seems to appear more often/likely if the GL-CI server (runner) are very busy. There is no option to pause between auto-repeated GL-CI jobs, so if GL-CI is very busy for some time, and all 3 tries of a job fall into that period, they are likely to fail. In that case it is best to re-run the pipeline again manually after some hours passed, not ideal but manageable. Increasing the number of auto-tries might not be desirable in this case, because they are likely just wasting the precious cost-free 2000 GL-CI minutes per month.

Merge @ptitSeb's and @RolandTaverner's branches to master

Before this repository was created, there were at least two independent branches of development based on the prevailing trunk of the original SVN repository (previous ctp2 source code hosting, which is now retired in favor of this github repositry).
Those branches are:

The goal of this issue is to merge both of those branches to current master, so the work of their authors is not lost.
The decision has to be made with regard of the order that the branches being merged. Both of them are based on the same commit (current master), so the first merge will be fast-forward, but merging second of them, will result in many conflicts since both branches bring changes in the same code areas.
This decision will probably has to be made by new maintainer when issue #2 is resolved.

The discussion on that started in the comments for issue #3 of @ptitSeb's repository, and will be continued here, so if any of the comments bellow seem out of context, it may be helpful to follow original discussion first.

piracy booty is not assigned in case multiple civs pirate the same route in the same turn

The discussion in #75 and #76 (comment) showed that the booty of piracy is not assigned in the case that multiple civs pirate the same route in the same turn.

One way to determine a disticinct winner of the concurrent pirating civs would be to assign the booty to the civ whose unit is closest to the trade route source along the trade route.

Currently, no civ gets the booty if multiple civs pirate the same route in the same turn, i.e. the message of #71 does not appear (as might be expected) nor does the victim get informed (as might be expected as well, see #75) nor can the victim ask to stop piracy by diplomacy (as might be expected too, see #116).

SDL bug?

Hi, ive tried the ptitseb fork for pandora, and I achieved to build the game for rpi3. The problem its than there is some trouble/bug with sdl and the game crashes due some peep mouse event. so, Ive tried this repo and I could't achieve to finish because of something related to c3files.cpp

this its the output when it fails:

 
ctp/ctp2_utils/c3files.cpp: En la función ‘const MBCHAR* c3files_GetCDDriveMount(MBCHAR*, size_t, DriveIdType)’:
ctp/ctp2_utils/c3files.cpp:658:2: error: narrowing conversion of ‘-2147483648’ from ‘int’ to ‘long unsigned int’ inside { } [-Wnarrowing]
  };
  ^
ctp/ctp2_utils/c3files.cpp:658:2: error: narrowing conversion of ‘-2147483648’ from ‘int’ to ‘long unsigned int’ inside { } [-Wnarrowing]
ctp/ctp2_utils/c3files.cpp:667:23: aviso: comparison of integer expressions of different signedness: ‘sint32’ {aka ‘int’} and ‘size_t’ {aka ‘unsigned int’} [-Wsign-compare]
   for(sint32 i = 0; i < strlen(cdDriveName); ++i)

thanks as always

victim of piracy is not getting a message/info about this fact

In relation to #49 and PR #71, it seems that the victim of piracy is not getting a message about this fact, if playing with the ctp2 style of pirating rule. (This only seems to happen if ctp1 style of pirating rule is used.)
Additionally, as I understand the code, the trade gold of the route that is getting pirated is not removed from the victim (only additionally added to the attacker).

text field input not possible under linux

No text can be entered into text fields under linux (e.g. filenames or slic comands in the chat window), neither in the master nor the linux branch. Probably some SDL keyhandling is buggy or missing, hotkeys do work.

Linux version loads save games created on Windows and creates save games that load on Windows

Now, the Linux version creates and loads save games that are created on Windows. Unfortunately, this breaks save games you created while testing.

This is an issue with binary compatibility. Since these save games you created are unofficial, they won't be supported, unless you go into the hassle to do it yourself.

To do so I had to implement the struct GUID, which has to be 16 byte big. _MAX_PATH has to be 260, as on Windows. Activision did something with it that is not good. Maybe it has some unwanted side effects. But we will see.

irregular segfaults during game play

Observed irregular segfaults that happen after playing a few up to many rounds (master branch run under linux, sometimes not occurring for hours) no obviously related to some specific game state. Probably needs gdb debugging during playing.

wages slider shows effect of previous position (not current position)

When changing the wages in the commerce field of the domestic policy in the empire manager (F1) (master branch run under linux), the result in the shown values (probably also in the game logic) correspond to the previous position of the slider and not to the current position (compare to result of optimize sliders button).

Workflow and other general project discussions

This issue is meant to be a place holder for deciding workflows and other general project considerations.

It is meant to avoid off-topic discussion in other issues.

Let's try to make other issues very specific, and discussion under them on-topic, so it's easy to decide when they are resolved and can be closed.

This should help keep number of opened issues to minimum and have all general project related discussions in one place.

For starters, I suggest to continue here discussion started in: #2 (comment) and #57 and closing those issues.
If there are any other off-topic discussion under other issues, I let's also link them and carry on here.

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.