Author Topic: Building for Windows in 2021  (Read 729 times)

Monsieur OUXX

  • Mittens Vassal
  • Cavefish
  • Mittens Half Initiate
    • I can help with proof reading
    • I can help with translating
    • I can help with voice acting
    • Monsieur OUXX worked on one or more games that won an AGS Award!
    •  
    • Monsieur OUXX worked on one or more games that was nominated for an AGS Award!
Building for Windows in 2021
« on: 02 Sep 2021, 18:18 »
I want to build the SDL2 branch of the Engine on Windows 10.

I'm following those instructions : https://github.com/adventuregamestudio/ags/blob/master/Windows/README.md

Here is what I've tried :

1. Open Visual Studio 2019
2. Clone repository : https://github.com/adventuregamestudio/ags.git
3. VS asks me if I want to convert the project to VS2019. I say yes.
4. Switch to branch ags3--sdl2
4. Open solution 'Engine'
5. Download SDL2 from https://www.libsdl.org/download-2.0.php ( SDL2-2.0.16-win32-x86.zip ) , unzip it to a random folder
6. In project Engine.App, set the path to SDL2's include folder as shown here : https://lazyfoo.net/tutorials/SDL/01_hello_SDL/windows/msvc2019/index.php
7. In project Engine.App, set the path to SDL2's lib folder as shown here : https://lazyfoo.net/tutorials/SDL/01_hello_SDL/windows/msvc2019/index.php
8. Download glext.h from here ( https://www.khronos.org/registry/OpenGL/api/GL/glext.h ) and put it in SDL's include folder for convenience. EDIT: I don't know if it's still needed
9. Download SDL_sound from here ( https://hg.icculus.org/icculus/SDL_sound/archive/997e90562b35.tar.gz ). Unzipped it to a random folder. In project Engine.App, set up the path to SDL_Sound's include folder.


Clean the solution , rebuild the solution.

No compilation error, but linking error : SDL_sound.lib cannot be found.
It's not in the prebuilt package : https://www.dropbox.com/s/3vdq7qw01tdtfux/ags-prebuilt-libs-3.5.x.zip?dl=0

How do I get SDL_sound.lib ?
In the past I've built it myself but I cried so many tears of blood trying to download the dependency of the dependency of the dependency for whatever many libs that I'm not doing it again.
« Last Edit: 02 Sep 2021, 19:03 by Monsieur OUXX »
 

Monsieur OUXX

  • Mittens Vassal
  • Cavefish
  • Mittens Half Initiate
    • I can help with proof reading
    • I can help with translating
    • I can help with voice acting
    • Monsieur OUXX worked on one or more games that won an AGS Award!
    •  
    • Monsieur OUXX worked on one or more games that was nominated for an AGS Award!
Re: Building for Windows in 2021
« Reply #1 on: 02 Sep 2021, 22:22 »
Despite the end of my post, "just suck it up and build the library yourself" is an acceptable answer. I just want to be sure that it's not just lying around somewhere.
 

eri0o

Re: Building for Windows in 2021
« Reply #2 on: 03 Sep 2021, 10:17 »
I don't know what you are doing or want to do, but, some observations:

  • master branch is ags3 with sdl2 backend
  • latest release of master branch includes a zip file with Windows Visual Studio project Dependencies pre-built
  • If you don't use VS, but you have it installed, you can also just use CLion and it will magically download and prebuild all dependencies - again, for VS pre-built everything is on GH release if you need

Right, we also have environment variables you can set (for your user on Windows) to point where the pre-built of each library is in your system.

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: Building for Windows in 2021
« Reply #3 on: 03 Sep 2021, 10:39 »
4. Switch to branch ags3--sdl2

"ags3--sdl2" was a temporary branch where we prepared SDL2 version, and it was long since merged into the "master" branch, which I recommend to use now.
It's quite possible that its README is also very much outdated.
The old branch should be deleted, as it's no longer necessary.

6. In project Engine.App, set the path to SDL2's include folder as shown here : https://lazyfoo.net/tutorials/SDL/01_hello_SDL/windows/msvc2019/index.php
7. In project Engine.App, set the path to SDL2's lib folder as shown here : https://lazyfoo.net/tutorials/SDL/01_hello_SDL/windows/msvc2019/index.php

If you will be using current "master", I recommend to set up user's enviroment variables instead of modifying the projects, as the opensource projects are shared among all users and should not normally contain absolute paths. You will find more detailed instructions with links to microsoft docs in the recent README: https://github.com/adventuregamestudio/ags/tree/master/Windows#building-ags-engine

latest release of master branch includes a zip file with Windows Visual Studio project Dependencies pre-built

For the reference, here's latest release page: https://github.com/adventuregamestudio/ags/releases/tag/v.3.6.0.8
The prebuilt package is called "WinDevDependenciesVS.zip", here's direct link: https://github.com/adventuregamestudio/ags/releases/download/v.3.6.0.8/WinDevDependenciesVS.zip
We should update instructions in the readme to either directing to the same package or mentioning where to get one.
« Last Edit: 03 Sep 2021, 10:44 by Crimson Wizard »

Monsieur OUXX

  • Mittens Vassal
  • Cavefish
  • Mittens Half Initiate
    • I can help with proof reading
    • I can help with translating
    • I can help with voice acting
    • Monsieur OUXX worked on one or more games that won an AGS Award!
    •  
    • Monsieur OUXX worked on one or more games that was nominated for an AGS Award!
Re: Building for Windows in 2021
« Reply #4 on: 03 Sep 2021, 11:58 »
"ags3--sdl2" was a temporary branch where we prepared SDL2 version, and it was long since merged into the "master" branch.
OK cool, didn't know that.


I recommend to set up user's enviroment variables instead of modifying the projects
Yes, I'll do that. For now I just want to see if I can compile at all.


For the reference, here's latest release page: https://github.com/adventuregamestudio/ags/releases/tag/v.3.6.0.8
The prebuilt package is called "WinDevDependenciesVS.zip", here's direct link: https://github.com/adventuregamestudio/ags/releases/download/v.3.6.0.8/WinDevDependenciesVS.zip

New questions
1. Do the releases always have a Dependencies package released? If yes then maybe the readme should just say "Go to the latest version's forum thread".
2. What about Native? Is it still used at all or has it finally been ousted? (no need to give details, just yes or no)
3. What about the Compiler solution? Can it just be compiled out of the box? Is it simpler to grab the DLL from the latest AGS release? where do we get the .h files when compiling NoNative?
 
« Last Edit: 03 Sep 2021, 12:27 by Monsieur OUXX »
 

eri0o

Re: Building for Windows in 2021
« Reply #5 on: 03 Sep 2021, 12:21 »
The WinDevDependenciesVS.zip package is really recent, it was added on last version - I got a new PC and had to configure it so decided to add it (and we had a ticket on the issue tracker for it). We could add a bootstrap script (to set-up dev environment) and I honestly planned on adding one after the package was included in releases, but I am in the midst of too much homework (studying coding stuff) and had zilch time. :/

Monsieur OUXX

  • Mittens Vassal
  • Cavefish
  • Mittens Half Initiate
    • I can help with proof reading
    • I can help with translating
    • I can help with voice acting
    • Monsieur OUXX worked on one or more games that won an AGS Award!
    •  
    • Monsieur OUXX worked on one or more games that was nominated for an AGS Award!
Re: Building for Windows in 2021
« Reply #6 on: 03 Sep 2021, 12:25 »
The WinDevDependenciesVS.zip package is really recent, it was added on last version - I got a new PC and had to configure it so decided to add it (and we had a ticket on the issue tracker for it). We could add a bootstrap script (to set-up dev environment) and I honestly planned on adding one after the package was included in releases, but I am in the midst of too much homework (studying coding stuff) and had zilch time. :/

Have you considered using NuGet in C++? That's slowly becoming a thing. SDL is there.
EDIT: Added more quesiton sin my last post above ^
« Last Edit: 03 Sep 2021, 12:33 by Monsieur OUXX »
 

eri0o

Re: Building for Windows in 2021
« Reply #7 on: 03 Sep 2021, 12:52 »
We use NuGet only for xiph libraries - but it requires Azure Classic for shipping. It's fetch on the pipeline that builds the docker image. But the package above already contains those binaries.

NuGet can't have truly automated releases, a person has to be responsible for it - to actually submit the package. Plus we actually use Docker instead.

There are a bunch of things that won't work with NuGet (found a bug upstream and want to test and fix on AGS? How to do this in a NuGet workflow?) you can see that most MS own repositories use either CMake (and maybe with vcpkg too) or VS Solutions with a bootstrap script. (A bootstrap script is really useful to check for environment build dependencies, like do we have the C++/CLI compiler we need for AGS Native with .NET 4.5 ?)
« Last Edit: 03 Sep 2021, 13:41 by eri0o »

Monsieur OUXX

  • Mittens Vassal
  • Cavefish
  • Mittens Half Initiate
    • I can help with proof reading
    • I can help with translating
    • I can help with voice acting
    • Monsieur OUXX worked on one or more games that won an AGS Award!
    •  
    • Monsieur OUXX worked on one or more games that was nominated for an AGS Award!
Re: Building for Windows in 2021
« Reply #8 on: 03 Sep 2021, 14:51 »
OK that was all gibberish to me but I'll take your word for it.
Did you see the other questions?
 

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: Building for Windows in 2021
« Reply #9 on: 03 Sep 2021, 15:09 »
2. What about Native? Is it still used at all or has it finally been ousted? (no need to give details, just yes or no)

Editor still uses native dll.

3. What about the Compiler solution? Can it just be compiled out of the box?

Which Compiler solution are you refering to, we have two now: Compiler.Lib.sln which makes a script compiler library, and Compiler.App.sln which makes a script compiler frontend (exe).

Is it simpler to grab the DLL from the latest AGS release?

Uhm... I assume that you are refering to AGS.Native.dll? It is simple to take one from a release, but then it means that you won't be able to change this part of the editor; also depending on which version or commit you are building you may run in a situation where Editor requires newer native code and the one got from release is not matching these expectations.

where do we get the .h files when compiling NoNative?

NoNative solution is pure C# and does not require any .h files.
« Last Edit: 03 Sep 2021, 15:22 by Crimson Wizard »

Monsieur OUXX

  • Mittens Vassal
  • Cavefish
  • Mittens Half Initiate
    • I can help with proof reading
    • I can help with translating
    • I can help with voice acting
    • Monsieur OUXX worked on one or more games that won an AGS Award!
    •  
    • Monsieur OUXX worked on one or more games that was nominated for an AGS Award!
Re: Building for Windows in 2021
« Reply #10 on: 03 Sep 2021, 15:32 »
NoNative solution is pure C# and does not require any .h files.
Ah yes duh. Thanks for all the answers! (I don't need to know more about the compiler)