Home » MODDING HQ 1.13 » v1.13 General Development Talk » Quick Guide for Compiling and Debugging Source Code in Visual Studio
Quick Guide for Compiling and Debugging Source Code in Visual Studio[message #301086] Tue, 06 March 2012 06:16 Go to next message
haydent is currently offline haydent

 
Messages:265
Registered:November 2007
Location: NSW, Australia
Install Visual Studio 2005, 2008, 2010 or 2013 (this guide is based on 2008)

Install JA2 Original

Checkout 1.13 from SVN:
https://ja2svn.mooo.com/source/ja2_v1.13_data/GameDir/
(and put it the files in your game dir)

Checkout SVN copy of source from repository with Tortoise SVN e.g.

Latest 1.13 Trunk:
https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13

Latest 1.13 MP Dev Branch:
https://ja2svn.mooo.com/source/ja2/branches/Wanne/JA2 1.13 MP
(there are gamedir files in this branch too, that need putting in the right place)


Open Corresponding .sln solution file for you VS version ie ja2_VS2008.sln

Once Open Click Menu At Top: Project -> Properties (Alt + F7)

Change "Configuration" dropdown to "All Configurations"

Click "Configuration Properties" -> General

Change "Output Directory" to you game directory (where ja2.exe is)

Click "Configuration Properties" -> Debugging

Change "Working Directory" to you game directory (where ja2.exe is)

Click OK, Save.

To Choose if you build a debug or release exe use the dropdown in top menu near green play button.

Use the build menu to just build, use green play button to build with debugging.

Compiled Exe's will appear in your game directory.

Maybe this can be stickied, and added to if need be.

[Updated on: Wed, 02 July 2014 23:02] by Moderator

Report message to a moderator

Master Sergeant

Re: Quick Guide for Compiling and Debugging Source Code in Visual Studio[message #358687 is a reply to message #301086] Fri, 20 December 2019 06:09 Go to previous messageGo to next message
Kitty

 
Messages:465
Registered:October 2017
Location: Germany
Important Note

In October 2022 the server hosting the SVN went down. The links above won't work anymore.

Therefore things were moved to github, see here for (more)

The guide for compiling the source with VS is still valid. Just scrap the part about SVN (and Tortoise for it).

Go to github https://github.com/1dot13 and download "source" (click on "code", in the dropdown will be "download as zip").

For compiling the ja2.exe from this, follow the guide and hints that follows under this post (if the pics are down again, further down is a link to download them).

When done, you could also download "gamedir" from github at the same time. It is highly advised to do this the same time as downloading the source, this will ensure exe and GameDir match each other.

Put the compiled exe in the GameDir. Copy content of GameDir (with exe) in your original ja2-folder, overwrite. Voila, after that you have the latest 1.13.
--

Links:

ja2 v1.13 Source on gitHub

ja2 v1.13 GameDir on gitHub

--
Use cnc-ddraw-config.exe to adjust to modern monitors/resolutions or getting blackscreen, lags, alt+tab issues, no fullscreen or other stuff related to run an ancient game on modern OS.

If you don't want to compile yourself and assemble with GameDir, look below. In my signature are links, one leads to "How-to-get..." There you should find at least one downloadsource for an ready-to-go SCI (single-click-installer).

Further help can be asked at discord https://discord.gg/Ku2H9Hf


For a Quickstart, --
Mind you, it's a simple example of a basic workflow. Refer to guide (above) and/or supplementing step-by-step screenshots of the guide (below) for more details on settings in VS

--
Edit: added an example of a basic workflow as kinda Quickstart (13.12.2022)
--
Edit: I re-used my original post since it's close to start of thread. Below is the original post, left it because some following replies will otherwise look out of place.
--
Is this up-to-date enough in 2019?
And which version of Visual Studio is used nowadays?
The version I use to look into files is VisualStudioCode,
nut there is no "Projects"-tab in this one.
--

[Updated on: Wed, 14 December 2022 02:25]




How to get: latest 1.13, 7609 and more | 7609 SCI (eng) | Compiling+SVN

I need more details. (Didi Hallervorden)

Report message to a moderator

Master Sergeant
Re: Quick Guide for Compiling and Debugging Source Code in Visual Studio[message #358691 is a reply to message #358687] Fri, 20 December 2019 12:24 Go to previous messageGo to next message
DepressivesBrot is currently offline DepressivesBrot

 
Messages:3657
Registered:July 2009
Visual Studio Code is an entirely different product to Visual Studio 20XY. There's project files for up to VS2017, I don't know if there's any changes in VS2019 that would prevent a straight import of the '17 files, just give it a try.


Chat with us!
#bearpit on IRC
Discord
Get your latest 1.13 Builds
(Pls don't use my forum PMs for general game queries)

Report message to a moderator

Captain

Re: Quick Guide for Compiling and Debugging Source Code in Visual Studio[message #358705 is a reply to message #358691] Sun, 22 December 2019 05:53 Go to previous messageGo to next message
Kitty

 
Messages:465
Registered:October 2017
Location: Germany
Thanks,

from first glance after downloading VisualStudioExpress2017 and VisualStudioCommunity, I probably
need more tutorials and research on them. First try ended with complains about missing extensions (SDK),
so I first need to learn more.
But it's good to know that it might be possible, if I learn to manage the tools. Don't know, if I can
realy make it happen, but I'll give it a try.



How to get: latest 1.13, 7609 and more | 7609 SCI (eng) | Compiling+SVN

I need more details. (Didi Hallervorden)

Report message to a moderator

Master Sergeant
Re: Quick Guide for Compiling and Debugging Source Code in Visual Studio[message #360403 is a reply to message #358705] Thu, 18 June 2020 10:27 Go to previous messageGo to next message
Kitty

 
Messages:465
Registered:October 2017
Location: Germany
ok, finally managed to compile.

For building an MapEditor I used the same 113-source from SVN as for game-exe. Instead of "release", I've choosen "MapEditor" (VS2019). In quick tests this seems to be working, but is this the right way to do this? Or am I missing something?

And how am I building an UB-exe? Is there a different source for UB somewhere?



How to get: latest 1.13, 7609 and more | 7609 SCI (eng) | Compiling+SVN

I need more details. (Didi Hallervorden)

Report message to a moderator

Master Sergeant
Re: Quick Guide for Compiling and Debugging Source Code in Visual Studio[message #360404 is a reply to message #360403] Thu, 18 June 2020 11:41 Go to previous messageGo to next message
Asdow is currently offline Asdow

 
Messages:131
Registered:August 2010
Yeah, that should be correct for the mapeditor. For UB, pick release and then in builddefines.h you need to uncomment two lines.
// -----------------------------
// *****************************
// WANNE: Enable those 2 defines, if you want to build UB-Version!!

//JA2/Unfinished Business
#define JA2UB

//Unfinished Business - Titles (ja2set.dat)
#define JA2UBMAPS

Also, note that even though it should now launch a new game without issues after my fixes, since UB side hasn't been worked on in a long while it will have weirdness happening in game.

[Updated on: Thu, 18 June 2020 11:51]

Report message to a moderator

Sergeant
Re: Quick Guide for Compiling and Debugging Source Code in Visual Studio[message #361479 is a reply to message #301086] Mon, 05 October 2020 10:06 Go to previous messageGo to next message
Kitty

 
Messages:465
Registered:October 2017
Location: Germany
As supplement for Haydents allready good Guide for Compiling, I added some pictures (based on Visual Studio 2019).

Also with description on how to compile a MapEditor and UB.


haydent wrote on Tue, 06 March 2012 06:16
Open Corresponding .sln solution file for you VS version ie ja2_VS2008.sln
--
01
--
The following examples are based on Visual Studio 2019. The solution-file (in download from SVN Source) should look something like this:
--
--
Quote:
Once Open Click Menu At Top: Project -> Properties
--
02-03 additional explaination on steps before 04
--
04
--
open drop-down at Tab Project, there click at Properties
--
https://i.imgur.com/94od1f3.png
--
05
--
Quote:
Change "Configuration" dropdown to "All Configurations"
--
Click "Configuration Properties" -> General
--
https://i.imgur.com/tozs4zV.png
--
06
--
Quote:
Change "Output Directory" to you game directory (where ja2.exe is)
--
It doesn't have to be the game directory, you can define any directory as an output-directory.
At least, that's what I'm doing. So far the compiles have been working.
I can't see, why the former exe or the GameDir would be nescessary to compile the code.
Correct me if I'm wrong, so that I could adjust this description, if so.
--
https://i.imgur.com/IoUogeL.png
--
07
--
During the compiling, some intermediate files are created. Those need an output-directory as well.
--
07
--
08
--
Do check, if configuration type is .exe
--
--
09
--
Quote:
Click OK, Save.
--
Confirm changes, click ok to close.
--
https://i.imgur.com/sxTmdmA.png
--
10
--
Quote:
To Choose if you build a debug or release exe use the dropdown in top menu near green play button.
--
Use the build menu to just build, use green play button to build with debugging.
In that drop-down (of quote, not picture) you can also choose the MapEditor later on.
--
For anything else then debug, to build choose Tab "Build" at top and in drop-down (picture) of this then choose "Build ja2".
--
https://i.imgur.com/Ya27RGc.png
--

[Updated on: Wed, 14 December 2022 02:31]




How to get: latest 1.13, 7609 and more | 7609 SCI (eng) | Compiling+SVN

I need more details. (Didi Hallervorden)

Report message to a moderator

Master Sergeant
Re: Quick Guide for Compiling and Debugging Source Code in Visual Studio[message #361480 is a reply to message #361479] Mon, 05 October 2020 10:06 Go to previous messageGo to next message
Kitty

 
Messages:465
Registered:October 2017
Location: Germany
--
11
--
Quote:
Compiled Exe's will appear in your game directory.
--
If the compiling is successful, it will look like this. The exe will appear in output-directory of your choice.
--
https://i.imgur.com/IdBkbyr.png
--
12 - Compiling a MapEditor
--
13-18 Preparations for compiling UB and compiling UB
--
19 Debugging
--
The compiled exe should always be used with the matching GameDir. If updated from GitHub at same time, it can be assumed that they match.
--
If you find any mistakes, please let me know, I will then adjust the descriptions and/or pics.

[Updated on: Wed, 07 December 2022 01:29]




How to get: latest 1.13, 7609 and more | 7609 SCI (eng) | Compiling+SVN

I need more details. (Didi Hallervorden)

Report message to a moderator

Master Sergeant
Re: Quick Guide for Compiling and Debugging Source Code in Visual Studio[message #361483 is a reply to message #361480] Mon, 05 October 2020 18:58 Go to previous messageGo to next message
Kitty

 
Messages:465
Registered:October 2017
Location: Germany
Haydents Guide is starting with instructions to checkout latest Source and gameDir from SVN, and is also providing the links to JA2-SVN for this.

He is suggesting to use a programm called TortoiseSVN for this. It's freeware and opensource and will allow a convenient way to download the files at the links.

It will add new entries to the context menu (that is, if you right-click on a file or folder). The same as, e.g. VLC-Player or 7-zip do.

More information and download here: TortoiseSVN

Following, I assume it's downloaded and installed.


If you wanna use it for JA2-SVN, start with creating a new and empty folder, name it however you like.

Right-click on this Folder to open the context menu. With TortoiseSVN, there will be an entry "SVN Checkout".

Click on this and a window will open. There is a field for "URL of Repository".
The links from starting post will go there. Haydent called the one for Source "Latest 1.13 Trunk" and
the one for GameDir "Checkout 1.13 from SVN". I don't know about the one about MP-branch, never used it.

Once the link is pasted in there and the path to SVN-Folder at your side is confirmed, click ok.
This will open another window and the download (checkout) will start.

For the source this probably won't take long, but the GameDir will take a few minutes.
If this initial checkout is finished, once again do a right-click on the folder you directed SVN to.

You'll see that the entries at context menu have changed. Instead of "SVN Checkout", there are now
SVN Commit and SVN Update. Commit is for developers with permission to add stuff.

If clicking on SVN Update, it will check for any changes and open a window with the results.
If the checkout just happened, there probably won't be any updates. Check the log for more details.

Repeat the above for both, the GameDir and the Source. Each with it's own folder and matching link.

Compile exe from SVN Source and use it with matching SVN GameDir (on top of JA2 vanilla, original), enjoy the latest JA2 v1.13.

That's it. Download, install, create folder, connect link, checkout, ready to update anytime.

For a more visual way of explaination, take a look at the picture.


How to use Tortoise for ja2v1.13 SVN
--

More details on SVN:

Instructions for using SVN (by Marlboro Man)


Links to downloadsources for already compiled, ready to use SCI

How to get: latest 1.13, 7609, feature-descriptions and more (Tired of searching? Here are the links and informations you need to start)

[Updated on: Wed, 07 December 2022 02:38]




How to get: latest 1.13, 7609 and more | 7609 SCI (eng) | Compiling+SVN

I need more details. (Didi Hallervorden)

Report message to a moderator

Master Sergeant
Re: Quick Guide for Compiling and Debugging Source Code in Visual Studio[message #361738 is a reply to message #361483] Mon, 02 November 2020 22:14 Go to previous messageGo to next message
Kitty

 
Messages:465
Registered:October 2017
Location: Germany
The above series of screenshots uses Visual Studio 2019 to describe compiling of JA2.

If you wanna compile exe that are compatible with XP, a platform toolset for xp needs to be chosen.

Versions I'm aware of supporting xp-platfrom toolsets are VS 2017 and VS 2013.

Confused?

Don't worry, the only step that differs to the above screenshots is choosing the xp-platform-toolset.

How to do this with VS 2013 can be seen in this screenshot:

--
And if you wanna copmpile an UB.exe with VS 2013 you may wonder where "builddefines.h" has gone.

It's located in a sub-folder, like can be seen here:

--
Anything else, is just the same as in Haydents description and my former screenshots.

Edit:

I meanwhile found out that you can also use the VS17 platform toolset for XP (Visual Studio 2017 - Windows XP (v141_xp)) from within VS19

That'll allow you to use a more modern VS and still create an exe compatible downwards to XP
--
Edit: re-uploaded pictures

[Updated on: Thu, 08 December 2022 01:04]




How to get: latest 1.13, 7609 and more | 7609 SCI (eng) | Compiling+SVN

I need more details. (Didi Hallervorden)

Report message to a moderator

Master Sergeant
Re: Quick Guide for Compiling and Debugging Source Code in Visual Studio[message #361919 is a reply to message #361738] Mon, 23 November 2020 16:39 Go to previous messageGo to next message
Inveris is currently offline Inveris

 
Messages:39
Registered:September 2020
Hello everyone

To build mapeditor.exe from 1.13 is very easy, because everything was described in details here and in the proper files in source code.

But I was trying to build original mapeditor.exe from original source code from JA Gold 1.12, changing in builddefines.h proper lines. Unfortunately every time I failed. All the time the ja2.exe is creating, which is running the game.

https://github.com/dariusk/ja2
https://storage.rcs-rds.ro/links/4729f8d6-f44b-42b7-aa3e-e0ddc6deead6?path=%2FJA_2%2FMods_Vanilla%2FSource%2FGold

Maybe someone knows what else I should change in the source code, to build original mapeditor.exe from original source code. Thanks.

[Updated on: Mon, 23 November 2020 18:36]

Report message to a moderator

Private 1st Class
Re: Quick Guide for Compiling and Debugging Source Code in Visual Studio[message #362331 is a reply to message #361919] Sun, 07 February 2021 23:16 Go to previous messageGo to next message
datachild is currently offline datachild

 
Messages:5
Registered:September 2010
Hello everyone,
after mostly relying on SLIs and other pre builds I took the time to try to compile ja 1.13 for myself. Thanks to haydent and Kitty I even succeeded with producing a working executable file. I compiled rev 8926 from 1.13 Trunk link first post with VS2019 on Windows 10 and while this was successful after starting the newly generated ja.exe it presented me with an alleged build number of 8900. Since I have another SLI build from a polish forum that clearly stated 8922 as revision after starting, I was wondering where/how I lost 26 revisions ;). Maybe it's just a standard setting/configuration that doesn't really matter but since there are other builds with higher rev declarations it got me worried never the less. Therefore did I do something wrong, or is this "normal" behavior.

Best regards and thank you all for still supplying this great game with new content.

EDIT: Ok, to answer my own question to a certain point, the number seems to be generated from GameVersion.cpp which was last updated in Version 8900 (Silversurfer) and not in any of the recent updates from Sevenfm. Therefore my build number makes sense, however it somewhat confuses a newbie like me ;). Since any changes since then are only modifications to preexisting files I can assume that I don't need to manually add any includes to get the full feature set of rev 8926. If I'm mistaken, please correct me.

[Updated on: Sun, 07 February 2021 23:28]

Report message to a moderator

Private
Re: Quick Guide for Compiling and Debugging Source Code in Visual Studio[message #362332 is a reply to message #362331] Sun, 07 February 2021 23:41 Go to previous messageGo to next message
Deleted.

 
Messages:2662
Registered:December 2012
Location: Russian Federation
Version that the game shows you at the start doesn't mean anything, it's just a text in the code which is changed from time to time and often is outdated.
The code that you update from official svn is the most recent.
You don't need to manually change anything except initially set up out dirs and change mode to release from debug.
As for Polish version, it's better to ask on Polish forum, maybe they change version number in their own source copy for convenience when compiling, I don't know.



Left this community.

Report message to a moderator

Lieutenant

Re: Quick Guide for Compiling and Debugging Source Code in Visual Studio[message #363031 is a reply to message #301086] Wed, 28 April 2021 06:33 Go to previous message
Kitty

 
Messages:465
Registered:October 2017
Location: Germany
The image-server where I uploaded my screenshots seems to be down sometimes. Until today, this was only temporarely and they have shown up again the next day. In case you came arround on a day they aren't shown, or the image-server is finally giving up, you can find those screenshots also here:

Screenshots Compiling Guide

[Updated on: Wed, 28 April 2021 06:34]




How to get: latest 1.13, 7609 and more | 7609 SCI (eng) | Compiling+SVN

I need more details. (Didi Hallervorden)

Report message to a moderator

Master Sergeant
Previous Topic: Jagged Alliance Deadly Games Mercs with all speech for 1.13
Next Topic: The king is dead! long live the king! (v1.13 GitHub)
Goto Forum:
  


Current Time: Thu Jul 18 12:10:02 GMT+3 2024

Total time taken to generate the page: 0.01598 seconds