Friday, 7 August 2015

Console programming in Windows

I'm planning a new roguelike with ascii text in a console window. I guess curses is the only library available as cross-compiler solution and for some reason I didn't want to go there. Rather than using any libraries I started to investigate the possiblity to use Windows native console API.

I've only taken the first step and found out that you actually can set the console windows size other than default 80x25 from within the program. It's an important step, because I plan to make the size static, possibly smaller than 80x25.

The next step is a gui class to restrict all that ugly Windows API code in one class if there ever is need to change that to something else or port the game to other platforms. My prediction is that creating the gui is going to take some time because WinAPI, but once it's done it will be easier than working with graphical roguelikes as I've done this far.

This time I'm also going to use external script files, unlike in my current projects with only C++ data structures. In scripting I don't see any other advantages but "default" values which means you only have to write the data that is different from default type. Some people say it's good that you don't have to recompile the project to change data, but I think it's a non-issue in a modern IDE where only files that were changed are compiled.

The gameplay idea I have for this project is quite simple, so we are not talking about a major roguelike. If I can get the gui and parser for data done before abandoning the project it may be finished some day.

No comments: