Project Perfect Mod Forums
:: Home :: Get Hosted :: PPM FAQ :: Forum FAQ :: Privacy Policy :: Search :: Memberlist :: Usergroups :: Register :: Profile :: Log in to check your private messages :: Log in ::


The time now is Fri Nov 08, 2024 4:34 am
All times are UTC + 0
Quick Guide on How to compile the DLLs on Visual Studio
Moderators: Global Moderators
Post new topic   Reply to topic Page 1 of 1 [26 Posts] Mark the topic unread ::  View previous topic :: View next topic
Author Message
Banshee
Supreme Banshee


Also Known As: banshee_revora (Steam)
Joined: 15 Aug 2002
Location: Brazil

PostPosted: Tue Jun 02, 2020 5:37 am    Post subject:  Quick Guide on How to compile the DLLs on Visual Studio Reply with quote  Mark this post and the followings unread

The TiberianDawn.DLL and RedAlert.DLL are the files that determine the way Tiberian Dawn and Red Alert runs respectively in the C&C: Remastered Collection. It defines the behavior of the characters, gameplay, physics, and AI.

The first step to modify these files is to access its source code. In order to do that, download the latest source code at EA's GitHub:

https://github.com/electronicarts/CnC_Remastered_Collection

The next step is getting something that will be able to compile it. The free solution we can offer is Visual Studio Community 2017 or 2019. The 2017 can be downloaded at the link below:

https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community&rel=15

Run the installer and make sure you check the C++ desktop development workflow, at the individual components, make sure you check Visual C++ ATL for x86 and x64 and Visual C++ MFC for x86 and x64. I am not sure if the C++ game development workflow is a requirement, but I would check that too.

Once you finish installing it, run the solution file CnCRemastered.sln that is in the root of the source code directories. If you proceeded so far, you will be able to compile both game DLLs out of the box.


Start your engines and good luck!


Key Words: #Tutorials #CommandAndConquerRemastered #RedAlertRemastered #CnCRemasteredCollection 

Last edited by Banshee on Thu Jun 11, 2020 7:17 am; edited 5 times in total

Back to top
View user's profile Send private message Visit poster's website Skype Account
alphanon
Guest




PostPosted: Thu Jun 04, 2020 8:17 am    Post subject: Build error Reply with quote  Mark this post and the followings unread

I cloned the repository with VS 2019. I am getting two errors when trying to build this solution.

The command "ml.exe /c /nologo /Zi /Fo"Win32\Release\TOBUFF.obj" /W3 /errorReport:prompt  /Tawin32lib\TOBUFF.ASM" exited with code 1. TiberianDawn C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\BuildCustomizations\masm.targets


The command "ml.exe /c /nologo /Zi /Fo"Win32\Release\LCWCOMP.obj" /W3 /errorReport:prompt  /TaLCWCOMP.ASM" exited with code 1. RedAlert C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\BuildCustomizations\masm.targets


I did re target this solution to VS 2019 and Windows SDK 10. Please help.

Back to top
Banshee
Supreme Banshee


Also Known As: banshee_revora (Steam)
Joined: 15 Aug 2002
Location: Brazil

PostPosted: Thu Jun 04, 2020 8:40 pm    Post subject: Reply with quote  Mark this post and the followings unread

Did you copy the entire message? Sometimes the error goes beyond it. And with what you've posted so far, it is hard to figure out where is it messed up.

Back to top
View user's profile Send private message Visit poster's website Skype Account
Hambo-Kun
Civilian


Joined: 05 Jun 2020

PostPosted: Sat Jun 06, 2020 11:17 am    Post subject: Reply with quote  Mark this post and the followings unread

Hi, everyone

I'm struggling to create the DLL files for Tiberian Dawn, i have opened CnCRemastered.sln made some changes, now how do i get is as dll file for Tiberian Dawn?

Back to top
View user's profile Send private message
Banshee
Supreme Banshee


Also Known As: banshee_revora (Steam)
Joined: 15 Aug 2002
Location: Brazil

PostPosted: Sat Jun 06, 2020 4:08 pm    Post subject: Reply with quote  Mark this post and the followings unread

By default, these vcxproj are set to generate the DLL files instead of the executable, so, you can always get the original ones back and even compare them with your files using a program like Meld.

Back to top
View user's profile Send private message Visit poster's website Skype Account
Guest





PostPosted: Sat Jun 06, 2020 9:13 pm    Post subject: Reply with quote  Mark this post and the followings unread

Banshee wrote:
By default, these vcxproj are set to generate the DLL files instead of the executable, so, you can always get the original ones back and even compare them with your files using a program like Meld.


Thanks for the response, i've seen the vcxproj but i can't locate the actual DLL? do i have to build the solution trhough the vxcproj file?

Back to top
Hambo-Kun
Civilian


Joined: 05 Jun 2020

PostPosted: Sat Jun 06, 2020 9:15 pm    Post subject: Reply with quote  Mark this post and the followings unread

Banshee wrote:
By default, these vcxproj are set to generate the DLL files instead of the executable, so, you can always get the original ones back and even compare them with your files using a program like Meld.


Thanks for the response, i've seen the vcxproj but i can't locate the actual DLL? do i have to build the solution trhough the vxcproj file?

Back to top
View user's profile Send private message
Banshee
Supreme Banshee


Also Known As: banshee_revora (Steam)
Joined: 15 Aug 2002
Location: Brazil

PostPosted: Sun Jun 07, 2020 6:58 am    Post subject: Reply with quote  Mark this post and the followings unread

The sln file loads the vcxproj, so if you build the project, you build the vcxproj. If you build the solution, you build both vcxprojs (TiberianDawn and RedAlert).

Anyway, the output is stored on the vcxproj file in two different sections. In TiberianDawn one, it looks like this:

Code:
  <PropertyGroup Label="Globals">
    <ProjectGuid>{1380ED08-82A3-49C2-A171-1915574B3382}</ProjectGuid>
    <Keyword>Win32Proj</Keyword>
    <RootNamespace>TiberianDawn</RootNamespace>
    <SccProjectName>SAK</SccProjectName>
    <SccAuxPath>SAK</SccAuxPath>
    <SccLocalPath>SAK</SccLocalPath>
    <SccProvider>SAK</SccProvider>
    <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
  </PropertyGroup>


RootNamespace determines the name of the DLL file.

Code:
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
    <LinkIncremental>false</LinkIncremental>
    <OutDir>..\bin\$(PlatformName)\</OutDir>
    <IntDir>$(PlatformName)\$(Configuration)\</IntDir>
  </PropertyGroup>


So, the OutDir is where it is generated.

It is in the source code dir + \bin\win32\TiberianDawn.dll

Back to top
View user's profile Send private message Visit poster's website Skype Account
Hambo-Kun
Civilian


Joined: 05 Jun 2020

PostPosted: Sun Jun 07, 2020 9:28 am    Post subject: Reply with quote  Mark this post and the followings unread

Banshee wrote:
The sln file loads the vcxproj, so if you build the project, you build the vcxproj. If you build the solution, you build both vcxprojs (TiberianDawn and RedAlert).

Anyway, the output is stored on the vcxproj file in two different sections. In TiberianDawn one, it looks like this:

Code:
  <PropertyGroup Label="Globals">
    <ProjectGuid>{1380ED08-82A3-49C2-A171-1915574B3382}</ProjectGuid>
    <Keyword>Win32Proj</Keyword>
    <RootNamespace>TiberianDawn</RootNamespace>
    <SccProjectName>SAK</SccProjectName>
    <SccAuxPath>SAK</SccAuxPath>
    <SccLocalPath>SAK</SccLocalPath>
    <SccProvider>SAK</SccProvider>
    <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
  </PropertyGroup>


RootNamespace determines the name of the DLL file.

Code:
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
    <LinkIncremental>false</LinkIncremental>
    <OutDir>..\bin\$(PlatformName)\</OutDir>
    <IntDir>$(PlatformName)\$(Configuration)\</IntDir>
  </PropertyGroup>


So, the OutDir is where it is generated.

It is in the source code dir + \bin\win32\TiberianDawn.dll


There is no DLL file there, earlier i rebuilt Tib dawn and i get this error which seems to be to do with in the TiberianDawn.rc

It says in the output
1>------ Build started: Project: TiberianDawn, Configuration: Release Win32 ------
1>Resource\TiberianDawn.rc(10): fatal error RC1015: cannot open include file 'afxres.h'.
1>
1>Done building project "TiberianDawn.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========



vs19 error.jpg
 Description:
 Filesize:  60.1 KB
 Viewed:  185104 Time(s)

vs19 error.jpg



Last edited by Hambo-Kun on Sun Jun 07, 2020 10:45 am; edited 1 time in total

Back to top
View user's profile Send private message
jonwil
Rocket Infantry


Joined: 24 Jul 2005

PostPosted: Sun Jun 07, 2020 11:03 am    Post subject: Reply with quote  Mark this post and the followings unread

If you get an error about afxres.h, open the Visual C++ installer, hit "modify" on your installed copy, go to "individual components" and look for things labeled MFC and install those.

Back to top
View user's profile Send private message
Hambo-Kun
Civilian


Joined: 05 Jun 2020

PostPosted: Sun Jun 07, 2020 11:45 am    Post subject: Reply with quote  Mark this post and the followings unread

jonwil wrote:
If you get an error about afxres.h, open the Visual C++ installer, hit "modify" on your installed copy, go to "individual components" and look for things labeled MFC and install those.


This is what i've got now, so i'll try again.



vs19.jpg
 Description:
 Filesize:  200.66 KB
 Viewed:  185091 Time(s)

vs19.jpg



Back to top
View user's profile Send private message
munkle555
Civilian


Joined: 07 Jun 2020

PostPosted: Sun Jun 07, 2020 2:12 pm    Post subject: Reply with quote  Mark this post and the followings unread

Hey thanks for the post, I have downloaded the software, made a change to udata to add a new unit and tried to build the project but receive 2 errors for each resource the first is C1083 cannot open file and the second is E020 identifier "" is not identified. I can see all the source files within VS with the correct file path property so not sure whats wrong. Any help would be great

Back to top
View user's profile Send private message
CabalCore
Cyborg Soldier


Joined: 23 Oct 2013

PostPosted: Mon Jun 08, 2020 4:16 am    Post subject: Reply with quote  Mark this post and the followings unread

So once you have the dlls. What do you use exactly to edit the units and buildings? And also does it have a rules.ini?

Back to top
View user's profile Send private message
Banshee
Supreme Banshee


Also Known As: banshee_revora (Steam)
Joined: 15 Aug 2002
Location: Brazil

PostPosted: Mon Jun 08, 2020 7:55 am    Post subject: Reply with quote  Mark this post and the followings unread

@Hambo-Kun: With these individual MFC and ATL components selected, hit Install while downloading. Restart the Visual Studio later and if that fails, restart your pc.

munkle555 wrote:
but receive 2 errors for each resource the first is C1083 cannot open file and the second is E020 identifier "" is not identified.


Which file could not be opened? Sometimes the file that could not be opened is exactly the one that has the identifier that is not identified. Make sure you are not running the game when you try to compile the DLL files.

CabalCore wrote:
So once you have the dlls. What do you use exactly to edit the units and buildings? And also does it have a rules.ini?


Rules.ini is for Red Alert only. In TD units are added through Visual Studio as explained in:
https://ppmforums.com/post-586096/step-by-step-on-how-to-create-petroglyphs-nuke-tank-td/#586096

Back to top
View user's profile Send private message Visit poster's website Skype Account
munkle555
Civilian


Joined: 07 Jun 2020

PostPosted: Mon Jun 08, 2020 10:59 am    Post subject: Reply with quote  Mark this post and the followings unread

Banshee wrote:
@Hambo-Kun: With these individual MFC and ATL components selected, hit Install while downloading. Restart the Visual Studio later and if that fails, restart your pc.

munkle555 wrote:
but receive 2 errors for each resource the first is C1083 cannot open file and the second is E020 identifier "" is not identified.


Which file could not be opened? Sometimes the file that could not be opened is exactly the one that has the identifier that is not identified. Make sure you are not running the game when you try to compile the DLL files.

CabalCore wrote:
So once you have the dlls. What do you use exactly to edit the units and buildings? And also does it have a rules.ini?


Rules.ini is for Red Alert only. In TD units are added through Visual Studio as explained in:
https://ppmforums.com/post-586096/step-by-step-on-how-to-create-petroglyphs-nuke-tank-td/#586096


Thanks for the reply, I had to play around with components but I managed to get it to work, Not sure exactly what but I turned on anything relating to C++

Back to top
View user's profile Send private message
CabalCore
Cyborg Soldier


Joined: 23 Oct 2013

PostPosted: Mon Jun 08, 2020 1:35 pm    Post subject: Reply with quote  Mark this post and the followings unread

I want to revert the skirmish AI to it's classic RA counterpart (where is builds a massive base, has defenses and gathers up a huge force and attacks the player or opponent) for both TD and RA. Where would I go to do this?

Back to top
View user's profile Send private message
WadeSullivan
Vehicle Drone


Joined: 24 Aug 2017

PostPosted: Mon Jun 08, 2020 7:17 pm    Post subject: Reply with quote  Mark this post and the followings unread

Well one thing i could make in TD was edit a little the missions in the campaing, but i cant still edit the "build level" for example.
Every mission has a "tech level" but even if you change from 1,2....to 15 (the higher one) the mission is still the same =/

With the DLL files, its possible to change the level from the builds and army?

Back to top
View user's profile Send private message
CabalCore
Cyborg Soldier


Joined: 23 Oct 2013

PostPosted: Sun Jun 14, 2020 7:59 pm    Post subject: Reply with quote  Mark this post and the followings unread

When I get errors in the VS trying to compile the source code, does that mean I need more components?

And also, do I use the VS to edit the dll and mod the game?

Back to top
View user's profile Send private message
Dennis123
Guest




PostPosted: Mon Jun 15, 2020 12:48 am    Post subject: Run the game? Reply with quote  Mark this post and the followings unread

Thanks for your instructions. Got VS2019 to compile the dlls.

But can I actually run the whole game?

Back to top
Dennis123
Guest




PostPosted: Mon Jun 15, 2020 9:57 am    Post subject: Reply with quote  Mark this post and the followings unread

Did some reading - if anybody else has this stupid question of mine:
Only the .dlls were released under the GNU-license. So you have to own (either the original or?) the newly released game in order to exchange the .dlls with the ones you modded. Then, you start the .exe that came with the bought games.

Too bad, would have liked to be able to compile the whole game on my own, but really impressing, how much code there ist for half the game and how long it takes to compile - a game from the 90s!
So, that's where you need all the cores for!

Back to top
Blade
Cyborg Commando


Joined: 23 Dec 2003

PostPosted: Mon Jun 15, 2020 12:49 pm    Post subject: Reply with quote  Mark this post and the followings unread


Back to top
View user's profile Send private message
JonathanvQP
Civilian


Joined: 16 Jun 2020

PostPosted: Tue Jun 16, 2020 4:31 am    Post subject: Compiled RA and TiberianDawn.dll Reply with quote  Mark this post and the followings unread

I own Command and Conquer Remastered edition. I am successful in compiling the source code to produce both the RedAlert.dll and TiberianDawn.dll. Theoretically, I should be able to copy both these newly created dlls to the CnC Remastered directory that has the original RedAlert and TiberianDawn.dlls and run the game successfully.

Unfortunately, it does not work. It produces a huge crash report which I am currently investigating. According to one of the logs, it states that it can't add Data\CutScences.meg etc... The problem is that CutScences.meg does not exist in the CnC Remastered DATA directory!!! Anyone have an ideas??

Back to top
View user's profile Send private message
Remus
Rocket Cyborg


Joined: 14 Apr 2003
Location: North America

PostPosted: Wed Jul 08, 2020 12:32 am    Post subject: Reply with quote  Mark this post and the followings unread

I have been attempting to follow your tutorial here as well as the following tutorial posted in the Steam community:

https://steamcommunity.com/sharedfiles/filedetails/?id=2121564366

I have the Workloads and Individual Components installed that are recommended. To test that my installed copy of Visual Studio can compile correctly, I attempted to build unaltered RA from the source code provided with the game's installation. Unfortunately, I get the errors shown in the posted screenshot. There are a total of 182 errors and 552 warnings, but this screenshot probably shows a sufficient sampling of the errors as they all just repeat the error shown here but with all of the .CPP files. I haven't seen this error posted before, so I do not know its cause. Any assistance in being able to overcome this and compiling the DLLs is greatly appreciated.



RA_Build_ErrorList.png
 Description:
Visual Studio 2017 Error List - Building RA
 Filesize:  107.3 KB
 Viewed:  184281 Time(s)

RA_Build_ErrorList.png



Back to top
View user's profile Send private message
E1 Elite
General


Joined: 28 May 2013

PostPosted: Wed Jul 08, 2020 1:29 am    Post subject: Reply with quote  Mark this post and the followings unread

Keep the files unaltered, those should be in ANSI encoding.

Back to top
View user's profile Send private message
jonwil
Rocket Infantry


Joined: 24 Jul 2005

PostPosted: Wed Jul 08, 2020 9:11 am    Post subject: Reply with quote  Mark this post and the followings unread

It looks like Visual Studio is trying to interpret these files in code page 932 (seems to be some sort of Japanese code page) rather than in the standard English code page it should be using.
I have no clue how to get VS to interpret things correctly though.

Back to top
View user's profile Send private message
Tank677
Civilian


Joined: 13 Aug 2020

PostPosted: Thu Aug 13, 2020 5:01 pm    Post subject: Reply with quote  Mark this post and the followings unread

Well, I am not VS or C++ savvy; but got an interesting one.

Compiling the provided, unchanged source causes RA to immediately crash when it tries to load a game. TD loads fine; however there are some weird crashes with it as well.

One thing I noticed was the compiled DLL was 2 KB smaller than the DLL in the main directory.

Is there a VS setting somewhere that needs to be changed? Game runs fine with the provided DLL in the mods folder.

So far all I do is add the WINDOWS_IGNORE_PACKING_MISMATCH and set it to Windows 10.0 SDK and v142.

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [26 Posts] Mark the topic unread ::  View previous topic :: View next topic
 
Share on TwitterShare on FacebookShare on Google+Share on DiggShare on RedditShare on PInterestShare on Del.icio.usShare on Stumble Upon
Quick Reply
Username:


If you are visually impaired or cannot otherwise answer the challenges below please contact the Administrator for help.


Write only two of the following words separated by a sharp: Brotherhood, unity, peace! 

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © phpBB Group

[ Time: 0.2615s ][ Queries: 16 (0.0145s) ][ Debug on ]