Roguelike Development with Love2d?

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
osoII
Prole
Posts: 9
Joined: Tue Jul 16, 2013 4:46 am

Roguelike Development with Love2d?

Post 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.
User avatar
DaedalusYoung
Party member
Posts: 407
Joined: Sun Jul 14, 2013 8:04 pm

Re: Roguelike Development with Love2d?

Post by DaedalusYoung »

I don't see why it would be unsuited. What problems do you encounter?
User avatar
Davidobot
Party member
Posts: 1226
Joined: Sat Mar 31, 2012 5:18 am
Location: Oxford, UK
Contact:

Re: Roguelike Development with Love2d?

Post by Davidobot »

Roguelikes and Roguelites are definitely possible in LÖVE.
PM me on here or elsewhere if you'd like to discuss porting your game to Nintendo Switch via mazette!
personal page and a raycaster
osoII
Prole
Posts: 9
Joined: Tue Jul 16, 2013 4:46 am

Re: Roguelike Development with Love2d?

Post 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.
Mikaboshi
Prole
Posts: 12
Joined: Mon Jul 22, 2013 8:55 pm

Re: Roguelike Development with Love2d?

Post 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.
User avatar
substitute541
Party member
Posts: 484
Joined: Fri Aug 24, 2012 9:04 am
Location: Southern Leyte, Visayas, Philippines
Contact:

Re: Roguelike Development with Love2d?

Post 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.
Currently designing themes for WordPress.

Sometimes lurks around the forum.
User avatar
Plu
Inner party member
Posts: 722
Joined: Fri Mar 15, 2013 9:36 pm

Re: Roguelike Development with Love2d?

Post 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.
User avatar
Davidobot
Party member
Posts: 1226
Joined: Sat Mar 31, 2012 5:18 am
Location: Oxford, UK
Contact:

Re: Roguelike Development with Love2d?

Post 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....
PM me on here or elsewhere if you'd like to discuss porting your game to Nintendo Switch via mazette!
personal page and a raycaster
jjmafiae
Party member
Posts: 1331
Joined: Tue Jul 24, 2012 8:22 am

Re: Roguelike Development with Love2d?

Post 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).
User avatar
Davidobot
Party member
Posts: 1226
Joined: Sat Mar 31, 2012 5:18 am
Location: Oxford, UK
Contact:

Re: Roguelike Development with Love2d?

Post 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
PM me on here or elsewhere if you'd like to discuss porting your game to Nintendo Switch via mazette!
personal page and a raycaster
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot], rabbitboots, zorg and 47 guests