As some of you may or may or may not know, I wrote the original library that allowed a seamless port to windows. It was for the original Cataclysm, and was meant to be a proof of concept thing. I expected someone to take it and build their own port of it. It was never meant to be front and center, but I’m glad it has become so. It’s the first time any work I’ve done has become something that actually has some value to it. I’ve licensed it under a plain zlib license (some text at the top of one header file, and maybe a single line at the top of some source files, telling that the license is in the header). This is NOT AT ALL to limit DDA’s access to it, but to separate it from being an actual asset of DDA, and to not have any problems in the future, as I’m working on releasing the source as a stand-alone drop-in replacement for other linux rougelikes/ncurses applications. I’m perfectly willing to work with kevin or whoever on that issue to do what I need to make it as smooth as possible. It will keep the name Catacurses as a tribute to the game that spawned it, and will (eventually) be available at www.catacurses.com.
I’d like the help of someone willing to help me integrate the new version into DDA, as I’ve no experience with git/anything of the like. I still play the game when I have time, but I’ve gotten so used to playing with my console version that I’d like it to be merged simply so I can upgrade versions without having to compile it myself. Now, on to explaining this release a little.
To shine a little light on the performance complaints, it seeemed to me that the ‘default’ windows release was the old catacurse version, rather than the SDL version. I’ve looked over it and it’s been hacked to bits to allow the new wide strings. The new version (non-SDL) blows the current catacurse and SDL both far out of the water.
A major reason SDL seemed so much faster, is that rather than a 25ms timer on movement, it was a 1ms, so essentially it ran 25 times faster. I’ve changed this in the new catacurse so it will act faster as well. What people are calling performance, isn’t actually performance for the most part, it’s just sleep timers. But for real, actual performance, the old version uses GDI, or Graphics Device Interface, which a in-built windows library for handling graphics. So it looks and acts like a console, but is actually a 2D graphics engine that pretends to be one, which isn’t ideal.
A major advancement in the new version, is that it uses a true console window. I’ve made sure it supports XP and up, and after a few days of tweaking it’s very nearly complete. Not having an XP machine has slowed me down a little, as there were some gotcha for XP. The performance of a true console window will be very hard, if not impossible, to ever beat. It’s a core part of the OS, and is meant to be very very fast. It also makes the code much easier to follow, as there are less work-arounds to make it look more like a console, so if you guys ever wish to modify it more, it should be easier to do. Besides using a console window, I’ve went back and re-wrote several functions to perform better. Rather than printing one character at a time for a string, it now prints the whole line. Most all multi-character writes are direct memcpys and memsets directly to the buffer, so that alone improves performance a good deal on all machines. The only downside of using a real console, is that there is a little annoyance when you want to use custom fonts in a console window. I can write a stand-alone tool to help that a little (Optional download), but for most systems you’ll be limited to 2 or 3 fonts. I have it currently set to use the “Lucida Console” font, as it’s available on all sysems XP and up, and has a unicode variant to it as well, which brings us to…
Using a real console window had an unintended bonus, full Unicode support out of the box! Because windows is a multilingual OS, it should support all fonts directly on the console window, with no tweaks needed to accommodate them. This also means support for non-Latin languages such as Chinese, though wider characters may cause issues, but I’m not sure on that front. The only thing that has to be done to the game to get this working, is for the game to switch to using wchar_t as the main string type, which I believe Kevin already said they were going to do, so the newly formed catacursesw library will function with that just dandy.
As for the eventual tileset/SDL/etc version, I’m going back and adding some extensions and exposing a few properties to the logic so people can create other engines with it, whilst still using methods of emulating curses, leaving it up to them how to display the data. I don’t know much about SDL, so I’m afraid someone else will have to be responsible for making any changes to fit in with the new curses. I actually have a half-working version of a DirectX based version of my original curses library somewhere, so I may eventually offer a version of that, but don’t hold out for that. I’d happily work with anyone that wants to make their own display for catacurse, including the person that created the SDL port.
Any comments or requests for the new version should really be posted on this thread. Any questions on the technical side are welcomed as well, either about the new version or the current version.