Sharplike Progress

One of the nice things about using software that you develop is that when you come across a feature you’d really like to have, you can just add it. Sharplike was originally designed for massive, procedurally generated environments, but I really wanted to build my own environments square by square. And I did not intend on doing this by having a massive list of function calls in my source code. No thanks.

Enter Editlike.

Editlike is a project I’ve been working on this week, despite the feature freeze. You won’t see it in v0.5.0, but it will hopefully be done enough for production use by v0.6.0. It builds on the map caching system that Alex implemented, and can be used to construct a map file, complete with entities already placed in the world, which can be loaded into Sharplike with one function call. Place your player entity and you’re off and playing a game.

Editlike - The Sharplike Map Edito

Editlike - The Sharplike Map Editor

I’ll document in more detail exactly how to add your own squares and entities to the editor later, once I get closer to releasing it, but for now I figured I’d post a quick preview of a map I threw together in five minutes or so, using semi-nethack glyphs. Dots are floor, dashes are walls. They were placed with a “fill” tool, which lets you place squares in rectangular clusters through a click-and-drag interface.

If you’re so inclined, check out the Editlike project in the Sharplike repository. Currently it’s quite unfinished – not even the UI is complete, let alone all the code behind it, but it’s a start.

Sharplike 0.4.0 Released

Sharplike 0.4.0 has just been uploaded to our server.

The highlights:

  • Many bugs in the core systems (audio, graphics, input, scripting) worked out. The API was heavily refactored.
  • Mapping system is (mostly) finished, using Pages (uniformly sized blocks) of Squares (tiles).
  • Caching system is implemented. Currently only “cold” caching (to-disk) is implemented; later we’ll add a “warm” caching system for saving on CPU time while keeping the page in memory.
  • Scheduling system is implemented, with a number of scheduler types. The SingleThreadedScheduler is recommended for simpler games, such as Hacks and Bands, while the multithreaded schedulers (included primarily for advanced use) are more useful for large-scale, Dwarf Fortress-style games.
  • Entity system implemented (usable for both mobiles and items). Predominantly event-driven to enable fine-grained control.
  • Messaging system implemented, to send messages between entities and pages in a thread-safe manner (that works effectively with the multi-threaded schedulers).
  • Regions system implemented, for use in graphical displays. A Region is somewhat similar to a Windows Form control, in that it may be arbitrarily placed within the display window. They may be subclassed for your specific needs. (The map display is a Region, and can be manipulated as such.)
  • “Storylib” implemented: a library for maintaining relationships between entities. This is placed in the Utilities folder due to is greater level of decoupling from the Sharplike system itself.

As usual, you can download it here. We’re starting to get into the area where “yes, you can build a game with this,” and we intend 0.6.0 (which will include Effects–a visual system for glowing lights and such–Lighting, Field of View, and Pathfinding) to be enough to make the games we want to make–so, hopefully, it’ll be enough for the games you want to make, too. If you run into any bugs or have any suggestions for features we could add in 0.6.0 or even later, please feel free to post an issue in our tracker or let us know via our forums.

Thanks for checking out Sharplike!

Road to Sharplike 0.4

We’re approaching the 0.4 release fairly soon, which is going to be the start of “hey, you can write a game with this.”

Basically, we’re at the point where I can say that we’re including a full game framework in 0.4. Personally, I think it’s pretty slick. Maps are composed of Pages, which are 3-D blocks composed of Squares. Entities (which are left very vague–players, monsters, items, and trees would all be entities, although you might want trees to actually be Squares based on your game model) travel on squares, and are seamlessly handed off between Pages. The reason there’s a segmentation of the map into Pages is to allow the implementation of two features: caching and scheduling. There’s also a cool third feature to talk about, which is messaging.

First, scheduling. For most large-scale “world simulator” roguelikes, it’s not simple to multithread them for performance (often because it wasn’t designed to be parallelized to begin with) With Sharplike…it pretty much is simple, at least for the end developer. Maps are scalable; we will be using threadpools to run as many threads updating individual pages as is reasonably possible on your hardware (so multi-core computers will see a near-linear speed increase–dual-core, double the simulation performance) Stuff like entities or fluids would be handled by this system, which should demonstrate fairly large perf improvements over the standard “single-thread EVERYTHING!” approach that many other engines use. Entities will use a global timer and a Delay value, so objects will be able to “skip their turn” if they don’t need to be checked every game tick/step.

The obvious problem here is performance. Even threaded, you could have hundreds of thousands of objects that need going-over, over hundreds or thousands of pages. This is, shall we say…not speedy. To this end we’re implementing a caching mechanism, which both allows conservation of memory and CPU time. Pages exist for caching: each page can be cached a specified way. Caching has three states: Hot, Warm, and Cold. Hot states are “active” and in RAM; they’re simulated every game step. Warm ones are in RAM, but simulated only on certain steps–up to you to figure out what’s right for your game for that. Cold pages are stored on-disk in serialized format – they aren’t simulated at all. The system will allow you to specify what should and shouldn’t be cached, to allow for fast transitions. (For example, in a walk-around-a-really-big-world roguelike, you could specify that everything within a 5-page square around the player should be hot, and a 2-square radius past that should be warm, and everything else will be cold. So it transitions from warm to cold as the player moves, loading into RAM well before it’s necessary in the game.)

The third feature is messaging. Anything that implements the IMessageReceiver interface–by default, the Game class, the Map class, the Page class, and all entities–can define a global name for themselves (it’s optional), and set up to receive messages from other objects. Messages are passed hierarchically, so if you’re sending it to an entity on the same Page, it doesn’t traverse up to Map-level before getting to the correct place. There’s also the Message Channel system – objects that implement IMessageReceiver can subscribe to a channel and all of them, game-wide, will receive them at once. This is nearly required with our multithreaded scheduling model, and will require a little practice for programmers to harness correctly, but it’s relatively fast and very scalable. And while 0.4 may not include realtime game capabilities, once they’re there it’ll work pretty much out-of-the-box.

We’ve also significantly improved our UI system, but Sean or Alex can talk about that.

Sharplike 0.2.0 Releases

The first “real” release of Sharplike is prepped and ready. Features include:

  • Modular core system for audio, graphics, input, and scripting (scripting
    currently disabled) using a provider model for all core systems.
  • OpenGL audio and video system, using OpenTK.
  • Keyboard and mouse input using WinForms. Command-based input mechanism; games don’t have to care about specific key bindings outside of an .ini file.
  • Stepwise game loop system for roguelike game control.
  • Stack based state machine for control flow. Integrates with the game loop automatically, without any special configuration.
  • Preliminary noise generation systems in Sharplike.Noise.
  • Very early start of a UI library to use in conjunction with the core libraries. (Next release wll build this out significantly.)
  • Built using the .NET Framework 2.0 and tested with Mono 2.4.4 to ensure cross-platform operation on Linux and Mac OS X.

You can download Sharplike 0.2.0 (licensed under the CPAL, a Mozilla Public License derivative) here (4.3 MB). Documentation is still a little lacking; if you need assistance, you can visit our Sharplike discussion forums in our issue tracker or our IRC channel, #sharplike on Freenode. Or, if you’d like to be kept up to the minute with Sharplike development, you can SVN checkout straight from our trunk at:

http://opensource.edropple.com/svn/Sharplike/trunk

Hope you like Sharplike!

LARGE RUSSIAN GAMES THE OPEN SOURCE BLOG

Tonight, we are excited to make two announcements. I won’t keep you long.

First, Large Russian Games is launching it’s open source blog, which will provide a central announcement source for all of LRG’s open source projects, which is not really very cool on it’s own. Open source blogs need open source projects, and that brings us to the second announcement, which is…

The very first release of our very first open source project, Sharplike v0.2.0. Sharplike is a C# based Roguelike engine. There’s not much that I can say about it that it doesn’t already say for itself. We have some really cool things planned for Sharplike, so if you’re into roguelikes, keep an eye on the issue tracker for a glimpse into the future.