Build IVAN with Visual Studio 2017 ?

The Cathedral of Attnam > IVAN Development

# Mar 3, 3:05 am Hide



Would somebody consider giving me some hints as to how one would build IVAN with VS2017 ?

I started with c++ about a year ago and make small projects such as these to improve my skills in programming: (read video description for project details)

While maybe my grasp on game loops, and design patterns got a bit better, I'm still lagging behind when it comes to actually building a project - I'm very anxious to make this work on the IDE I use and so I'd be really, really grateful if somebody would lend me a hand with this !

EDIT: I forgot to also ask this: would making the source code work on VS 2017, somehow brake "stuff" ?, like generate bugs where there wouldn't be in the first place?
# Mar 3, 4:59 am Hide


Hey RustKnight, I've been thinking about this and I vaguely remember that either or both of the 0.50 source or CVS source has an msvc project packaged with them, which you could try opening. I don't know if they are live but if so, they could be good starting points.

Another strategy could be to start with the CVS source since it only relies on SDL, which should be straightforward to set up.

The community version on GitHub uses CMake to prepare makefiles. I wonder if it can produce makefiles for Visual Studio?

These are all just guesses at the moment, I'll need some more time to search around for answers, I'll have a look early tomorrow.

EDIT: in answer to your question, no it won't break stuff. If VS is configured correctly and has all the right dependencies, then it should compile no problems. Getting there will most likely not be trivial, but it won't be impossible
# Mar 3, 11:24 pm Hide


Hey RustKnight, you're in luck! I have been tooling around with Visual Studio Express 2013 for Windows Desktop (available here in m$ "hard-to-find" section):

I used the "Concurrent Version System" version of IVAN, purported to be the last version the original devs worked on, linked here:
Download the source, which is ivan-cvs.tar.gz (you can unzip this using 7zip). I unzipped it somewhere with a handy folder name like C:\ivan-cvs

Then I downloaded SDL 1.2 (not SDL 2.x) from here:
I downloaded the for Visual C++. I unzipped this folder into C:\ivan-cvs and re-named it just "SDL" (so now I have a folder located here: C:\ivan-cvs\SDL

Next I opened the IVAN.dsw (found in C:\ivan-cvs) with Microsoft Visual Studio Click OK and it does the conversion step automatically, it will say it's no longer backward-compatible but you can ignore this.

IMPORTANT STEP: Once in Visual Studio, my very first step is to change the "Solution Configuration" in the drop-down menu to "Release"

Next I followed the incredibly well written SDL setup steps from
These steps are the same for SDL1.2 as they are for SDL2.0, except you should use SDL where they write SDL2 etc
Other changes were: I used absolute paths for the location of SDL, both the header files (where SDL.h is found) and the library files (where SDL.lib and SDLmain.lib are found)
IVAN is a little bit different in that the "Main" project (ivan.exe) is dependant on "FeLib" (a.k.a. the "Fatal Error" library - the original devs' custom C++ library). Simply follow the same configuration steps to both Main and FeLib. For instance, for FeLib, the Additional Dependencies can be found under "Configuration Properties- > Librarian -> General" and you can add


(This contrasts with Main, where this is done under "Configuration Properties- > Linker -> Input", as per the instructions in the SDL setup guide I linked).

You can press F7 now to build, but you will get errors. I made them go away by doing the following:

1. Added _USE_32BIT_TIME_T to "Preprocessor Definitions" which I found under Alt-F7 "Configuration properties -> C/C++ -> Preprocessor"
2. Added WIN32 and _WIN32 to Preprocessor Definitions (this seemed not ti fix anything, but I did this for superstition)
3. Replaced #include "afxres.h" with #include "windows.h" in Ivan.rc (seemed to overcome the "afxres.h not found" error, thanks to this answer here:
4. I used absolute paths for SDL.lib and SDLmain.lib, like so:

Then I pressed F7 to compile and build. It magically builds IVAN.exe located at C:\IVAN-cvs. If you click on it to run, you will get another error saying SDL.dll not found. Copy SDL.dll from C:\IVAN-cvs\SDL\lib\x86 to the folder where IVAN.exe is and then open IVAN again. It will run the game.

Please let me know if you get stuck and I will see what I can do to help. If you're unsure about my VS configs, I can post screenshots if you like

Corollary: I wonder if Appveyor does Visual Studio builds in the cloud??
# Mar 4, 1:51 am Hide


Thank you for all the richly described instructions Fejoa!
I'm sure now with all that help, I will be able to make it run - I'll start tinkering on the game source. If after some months I become more comfortable with the source code and understand it's architecture, I'll for sure tag along on Github and help out with bugfixes where I can.

Speaking of architecture - I can clearly see it's object orientated, but does it uses any Design Pattern consecrated in the gang of four ? How would you describe the game engine ? Tidy, logical, neat ? Has a good structure in the big picture ?

I imagine, given with such a huge numbers of features and mechanisms interacting with each other, that one would simply NEED to have a good structured game engine to properly scale the complexity and numbers of features.

Anyway Fejoa thank you very much for time you spent on the post, and thank you for believing me This will prove invaluable in my self-learning programming journey! I'll post a reply here saying how it went with VS. (I'm sure trying it out with VS2017, shouldn't be a problem).

PS: yes, I'm actually fine with just using the last version of the original DEVs - this version and the latest github version, I would imagine they aren't that different architecture/codewise ?
# Mar 4, 10:41 pm Hide


While tooling around with the configs a bit more, I figured you can set relative paths in VS Express 2013 like this:


So no need for those absolute paths I mentioned earlier. I think VS 2017 will allow you to evaluate the expression in a window below so you can check the result is what you expect.
# Mar 27, 2:10 am Hide


So I managed to get to the final steps - added libraries and all, and everything seems to go long nicely.
The only 2 errors that still persist are the ones you see in the screenshot. Any ideas why I hit them ?
# Mar 27, 2:28 am Hide


Hm - actually there seems to be errors also in the source files of IVAN - they seem to be missing some includes....
# Mar 28, 6:30 pm Hide


Let's try fix the first thing first. I actually remember seeing this error, but I don't remember how the hell I fixed it. The message about '>>' operators might be related to the size of int64 a la:
You need to tell Visual Studio the whole code needs to be handled as 32 bit.

Did you follow these steps?

1. Added _USE_32BIT_TIME_T to "Preprocessor Definitions" which I found under Alt-F7 "Configuration properties -> C/C++ -> Preprocessor"
2. Added WIN32 and _WIN32 to Preprocessor Definitions (this seemed not ti fix anything, but I did this for superstition)

It could be that step 2 helped me overcome the compile error after all. Here are my settings:

Under preprocessor definitions (Configuration->C/C++->Preprocessor) for Main, I have:


and for FeLib, I have:

Have a look in the attached pictures. Let me know if it helps or not
# Jun 6, 11:49 pm Hide


Some work has recently been done by someone on this: