Structure of Commander Genius 2.0

All discussion about the Commander Genius project (a Keen interpreter + more).
Post Reply
gerstrong
Vorticon Elite
Posts: 1244
Joined: Wed Dec 31, 2008 14:44
Location: Frankfurt - Germany
Contact:

Structure of Commander Genius 2.0

Post by gerstrong »

Yeah, I already have plans for that and for version 1.8 of course.

Some of you might have seen the massive amount of commits lately, thanks to some free time I have had, but let's get to the topic.

Since Galaxy Engine is pulling pretty well on CG, and it came out with the goal to get it working rather than take the time and have a clean code structure, which in some parts I regret, I always felt the need to go the first way around. On the otherside you have to ask yourself, how could you get something done with a good structure, if the thing you want to get done really won't work. It wasn't certain, that galaxy engine would pull off that well.

In 2009 when I had the wish as others to get CG support Keen 4-6 I really had my doubts if it was possible. I had no idea of how to decompress the game data and so on, but we or I learned. I have to admit, I wasn't really ready to programm a game like this, it needed some time and help of others like Napalm, Lemm, Pickle, NY00123 to mention some of the great guys here around. I'm really greateful, that most of the hacking through this community and Keen::Modding was possible and done over all these years.

We still had components missing in order to get a working galaxy engine, but still, other people had done it before. Too bad, those projects got forgotten, but they were flawed or maybe too limited, I don't know exactly. Every one of these has his own history. So I thought we need to get this done!

Why am I creating a new structure this time and what development approach am I aiming?

Well, let's get the reason for that out of the way:

- I want more people get involved into CG
- A lot of work has been invested and should honored better
- I want to extend CG to other new levels of excitement

How can this be done?

- A good community. This PCKF and Keen:Modding is already a base. Fans of games like these is in my opinion a good base.
- An awesome game. Keen is awesome. It is a 2D platformer and pretty much self explanatory. Good condition to go forward.

But there are some missing points I need address:

- Structured code will win the interest to more people, as they will want to read more than understand bad variable names and get lost in huge amount of neverending files. On that point I need to work a lot on that aspect and hopefully for CG 2.0 it will be completed
- New game engines. Better structured code will allow more game engines and more interested to let people add something new
- Documentation. I need to write more on this. There are parts of doxygen stuff but we need more and other documents to explain what is going on.

So here it goes. I created a structure I'm planning for now. The version, maybe 1.8 or another between will use parts of that and hopefully in 2.0 it is completed.

I'm not trying to rewrite CG. When CloneKeenPlus was renamed to Commander Genius I think it was worth due the lacks it had and the fewer lines of code that were found. The risk to implement new bugs is to high for me. So I will be slowly transferring code, changing names, splitting up classes and so on, with active testing.

This approach is similar to what the KDE developers are doing for the next generation of their projects. I think it makes sense going that way.

Image

GsKit is a code base that will be compiled to either a dynamic or static lib and then linked to the Commander Genius executable. It's task is to provide the service you see here. I left network out, because nothing has been done yet on that part, but it will be added after more cleanups. Yeah the code for that GsKit already exists, but it floats in the source code of CG somewhere around. I want to have it a bit more independent and use it as like a service for game engines, taking care of the hardware, OS and user interaction. The will represent tools for getting a game like Keen ones run. I also want to use more tablet and phone features in this Kit. The keen games have to stay independent of that mostly.

Special about this one is the main cycle a game needs. It tries to provide good performance you need for games and separates some tasks there. I will document more about that in future.

Commander Genius itself will have a collection of engines to run. That way CG will concentrate only on the level management, physics, enemy AI, story features, and so on. All the hardware management and everything outside that scope needed will be provided the GsKit library.

In the posted picture the blue rectangles called "Launcher", "Vorticon", "Galaxy" and "Maybe your game?" are engines created in Commander Genius. GsKit provides a small base for it.

The Launcher is started when you start the app and see some games at first glance. Then the user chooses one game and the launcher will trigger an event to start the appropiate engine was the game together. Only one engine at a time will be running. Keenengine is parent of Vorticon and Galaxy and will hold some common stuff between those engines, nothing else.

I like that architecture, because there are plans to support more games and let people write their own games using it. A lot has to be done, but I think it is worth and will enhance the code quality.

About interpreting EXE files, I still am not clear if really to support that feature. Doing so would make Commander Genius more like Dosbox. I'm not sure, if that's a good idea or even wanted by everybody. I still believe that we should do something more by our own. Maybe within the engine I will put a mini VM or something to make it happen. For enemy AIs it would spectacular and it would enhance the experience with some mods even more.

Now its your turn! Write an opinion about this topic :-). I'm interested to read, what think about it.
Having fun developing stuff...
User avatar
Roobar
Vorticon Elite
Posts: 3267
Joined: Tue Jan 08, 2008 16:12
Contact:

Post by Roobar »

With the KeenEngine, are you referring to the K1n9_Duk3's keengine?
gerstrong
Vorticon Elite
Posts: 1244
Joined: Wed Dec 31, 2008 14:44
Location: Frankfurt - Germany
Contact:

Post by gerstrong »

No. There were plans to integrate it, but it wont happen. It is just a base for common stuff between both of the engines.
Having fun developing stuff...
Post Reply