Home » MODDING HQ 1.13 » v1.13 General Development Talk » Code cleanups, how to contribute
|
Re: Code cleanups, how to contribute[message #358929 is a reply to message #358918]
|
Tue, 04 February 2020 19:42
|
|
CptMoore |
|
Messages:224
Registered:March 2009 |
|
|
I have done some more refactorings and I am confident that the new class(es) and moving stuff there is helpful in remove code clones.
Already touched 34 files.
I want to basically move all
if (gGameOptions.fNewTraitSystem) checks into the new SoldierTraits and ProfileTraits classes. That declutters a lot already and remove code clones since it's easier to share code now.
Report message to a moderator
|
Sergeant 1st Class
|
|
|
Re: Code cleanups, how to contribute[message #358948 is a reply to message #358918]
|
Fri, 07 February 2020 03:31
|
|
CptMoore |
|
Messages:224
Registered:March 2009 |
|
|
Here is a patch that introduces VS2019 files and a script that can quickly create new VS files (prepare-vs-files.sh can be run using git bash on windows).
Quote:https://patch-diff.githubusercontent.com/raw/CptMoore/ja2-1.13-source-mirror/pull/2.patch
After that, one can try applying the first batch of code cleanups, includes the new traits file that is added to all VS project files. (only tested VS2019 variant)
Quote:https://patch-diff.githubusercontent.com/raw/CptMoore/ja2-1.13-source-mirror/pull/1.patch
After googling, those github-generated patches might not be subversion compatible, so after an hour of pain I have create 2 hopefully-subversion-compatible patches one can download here:
Quote:https://github.com/CptMoore/ja2patches
The code cleanups are far from finished as one can always improve things, but the general idea of how to consolidate code is already implemented (traits file, 2 classes, naming conventions, patterns on how to use those classes)
Report message to a moderator
|
Sergeant 1st Class
|
|
|
|
|
|
Re: Code cleanups, how to contribute[message #359294 is a reply to message #359273]
|
Sat, 28 March 2020 23:07
|
|
CptMoore |
|
Messages:224
Registered:March 2009 |
|
|
I didnt test all the code the refactorings touched, so there might be stuff breaking, but I also fixed some bugs by removing code cloned that were forgotten when fixing those bugs.
The problem is merging the VS2019 files I also added, might be better to just ignore those and kick em out (or re-create them using the prepare-vs-files.sh script from one of the patches).
Report message to a moderator
|
Sergeant 1st Class
|
|
|
Re: Code cleanups, how to contribute[message #359412 is a reply to message #359294]
|
Sun, 05 April 2020 00:23
|
|
CptMoore |
|
Messages:224
Registered:March 2009 |
|
|
I just saw after was told by the guy who did it, that another VS2019 was already added.
Probably not compatible with how I did it.
Anyway I wouldn't apply my changes anymore.
For this project to allow refactorings, smaller/quicker change cycles would be necessary and that would require some fundamental changes of the project structure to make them go smooth:
- Switch to something like cmake to support VS2005 to VS2019 without having to add new files to each VS project file manually and hoping it somehow works. Right now nobody wants to add files because its a hassle to add them to all VS project files separately (there are project files for 2005, 2008, 2010, 2013, 2017, 2019). That then means some few files grow and grow and grow instead of being split nicely.
- Addition of Continuous Integration (CI), checks if the code properly compiles outside of my dev machine. That way many small refactorings can be more confidently merged, shorting the refactoring cycles even more.
- Switch to git. If someone can use VS to directly commit to github without using extra tools like TortoiseSVN, where a free CI-build system can compile my code before merging into master, then the cycle is even more tightly done and refactorings can be done even more often.
After talking on Discord about it, I see many of the JA 1.13 dev-cycle problems already solved by ja2-stracciatella, so using their git+(travis/)appveyor+cmake setup (https://github.com/ja2-stracciatella/ja2-stracciatella) as a base provides a quick and efficient dev cycle that would benefit everyone.
Sry for this rambling, this is more for the archive if anyone will ever wonder.
Report message to a moderator
|
Sergeant 1st Class
|
|
|
Goto Forum:
Current Time: Mon Jan 20 20:58:05 GMT+2 2025
Total time taken to generate the page: 0.01487 seconds
|