{"id":19756759,"url":"https://github.com/thebracket/rltk","last_synced_at":"2025-04-09T16:05:00.097Z","repository":{"id":41435446,"uuid":"52610288","full_name":"thebracket/rltk","owner":"thebracket","description":"Roguelike Toolkit - Modern C++ (14) SFML-based toolkit for creating roguelikes.","archived":false,"fork":false,"pushed_at":"2021-08-17T20:36:30.000Z","size":59320,"stargazers_count":319,"open_issues_count":3,"forks_count":21,"subscribers_count":28,"default_branch":"master","last_synced_at":"2025-04-09T16:04:56.208Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thebracket.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-02-26T14:37:30.000Z","updated_at":"2025-03-05T20:59:20.000Z","dependencies_parsed_at":"2022-08-27T05:00:46.696Z","dependency_job_id":null,"html_url":"https://github.com/thebracket/rltk","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thebracket%2Frltk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thebracket%2Frltk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thebracket%2Frltk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thebracket%2Frltk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thebracket","download_url":"https://codeload.github.com/thebracket/rltk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248065289,"owners_count":21041871,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T03:16:50.472Z","updated_at":"2025-04-09T16:05:00.078Z","avatar_url":"https://github.com/thebracket.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rltk : Roguelike Toolkit - Modern (C++14) SFML-based toolkit for creating roguelikes.\n\nIt's very early days, but I hope that this can be a useful tool. Black Future was getting messy, and I needed to separate out some \nengine logic from game logic for my sanity; I realized that others might find the underlying engine code useful.\n\nRight now, it's a very fast ASCII (code-page 437) terminal renderer compatible with fonts from libtcod and Dwarf Fortress.\nEventually, it will provide assistance with a number of game-related topics including path-finding, line-plotting,\nand probably some of the entity-component-system I've been enjoying.\n\n**Credit to Pyridine for the REXPaint format code. Original located at: [https://github.com/pyridine/REXSpeeder](https://github.com/pyridine/REXSpeeder)**\n\n## Building from source\n\nYou need SFML for your platform, Boost, and cmake. Make a \"build\" folder, and use CMake to generate build files for your platform (I'll expand upon this later, when this is a more useful library).\n\n## Building on Visual Studio 2017\n\n* Setup VCPKG, following the instructions [here](https://blogs.msdn.microsoft.com/vcblog/2016/09/19/vcpkg-a-tool-to-acquire-and-build-c-open-source-libraries-on-windows/)\n* Ensure that you've integrated it, with `vcpkg integrate install` (see [here](https://github.com/Microsoft/vcpkg/blob/master/docs/examples/using-sqlite.md))\n* Install packages: `vcpkg install sfml` and `vcpkg install cereal`. These take a while.\n* Open Visual Studio 2017, and use \"Open Folder\" to open the RLTK folder to which you cloned everything. The CVPKG stuff will ensure that SFML is linked correctly.\n* If you've previously opened the project in VS2017, use the CMake menu to delete your cache and regenerate everything. You really shouldn't have to do this, but CMake integration is young.\n* You should now be able to select an output, and build/run it.\n\n## Included Examples (with lots of comments!)\n\nI'll write proper documentation as the library evolves; I don't really want to write up a lot of docs and have to revise them\nheavily as things solidify. I'm doing my best to include examples evolving towards a real roguelike. Currently, these are:\n\n### Example 1: Hello World\n![Hello World](https://raw.githubusercontent.com/thebracket/rltk/master/tutorial_images/example1.png \"Hello World\")\n\n[Example 1](https://github.com/thebracket/rltk/blob/master/examples/ex1/main.cpp): demonstrates a Hello World with frame-rate.\n\n### Example 2: Randomly moving @\n![Randomly Moving @](https://raw.githubusercontent.com/thebracket/rltk/master/tutorial_images/example2.gif \"Randomly Moving @\")\n\n[Example 2](https://github.com/thebracket/rltk/blob/master/examples/ex2/main.cpp): a randomly moving yellow @ on a field of white dots.\n\n### Example 3: Bresenham's Line Pathing\n![Bresenham Line Pathing](https://raw.githubusercontent.com/thebracket/rltk/master/tutorial_images/example3.gif \"Bresenham Line Pathing\")\n\n[Example 3](https://github.com/thebracket/rltk/blob/master/examples/ex3/main.cpp): our @ dude again, this time using Bresenham's line to find his way. It also renders additional glyphs, as Mr @ finds his way to his destination.\n\n### Example 4: A-Star Pathing\n![A Star Pathing](https://raw.githubusercontent.com/thebracket/rltk/master/tutorial_images/example4.gif \"A Star Pathing\")\n\n[Example 4](https://github.com/thebracket/rltk/blob/master/examples/ex4/main.cpp): our @ dude again, now on a defined map with obstacles and using A* to find his way to the heart. This demonstrates using templates to specialize map support - we won't force you to use a specific map representation!\n\n### Example 5: Mouse Controlled Path-Finding\n![Mouse Driven A Star Pathing](https://raw.githubusercontent.com/thebracket/rltk/master/tutorial_images/example5.gif \"Mouse Driven A Star Pathing\")\n\n[Example 5](https://github.com/thebracket/rltk/blob/master/examples/ex5/main.cpp): our @ dude again, using A* pathing to find his way to the mouse\ncursor. Click and he goes there.\n\n### Example 6: Visibility\n![Visibility](https://raw.githubusercontent.com/thebracket/rltk/master/tutorial_images/example6.gif \"Visibility\")\n\n[Example 6](https://github.com/thebracket/rltk/blob/master/examples/ex6/main.cpp): Example 5, but now we have true visibility plotted as you wander.\n\n### Example 7: Multi-font ASCII Layout\n![ComplexGui](https://raw.githubusercontent.com/thebracket/rltk/master/tutorial_images/example7.png \"Complex GUI\")\n\n[Example 7](https://github.com/thebracket/rltk/blob/master/examples/ex7/main.cpp): A complex GUI with multiple fonts and layers, dynamically resizable.\n\n### Example 8: Owner draw, and retained-mode GUI elements\n![RetainedMode](https://raw.githubusercontent.com/thebracket/rltk/master/tutorial_images/example8.gif \"Retained Mode\")\n\n[Example 8](https://github.com/thebracket/rltk/blob/master/examples/ex8/main.cpp): Demonstrates an \"owner draw\" panel (with SFML render target callback), drawing a background image. Some ASCII consoles are spawned, and one is populated with a mouse-over, a checkbox, radio-button set, a list-box and some status bars. The other panel displays the results.\n\n### Example 9: Sparse layer with effects\n![Sparse](https://raw.githubusercontent.com/thebracket/rltk/master/tutorial_images/example9.gif \"Sparse\")\n\n[Example 9](https://github.com/thebracket/rltk/blob/master/examples/ex9/main.cpp): This demo uses a regular console layer to draw the map,\nand a \"sparse\" console layer for the character and traversal path. It uses sub-character alignment to smoothly move the @ around, and\ndemonstrates rotation of the @ by leaning left or right as he travels (not an effect I recommend for a game, but it works as a demo!).\n\n### Example 10: The beginnings of a roguelike\n![Sparse](https://raw.githubusercontent.com/thebracket/rltk/master/tutorial_images/example10.gif \"RogueBeginnings\")\n\n[Example 10](https://github.com/thebracket/rltk/blob/master/examples/ex10/main.cpp): This example generates a random map, and you can move your @ around with the arrow keys. It is the first example to use the Entity-Component-System (ECS) provided by RLTK; it makes for a relatively straightforward and modern way to design a roguelike - with very little code, we have the basics of wandering around a map. Note: message passing isn't implemented yet; when it is - this example will be even smaller!\n\n### Example 11: REXPaint support (http://www.gridsagegames.com/rexpaint/)\n![RexPaint](https://raw.githubusercontent.com/thebracket/rltk/master/tutorial_images/example11.png \"RexPaint\")\n\n[Example 11](https://github.com/thebracket/rltk/blob/master/examples/ex11/main.cpp): This example is basically Hello World, but with a REX Paint image loaded (Nyan Cat) and displayed.\n\n\n## Example\nThe goal is to keep it simple from the user's point of view. The following code is enough to setup an ASCII terminal,\nand display **Hello World** with a frame-rate displayed (around 100 FPS on my workstation):\n\n```c++\n#include \"../../rltk/rltk.hpp\"\n#include \u003csstream\u003e\n\nusing namespace rltk;\nusing namespace rltk::colors;\n\nvoid tick(double duration_ms) {\n\tstd::stringstream ss;\n\tss \u003c\u003c \"Frame duration: \" \u003c\u003c duration_ms \u003c\u003c \" ms (\" \u003c\u003c (1000.0/duration_ms) \u003c\u003c \" FPS).\";\n\tconsole-\u003eprint(1, 1, \"Hello World\", WHITE, BLACK);\n\tconsole-\u003eprint(1, 2, ss.str(), YELLOW, BLUE);\n}\n\nint main()\n{\n\tinit(config_simple_px(\"../assets\"));\n\trun(tick);\n  return 0;\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthebracket%2Frltk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthebracket%2Frltk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthebracket%2Frltk/lists"}