Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building on Windows with Visual Studio 2010 #9

Open
Shimmen opened this issue Sep 24, 2020 · 15 comments
Open

Building on Windows with Visual Studio 2010 #9

Shimmen opened this issue Sep 24, 2020 · 15 comments

Comments

@Shimmen
Copy link

Shimmen commented Sep 24, 2020

I got the game+engine building and running on Visual Studio 2010 (Express) and while it wasn't very difficult it did require some steps. I thought I would document the steps here, both to make it public knowledge but also so some things could be fixed in the main repo maybe.

Getting it to work

First of all, in amnesia/src/game/Lux.sln change the following lines:

- Microsoft Visual Studio Solution File, Format Version 12.00
- # Visual Studio 15
- VisualStudioVersion = 15.0.26730.10
- MinimumVisualStudioVersion = 10.0.40219.1
+ Microsoft Visual Studio Solution File, Format Version 11.00
+ # Visual C++ Express 2010

The critical part here is the format version. I did not test building this with Visual Studio 2015 as the actual content of the file suggests might work, but since pretty much everything else in this repo is based around the 2010 version or earlier and the readme explicitly says 2010 I think this makes more sense anyway.

Secondly, depending on your Visual Studio install and possibly other Windows stuff, you might also have to change one line in amnesia/src/game/Lux.rc:

- #include "afxres.h"
+ #include <windows.h>

See this link for an explanation.

Finally, to actually debug and run it from within the IDE, just set the working directory to wherever your copy of the game is installed to. That should be it.

Fixing it

It's probably worth fixing these problems in this repo too. The first thing seems like a bug. The second one should at least be documented somewhere. I can make a pull request.

// Simon

@italodirenzo93
Copy link

Has anyone managed to get the code to compile under VS2019? Curious.

@Shimmen
Copy link
Author

Shimmen commented Sep 25, 2020

Has anyone managed to get the code to compile under VS2019? Curious.

Probably won't be possible without a lot of effort. The game & engine requires a bunch of prebuilt libraries that presumably are compiled in VS2010 and won't necessarily work in later versions due to ABI changes.

But I haven't tried anything, so don't actually know.

fgRuslan added a commit to fgRuslan/AmnesiaTheDarkDescent that referenced this issue Sep 26, 2020
I did it by the instruction at FrictionalGames#9
@noamzilo
Copy link

noamzilo commented Sep 26, 2020

I tried under 2019 with vs2010 compiler and failed due to many missing dependencies. I was just about to quit when I saw this post.
2010 gives me "the selected file is a solution file, but was created by a newer version of this application and cannot be opened"

Changing like you recommend allows it to open, but then again many dependecy errors

@Shimmen
Copy link
Author

Shimmen commented Sep 26, 2020

many dependecy errors

Did you unpack dependencies.zip? It can be found under the HPL2 directory. Just unzip it into a directory of the same name.

Forgot to mention that, sorry.

@noamzilo
Copy link

noamzilo commented Sep 27, 2020

many dependecy errors

Did you unpack dependencies.zip? It can be found under the HPL2 directory. Just unzip it into a directory of the same name.

Forgot to mention that, sorry.

thanks!

This allows compilation to succeed.

then, going to AmnesiaTheDarkDescent\amnesia\redist\Amnesia_Debug.exe

gives another error:

The program can't start because glew32.dll is missing from your computer. Try reinstalling the program to fix this problem.
pressing ok and then
The program can't start because zlibwapi.dll is missing .......
The program can't start because SDL2.dll
The program can't start because DevIL.dll

@Shimmen
Copy link
Author

Shimmen commented Sep 27, 2020

All of these .dll files should be in the game install directory (from steam or whatever). Did you follow the last step:

Finally, to actually debug and run it from within the IDE, just set the working directory to wherever your copy of the game is installed to.

@noamzilo
Copy link

All of these .dll files should be in the game install directory (from steam or whatever). Did you follow the last step:

Finally, to actually debug and run it from within the IDE, just set the working directory to wherever your copy of the game is installed to.

maybe I didn't understand.

Do i need an actual copy of the game? I thought compiling the game IS the copy of the game.

Since this is open-source, I am assuming getting a copy should be free? Where do I get my copy?

Thanks again!

@Mudbill
Copy link

Mudbill commented Sep 27, 2020

No, the game is not free. The source code is freely available. You still need to buy the game to acquire the assets that the game uses to play; like models, entities, sounds, etc.

@orion160
Copy link

orion160 commented Sep 27, 2020

Thank you @Shimmen, compilation succeded under vs2019 with vs2010 toolchain, there should be a post self contained post somewhere indicating how to compile the game.
Also, anyone knows how to stablish a debug enviroment, when i debug errrors the game seems to work bad, i think because it is fullscreen

@Shimmen
Copy link
Author

Shimmen commented Sep 27, 2020

Tip: change the ShowMenu and ShowPreMenu settings to false in the main_settings.cfg under Documents/Amnesia/Main in your home folder, and you will instantly load up a nice debug profile when you run. From there you can change some settings like window size and fullscreen etc. to make it more debuggable.

@italodirenzo93
Copy link

@noamzilo See https://frictionalgames.com/2020-09-amnesia-is-now-open-source/.

TL;DR The game is not free, just the source code. The code on its own does nothing without the game assets such as models, textures, audio, etc. You need to purchase a copy of the game to use these with the source code.

@orion160
Copy link

I think that this issue should close, there is already an explaination of how to compile the game, but the part that i am confused is that 2 days ago they deleted the repo and started with a new initial commit @_@

@dimutch833
Copy link

dimutch833 commented Oct 20, 2020

i get dark descent and machine for pigs for free in epic games store

@orion160
Copy link

orion160 commented Aug 15, 2021

Ehhh, did they change anything, now there is the error of fbxsdk.h?

i compiled it about a year, and now it doesnt work, did they removed the FBX SDK? (by law terms)?

@Mudbill
Copy link

Mudbill commented Aug 15, 2021

@orion160 yes they had to remove the FBX SDK, so it has to be added separately. Unfortunate because good luck finding it from an official source. Luckily you can grab it from one of the many forks that were made of this repo before they removed it 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants