Jump to content

Is OpenJK meant to be so C90?


MXXIV

Recommended Posts

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.

Link to comment

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

Smoo and Circa like this
Link to comment

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
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...