Codex wrote:My suggestion - instead of one big RL project, how about one big RL library to make creating one much easier.
Good idea. LÖVE primarily attracts hobby coders (like me) I guess and roguelikes are a popular genre for that crowd because you don't necessarily need a graphic artist.
(ie. shadowcasting, map layer system, color text print) It would be hard to figure out how design the library to avoid being so specific that it could potentially limit people's ability to add or change things.
It's not obvious (for a non-pro) how to implement a turn-based/ASCII interface in LÖVE, I think this is the primary problem. I have quite a bit of programming experience but it took me awhile to figure it out. Simple things like "let the player enter his character's name" are a challenge if you start with naked LÖVE. Here is the current version of my GetString code:
Code: Select all
-- Prompts the user to enter a string
-- Returns the entered string or false if the input process is not complete
local GetStringBuffer = Rope.New()
function Keyboard.GetString(frame, maxSize)
local buffer = GetStringBuffer
frame:Draw(buffer)
frame:Draw("_")
frame:MoveCursorLeft()
local key, unicode = Keyboard.GetKey()
if key == "return" then
frame:Draw(" ")
return buffer:Yield()
elseif key == "backspace" or key == "delete" then
if buffer:Size() == 0 then return false end
buffer:Remove()
frame:MoveCursorLeft()
frame:Draw(" ")
frame:MoveCursorLeft()
frame:MoveCursorLeft()
frame:Draw("_")
elseif Symbol.IsCharacter(unicode) then
if buffer:Size() == maxSize then return false end
buffer:Add(unicode)
frame:Draw(unicode)
frame:Draw("_")
end
return false
end
It works but there is a hell lot of groundwork code behind this. Starting with the most basic stuff like a rope (table of string fragments) ADT for string construction, the whole logic to print colored ASCII characters in an efficient way, etc.
The "non-specific" version of a "roguelike library" would be a curses/conio style library which provides functions for character input/output. We already have multiple generic pathfinding libs which could be combined with this. I am no fan of shadowcasting FOV but those algorithms could be implemented in a standalone, generic way too.
I think instead of trying to make one big "roguelike library", smaller, more focused libraries following the "do one thing, and do it well" spirit would be better e.g. one for pathfinding (already exists), one for character I/O, one for dungeon map generation etc.