Tuesday, 20 March 2018

Follow The Prowler on Github

The procedural style project I've been talking about is The Prowler (project name). I decided to put it on Github:


Although it feels like I entered a rabbit's hole when introducing myself to Git. The process is automated in Visual Studio, but one thing I've not managed to figure out is how to remove .sln and .vcxproj files from the repository. When I look it seems I wrote vxproj to .gitignore, so there is one error. But .sln is in it and VS still wants to include it in the repository. There doesn't seem to be possibility to remove project files from VS project (which does sound a bit weird) same way as you would 'exclude' a file from the project (not in the project, but still exists as a file).

I guess it's ok to include project files for those who use Visual Studio, but if I study git for 34 years it could be possible to learn how to remove those files. It sure feels that nothing comes easy when talking about git, an open source... thing.

Now I begin to understand why open source developers never get anything done. They are just wondering all the time how to do something simple and trying to figure out the exact proper sequence of commands to use.

Wednesday, 14 March 2018

Modules with procedures

Experiences so far from a procedural C++ game project have been somewhat interesting. It's divided into modules which at the moment are Datatype, File, Function (for generic functions), Gui and the main module. Most of the code is in the Gui as you would expect. What I have learned is that procedural code seems to be "shorter" than writing classes, but it looks strangely messy. Maybe it's just that I don't quite know how to write clean looking procedural code.

Another interesting part is the Datatype class where I made a decision to use inheritance which may sound weird in this context. I'm using as much inheritance as I can, for example Rectangle class inherits from both Point and Size classes. And I have a feeling this is how I should have done this in the first place in my other projects as well. Using inheritance in this kind of limited context is easy and doesn't seem to have any problems this far. I had to name generic "Set" functions for Point to "Locate" and for Size "Resize" which is I guess better way to describe them. Using inheritance avoids repeating type of data and code for datatypes.

The graphics engine which is less than 300 lines of code in Gui can already display everything it needs: background tiles and letters with different colors. The next step could be the division of screen to three areas: gameview, message window and stats window.

Sunday, 11 March 2018

My 7DRL plans

I think there is 7DRL season going on at the moment, I'm not sure. While I'm working on my main three projects it could be "fun" to write a smaller game. The problem you have with larger projects is that they become less and less manageable which is something that just happens. For a reason.

I do have a fun plan for this "7DRL" project in which I'm trying to write C++ with procedural style (also known as C) but with some classes where they are the most logical solution. The code is going to be more "modular" as more functions can be stacked in one file, rather than C++ style two files per class.

I wouldn't do this without a great idea for gameplay which I have had for couple of years. For simplicity I'm going to use ASCII graphics with SDL2, similar to what I have in Teemu. In fact I'm probably going to use Teemu's GUI (+fonts) and change it to procedural style.

Another reason I'm doing this is that I really need some time off from my large projects.