MXXIV Posted March 5, 2019 Posted March 5, 2019 I wanted to fork OpenJK and try to make changes. My aim is mostly improving server management. I also wanted to build a map parser module for myself. However I was really surprised to see that the whole project is written in C90 style, rather than C++. I'm not saying it's inherently wrong at all, just a bit strange for a 2017 project. It also makes derivatives more complicated, given the nasty amount of global variables. So the question essentially is whether moving to more C++ style project is something that is welcome, or if the game is written as C program intentionally and mixing C++ patterns would be bad.
Xycaleth Posted March 5, 2019 Posted March 5, 2019 OpenJK is a cleaned up/slightly modified version of the original code which was written back in 2002 which itself is built on the Quake 3 engine from 1997. C++ wasn’t so popular back then so the vast majority of the code stuck with C89. Some of the newer code written specifically for JKA is in C++ but doesn’t resemble anything you would consider “modern” by today’s standards. I would say adding/writing C++ code for the sake of writing C++ isn’t particularly useful. Unless something benefits from using C++ then there’s not really much need to do so Circa and Smoo like this
MXXIV Posted March 5, 2019 Author Posted March 5, 2019 I didn't know the original source was ever available, I originally thought this is written from scratch. Thanks for explaining. I didn't mean rewriting just for the sake of rewriting, but for example if I were to create map parser dynamic library, I suppose I would be best of rewriting the current parser to OOP. Interfacing scripting APIs, such as lua/python/javascript also probably works better with C++ objects that can be passed to lua. Of course I can just fork the project and do whatever, but I'd be more happy to write code that benefits others as well. Setlec likes this
Circa Posted March 6, 2019 Posted March 6, 2019 You could fork the project and if the OpenJK gents like what they see, I'm sure they'd be willing to merge your stuff into the main project. Maybe. Setlec likes this
Archangel35757 Posted March 12, 2019 Posted March 12, 2019 @@MXXIV ...if you are planning to interface some scripting language, perhaps you should chat with the other OpenJK devs on Discord.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now