Free and Open Source real time strategy game with a new take on micro-management

Mingw compilation

From Globulation2

Jump to: navigation, search

This page explains how to compile Globulation 2 on windows using mingw.


OVERVIEW -READ ME- to get smartly started

  • READ-ME-FIRST

I Wanted to have a Quick Wiki to get through and While First time I followed it I got many pain due to many Errors Returned back to me from the compilation process, We fixed the most of them, and I wanted to help the people to know Why those Bug came from and sometime it was just another question, like How to choose my source to compile, since the First tutorial was really with none other explanations, I got lost.

On The other Hand Now,with a lot of investigation&time, the Tutorial is getting a kind a small Book, and this could bored, or discouraged many of Windows Users, (linux users are more use to read documentations to do staff on their machines, and this is an advantage, they do understand quite well their machine behavior.

So I decided to create A Fast-way to get ride of compilation faster than never, because I'm convince that many of you want to spend time on playing/testing the new release than reading the manual and the compilation.



PLEASE NOTE IF YOU HAVE SOME INTEREST ON COMPILATION AND HOW IT WORKS OR HOW IT DOES NOT WORKS --BUG CASES--- even HOW TO CUSTOMISE YOUR COMPILATION PICKING YOUR SOURCE PLEASE FOLLOW THE MAIN TUTORIAL TWO WAYS ARE The old command line WAY and THE MS windows way PLEASE NOTE THAT WE NEED TO USE COMMAND LINE FOR LAUNCHING THE COMPILATION SOFTWARE By HAND (2 code lines, quasi nothing) and making the bundle (3 more lines)


From Windows VISTA and above Microsoft O.S: You need to run as an administrator to install packages/software.
  • The Msi installer type are perfect,but could required to accept some 'un-zip' authorization.
  • Some other type, deprecated one but compatible, got warnings from VISTA and above MS O.S ,some because their developers did not get a Digital Windows O.S-type certificate ( from Xp, Vista,7 -apparented to the MS O.S logo on the bundle software pack or on the product web pages )in this case DO accept the installation we need those and we know that they are not verify and sign by MS Digital certification but they run well.
  • Another one may ask for an authorization to install some other dependence files , do accept.
  • All_installation_pack_with_this_extension.exe" MUST BE run as administrator by right-clicking on it and selecting -in the contextual menu- run as an administrators, specially for scons & MinGW.



.

HIGH-WAY COMPILATION -Toll free-

HERE YOU WILL GET NO <bla bla bla> BUT IF YOU DO NOT STRICTLY OBSERVE THE DIRECTION YOU MIGHT FAIL DURING THE PROCESS ! Also if some step are obscure and you can't achieve it please Get off from the HIGH-Way to the next EXIT -free toll- and follow the MAIN TUTORIAL. That said let's start it now !


  • DOWNLOAD & INSTALL
  • GET Python 2.6 EXCLUSIVELY
  • Install into the directory "C:\Python26"
  • GET scons-1.1.0 EXCLUSIVELY and install it [**AS ADMINISTRATOR**] into the same directory as the python got installed
  • GET TortoiseHg.
  • GET winrar (winrar is a Commercial Shareware -with a 30day free-trial) or 7-ZIP (gnu, but friendless)
  • GET MinGW- Minimalist GNU for Windows (the actual v5.x.x works well)and
  • Install it into the directory c:\mingw (lower case).
  • During installation, select "Current" when asked what version, and then
  • select the "MinGW base tools" (by default) and "g++ compiler" packages only
  • Download and install MSYS-1.0.10.exe into the directory c:\msys\1.0\ (lower case).
  • At the end of the installation, it will ask you if you want to continue with the post-install. Select yes, and yes again when it ask if you have mingw installed.
  • Then -the black windows prompt- will continue asking you to indicate where the directory is installed,type :
  • c:/mingw (yes, with a forward slash -linux habit to have- as the program prefers it that way).
  • GET&save GLOB2 LIBRARY in "c:\msys\1.0\"


  • First manual GEAR
  • Un-zip the Archive glob2_required_libs_mingw-scons.tar.bz2 into "c:\msys\1.0\"
TIP: OVER-WRITE FILES AND FOLDERS MUST BE ON or GRANTED on Vista and above OS.Tell Yes for all if this it's asked to you.
  • Second GEARS

We'll get the 'Original-Project'

  • Get there "C:\msys\1.0\"
  • Create a Directory Call "glob-compilation", Get inside this folder
  • Right clicking, This open the contextual menu, then
  • Select TortoiseHG>>Clone ,a pop-up windows will appear,
  • In source path please fill in this: "https://bitbucket.org/giszmo/glob2" without the quotation mark.
  • As Destination fill it that way: "C:\msys\1.0\glob-compilation\repository\" without the quotation mark.
  • Push the button "Clone"

This Will take a lot of CPU energy and internet bandwidth, internet broadband is recommended ! -about 3mins@ 6Mi-bit/s -

  • CLONING: things get faster
  • Create a Sub-Directory called "glob2_source_building"
  • Right clicking on this new folder, will open the contextual menu, then
  • Select TortoiseHG>>Clone
  • Set the source path to the " repository" folder
  • In the "advanced options" Check the box "clone to Revision" and in the next field, fill in that: default
  • launch the clonning process by pressing the button.


  • UPDATING: Never faster than ever [OPTIONAL !!!!]

clony do an update anyways -from the source path set above.And for the first time -following this wiki- your repository data are fresh food ! so on the High-way we decide to skip this ! Further informations about this in the main tutorial.


  • Third GEARS

Alright budy, now time to let's free your Engine HORSES, shifting the third gears :)

  • Open msys by double clicking the desktop icon,
  • Could you type the following code;

hint: The "TAB KEY" help you to finish to fill up the path name use it to save time and mistake.

cd /glob-compilation/glob2_source_building
scons

The process -compilation- Could take a while (minimum 10 mins on recent computer)The cursor or prompter is blinking and a lot of information quickly print out.The process ending when no more information are printing in the "yellow command line" windows and the prompter is not blinking and Marine-blue you should normally find the glob2.exe in the folder glob2_source_building if not you need to take the next exit, getting off the High-way, and follow the MAIN TUTORIAL, sorry.

NOTE: On old/tired/busy computer: this process could take a while, even HOURS !

PLEASE NOTE also that you could check out the "Possible Issues" section scrolling all your way down this page, and look for some possibles common ISSUES/BUGS/MISTAKES or a solution if any.


  • Fourth GEARS

If you read this is because all things goes well, congratulation, you are a fine compilitor-pilot, now let's shift the fourth gears.

  • Make a 'TEST' directory.
  • Copy into it all the file found in "C:\msys\1.0\local\lib"
  • Copy also the Glob2.exe from glob2_source_building.
  • Copy the SDL.dll from "C:\msys\1.0\local\bin".
  • GET READY BUDY, your Engine Horses make you good, alright -->launch glob2.exe

At first start the application, the game, is freezing , because it is setting many parameters, so on a slow/busy machine this could take a while.

On Vista and above: you could get an alert saying this application do not answer/respond or similar, and ask what to do, you must select Wait until the program respond or similar.As it as been told this could take a while (e.g 30s on recent not busy computer, but much more on a busy or old computer -like one core computer).

OF COURSE this is different if the application crashed by an alert saying this application has stop to run in an unexpected manner or similar !


  • Fifth GEARS (stage under testing)

Budy is the Test was good? You 'r certainly feeling good, right now ! Let's shift the 5th Gears, Do we need it? Well if you do want to set an installation-bundle-pack, yes you need it!

  • In MSYS, run the following codes making a windows bundle set-up file:
cd /glob-compilation/glob2_source_building
cd bundle
glob2_make_win32.sh


If all things goes well, an binary(.exe) is ready, making installation on windows computers easier than ever ! Look in the bundle folder. Test it (install and play), and if it works, send it to your friends ;)


  • The Happy Ending :D :) :-D

I hope this first trip was AwEsOmE, if you need to customize your baby take your way off by the MAIN TUTORIAL EXIT, thank you for riding on our compilation-High-way, We wish to you a Happy & nice day :D


.

MAIN TUTORIAL

Here you will Have, I wish, all the informations you need for learning on how to compile Globulation2-project to get a binary(.exe).If you don't care about this please do follow the earlier (above) HIGH-WAY Tutorial/stage.

MESSAGE: Main tutorial are completely under remodeling it still working though, some informations could be redundant.The goal is to have a very nice Mercurial Repository System Overview Definition , to assist you in picking your source code you want to build for MS_Windows_O.S and to have a Quick & clear View of What to do. As you can see A lot of work !



Command Line Method old school & well efficient

DownLoad & Installation

  • Download and install Python2.6 EXCLUSSIVELY into the directory "C:\Python26" (default install is Python26, don't change this)
  • Download and install Scons-1.1.0 EXCLUSSIVELY into the same directory as the python install (C:\Python26\)
  • Download and install stable Mercurial locally so the command hg will work. When you get to the end of the install, make sure you check "add mercurial to your computers search path" or something similar.
  • Download and install NSIS into all its default installation folder "C:\Program Files\NSIS\".(For creating a windows installer)
  • Download and install MinGW into the directory c:\mingw (lower case). During installation,
  • select "Current" when asked what version,then
  • select the MinGW base tools and g++ compiler packages only And,
  • download and install MSYS-1.0.10.exe into the directory c:\msys\1.0\ (lower case). *At the end of the installation, it will ask you if you want to continue with the post-install.
  • Select yes, and yes again when it ask if you have mingw installed.
  • When it ask you to indicate the directory where it is installed, type in c:/mingw (yes, with a forward slash as the program prefers it that way).
  • Download glob2 required library glob2_required_libs_mingw-scons.tar.bz2 &save it at "c:\msys\1.0\"
  • Double click the MSYS icon that has been placed on your desktop during MSYS's installation.
  • untar the libraries using the command:
cd /
tar jxf glob2_required_libs_mingw-scons.tar.bz2 -C /

This process could take a while

Globulation 2 cooking Preparation

Stage 1:Ingredient
  • Released source code ingredient

If you wish to Compile from Released source code follow this stage if not skip to the next Ingredient mark below.

  • Download&Save The Archive Source Code Released (e.g glob2-0.9.4.4.tar.gz)and
  • extract it into "c:\msys\1.0\"
cd /
tar zxf glob2-X.x.x.x.tar.gz -C /

zxf: mean z for .gz archive file, x for extracting, f force it.So if ever the extension of the source is a .bz2 use jxf instead of zxf

  • then run (changing the version numbers):
cd /
mkdir glob-compilation
cd glob-compilation
mkdir glob2_source_building
cd /
mv glob2-X.x.x.x.tar.gz glob-compilation/glob2_source_building


  • Using the Mercurial software repository ingredient
  • Getting Globulation 2 from mercurial:
cd /glob-compilation
hg clone https://bitbucket.org/giszmo/glob2 repository
  • Get -branch you would like to work/play, you might also get other branches, such as beta4-rc, more information in the Definition section (not yet created):
hg clone -r default repository glob2_source_building
  • To get the latest code [OPTIONAL, not required], run:
cd glob2_source_building
hg update -C tip

More information about update, tag like tip, and branch in the definition section (under construction section of this wiki, not yet released though)

Step 2: Cooking

Start compiling Globulation 2. Don't worry about the warnings. If something is wrong, it will grind to a halt and it will let you know why. Here you might got many errors please check out the ISSUE SECTION by scrolling ALL your way down.

Message: Also on a slow/busy/tired Computer this process burn a lot of time & cpu energy.

On a recent computer it takes an average of 12 mins, but could be multiply by 10 or more according to your system characteristic -specially cpu core clock frequency.

  • To launch the compilation, run:
cd /glob-compilation/glob2_source_building
scons -j5 --random --cache-force

The argument are optional and are add here when you got a multi-core CPU , that command order to compile on 5 other cores simultaneously! [Multi-threading or tasking]

More Details will be found at scons MAN PAGE.

Normally if all is done you should see the blinking cursor in the shell,return to a new line with a $ followed by the no more blink cursor (marine blue color normally).Also as a rule of dumb you should get the Binary from a succesful cooking/compilation, So Have a look inside glob2_source_building folder ;)

Step 3: Testing

Once compiling has successfully finished

  • Make a 'TEST' directory call "test" at "C:\msys\1.0\glob-compilation".
  • Copy into it all the file found in "C:\msys\1.0\local\lib" then do not forget to do,
  • Copy and past of the Glob2.exe from "C:\msys\1.0\glob-compilation\glob2_source_building\src\" into this 'Test' directory you have just made.
  • Copy the SDL.dll from "C:\msys\1.0\local\bin" and past it into your 'test' folder, and...
  • launch it ! ENJOY IT !
NOTE: At first start the application, the game, is freezing , because it is setting many parameters, so on a slow/busy machine this could take a while.
  • ON VISTA and Above set the alert if any to Wait until the application respond.
Step 4: Packaging (SECTION UNDER TESTING)

In this Stage We will Build a Globulation2 NSIS package.

  • In MSYS, run the following codes to compile a windows installable exe file:
cd /glob-compilation/glob2_source_building
cd bundle (or windows if bug)
glob2_make_win32.sh

If all things go well, an exe ready for installation on windows computers is now ready within the bundle folder. Test it (install and play), and if it works, send it to your friends ;)



! ! ! SECTION UNDER REMODELING ! ! !

NOW THE COMMAND LINE IS REDUCED to the minimal -while the command line method remain in the wiki for the linux-lover-, This wiki may seems long to read, but it does contain many informations to dig deeper later than a simple compilation, and this will be really a hand when a question like, Can I choose my source to compile ?, How I patch it thought ?.... exciting is'n it.


  • DOWNLOAD&INSTALLATION
  • Download Python EXCLUSIVELY A PYTHON V2.x.x VERSION -Newer Python are not compatible with scons (V1.x.x or V2.0.0.final.0)
  • Install into the directory "C:\Python26" (default install is Python_version_number, change this number to 26 during installation if you want to avoid a BUG [Issue #3], even if you got Python34 )! the Version 3.1.2 is NOT COMPATIBLE as I'm writing now (july-2010) !
  • Download scons-1.1.0 and install it [**AS ADMINISTRATOR**] into the same directory as the python install (C:\Python26\) If you are installing the most recent scons version than the "scons-1.1.0" An issue #3 [BUG] will occurred. An easy measure is not yet defined. The Version 2 has been tested and is compatible with Python27 but not with Python31 nevertheless using other version than the v1.1.0 will call the issue #3!
  • Download and install HgTortoise we come along with mercurial software.


PLEASE INSTALL: ONLY ONE Mercurial ! The Mercurial version 1.6.0 with Turtoise or not work perfectly !


  • EITHER Friendly Windows & command line: GET TurtoiseHG NOW along with mercurial out of the box !
  • What exactly is HgTortoise, though ?

TortoiseHg is a set of graphical tools and a shell extension for the Mercurial distributed revision control system. On Windows, TortoiseHg consists of a shell extension, which provides overlay icons and context menus in your file explorer, and a command line program named hgtk.exe which can launch the TortoiseHg tools. Binary packages of TortoiseHg for Windows come with Mercurial and a merge tool and are thus completely ready for use “Out of the Box”.

It's a powerful Graphical User Interface (GUI) for developer, and give to the simple user an overview easiest and simplest ever ! Even better than Globulation2 Hg Web site, in my opinion, I just love it. After Testing, No trouble has been noticed and you can continue to use Minimalist Gnu for Windows and Hg command line to perform it by hand like this tutorial teach you to do. Soon we will use this powerful GUI for even less command lines ! :)


Wanna Know more about TortoiseHg visit their Web Site here, please.


  • OPTIONAL DOWNLOAD:

(To create a windows installer)

  • Download and install NSIS into all its default installation folder "C:\Program Files\NSIS\".

(To be proud of using MS WINDOWS GUI for tarballing archives matter)

  • Look for7-Zip (GNU) or winrar (winrar is a Commercial Shareware -with a 30day free-trial), You have also IZarc [Free](but it can't make Gzip archive, he does extract them However) for a more friendly GUI than command line, We are under Windows, do we ?

(In case of Bug or Issues, who knows ? )



.

Setting up MinGW and MSYS

  • Download MinGW- Minimalist GNU for Windows (the actual v5.x.x works well)and
  • Install it into the directory c:\mingw (lower case).
  • During installation, select "Current" when asked what version, and then
  • select the "MinGW base tools" (by default) and "g++ compiler" packages only
  • Download and install MSYS-1.0.10.exe into the directory c:\msys\1.0\ (lower case).
  • At the end of the installation, it will ask you if you want to continue with the post-install. Select yes, and yes again when it ask if you have mingw installed.
  • Then -the black windows prompt- will continue asking you to indicate where the directory is installed,type :
  • c:/mingw (yes, with a forward slash -linux habit to have- as the program prefers it that way).

Compiling Prerequisites

Windows Method

  • Open in a news Windows Explorer windows the path "C:\msys\1.0" (we will drop some files into it later from an archive)
  • Download glob2_required_libs_mingw-scons.tar.bz2 and put it in the home directory of msys (c:\msys\1.0\home\XXX\ where XXX is the username)
  • Open it with a bz2-tar archiver application like Winrar,or 7z, and
  • Drag and drop All Directories from the Archivers (e.g Winrar) into the path "C:\msys\1.0" (remember we already got a windows ready for that) , tell yes if it ask for over writting, or already existing files/folders. This could take a While.
NOTE: :On Windows VISTA and Above you might need the Administrators Right to access copy or drag and drop files into the C Drive trees. an inheritance from linux chmod :(

ONCE Done, close the Archiver, and Windows that we opened for the drag and drop.


Linux like Method

OLD_METHODE , 'command line geek' -This will be cleared soon- :


  • Double click the MSYS icon that has been placed on your desktop during MSYS's installation.
  • Go in the directory where you put the glob2_required_libs_mingw-scons.tar.bz2 (for example cd ~) and untar the libraries using the command below. This process could take a while:
tar jxf glob2_required_libs_mingw-scons.tar.bz2 -C /

ON The Way to get Ready for Compiling Globulation 2

Step 1: Choosing from What Source Code to compile

INFO: 'Mercurial source' is a well known expression but at my sens are an Idiom abuse, What People called here mercurial Sources,is designing in reality the Globulation Source Development Pool using Mercurial, and that is the way I would prefer to name it "Project source files".Mercurial is indeed a Sotfware who organized the Globulation project development and not The project name itself, but I will sometime refer to "mercurial sources" idiom inside this wiki, since this is a pretty common well-known-expression.

Follow the

  • step 1A for compilation with Official Code source release (tar-ball download)
  • step 1B for compilation from 'Mercurial source' by hand -friendless-
  • step 1C for compilation from 'Mercurial source' by Friendly windows :D

Follow only one of those step and after done it , got to go to the appropriate STEP2


STEP1 A - Official Web site Released source code

  • Download [ Download_and_Install ] The c++ tarball archive source code file
  • Create a Folder name "glob2_source_building" at c:\msys\1.0\home\XXX\ (where XXX is the username)
  • Extract the source code archive [USING 7-Zip or assimilated software]in the folder you have just made.
  • Then Go Down to STEP2 ( quicker compiling way :)

STEP1 B - The "Project source files" [NO TURTOISE API]

(known formerly as Mercurial Source)


Hint: If you got the TortoiseHG (is friendly Windows software appearance using Mercurial ) you can USE IT, by going down now to the B.2 Section!


  • Download Globulation 2 from a remote repository (Formerly called here mercurial-Sources.
hg clone https://bitbucket.org/giszmo/glob2 glob2-local-repository
This can take a while if your internet connexion is a limited bandwidth, You are "just" getting ALL the Globulation Work history back from November 2001, when it all began ;)


Do you look for more information about hg clone option&parameters see this MAN PAGE.


DESCRIPTION:

  • Tags Tags are used to name particular revisions of the repository and are very useful to compare different revisions, to go back to significant earlier versions or to mark branch points as releases, mark certain versions when glob2 publishes a new released (e.g beta4.5 is the beta-4 series 5th version ). This is better and more stable than the beta4.4 but should not desync against beta4.1. If you only want to play glob2 beta4, use the latest tag beta4.whatever_revision.
  • tip is a special Revision tag. It is the revision last committed to the Working repository. In general this is not what you want but you get it by default.
  • Branches are a kind of core-game or working-pool which is based on an existing release ( game source_code) so branches are set to define some news BIG changes or features like 'replay' or 'market_bug' or why not AI_changes ,They are used to mark a sequence of revisions that are not necessarily all stable. Somewhere between beta4-rc branch and beta4.5 there might be versions -branches with Revision update applied or not- that don't compile (mainly for Coding mistake or incompatible branch modification with the apply of an Revision (patch for other bug or merged branches) or not. If you want to help on a beta4.6 you would need to get the branch beta4-rc and update with the revision you would like to help for in this case beta4.6 -this will be explain later.If you would like to play the Beta4.5 with the latest patch (who may be unstable too) you will need to extract the Branch "beta4-rc" and later update it with a proper tags like "tip" or "beta4.5" or else(you got the tags list from the command 'hg tags').
  • default is the main branch where the latest changes is being made (New Series Version,New RC, or unstable version, so this might include new branch). IT's the right place to check it out what news stuff is being coded and implemented.
  • NOTE:If you would to play this branch is not the right -could be Desynchronized , and Unstable.If you look for fixing bugs, this is not the right 'setting' either, because you might look for the buggiest version. Bugs in the default could got fixed in the earliest supported branches (those with an -rc) but not always.If you want to implement new features that you are sure to finish do it in "default". If your feature is complex, use "default" but branch off a feature branch (hg branch my-complex-feature)-> the branch creation will not exist in the repository until the next commit -see HG MAN page for references.



  • Now time for Extracting The [branch name you picked above (this depending of your goal)] you want to work/play with from the 'Project source pool called mercurial' download into the a separate folder for the updating & compilation work, I decided to named it "glob2_source_building". So if the compilation abort you do not have to download again from the remote site the mercurial data, avoiding a server overload.In a case of a compilation failure and ONLY in this case you should just delete glob2_source_building by using Windows explorer GUI (with contextual menu and mouse use) This folder should be found at "C:\msys\1.0\home\XXX" Where XXX is your PC's name or username.After that start over from down here.
hg clone -r [branch name you picked above e.g beta5-rc] glob2-local-repository glob2_source_building
cd glob2_source_building

Hg clone HELP here.


  • update to the Revision you would like to apply, have or work with.

The [OPTION] -C will assure you that no Hybrid code will be made by any merge branching uncommitted 'revision'. if the update tag chosen is an no consequent one like you choose to apply a Revision design for Beta3-series on your chosen branch beta5-rc , The updater will abort with no modification -If I correctly get the meaning in the manual see: Hg manual. Hint: Branch name could be alias as 'Feature-pool' and tag as 'Revision' ,both are proper called 'changeset' in the Hg manual.

hg update -C [tag 'revision' name you'd like to have e.g tip or beta4.5 ]

Hints: The list of tags are listed with the command "hg tags"

To get more information about How Mercurial Work have look there :Mercurial.

STEP1 C - The "Project source files" [USING TURTOISE API]

(known formerly as Mercurial Source)


THIS SECTION HAS SUCCESSFULLY BEEN TESTED and APPROVED !


  • DOWNLOADING the 'Project'
  • Open Windows File Explorer (WIN_KEY+E) and go to "C:\msys\1.0\"
  • Create a Directory Call "glob-compilation", Get inside this folder
  • Right clicking, This open the contextual menu, then
  • select TortoiseHG>>Clone ,a pop-up windows will appear,
  • in source path please fill in this: "https://bitbucket.org/giszmo/glob2" without the quotation mark.
  • as Destination fill it that way: "C:\msys\1.0\glob-compilation\repository\" without the quotation mark.
  • push the button "Clone"

This Will take a lot of CPU energy and internet bandwidth, internet broadband is recommanded (size is over 100MB)!

  • SELECTING Branch
  • Right-click on the repository folder, mouse down -in the contextual menu- to "Hg Repository Explorer", this open the Explorer where you can see and get an overview of all the sources modification from the very beginning of the project up to now ( at least the download date or update of the online-repository !

Now Here you can see The project source board is a bit complicated to explain all things though , I will limited myself to the basic staff, feel free to read the Software HELP. Now let 's get the list of those branches,On the middle under the task-bar of Turtoise, you can see a kind of button following by an arrow called "branches" if you click on the next by arrow you can see a list of the actual branches in the repository you are actually exploring.

  • Branch Definition

A NEW changing state in the repository -where code data are recorded- and has been created from an another branch that is not a head -the very beginning of a any branch. If a new branch is named, it becomes a named branch. If a new branch is not named, it becomes an anonymous branch. A branch name should represent the tipmost revision of that branch.


  • Beyond the water.

(you can skip it if you don't care about How the code is organized)


Branches are like real trees branches they grow on a tree from the ground zero (the first branch call -NULL- (ID 00000000). and from branch to branch they keep growing, and like real tree they have communication point-node- between each one another (merge) and for easiest classification the use of name and tag name along with Unique SHA1-ID.When a Branch got mature and got merge into the trunk (the main first branch call by default: default), on the website and the hgturtoise software they are represented as different colored lines.The different between real tree and the program is that the real tree branches have his branches that keep growing, in opposition, with the Mercurial Program Branches, which when a branch is not any longer supported -mainly because the goal is reached and then are merge into one another or they miss their goal and have their Head set to be closed.Then naturally they could not grow any longer, they just Disappear -into the main branch or ended in a dead-end -as I believe- see the Mercurial Documentation for Exact Details and our local Documentation.

Branches are like a small-working-pool which is based on an existing release (earlier branch)so branches are set to define some news changes that the dev or devs team wish to implement and for testing game core stability and avoiding corruption the Code are split into branches - e.g the famous 2007_Game_core_Writing, for this example a tag has been created to avoid people to update from the main branch to the experimental branch. Branch functionality are very complex to understand and to explain.When a experimental branch get stable and add an new features or fix a bug ,they are merge into the main branch called default at this point if the dev feel the need for, He/she could set a tag to refer to his improvement.

  • Cloning a branch -example-

Cloning a branch that has been split from the main branch for experimentation and not yet get merge into it, will give you the game source data that this dev team are working on, due to the fact that the code is under writing of course it may be not always be compilable, specialy since other well known bug could be fixed on other branches or in the main default branch, who do not profit to a particular branch unless they get merge into.I told you complicated staff.

  • Head

it's even more complicated if you can imagine that branch should have a Head and many head could exist in the Mercurial system but are not recommended. Head are define as a very new branch beginning with no descendants yet.

or features like 'replay' or 'market_bug' or why not AI_changes ,They are used to mark a sequence of revisions that are not necessarily all stable, they come from parent and lead to children unless if the got merge in or off.


  • SUMMARY

The 'Default' is the last one where every one look at for improvement.not necessary stable. after come the 'betaX-rc' -branch name- who the X represent the Game Core Version along with the suffix -rc , meaning Release Candidate are usualy stable and less buggy, good for gaming ! However I found in some case that betaX-rc are less stable than the Default branch ! And the other are mostly dedicated for debugger, tester, and other geeks!



  • CLONYING our Branch [DIRECTION]

(for a clean Re-compilation in case of Failure )

  • Create a Directory called "glob2_source_building" -with Windows File Explorer (WIN_KEY+E)- at "C:\msys\1.0\glob-compilation\"
  • Right clicking on this new folder, will open the contextual menu, then
  • select TortoiseHG>>Clone ,a pop-up windows will appear,
  • Set the source path to the " repository" folder either using the Browse button or filling up the field with "C:\msys\1.0\glob-compilation\repository"
  • Select using the arrow the "advanced options"
  • Check the box "clone to Revision" and in the next field, fill in the branch you want. ( e.g: Default ,or, beta5-rc ).
  • launch the clonning process by pressing the button. ( this time it's require less time)


  • UPDATING IT [DIRECTION]

This stage may be useful if you are getting to work on a long term with mercurial system,if you are just a fast windows player skip this part to the next.

Revision: is A repository snapshot at a particular time.Therefore earlier revisions can be updated to by using the Update command.It can be specified as a changeset revision number, a tag name, or a unique SHA-1 hash value substring of the changeset.

The tag tip: is the snapshot with the highest revision number.It is the changeset most recently added in a repository.

The tag betaX (X is a number): are tag created to refer to a particular working branch bond normally to the branch name "betaX-rc"


When your local Globulation2 Project Repository is getting old -for months- you can use the Update option find in the contextual menu under the HgTurtoise section, when right clicking on a folder. The best bet is to update either your local repository or just your working source folder "glob2_source_building".Using mostly the tip tag or default or a betaX-rc -where X is a number.

  • Details

This stage , in my opinion as I am writing, is optional, the purpose is to get the last Revision that has been coded for a typical branch, they are called Tags, Revision.When using a local repository up to date, the update is not needed.See the online GRAPH improvement to see if you need to update your data and compare to your local repository Data using HgTurtoise explorer on the repository folder -that you has cloned maybe for a while.


  • Tag -definition-

Do not hesitase to get read those pages for further Informations:


  • Get Beyond the water.
  • A tag name is associated with a revision ID number.
  • The special tag "tip" is always identifies the most recent revision.
  • Tag names have priority over branch names during revision lookup, using an existing branch name as a tag name is discouraged.


example: If you update to an "Revision" -tag-,let's say the beta4-rc you was an branch aside from the main one -default-, the beta4-rc was under development on the developer local repository, until they commit their work online.

_ who is buggy or old, you could create some version who is really not WANTED, because of the bug they can create and the hight risk of compilation failures.To prevent this check the box , "discard local changes,nobackup -C/--clean" option, and always show log ( to get a traceback of any change that will be done). USING the -C option will avoid any bad update ! it's a safe way to update, I think.

I'm not really confident with updating, but some do , with no trouble. The Tags, or "Revison"; tip is really adapted to the default branch, for a good 'cooking' ask the devs or look upon the forum to see what update Revision to use with what Branch.

On the Update setting windows you can choose your Tags, and see the target description below , who will change for each different one. The parent part will inform you about the actual branch you are updating from.


  • Right clicking on the glob2_source_building folder, This open the contextual menu, then
  • select TortoiseHG>>update ,a pop-up windows will appear,
  • choose your Revision you decided to apply (e.g: tip)
  • check the First option box only and verify the other are uncheck.
  • then push the update button

Once done, close the windows.


Now time for compiling, and we need to get ready for command lines....

STEP 2: COMPILATION

PLEASE NOTE: The compilation Stage could lead to some ISSUES,they are disccuss in the proper section below. Don't worry about the warnings while compiling. If something is wrong, it will grind to a halt and it will let you know why.Also Depending on the machine characteristic the process could take more or less longer. from 5min from a rocker computer to I guess over 192 mins for a old and tired computer

When You have Followed the

  • STEP 1A follow the STEP2 A&B
  • STEP 1B follow the STEP2 A&B
  • STEP 1C follow the STEP 2C

Pretty easy , right....

Step 2 A&B Direction

  • Start compiling Globulation 2.
  • Open msys by double clicking the desktop icon, type the following code into the emulated *NIX-shell;
cd glob2_source_building 
scons

Step 2 C Direction

  • Starting Globulation 2 compilation.
  • Open msys by double clicking the desktop icon, type the following code into the emulated *NIX-shell;
cd /glob-compilation/glob2_source_building
scons

HINT: The "TAB KEY" help you to finish to fill up the path name use it to save time and mistake.

Step 2 A&B&C The TEST After a Success compilation

  • Once compiling has finished
  • Make a 'TEST' directory call "test" or "whatever" using MS WINDOWS in your desktop or 'elsewhere' for the simplest example we will set it up in our windows desktop :) .
  • Copy into it all the file found in "C:\msys\1.0\local\lib" then do not forget to do,
  • Copy and past of the Glob2.exe from "C:\msys\1.0\home\XXX\glob2_source_building\src\" where XXX is the PC's name or user into this 'Test' directory you have made in your desktop.
if you went from C Step: The binary will be found into C:\msys\1.0\glob-compilation\glob2_source_building directory.
  • Copy the SDL.dll from "C:\msys\1.0\local\bin" and past it into your desktop 'test' folder, and...
  • launch it ! ENJOY IT !

At first start the application, the game, is freezing , because it is setting many parameters, so on a slow/busy machine this could take a while.

Building a Globulation 2 NSIS installer

When You had run the STEP2 A&B:

  • In MSYS, run the following codes to compile a windows installable exe file:
cd glob2_source_building
cd bundle
glob2_make_win32.sh

When You had run the STEP2 C:

  • In MSYS, run the following codes to compile a windows installable exe file:
cd /glob-compilation/glob2_source_building
cd bundle
glob2_make_win32.sh


  • If all things go well, an exe ready for installation on windows computers is now ready within the bundle folder. Test it (install and play), and if it works, send it to your friends ;)

Possible Issues

  • ISSUE #1.

Make sure you have no hidden GNU-GCC installed somewhere. GCC is for example included in the FreePascal-Compiler. (You won't find any Lib anymore if another GCC is activ.)


  • ISSUE #2.

Make sure path to GCC is set in Path Enviroment Variable. The Scons-Script just aborts (can't find libSDL) if it is not.


  • ISSUE #3.0 sh: /bin/scons: No such file or directory

(Wrote in Summer-2010)

  • Fixed that by installing Python2.6 along with scons-1.1.0 or editing scons file found in the ../Bin/ more details about that below.


I got this trouble as many other people look there. It is not quite easy to explain how to make-it-works,The solution could be fixed easily but have to be dynamic with ever new python & scons product version . So this Trouble could come over again later.

  • Where that Trouble come from ?

This comes from a "unix-kind-link" who has been designed for Python 2.6 AND scons-1.1.0 Versions ONLY due to the fact that today the Python version and scons have and will evolve their name, their path will too, breaking the scons unix-type-link ! That said, as you see The Trouble will come over and over if the way to bond the scons to mingw sh (unix command bash, & emulated environment) will stay like that -none dynamic-

  • How the Community can fix it ?

Here some ideas: We need to maintain a right scons file provided in the tarball file call 'Prerequisites' (glob2_required_libs_mingw).

  • What YOU can do to make it works ?
  • The EASIEST, SIMPLEST,EFFICIENT WAY:

Remove the actual Python and scons program from your computer, then download and install the old python2.6 **AND** scons1.1.0 version for windows if they are still available for download.


  • OR THE MOST COMPLICATED WAY: Editing the scons file.

Scons File with no Extension and normaly "located" at "c:\msys\1.0\bin\" or might also work or be found there at "c:\mingw\bin\"

You should use a proper Text Editor , do not even think to use the MS notepad because it does sometime files coruption, at least you may use MS WORDPAD at your own files risk !,Better to use the Free Notepad++ -get it now- who really edit well available as portable application also.

  • Editing the ORIGINAL scons file :

FOR THIS WORK YOU NEED TO USE notepad++ (gnu) get it now.

  • Replace the line:
#! C:/Python26/python  ,

by your real python version (it is either 26 or 27 , newer version are not compatible) :

#! Drive:/Python_version_location/python 
  • AND the two next occurrences of the expression or chart: 'scons-1.1.0'

by your actual 'scons-version.x.x.x.'

example:

Original scons link:

#! C:/Python26/python

from os.path import join
import sys

sys.path = [ join(sys.prefix, 'Lib', 'site-packages', 'scons-1.1.0'),
join(sys.prefix, 'Lib', 'site-packages', 'scons'), join(sys.prefix, 'scons-1.1.0'),
join(sys.prefix, 'scons')] + sys.path
import SCons.Script
SCons.Script.main()

Modified Scons for using Python2.7 and scons-2.0.0.final.0 as:

#! C:/Python27/python

from os.path import join
import sys

sys.path = [ join(sys.prefix, 'Lib', 'site-packages', 'scons-2.0.0.final.0'),
join(sys.prefix, 'Lib', 'site-packages', 'scons'), join(sys.prefix, 'scons-2.0.0.final.0'),
join(sys.prefix, 'scons')] + sys.path
import SCons.Script
SCons.Script.main()

(3 entry has been changed, for this example)


  • Try again the STEP2 according to what STEP1 you followed, If 'scons' start compiling - a lot of information will be writting in the MSYS application windows, you 'r done !
  • IF NOT see those hint :

you might need to check and found the file 'SConscript.pyc' on the right path following this model "Drive:\Python_version_path\Lib\site-packages\scons-version.x.x.x\SCons\Script\SConscript.pyc" IF the problem persist uninstall scons first and python after, and INSTALL PYTHON2.6 and SCONS-1.1.0 , that will fixed your trouble, no need to uninstall MSys neither MinGW.




  • ISSUE #3.1 scons line 7 ImportError: No module named SCons.Script

Its more likely you got the right python26 but the scons is not the scons-1.1.0 version, if this version is not any longer available to download, try to EDIT the scons file with the your exact scons version. you can know it by looking for the file SConscript.py in your computer and look closely the path the name you look for is right after the "....site-packages\scons-1.3.0\SCons\Script\SConscript.pyc" .

YOU NEED to have installed as an Administrator "scons-1.1.0" this exact version IF not the Issue will occur The Error look like :

"../bin/scons", line 7, in <module>
import SCons.Script
ImportError: No module named SCons.Script

and then a painful debugging process will be engage :(

More details on the Issue#3 who is related to.




  • ISSUE #3.2 ImportError: No module named SCons.compat or/and _scons_builtins

Your Python Version installed in your Windows is not compatible with scons , ALL Python v3.x.x.x Are NOT COMPATIBLE with Scons v1.1.0 or v2.0.0.final.0 (as I am typing this help august-2010), please consider to un-install it and get the python26 and scons-1.1.0 who is the best bet !

Also the Python SHOULD BE a V2.x.x release not The V3.x.x.x who break compatibility with scons !

Error code look like :

File "c:\Python26\Lib\site-packages\scons-2.0.0.final.0\SCons\__init__.py", line 43, <in module>
import SCons.compat
ImportError: No module named SCons.compat
(same things with) _scons_builtins

The Python Website -official- clearly show that even the __init__.py file, line 42 !

(related to Issue#3)




  • ISSUE #4. No SConstruct file found

( users made mistake ) This is because your are not in the working source directoring to compile or The Source code has been altered or missing ! re-do step by step the wiki skipping the Download & settings stages. a

cd glob2_source_building
scons

might help thoough !




  • MOTD

This Help is there and is provided AS IS , its works on my Windows Vista 32bit, and this Details Help should stay here long enough as long the file glob2_required_libs_mingw-scons.tar.bz2 contain the **OUTDATED** 'scons unix-link' ! Thank you for the reading

Conclusion

That concludes this Mingw compilation tutorial.

When I will know How to use friendly the GUI Hgturtoise , I will Update this Tutorial, that mean it will have less command line ever, in fact command line will be limited to the ONLY Source code compilation , up to this comming day , take this Wiki has a reliable and Stable one , since I made effort to correct the main errors people got while folllowing it.

Surely, Section designing need yet to be perform, and it will be .


  • Compilation_story

Also to give you and idea on a 4 cores pentium cpu @ 2.33GHZ the compilation of the RC beta5 got 12 minutes and the binary (Glob2.exe file) "pound" 133MB !! well the other geek guys made one at 98MB so we are 1.32 time more weighty with this type of compilation. But clearly as today the comparison between Beta4 & Beta 5 is amazing by the Glob2 binary file size ! from 4.8kb to 100Mb .

  • Trouble

If you have any NEW Trouble, please write a bug report and one of the Windows maintainers should be able to help you. More information on bug reports can be found at the Bug Reports page. Also think about the IRC , easy connexion via YOG.

Happy compiling.

Misc