UFO:Alien Invasion

Development => Newbie Coding => Topic started by: Thrashard96 on July 22, 2010, 07:07:53 pm

Title: How to download the source and compile it?
Post by: Thrashard96 on July 22, 2010, 07:07:53 pm
Hello. I want to compile but how to do it? I'm not advanced enough at this part so please take your time and explain me step-by-step what to do.

Please answer these questions in your posts if you can:
1. How to download the developer version?
2. Is going to https://ufoai.svn.sourceforge.net/svnroot/ufoai/ufoai/trunk manually (through internet explorer) is easier than the other way with some software?
3. If no, then what software is it?

I will ask more if i won't know something else.
Title: Re: How to download the source and compile it?
Post by: MCR on July 22, 2010, 07:11:12 pm
Read here:
http://ufoai.ninex.info/wiki/index.php/Getting_the_source
Title: Re: How to download the source and compile it?
Post by: Thrashard96 on July 22, 2010, 07:13:39 pm
I have turtoiseSVN and opened up repository browser, entered url, so what should i do now?

Edit: pressed checkout, what to do next?
Title: Re: How to download the source and compile it?
Post by: Destructavator on July 22, 2010, 08:18:31 pm
I'm not sure if you did this already or not, but you need a local folder on your hard drive to store all the source files, then you right-click on that folder and select "checkout" then enter the SVN URL.

You should then see a lot of files being downloaded in a new window.  Did this happen for you, or did you get an error message?
Title: Re: How to download the source and compile it?
Post by: Thrashard96 on July 22, 2010, 09:05:44 pm
I'm not sure if you did this already or not, but you need a local folder on your hard drive to store all the source files, then you right-click on that folder and select "checkout" then enter the SVN URL.

You should then see a lot of files being downloaded in a new window.  Did this happen for you, or did you get an error message?


It is downloading, but i wonder what will happen if i would put the pc to hibernation because i have to shut down my pc right now.
Title: Re: How to download the source and compile it?
Post by: Destructavator on July 22, 2010, 09:33:35 pm
You can interrupt the download/update process at any time, and later right-click on the folder and select "SVN update" and Tortoise SVN will pick up where it left off.  This also works if it hits an error in the middle of an update or checkout.
Title: Re: How to download the source and compile it?
Post by: Thrashard96 on July 23, 2010, 09:05:04 am
Done! Now about how to compile it...
Title: Re: How to download the source and compile it?
Post by: Muton on July 23, 2010, 12:28:17 pm
The easy way http://ufoai.ninex.info/wiki/index.php/Code::Blocks_(guided_with_GUI) (http://ufoai.ninex.info/wiki/index.php/Code::Blocks_(guided_with_GUI))
Title: Re: How to download the source and compile it?
Post by: Thrashard96 on July 23, 2010, 06:37:01 pm
MakeNSIS v2.46 - Copyright 1995-2009 Contributors
See the file COPYING for license details.
Credits can be found in the Users Manual.

Processing config:
Processing plugin dlls: "C:\Program Files\NSIS\Plugins\*.dll"
 - AdvSplash::show
 - Banner::destroy
 - Banner::getWindow
 - Banner::show
 - BgImage::AddImage
 - BgImage::AddText
 - BgImage::Clear
 - BgImage::Destroy
 - BgImage::Redraw
 - BgImage::SetBg
 - BgImage::SetReturn
 - BgImage::Sound
 - Dialer::AttemptConnect
 - Dialer::AutodialHangup
 - Dialer::AutodialOnline
 - Dialer::AutodialUnattended
 - Dialer::GetConnectedState
 - InstallOptions::dialog
 - InstallOptions::initDialog
 - InstallOptions::show
 - LangDLL::LangDialog
 - Math::Script
 - NSISdl::download
 - NSISdl::download_quiet
 - Splash::show
 - StartMenu::Init
 - StartMenu::Select
 - StartMenu::Show
 - System::Alloc
 - System::Call
 - System::Copy
 - System::Free
 - System::Get
 - System::Int64Op
 - System::Store
 - TypeLib::GetLibVersion
 - TypeLib::Register
 - TypeLib::UnRegister
 - UserInfo::GetAccountType
 - UserInfo::GetName
 - UserInfo::GetOriginalAccountType
 - VPatch::GetFileCRC32
 - VPatch::GetFileMD5
 - VPatch::vpatchfile
 - nsDialogs::Create
 - nsDialogs::CreateControl
 - nsDialogs::CreateItem
 - nsDialogs::CreateTimer
 - nsDialogs::GetUserData
 - nsDialogs::KillTimer
 - nsDialogs::OnBack
 - nsDialogs::OnChange
 - nsDialogs::OnClick
 - nsDialogs::OnNotify
 - nsDialogs::SelectFileDialog
 - nsDialogs::SelectFolderDialog
 - nsDialogs::SetRTL
 - nsDialogs::SetUserData
 - nsDialogs::Show
 - nsExec::Exec
 - nsExec::ExecToLog
 - nsExec::ExecToStack

!define: "MUI_INSERT_NSISCONF"=""

Changing directory to: "C:\Program Files\UFOAI-2.3\build\projects\ufoai\contrib\installer\windows"

Processing script file: "C:\Program Files\UFOAI-2.3\build\projects\ufoai\contrib\installer\windows\ufoai.nsi"
!define: "PRODUCT_NAME"="UFO:Alien Invasion"
!define: "SHORT_PRODUCT_NAME"="UFO:AI"
!define: "PRODUCT_NAME_DEDICATED"="UFO:Alien Invasion Dedicated Server"
!define: "PRODUCT_VERSION"="2.4-dev"
!define: "PRODUCT_PUBLISHER"="UFO:AI Team"
!define: "PRODUCT_WEB_SITE"="http://ufoai.sf.net"
!define: "PRODUCT_DIR_REGKEY"="Software\UFOAI\ufo.exe"
!define: "PRODUCT_UNINST_KEY"="Software\Microsoft\Windows\CurrentVersion\Uninstall\UFO:Alien Invasion"
!define: "PRODUCT_UNINST_ROOT_KEY"="HKLM"
SetCompressor: /SOLID lzma
!include: "C:\Program Files\NSIS\Include\MUI.nsh"
!include: "C:\Program Files\NSIS\Contrib\Modern UI\System.nsh"
NSIS Modern User Interface version 1.8 - Copyright 2002-2009 Joost Verburg (C:\Program Files\NSIS\Contrib\Modern UI\System.nsh:8)
!define: "MUI_INCLUDED"=""
!define: "MUI_SYSVERSION"="1.8"
!define: "MUI_VERBOSE"="3"
!include: closed: "C:\Program Files\NSIS\Contrib\Modern UI\System.nsh"
!include: closed: "C:\Program Files\NSIS\Include\MUI.nsh"
!include: "C:\Program Files\NSIS\Include\LogicLib.nsh"
!include: closed: "C:\Program Files\NSIS\Include\LogicLib.nsh"
ShowInstDetails: nevershow
ShowUninstDetails: nevershow
!define: "MUI_ABORTWARNING"=""
!define: "MUI_ICON"="..\..\..\build\projects\ufo.ico"
!define: "MUI_UNICON"="..\..\..\build\projects\ufo.ico"
!define: "MUI_LANGDLL_REGISTRY_ROOT"="HKLM"
!define: "MUI_LANGDLL_REGISTRY_KEY"="Software\Microsoft\Windows\CurrentVersion\Uninstall\UFO:Alien Invasion"
!define: "MUI_LANGDLL_REGISTRY_VALUENAME"="NSIS:Language"
!define: "MUI_WELCOMEFINISHPAGE_BITMAP"="..\ufoai.bmp"
Var: "GAMEFLAGS"
Var: "MAPFLAGS"
Var: "GAMETEST"
Var: "MAPTEST"
Var: "GAMEICONFLAGS"
Var: "MAPICONFLAGS"
!insertmacro: MUI_PAGE_WELCOME
!insertmacro: end of MUI_PAGE_WELCOME
!define: "MUI_LICENSEPAGE_CHECKBOX"=""
!insertmacro: MUI_PAGE_LICENSE
!insertmacro: end of MUI_PAGE_LICENSE
!define: "MUI_COMPONENTSPAGE_SMALLDESC"=""
!insertmacro: MUI_PAGE_COMPONENTS
!insertmacro: end of MUI_PAGE_COMPONENTS
!define: "MUI_DIRECTORYPAGE_VERIFYONLEAVE"=""
!define: "MUI_PAGE_CUSTOMFUNCTION_LEAVE"="dirLeave"
!insertmacro: MUI_PAGE_DIRECTORY
!insertmacro: end of MUI_PAGE_DIRECTORY
!insertmacro: MUI_PAGE_INSTFILES
!insertmacro: end of MUI_PAGE_INSTFILES
!insertmacro: MUI_PAGE_FINISH
!insertmacro: end of MUI_PAGE_FINISH
!insertmacro: MUI_UNPAGE_INSTFILES
!insertmacro: end of MUI_UNPAGE_INSTFILES
!insertmacro: MUI_LANGUAGE
!insertmacro: end of MUI_LANGUAGE
!insertmacro: MUI_RESERVEFILE_INSTALLOPTIONS
!insertmacro: end of MUI_RESERVEFILE_INSTALLOPTIONS
Name: "UFO:AI 2.4-dev"
OutFile: "ufoai-2.4-dev-win32.exe"
InstallDir: "$PROGRAMFILES\UFOAI-2.4-dev"
InstallRegKey: "HKLM\Software\UFOAI\ufo.exe\"
ShowInstDetails: show
ShowUnInstDetails: show
Function: ".onInit"
!insertmacro: MUI_LANGDLL_DISPLAY
!insertmacro: end of MUI_LANGDLL_DISPLAY
FunctionEnd
Function: ".onInstSuccess"
MessageBox: 0: "If you want to play multiplayer games, open the TCP port 27910 in your firewall."
FunctionEnd
SectionGroup Game ->(SECGROUP01)
Section: "Game Files" ->(SEC01)
SetOverwrite: ifnewer
SetOutPath: "$INSTDIR"
File: "COPYING" 14928 bytes
File: "README" 120 bytes
warning: File: "..\..\..\src\docs\tex\*.pdf" -> no files found. (C:\Program Files\UFOAI-2.3\build\projects\ufoai\contrib\installer\windows\ufoai.nsi:90)
File: "SDL.dll" 324096 bytes
File: "SDL_image.dll" 43520 bytes
File: "SDL_mixer.dll" 312320 bytes
File: "SDL_ttf.dll" 331776 bytes
File: "intl.dll" 104861 bytes
File: "jpeg.dll" 113664 bytes
File: "jpeg62.dll" 153966 bytes
File: "libcurl-4.dll" 182272 bytes
File: "libogg-0.dll" 15872 bytes
File: "libpng12-0.dll" 132096 bytes
File: "libpng3.dll" 260096 bytes
File: "libvorbis-0.dll" 157696 bytes
File: "libvorbisfile-3.dll" 28672 bytes
File: "zlib1.dll" 74752 bytes
File: "..\..\..\ufo.exe" -> no files found.
Usage: File [/nonfatal] [/a] ([/r] [/x filespec [...]] filespec [...] |
   /oname=outfile one_file_only)
Error in script "C:\Program Files\UFOAI-2.3\build\projects\ufoai\contrib\installer\windows\ufoai.nsi" on line 92 -- aborting creation process
Title: Re: How to download the source and compile it?
Post by: geever on July 23, 2010, 07:24:19 pm
MakeNSIS v2.46 - Copyright 1995-2009 Contributors
See the file COPYING for license details.
Credits can be found in the Users Manual.

You should compile the game before creating an installer....

-geever
Title: Re: How to download the source and compile it?
Post by: Thrashard96 on July 23, 2010, 07:28:12 pm
how?
Title: Re: How to download the source and compile it?
Post by: Destructavator on July 23, 2010, 08:51:05 pm
how?

On Windows, there are two ways:

- If you just want to be able to update and build the latest SVN version and run it whenever you want to, I'd suggest Muton's way, it's much easier.

- If you know how to program in C, and plan to edit the code and contribute as a coder, you can use the more traditional approach of using a copy of MinGW with Code::Blocks IDE.  If you really want to tackle the task of building the game with this approach, I can help you get things set up, but it's far more complicated than Muton's utility.

Edit:  Based on what I've seen you post, no offense, but I get the impression that you're not ready for the second method, because if you really had the programming skill and experience to be a coder you likely wouldn't be asking the questions you've been asking.  If you want to learn and eventually become a coder, I'd still suggest Muton's way first, and then eventually "graduate" to the second method when you get a good understanding of the game code and programming in general.

If programming really interests you, I can help you get started, and we also have a section of the forum here for that sort of thing.
Title: Re: How to download the source and compile it?
Post by: Thrashard96 on July 25, 2010, 08:55:58 pm
Done! But it lags a bit in battlescape. Nothing unusual except new weapons.
Title: Re: How to download the source and compile it?
Post by: Duke on July 25, 2010, 10:40:17 pm
Did yo compile debug or release version ?
Debug exe is some six times slower and yes, that may show in battlescape and elsewhere (eg. startup), depending on your HW.
Title: Re: How to download the source and compile it?
Post by: Thrashard96 on July 26, 2010, 07:04:42 am
Did yo compile debug or release version ?
Debug exe is some six times slower and yes, that may show in battlescape and elsewhere (eg. startup), depending on your HW.


1. Debug
2. It happens all the time, but i sometimes forget to lower graphics and get huge lag.


I remember the lagged version (i forgot the number) where it was really lagging, because it was misconfigured to low priority...
Title: Re: How to download the source and compile it?
Post by: Duke on July 26, 2010, 11:45:40 pm
If everything is configured correctly, does debug still lag on your system ?

I know that's not your target, but...
Can you also compile a 'release' version ? How long does it take to recompile for release on your system ?
Does release also lag for you ?
Title: Re: How to download the source and compile it?
Post by: Thrashard96 on July 27, 2010, 02:57:41 pm
If everything is configured correctly, does debug still lag on your system ?

I know that's not your target, but...
Can you also compile a 'release' version ? How long does it take to recompile for release on your system ?
Does release also lag for you ?

1. If textures are lowered, it works without lag,
2. I don't know how to compile the release version.
3. I didn't compile it yet.
4. Release version works the same.
Title: Re: How to download the source and compile it?
Post by: Duke on July 28, 2010, 12:46:32 am
1. If textures are lowered, it works without lag,
We are talking about 'Texture resolution cap' ? Mine is set to 'high' and I don't experience lag with the debug exe (r31041).
I don't really know whether textures are more related to cpu or gpu. That's a question for Mattn when he returns. How many GHz does one core of your cpu have ?

2. I don't know how to compile the release version.
As I don't know the compile process you are using, I can't help here. Usually there is some kind of switch between 'debug' and 'release' somewhere.

@All: could anybody who uses the same compile method plz help him ?
Title: Re: How to download the source and compile it?
Post by: Kildor on July 28, 2010, 05:52:54 am
Nobody knows its compile method. This person only whines and complains about everything, but doesn`t want to think, read or search.
Title: Re: How to download the source and compile it?
Post by: Thrashard96 on July 28, 2010, 09:30:09 am
We are talking about 'Texture resolution cap' ? Mine is set to 'high' and I don't experience lag with the debug exe (r31041).
I don't really know whether textures are more related to cpu or gpu. That's a question for Mattn when he returns. How many GHz does one core of your cpu have ?
As I don't know the compile process you are using, I can't help here. Usually there is some kind of switch between 'debug' and 'release' somewhere.

@All: could anybody who uses the same compile method plz help him ?

1. About 2.5 ghz

2. The software i use only has "2.3 dev" and "2.4 dev" options, so what should i use to compile as easily as possible?

P.S. The source of 2.3 was added when i installed the game (there was an option)...
Title: Re: How to download the source and compile it?
Post by: Muton on July 28, 2010, 06:07:43 pm
@PAUL1UZ5
You need to provide far more infos from your system and build
The build is easy zip and add the buildlog
For ufoai add ufoconsole.log and config.cfg ( explorer "%APPDATA%\ufoai" )
your HW driver version and gfx type (ati radeon HD4600)

He is using make_UfoAI_win32.exe
A classic C::B build ....


If we talk about lag, I mean Geoscape
had to disable
"post-processing shader effects" (6fps vs. 45fps)
but i'm using a low^2 gfx card (onboard)
Changing resulotion cap made no difference (1 fps)

(http://ufoai.ninex.info/forum/index.php?action=dlattach;topic=4561.0;attach=3582)
Title: Re: How to download the source and compile it?
Post by: Thrashard96 on July 28, 2010, 08:02:50 pm
Nobody knows its compile method. This person only whines and complains about everything, but doesn`t want to think, read or search.

The executable is make_UfoAI_win32.exe, but it shows only dev versions, is any of its versions made for 2.3 stable version? No need anymore.

@PAUL1UZ5
You need to provide far more infos from your system and build
The build is easy zip and add the buildlog
For ufoai add ufoconsole.log and config.cfg ( explorer "%APPDATA%\ufoai" )
your HW driver version and gfx type (ati radeon HD4600)

He is using make_UfoAI_win32.exe
A classic C::B build ....


If we talk about lag, I mean Geoscape
had to disable
"post-processing shader effects" (6fps vs. 45fps)
but i'm using a low^2 gfx card (onboard)
Changing resulotion cap made no difference (1 fps)

(http://ufoai.ninex.info/forum/index.php?action=dlattach;topic=4561.0;attach=3582)

(http://gpuz.techpowerup.com/10/07/28/7g5.png)

Is this enough?

P.S. Muton, can you send me your made compiler, please??? No need.