Page 1 of 1

Roguelike Development with Love2d?

Posted: Wed Aug 21, 2013 3:10 am
by osoII
I've been obsessing over a roguelike that's slowly coming together in my mind lately. I've been using love2d for a while but it seems particularly unsuited for roguelike development. Is this the case or am I just not doing it right? Also, is a roguelike with multiple zlevels (similar to dwarf fortress) a reasonable possibility using lua or should I suck it up and learn C++ despite already knowing lua and being familiar with Love2d.

Re: Roguelike Development with Love2d?

Posted: Wed Aug 21, 2013 3:21 am
by DaedalusYoung
I don't see why it would be unsuited. What problems do you encounter?

Re: Roguelike Development with Love2d?

Posted: Wed Aug 21, 2013 3:24 am
by Davidobot
Roguelikes and Roguelites are definitely possible in LÖVE.

Re: Roguelike Development with Love2d?

Posted: Wed Aug 21, 2013 3:33 am
by osoII
DaedalusYoung wrote:I don't see why it would be unsuited. What problems do you encounter?
I'm not running into problems necessarily, I actually love the way tables work in Lua which is why I don't want to give it up. It just seems at odds with the layout of a roguelike. even the concept of love.update doesn't make sense for roguelikes, neither does love.draw because you only need to update once per turn. The whole game timer system seems at odds with it. Plus drawing things with love2d would be wasteful in a traditional roguelike (pretty sweet for adding non traditional graphics options though). I'm just worried that I'll get a ways into it and find out the language and platform aren't suited to what I'm doing.

Re: Roguelike Development with Love2d?

Posted: Wed Aug 21, 2013 5:31 am
by Mikaboshi
osoII wrote:
DaedalusYoung wrote:I don't see why it would be unsuited. What problems do you encounter?
It just seems at odds with the layout of a roguelike. even the concept of love.update doesn't make sense for roguelikes, neither does love.draw because you only need to update once per turn.
Well, you can actually redefine love.run to call love.update or love.draw whenever or however much you want. However, this is not necessary. Many modern roguelikes use constant updates/draws (DCSS, TOME). Just have some sort of timer and use that for the basis of your updates. Inefficiency is not really a problem, if you just set an FPS limit by adding a sleep to update, I doubt it will use more than 1-2% CPU @ 30-60FPS on a modern computer.

Anyway, there are already some roguelikes using LOVE. Snapshot is actually quite actively developed.

Re: Roguelike Development with Love2d?

Posted: Wed Aug 21, 2013 6:08 am
by substitute541
There are roguelikes made in Love2D. As for the love.update, you can either edit love.run, or just check for events like this:

Code: Select all

-- in some function that sends an event once (i.e., love.keypressed)
if (someExpression == true)
    someEvent = true
end

-- in love.update
if (someEvent == true)
    someEvent = false
    -- do something
end
Note that you need to use the keypressed/keyreleased functions, not the love.keyboard.isDown functions since it will send an event every frame.

Re: Roguelike Development with Love2d?

Posted: Wed Aug 21, 2013 12:56 pm
by Plu
Unless you plan to launch a game that would run on people's toaster or something, the inefficient part isn't really relevant. You can just keep drawing the game state every frame easily. Although I guess if you want to cut down on cpu cycles used you could draw everything to a canvas whenever an event happens and just keep drawing that canvas to the screen in love.draw.

Re: Roguelike Development with Love2d?

Posted: Wed Aug 21, 2013 4:06 pm
by Davidobot
Plu wrote:Unless you plan to launch a game that would run on people's toaster or something, the inefficient part isn't really relevant. You can just keep drawing the game state every frame easily. Although I guess if you want to cut down on cpu cycles used you could draw everything to a canvas whenever an event happens and just keep drawing that canvas to the screen in love.draw.
Having a roguelike to play while your bread is being heated.... Toaster Fortress....

Re: Roguelike Development with Love2d?

Posted: Thu Aug 22, 2013 3:39 pm
by jjmafiae
Davidobot wrote:
Plu wrote:Unless you plan to launch a game that would run on people's toaster or something, the inefficient part isn't really relevant. You can just keep drawing the game state every frame easily. Although I guess if you want to cut down on cpu cycles used you could draw everything to a canvas whenever an event happens and just keep drawing that canvas to the screen in love.draw.
Having a roguelike to play while your bread is being heated.... Toaster Fortress....
that actually sounds like a fun game, now i know what my next project is going to be about (im dead serious).

Re: Roguelike Development with Love2d?

Posted: Thu Aug 22, 2013 5:46 pm
by Davidobot
jjmafiae wrote:
Davidobot wrote:
Plu wrote:Unless you plan to launch a game that would run on people's toaster or something, the inefficient part isn't really relevant. You can just keep drawing the game state every frame easily. Although I guess if you want to cut down on cpu cycles used you could draw everything to a canvas whenever an event happens and just keep drawing that canvas to the screen in love.draw.
Having a roguelike to play while your bread is being heated.... Toaster Fortress....
that actually sounds like a fun game, now i know what my next project is going to be about (im dead serious).
Yay! More Roguelikes! I will finally have something to do while my bread is being heated! :D