ENSL / NS

Natural Selection mod for Half-life
http://www.unknownworlds.com/ns
GNU General Public License v3.0
42 stars 12 forks source link

Project and solution configurations broken or problematic #70

Closed pierow closed 1 year ago

pierow commented 4 years ago

There's a few configuration issues with the project and solution files that have been around either since the linux updates or since the game was open sourced. Currently only the playtest configurations are working, while the release and debug ones don't build.

I've managed to get a test configuration set up where I can debug ns.dll, but building a debug version of client.dll with visual studio makes hl.exe refuse to load it.

tankefugl commented 4 years ago

I might be able to help on this one. However, we should introduce CI/CD on Windows for VS to ensure it stays consistent. We can use Actions for this.

Is there any additional information on when this started happening? Commit hash or some other clue?

pierow commented 4 years ago

The project has had this issue since I've started on it, so before this ENSL fork. My best guess as to when this started happening is either: A: During fmoraw's fork for linux compatibility - https://github.com/fmoraw/NS/commit/1622255eeb5caa904c65c1cc166f40e05b0ac326 . Looking at the solution configurations prior to this, they are quite different. B: At or before the open source release.

Where I'm at right now is trying to determine A or B, but it might be fair to assume it's A. There's build issues out of the box for the initial release even in VS 2010 for me so I've been looking at fixing those or just moving over the configurations from earlier to troubleshoot the current version.

I've obtained a vcxproj file for another HL mod in development currently, so if you'd like to reference that at all let me know.

I noticed that dev builds from 3.2 and prior didn't include a .pdb for the client.dll, so there may have been issues debugging that in the past, but judging from the file size of client.dll in the official 3.2 release it looks like it was built with some sort of debug information.

tankefugl commented 4 years ago

Ok, that's good to know. We might be able to bisect back to see where it fails, but it might be just as easy to tackle it head-on with a reference .vcxproj file. If you can make this available or point me to it, that'd be good.

There are some issues with the VS solution files as they are right now, such as hard-coded paths. Once we identify why this debug fails and fix it, I am tempted to suggest either a CMake-based build system or to introduce environment variables in the solution to control system specific configurations.

pierow commented 4 years ago

I emailed you the mentioned project file since it's for a mod that isn't open source.

Here's valve's SDK. It has build errors out of the box for me: https://github.com/ValveSoftware/halflife An open source mod that might be of use. I haven't tried building it: https://github.com/maxvollmer/Half-Life-VR

Regarding CMake, OpenAG is a cross platform HL mod that uses it and might be a good reference if we move to that: https://github.com/YaLTeR/OpenAG

After moving the old project configuration settings over from puzl's fork I'm getting a bunch of debug code build errors that weren't being found before so perhaps fixing all of those will generate something usable.

tankefugl commented 4 years ago

Cheers.

I am having problems running NS from develop though, without any code changes I get access violations when creating a server, even with Playtest. Investigating.

pierow commented 4 years ago

I see what you mean about hard-coded paths. I was a few commits behind on my local branch and just tried the dev branch. Gerhard committed a bunch of project files here https://github.com/ENSL/NS/commit/86740805041c0f085672c15aadfcbeb406906dd6 that might be worth reverting to the previous versions.

I am able to build it and start a server at least in windows using the latest dev branch, but I'm still on vs 2017. This is with the playtest - balance disabled configuration. I haven't tried regular playtest. The only time I had access violations was when trying to debug ns.dll and I didn't have all of the debug files in the directory with it.

jirikivaari commented 3 years ago

I haven't really looked into the solution files as I don't use VS studio that much but there's already Makefile to make linux builds.

I know Asmodee got the solutions file to work after changes.

CMake could make visual studio project files for windows and makefiles for linux. Makefile has some changes in, so those would have to be included.

We don't really need the solution files to make windows or macos builds. Linux can do them as well with mingw32 or x86_64-w64-mingw32