Home » MODDING HQ 1.13 » v1.13 General Development Talk » Quick Guide for Compiling and Debugging Source Code in Visual Studio
|
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
|
|
Kitty |
|
Messages:477
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
|
|
|
|
|
|
|
|
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
|
|
Kitty |
|
Messages:477
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:16Open 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
--
02
--
In preparation to do so, first check if Project ja2 is chosen
--
--
03
--
and check if configuration Release is selected (and while there, check if "win32", right next to it, is chosen as well)
--
--
--
04
--
open drop-down at Tab Project, there click at Properties
--
--
05
--
Quote:Change "Configuration" dropdown to "All Configurations"
--
Click "Configuration Properties" -> General
--
--
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.
--
--
07
--
During the compiling, some intermediate files are created. Those need an output-directory as well.
--
--
08
--
Do check, if configuration type is .exe
--
--
09
--
Quote:Click OK, Save.
--
Confirm changes, click ok to close.
--
--
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".
--
--
[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
|
|
|
|
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
|
|
Kitty |
|
Messages:477
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.
--
--
--
13-18 Preparations for compiling UB and compiling UB
--
13 select build.defines in project ja2
--
--
14 locate UB lines in build.defines
--
--
15 remove double-slash before UB
--
--
16 save changes to build.defines
--
--
17 target name can be edited
--
--
18 tab build - build ja2-UB
--
--
--
19 Debugging
--
19 tab debugging - choose output directory
--
Quote:Click "Configuration Properties" -> Debugging
Change "Working Directory" to you game directory (where ja2.exe is)
--
--
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.
I haven't used debug in VS 2019 so far, can't say more about this. i assume that anybody capable of debugging
might allready know what to do.
--
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
|
|
|
|
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
|
|
Kitty |
|
Messages:477
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.
--
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
|
|
|
|
|
|
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
|
|
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
|
|
|
|
|
Goto Forum:
Current Time: Thu Jan 16 03:39:47 GMT+2 2025
Total time taken to generate the page: 0.01870 seconds
|