Showing posts with label libtcod. Show all posts
Showing posts with label libtcod. Show all posts

Thursday, June 04, 2009

New true-color C/C++ roguelike libraries

I recently came across two new roguelike libraries. Both are in an early stage, but are still advanced enough to do the most important : draw colored characters in a window.

The first is tinycurses, a.k.a. "the curses of the future", by EligZero.

Someone finally decided to take curses out of the early 80s and make something usable out of it :P While it doesn't support the whole curses API (and I can certainly not blame his author for that), it brings some new interesting features, the most important being true color support. The nifty thing is that it plans to support both an opengl renderer and a curses renderer, allowing to ease the port of classic roguelikes to the world of true colors, while keeping the telnet compatibility. But it's not simply curses with colors. It has some very innovative features, like the ability to draw up to 7 characters on top of each other. It's a feature that was frequently asked by libtcod users, but I've never been audacious enough to implement it. I'm looking forward to seeing what can be done with it.

The second is even more mysterious and promising, all the more since, as far as I know, it's written by one of the most significant modern roguelike developpers. While libtcod is some kind of layman library (no real const correctness, a very thin OOP design, ...), libneko is intended to use state-of-the-art C++. While it's currently in alpha stage, even less advanced than tinycurses, I definitely keep an eye on it, hoping its authors will sustain the effort.

The good news is that those libraries will help to create even more visually appealing roguelikes. This concurrence is good because libtcod and the roguelike community above all will benefit from it.


Saturday, May 23, 2009

Hardening libtcod 1.5

Progress is being made on the 1.5 branch. The most used modules have been "hardened", which means they shouldn't trigger crashes anymore :
  • console
  • image
  • sys
  • mersenne
  • noise
  • fov
  • path
As planned, those new modules stop your debugger with asserts while in debug mode when anything is wrong or try to do their best to keep the game from crashing in release mode. Note that with some Mingw32 versions, you may have to put a breakpoint in the _assert function so that the assert doesn't exit the debugger.

The new modules should also be more friendly with language wrappers, the assert displaying an error message on stdout instead of crashing when a bad parameter is send to libtcod.


Note that the python wrapper is not up-to-date on the 1.5 branch. No need to try and use it...

I also updated the noise sample so that it uses the subcell resolution.


There are still things to do until a release, but I thing a big part of the work is done and I can plan a first beta release at the end of May or the begin of June... Maybe even before the 1.4.2 release...!


New projects using libtcod

Here are a few recent projects using libtcod or libtcod.net.

SaneRoguelike, an unofficial 7DRL by Narf The Mouse (C#, libtcod.net).


Z-Day, a turn-by-turn zombie-killer by Adam Rezich (C#, libtcod.net).


Tombs Of The Aztecs, a crazy experimental raytraced wolfenstein-like 7DRL shooter by Ian Craig (C++) !

Wednesday, May 20, 2009

New features in 1.5 branch

The "colored tiles" and "subcell resolution" features are now in the 1.5 svn branch (but still very buggy).

The first one allows to use colors in font bitmaps. The color from the font bitmap is multiplied by the foreground color used in the console. You can use it for colored letters, but also for small bitmap tiles, icons, or when combined with the dynamic font character updates, even blit a fullscreen colored image (Umbrarum Regnum already does this with a greyscale image on it's title screen).

PS : note that I also increased the sample window size to get the framerate back to a sensible value ;)

The second has already been featured in pyromancer. It makes it possible to blit a TCODImage on a console using a few special chars that simulate 2x2 pixels in each console cell.



Monday, May 11, 2009

libtcod.net 1.4.1 released

Thanks to John Klimek and Chris Hamons, libtcod.net, the C# wrapper for libtcod, has been upgraded to the 1.4.1 version (don't believe what the homepage says, the 1.4.2beta 2 doesn't exist yet :D).

You can get it and try it there :

http://code.google.com/p/libtcod-net/downloads/list

Happy coding :) !

Friday, May 01, 2009

More frames for 1.5 samples

I made a significant change in the way the console stores colors. Instead of having an array of cells, each cell containing the ascii code, foreground and background colors, colors are now stored in 2 TCODImages.
The obvious advantage for the user is that every TCODImage feature is now enabled on console background or foreground color.
Another advantage is that the opengl renderer can now directly access colors from the console without conversion. This results in a slightly improved framerate...


Remember that the framerate with 1.4.1 is around 140 on the same computer...

There are still remaining bugs with the opengl renderer, though. Doing pixel-perfect 2D blitting is a pain with opengl. Another issue is that most linux distribs come with poor drivers which results either in poor performances or even in a completely broken display. Apparently, there's no way I can detect if the driver is good from the library so I'll have to make it possible for the player to disable the opengl renderer, maybe in a libtcod.cfg config file...

Saturday, April 25, 2009

libtcod 1.5 sneak peek

Mmmh... The library version apart, do you see any difference ?? ;)




Sunday, April 05, 2009

The FOV Graal !!!!

Some of you might have read the fov study I did a few months ago.
http://roguecentral.org/libtcod/fov/fov.pdf

My goal was to find the best fov algorithm for libtcod, on both gameplay and speed sides. Unfortunately, every algorithm I checked had some drawbacks.
It seems that Mingos, developer of Umbrarum Regnum has just found something that really looks like the fov graal, getting almost a perfect result on every test. We still have to check that there is no hidden glitch, and the code has still to be polished and optimized, but it's already beating the other algorithms to a pulp...

  • It has a perfect behaviour in every gameplay test of the study (see some of the screenshots below).
  • It has an acceptable symmetry, as good as the best non-symmetrical algorithms.
  • Its speed blows away other algorithms.
Once again, this has still to be double-checked, but restrictive fov will definitely make its way to libtcod 1.4.2 and 1.5. I'll publish an updated version of the fov study including restrictive shadowcasting when I find some time... ;)

Detailed results :

Symmetry :
Outdoor : 5.25 %
Indoor : 0.91%

Speed :

Empty 600x600 : 2.36 times faster than shadowcasting
Empty 100x100 : 4.28 times faster than shadowcasting
Empty 20x20 : 3.2 times fasters than shadowcasting
Full 600x600 : 1.38 times faster than shadowcasting
Full 100x100 : 1.9 times faster than shadowcasting
Full 20x20 : 1.39 times faster than shadowcasting
Outdoor 600x600 : second fastest (1.24 times slower than basic raycasting)
Outdoor 100x100 : 1.18 times faster than basic raycasting
Outdoor 20x20 : 1.28 times faster than basic raycasting
Cave 80x80 : 1.36 times faster than shadowcasting

Cave 40x40 : first ex-aequo (as fast as shadow casting)
Cave 20x20 : 1.13 times faster than shadowcasting

Wednesday, March 25, 2009

Umbrarum Regnum lights on youtube

There is an thread currently on r.g.r.d. about aesthetics of ASCII graphics. I think when it comes to aesthetics, pictures are better than words. Mingos has just released a video about lights in UR that contains stunning pieces of beauty. Judge for yourself...



libtcod 1.5 brainstorming

I created a thread on libtcod's forums to talk about the 1.5 release.
Feel free to describe what would be your dream library.

http://roguecentral.free.fr/smf/index.php?topic=216.0

This thread is rather about wide architectural changes, general issues than specific bugs/feature requests, but anyway feel free to speak about what bothers you in the current version, check the planed changes for 1.5 and let me know if some are too radical.

Thanks in advance for your feedback.

Sunday, March 22, 2009

libtcod 1.4.1 released

Finally ! After almost 6 months of betas and release candidates...
You can get it here :
http://thedoryenlibrary.appspot.com/

The documentation has also moved here :
http://roguecentral.free.fr/libtcod/1.4/doc/doc.php

I'll try to get an up-to-date version for linux 64bits as soon as possible.

I'll maintain the 1.4 branch with bugfix releases probably for quite a long time because the new 1.5 branch will break API compatibility. See the roadmap on libtcod's site for details.


I also wanted to thank all the developers who put their trust in libtcod for the recent 7DRL challenge. I'll soon put a brainstorming thread on libtcod's forum to get as much feedback as possible from this event and to put the 1.5 version on the right track to be even easier to use and more powerful.

Saturday, March 21, 2009

True-color real time javascript roguelike soon possible ?

The javascript speed war that's currently taking place amongst browsers may soon bring a javascript engine fast enough to have a pyromancer-like roguelike running in a browser.

http://www.chromeexperiments.com/browse/

That would be really cool. No more compilation/deployment/platform issue. I've been keeping an eye on browsers javascript speed for a few years, hoping that it would become fast enough one day for this :
http://jice.nospam.googlepages.com/rogue.htm
http://jice.nospam.googlepages.com/fire.htm

Well, that day seems really imminent...

Friday, February 20, 2009

libtcod on Mac OS X and updated fov study

Thanks to Michael De Rosa, libtcod made its way to Mac OS X. You can grab it here :
http://thedoryenlibrary.appspot.com/

You can also see how Jonathon Duerig's enhanced permissive field of view included in libtcod 1.4.1rc3 competes against other algorithms on the updated fov study here.

Thursday, February 19, 2009

libtcod-1.4.1rc3

erm.. A new release. 1.4.1 has really been too long. Too much releases and no real pilot in the plane... This version might not be more stable than the 1.4.1 betas because I completely changed the permissive fov and the default colors. I think I'll use the ubuntu scheme for the next release. Set a release date, keep the changes coming and freeze them one month before the release.

Anyway, this version brings you a lot more default colors, a handy permissive fov with variable permissiveness and it should be possible to use SDL based functions (get desktop resolution, load images, ...) before calling initRoot.

Get it here while it's still smoking ;)
http://thedoryenlibrary.appspot.com

[update] Sorry. It has been a rather chaotic release. Links on the website should be ok now...

Tuesday, February 17, 2009

libtcod projects news

Some news from libtcod users :

A new blog was created for The way of fallen. Check it there :
http://thewayoffallen.blogspot.com/

Umbrarum regnum has now its own forums. Feel free to register here :
http://umbrarumregnum.110mb.com/forum/index.php

After Chrysalis, Tomb of rawdin is the second 7DRL using libtcod. Get it here :
http://redmine.bloodycactus.com/projects/rawdin/wiki


Tuesday, February 03, 2009

Kingdom of Shadows

To my great pleasure, it seems that Umbrarum Regnum is back on the release track. After a few months of doubts, it recently went through its first complete rewrite, using now full C++.

According to Mingos, we should expect an early tech demo soon with some map generators, one of the all-time strengths of this title. I also witnessed the signs of a huge background work on the setting, which I won't disclose here but head to Umbrarum Regnum's official site and you'll get some hints.

Title, cave, forest, swamp...

Saturday, January 31, 2009

Fov study

You can read the fov study here :

http://roguecentral.org/libtcod/fov/fov.pdf

I'm waiting for your feedback, especially on conclusions since opinions may diverge on certain points.

[edit March, 22 2009 : fixed dead link]

Tuesday, January 27, 2009

In search of the fov graal

I've been working for a few weeks on various field of view algorithms. The conclusion is near and I should post results on r.g.r.d and roguebasin soon. Nothing revolutionary, but some data and facts that will probably be of some help.

Sadly I haven't found the perfect algorithm yet (if it exists...).

Also, you can check two new songs on the rogue bard, both being covers of titles submitted for the 2008 roguelike soundtrack contest. Enjoy :)

Thursday, January 15, 2009

New website for libtcod

I created a website on the brand new google appengine. I still don't know if I will keep it, but it's fun coding web pages in python ;)

http://thedoryenlibrary.appspot.com

If you want your project to be featured there of if your project is already featured and you want to change anything on its page, don't hesitate to contact me. I have crazy plans for to allow users to update their project page directly
in far future...

Monday, January 12, 2009

Optimized diamond raycasting

Surprisingly, diamond raycasting is slower than standard raycasting. I removed any memory allocation and expensive container operation from the loop, and it's still slower. Here are the last results on the same computer as the previous post :

CIRCULAR FOV time : 0.801974s => 125.939 call/s 7ms/call
DIAMOND FOV time : 1.79608s => 56.2336 call/s 17ms/call

The optimized code can be found here. Maybe someone will find a good optimization...
http://code.google.com/p/libtcod/source/browse/trunk/src/fov_diamond_raycasting.c

I have a few explanations about the result. Diamond raycasting main feature is that it visits each cell only once. So it's supposed to be much faster than standard raycasting when the cell visiting process is long enough. When using a TCODMap, visiting the cell is only testing a boolean value, so the gain is not significant here.
Besides, diamond raycasting involves a lot of function calls. When you removed memory allocation and container access issues, function calls may still kill your performances. While standard raycasting has one function call for each cell on the perimeter (one function call for each ray casted), diamond raycasting has more than 3 function calls for each cell in the fov ! When working on big field of views (like the one used in the benchmark), this certainly has a big impact on the performances. I think the only way to get significant performance improvement (at least 50%) now is to alter the algorithm itself...

Anyway 56 calls/second on a 600x600 map is probably enough for most usages :)