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

Update project to msvc143 (aka Visual Studio 2022) #30

Merged
merged 40 commits into from
Jul 21, 2022
Merged

Update project to msvc143 (aka Visual Studio 2022) #30

merged 40 commits into from
Jul 21, 2022

Conversation

stevewgr
Copy link
Member

@stevewgr stevewgr commented Jul 14, 2022

Decription

The following PR apart from doing some house keeping, it mainly upgrades the old compiler version to latest MSVC143(aka Visual Studio 2022).

Solution files for Game, Server and Tool were created as separated pieces.

Additionally some build optimizations were enabled to make the project build much faster than before thanks to precompiled headers.

Pattern: (typedef\s+)(.*>::)
Tokens: $1typename $2
There are few limitations with the way the engine is designed and
tightly coupled with other projects.
In an ideal situation all engine sources would have been built as a
separate library that will be consumed by other projects. However some
sources in the engine are not included part of the workspace project of
N3Base because they include files from game and such.
This design is terrible, because it should be decoupled from the rest of
the projects.
Therefore StdAfxBase.h precompiled header was removed from the project
in favor of StdAfx.h assuming every project that includes sources from
engine will compile with a precompiled header called StdAfx.h.
In the future we'll decouple things better, where it will be a completely
separate project with its own precompiled header which will be more
efficient in the long run.

Also remove diagnostics MFC code from engine as first step for
decoupling this project.

Pattern: #ifdef\s+_DEBUG\s*[\n\r]#undef THIS_FILE[\n\r].*[\r\n].*[\r\n]#endif[\r\n]\s
Tokens: empty
+ Optimize precompile header to make it build in less than a minute.
+ Delete old project files.
+ Create an external solution file.
+ Remove old project files.
+ Rename properly to AIServer including resources.
+ Update precompiled header.
+ Few fixes to adapt to latests msvc143.
+ Update gitignore.
Note that on Unix systems it will cause an error.
Note that there are much better ways of doing this with modern compilers.
This also causes annoyance during development where game depends on MFC
stuff, when in fact it doesn't.
We don't need these in 2022 and there are better ways of doing this.
+ Fix silly warnings / mistakes.
Generally to improve debugging experience in debug mode and also to make
sure we explictly not rely on important properties' defaults.
Don't ask why...compiler explodes on CMagicProcess::MagicPacket where it
excutes all types of magic. I think it gets confused by the amount of
branches this function produces when compiling and when removing the
group of switch cases there, it compiles.

So temporarily we disable optimizations, even though in Release mode and
it will be fixed once we do refactoring to this implementation.
Pattern: [r\n]#ifdef _AFXDLL[\r\n].*Enable3dControls.*[\r\n].*[\r\n].*Enable3dControlsStatic.*[\r\n].*[r\n][r\n]
Tokens: empty
@stevewgr stevewgr marked this pull request as ready for review July 21, 2022 21:47
Copy link
Contributor

@GiRx8 GiRx8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 would we still be required to use the build.cmd as I see it’s still there?

@stevewgr
Copy link
Member Author

👍 would we still be required to use the build.cmd as I see it’s still there?

The build.cmd is for convenient. Before it was useful since we had to set the old compiler explictly, now it's just for CI/CD.

@GiRx8
Copy link
Contributor

GiRx8 commented Jul 21, 2022

👍 would we still be required to use the build.cmd as I see it’s still there?

The build.cmd is for convenient. Before it was useful since we had to set the old compiler explictly, now it's just for CI/CD.

Alright.

Copy link
Contributor

@UTengine UTengine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks clean, will have to get used to it

Copy link
Contributor

@UTengine UTengine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks clean, will have to get used to it

@stevewgr stevewgr merged commit 7c09c9c into master Jul 21, 2022
@stevewgr stevewgr deleted the vc143 branch July 21, 2022 22:20
stevewgr added a commit to ko4life-net/ko-vendor that referenced this pull request Jul 21, 2022
With the following changes: ko4life-net/ko#30
we no longer depend on it anymore.
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

Successfully merging this pull request may close these issues.

None yet

3 participants