[HN Gopher] Building Game Prototypes with LOVE
___________________________________________________________________
Building Game Prototypes with LOVE
Author : healeycodes
Score : 183 points
Date : 2024-12-31 21:58 UTC (1 days ago)
(HTM) web link (healeycodes.com)
(TXT) w3m dump (healeycodes.com)
| DylanDmitri wrote:
| I gave this LOVE framework a try a couple years ago, but was
| dissuaded by the amount of spritework needed for my game. But
| looking at your prototype games here, they look pretty good and
| playable as is.
| furyofantares wrote:
| I love LOVE for prototyping, and am about to ship an extremely
| small game with it. Love.js works great to make a web build too;
| I host mine on the GitHub pages site for the repo. This is
| excellent for getting playtest help too even if you don't wanna
| ship it that way.
|
| Over Thanksgiving break I decided to see how far I could get an
| LLM to do all the work (using cursor) and I picked LOVE as a
| minimalist all-code framework. I put the game design and
| descriptions of UI and every screen in my .cursorrules file, so
| they are included in every prompt, and for a long while mostly
| told cursor in composer mode to do whatever the next thing it
| suggested was. I chose the smallest possible full game design I
| could and managed to just barely get there, although there were
| some brick walls where I had to help the LLM, but I got fairly
| far without writing or reading any code.
|
| Reviewing what went wrong, the biggest problem is the LLM code
| started pretty good but just got worse and worse over time,
| especially as soon as it couldn't fit everything in its context.
|
| ANYWAY, I was intending to suggest choosing the smallest possible
| game design you can if you wanna ship something.
|
| I'm ready to ship my tiny project and it's amazing just how much
| work it is to ship a thing even after you've got all the
| functionality done.
| trevorhinesley wrote:
| To the OP, try DragonRuby for your next game if you miss hot
| reloading but like the scripting, code-first nature of LOVE. It's
| also cross-platform. Not sponsored, just a big fan and it
| scratches many of the same itches as you described with LOVE.
| je42 wrote:
| Love 2d can be quickly extended with hot reloading. See
| https://github.com/rxi/lurker
| trevorhinesley wrote:
| That's awesome! It's been a core feature of DragonRuby since
| the start, and they share similar framework values from what
| I can tell. It's worth a look. I'm not the biggest Lua fan,
| personally, so DragonRuby scratches the right itch.
| vunderba wrote:
| Hmmm. DragonRuby seems to be a closed source proprietary game
| engine (at least as far as I can tell). With open source
| engines like Love2D / Godot / PhaserJS / Pyxel becoming more
| popular - this may be a deterrent for many devs on HN.
|
| Something else to consider is traction, if you get stuck in
| DragonRuby there's probably not a huge amount of docs/tutorials
| around it. That being said, it does seem like they have a
| pretty active Discord at least.
| trevorhinesley wrote:
| > DragonRuby seems to be a closed source proprietary game
| engine
|
| Yes, but check out:
| https://docs.dragonruby.org/#/misc/faq?id=dragonruby-is-
| not-...
|
| And
|
| https://docs.dragonruby.org/#/misc/faq?id=what-if-i-build-
| so...
|
| > If you get stuck in DragonRuby there's probably not a huge
| amount of docs/tutorials around it.
|
| You'd be surprised. The docs are extensive and there are
| sample games galore in the distro.
| https://docs.dragonruby.org/#/
|
| Also the Discord is incredibly helpful and the creators chime
| in regularly.
|
| It's a pretty special engine and community IMO
| jasonhr13 wrote:
| I prototyped a game in a few frameworks/engines, namely: Godot,
| GMS, Defold, Love, and DragonRuby. I ended up sticking with DR
| because I found the api the most intuitive, and because I'm a
| career ruby dev and just can't get myself to enjoy Lua. I find
| DR and Love to both be fantastic for those who just want to
| code.
| trevorhinesley wrote:
| Preach! Similar experience here. Agreed on Lua too. Love that
| some people dig Lua; to each their own, it's just not for me.
| d3VwsX wrote:
| I never was a big fan of Lua and that was something that
| kept me from looking closer at Love, but a few months ago I
| discovered fennel (Lisp-like that transpiles to Lua) and
| that you can use that to write Love games.
|
| This looks like an up-to-date introduction:
|
| https://itch.io/jam/love2d-jam-2024/topic/3484009/getting-
| st...
|
| The "absolutely minimal Love 2D fennel" repo was useful to
| me as I found the other templates a bit bloated (but
| possibly those are more useful for real-world projects
| beyond small experiments?):
|
| https://sr.ht/~benthor/absolutely-minimal-love2d-fennel/
|
| I did find that startup-time was bad for Fennel om some
| very low-end devices, or when running even a small game
| using LoveDOS in DOSBox, so I set up my test-projects to
| pre-compile the fennel-code to Lua as part of building the
| .love-files and that solved that problem.
| modernerd wrote:
| Balatro was made with LOVE, and a lot of it like the background
| and score flames were made with GLSL to reduce the amount and
| size of assets:
|
| https://www.reddit.com/r/PixelArt/comments/143ybxa/pixelated...
|
| The OP mentions hot reloading and there are a couple of repos
| that may help with that:
|
| https://github.com/clofresh/love-module
|
| https://github.com/usysrc/LICK
|
| Their card game prototype is really impressive for three hours'
| work!
| aquova wrote:
| Balatro recently published a mobile version of their game, but
| I was under the impression Love2D only supported desktop
| platforms. Has that changed?
| furyofantares wrote:
| It is pretty easy to build for iOS, Android, and web.
| greeniskool wrote:
| Should mention love.js isn't officially supported, and
| isn't 100% compatible with the LOVE API. It will work just
| fine for a lot of games out of the box, though
| cableshaft wrote:
| Yeah when I got to the point of trying to get my game
| working in love.js, all I got were webassembly errors. I
| was able to get a basic Hello World game working with the
| same setup, so it's something within my code that's not
| supported, but I don't really know how to pin down what
| the problem is.
| cableshaft wrote:
| Getting it built isn't too bad (at least iOS and Android,
| Web was giving me WebAssembly errors I couldn't figure
| out), but accessing native functionality seems harder and
| do not have any good tutorials (a couple really old
| discussions online that are probably out of date is all I
| could find).
|
| Like if you want to release a game on iOS you're going to
| need some sort of Ad framework and access its game center
| for achievements and leaderboards at the very least, and
| that's been tricky for me to get working. I know you need
| to write some hooks and saw some old code that I'm trying
| to use for reference, but it was still giving me enough
| issues I gave up on it for a the time being.
|
| And I've released games in native iOS before (although it's
| been a while), so it's not like I've never used them.
| KeplerBoy wrote:
| Why would you need an Ad framework and achievements?
| Isn't balatro a prime example of a game simply being a
| paid app? No ads, no bullshit. Just a game and a
| pricetag.
| cableshaft wrote:
| Balatro doesn't have ads but it does have achievements
| and game center.
|
| As much as I'd like my game to spread as far and wide as
| Balatro, I understand that it won't, not anywhere close.
| It's just not going to have the polish that Balatro has
| (I don't have the time or energy, I'm in my 40s with a
| spouse and a day job).
|
| But hopefully it will be fun to play (it is a more fully-
| featured remake of an old free web game I made many, many
| years ago that was played millions of times).
|
| And games that aren't already super high quality mostly
| don't sell on iOS anymore, at least not before people
| download it for free and try them. You pretty much have
| to make the base game free so people will download it and
| then provide an unlock later.
|
| I'm not trying to be obnoxious about ads. I'm wanting to
| use the Zach Gage model (Knotwords, Flipflop Solitaire,
| Good Sudoku, SpellTower). Some minimal ads in between
| matches (the matches last 5-10 minutes by themselves) and
| a few extras like themes or detailed stats behind a one-
| time unlock of a few bucks. I hate the standard model of
| throwing ads in your face every 30 seconds and wouldn't
| do that for my game.
|
| Also another native feature that Love2D doesn't support
| is the iOS Haptics library. Love2D only allows for a half
| second vibrate at full power and it's way too much.
| Balatro uses the iOS native haptics library as well (it's
| obvious, they're very light and quick vibrations). These
| haptics are super common in iOS games nowadays so it will
| seem weird if it doesn't support them properly.
| KeplerBoy wrote:
| Sure, making money with games is hard and I guess you
| have to have ads unless you strike it big. I just wish
| mobile gaming went a different way, but that's not the
| world we live in.
|
| Best of luck to you and your project.
| cableshaft wrote:
| I'm also planning to release it on Steam, and it will be
| an upfront cost there.
|
| Also after paying the 'remove ads' price, which will
| likely be cheaper than the price I'm planning to sell it
| for on Steam (thinking $2.99 for mobile right now), the
| game will effectively become the same as the Steam
| version anyway.
|
| I agree that it sucks. I wish I could just put $2.99 as
| the price and it would still have a chance of selling
| decently. One of the iOS games I made a long time ago I
| did exactly that (actually I priced it at $1.99). But
| people were also willing to pay $1-2 for Angry Bird-style
| mobile games by the millions back then.
|
| Now there are so many free games on there, they seem to
| just skip over to the next free game instead, and maybe
| pay to have ads removed (my own partner does this, bounce
| from free game to free game, and if she likes the game
| she pays to remove the ads).
| aspenmayer wrote:
| Have you looked into distributing on Apple Arcade? I
| haven't myself but it seems like it might be another
| potential source of income that doesn't rely on ads/in-
| app purchases. I think Google Play has a similar game
| service?
| japhib wrote:
| My 2c having released both premium and free apps on iOS
| and Android: premium apps do not sell. People don't want
| to fork over any amount of money just to try an app that
| they may or may not enjoy. You can still make _some_
| money, and get some downloads, that way, but it's just
| completely incomparable to making it free.
|
| Some rough numbers from my recollection: I released Card
| Crusade (deck building mobile game) for $4 back in 2019
| and i think in the first year we got about 2k-3k
| downloads total. When we made it free in early 2020 we
| got 25k downloads in the first _week_. The revenue was
| less for us as a free app, but that's with no ads and IMO
| we designed the IAPs pretty poorly.
|
| But, a while after making it free, we accrued enough
| positive reviews that the iOS App Store started
| recommending the game to more people, so we have a steady
| 200+ downloads per week, despite not having updated the
| game since 2020!
|
| I released another premium mobile game, Barnard's Star,
| back in 2022 (and am still slowly updating it).
| Coincidentally, both apps make roughly the same amount of
| money (about $500 every 6 months), but Barnard's Star
| makes that money from a fraction of the downloads... but
| the word of mouth effect (and game community) seems like
| it would be a lot stronger with f2p. So I'm planning on
| making Barnard's Star free eventually (with hopefully
| better designed IAPs this time!).
|
| One place where the "just a game and a price tag" model
| still works well is Steam. If i were trying to make a
| living off making games, I think I'd focus on releasing
| stuff there.
| furyofantares wrote:
| That's true.
|
| I have managed to expose some native apis from iOS, web,
| Windows and Steam but that is far less straightforward
| and the LLM is sure it knows what to do and it does NOT.
| Web searches are not great either.
| cableshaft wrote:
| If you've found anything online that has helped you get
| that working, if you remember and don't mind sharing I'd
| appreciate it.
| furyofantares wrote:
| I wrote a gist for you
|
| https://gist.github.com/kellydornhaus/45b8571807ec3ca659e
| a50...
| Buttons840 wrote:
| It took them many months to get it on Android. It was wildly
| successful initially, and then it took many months to reach
| phones and missed much of the hype cycle. So I think it took
| them a lot of effort to port.
| Kiro wrote:
| Considering it's the first game to dethrone Minecraft on
| mobile it doesn't seem that it missed out on much.
| fao_ wrote:
| > It took them many months to get it on Android.
|
| It's surprising given that back in June? 2024 I just
| extracted the .love zip from the executable, patched a file
| or two, and merged it into the love android apk and it Just
| Worked. Just goes to prove the last 5% rule
| edflsafoiewq wrote:
| The difficulty of porting to mobile is generally changing
| the UI to work well on a small touchscreen.
| gwervc wrote:
| This. I'm making a game and I have an Android and iOS
| experimental branches. Even with a multiplatform
| framework (Monogame), compilation and basic run isn't a
| given. Then thing like small buttons needs biggee touch
| target, text input requires adaptation. All those 3 days
| + 1 day + a week + ... quickly adds up.
| occz wrote:
| The desktop UI actually worked pretty much fine on
| mobile, to be honest. I ran it for a while using the
| porting methods available from the desktop binaries to an
| APK. The mobile UI basically just changes the
| interactions from a small button on the card to a drag-
| bases UI, which is slightly better on mobile.
| cloud-oak wrote:
| The funny thing is that the original Desktop UI is still
| in the Android version. Sometimes I'll get
| jokers/consumables stuck in the desktop's "selected"
| mode, where the tiny sell/use buttons pop out underneath.
| So the whole drag-n-drop thing seems to have been added
| on top of the original ui, and sometimes the old ui
| events still fire.
|
| Example: https://i.postimg.cc/P5VrVhQ4/Screenshot-2025010
| 1-103921.png
| occz wrote:
| Yep, I've noticed this as well.
| fooster wrote:
| Love may not but there is nothing inherently unworkable with
| Lua and iOS. I released an iOS game which used luajit on ios
| and it worked great.
| the_gipsy wrote:
| I downloaded a mobile version before the official release (I
| uad bought it on steam already). Somebody made an apk with
| some love-to-apk generator, and one or two fixes for the
| shaders on mobile.
| d3VwsX wrote:
| Yes, https://www.love2d.org/ has links to both iOS and
| Android SDKs.
|
| For Android you can also install the stand-alone LOVE Loader
| app that can open .love files to play. Some games on itch.io
| comes with a .love-download (in addition to platform-specific
| executables), but I guess they can sometimes be extracted
| from other games too.
|
| The .love-files, if provided or if they can be extracted from
| a game, are also useful on desktop, for playing the games in
| an operating system (like FreeBSD) that the game's developer
| did not provide binaries for.
|
| The stand-alone app is also a fun way to do some gamedev on
| an Android phone. The .love file is just a ZIP, so it can be
| easily created from termux.
| VectorLock wrote:
| MOONRING too which is another really fun game, although one
| that hasn't yet gone as mainstream as Balatro.
|
| There is so much "draw the rest of the Owl" between a very
| primitive framework like LOVE and stylistic games like BALATRO
| and MOONRING.
| freetonik wrote:
| Coincidentally, I've been building a chess-inspired game
| prototype with LOVE for a few days recently, but switched to
| Godot this week. Love and lua are lovely, but Godot makes so many
| things trivial, it's hard to argue against the pace of
| development I was able to achieve.
| keyle wrote:
| I've made games in both. They both have their pros and cons but
| Godot is basically a full IDE while Loves2D is a framework.
| domlebo70 wrote:
| What do people think of Phaser? Currently playing around with it.
| API seems pretty large
| jordwest wrote:
| It's definitely very much closer to a complete game engine than
| a library like LOVE and heavily leans on OOP.
|
| Personally I prefer PIXI.js (which only focuses on
| sprites/graphics) as I can plug it more easily into my own data
| oriented architecture
| p2detar wrote:
| It's a full-blown game engine and you can do A LOT with it.
| I've created several js games with it and it never let me down.
| I've never tried using it with ts, but it should be even
| better.
|
| edit: Just wanted to add that Phaser has one of the best docs
| out there including a library of tons of examples that can
| really get one going.
| Pufferbo wrote:
| How does it compare to Pixiljs?
| p2detar wrote:
| I think it actually uses Pixijs for rendering. Phaser is a
| game engine with lots of tools including audio, physics,
| scenes, tiled support, etc., while pixi is a graphics
| renderer lib.
| cableshaft wrote:
| I got most of the way through making a toy game with it. I kind
| of liked it, but I'm using Love2D for the game I'm working on
| now that I'm planning to release on Steam and hopefully mobile.
|
| Although I did like that I could use Typescript for Phaser, and
| that it was a lot easier to show off the game to other people
| through the web.
| riffruff24 wrote:
| Its mature and battle tested at this point. At least for 2D web
| games. The original/early version of Vampire Survivors is in
| Phaser if I'm not mistaken. Remade in Unity to make console
| port easier.
| vunderba wrote:
| I built Twins of Caduceus (a game where you have to control two
| snakes simultaneously) entirely using Phaser 3. I've had mostly
| very good experiences with it as a batteries included framework
| (renderer, asset management, physics, input, etc.)
|
| It's a shame that the Phaser map/level editor is a perpetual
| subscription fee with no fallback license. That means you're
| relegated to either building your own map editor or using
| something like Tiled.
|
| https://specularrealms.itch.io/the-twins-of-caduceus
|
| https://www.mapeditor.org/
| fn-mote wrote:
| The article gives a sketch of three games the author built.
|
| It sounds like the velocity was provided by consulting LLMs.
|
| It's fun.
|
| I wonder if the creative feeling is an illusion, though. Does the
| fact that the LLM doesn't feel like it is directly copying work
| it has ingested make the experience feel different than just
| ripping off a project you find on GitHub?
|
| Anyway, I would be very interested in a write up that gives more
| details: how long did the author feel like they were "on the
| path" that LLM knows from existing code, vs how does it handle
| being "off the path".
| furyofantares wrote:
| Not the author but you can see my other comment in this thread
| about similar experiences I had using an LLM + Love2D to build
| a full tiny game.
|
| I love coding and didn't get any of that creative feeling with
| my _code_. But it sure was a magnified experience in terms of
| the creative feeling about the thing I was actually building.
| It was amazing to just think about features and that 's it.
| Until it didn't work, I mean. Then it sucked.
| xixixao wrote:
| Have you ever had a creative feeling programming in a higher
| level language? Did you realize you were harnessing the power
| of the abstraction, "ripping it off", without writing a line of
| assembly yourself?
|
| That said, the LLMs are weak right now. They are great for
| getting some initial boilerplate (how do I draw a circle with
| HTML Canvas API?), but as the project grows you'll be fixing
| them more and writing your own code. Give it a try, especially
| with Cursor. It's awesome.
| spicyusername wrote:
| The current capability of LLMs feels perfect for bouncing high-
| level, "What are ways people commonly do X" or "How do I handle
| this architectural problem I'm having" off of.
|
| I'm building a game in Monogame / C# right now, and LLMs have
| been great to help point me in the right direction or suggest
| architectural patterns I'm less familiar with to investigate.
|
| e.g. If I have a GameStateManager, an
| InputManager, and a UIManager, and I represent input events as
| an enum of GameCommand's, what is a good way to register
| callback functions from these objects with the InputManager to
| trigger actions on particular game commands?
|
| or Is it common when using an Entity
| Component System framework to manage the UI using ECS? Or is
| the UI often managed separately using a more familiar object-
| oriented approach?
|
| They don't give me perfectly working solutions, but they do
| give me inspiration and additional lines of inquiry.
| delduca wrote:
| I have been using my engine https://github.com/willtobyte/carimbo
|
| Demo
| https://carimbo.run/play/1.0.30/willtobyte/megarick/1.0.30/7...
|
| You can use Lua as scripting language.
| jmpavlec wrote:
| FYI the link at the top of your GitHub to play doesn't work.
| Seems maybe you changed the domain name or maybe the version is
| outdated compared to the link you pasted here.
|
| play.carimbo.cloud vs carimbo.run
| raincole wrote:
| (Off topic) Which open-source engine/framework is best in terms
| of cross-platform? It seems that LOVE is desktop-only.
|
| Edit: by cross-platform I mean desktop + console + mobile.
| vunderba wrote:
| Like everything the answer is... it depends on what you're
| looking for.
|
| What does cross-platform mean to you? Just MacOS/Windows/Linux?
| Web? Consoles? Android? iOS? Blackberry?
|
| Godot comes pretty close to a batteries included cross-platform
| engine that handles 2D/3D.
|
| JS engines can likely be ported (with varying degrees of effort
| as PWAs, electron/tauri, etc) to most systems as well - look
| into Phaser though its intended use is 2D.
| valcron1000 wrote:
| Probably Monogame, a C# framework that supports Windows, MacOS,
| Linux, Android, iOS, iPadOS, Playstation 4, Playstation 5, Xbox
| One and Nintendo Switch
| hiccuphippo wrote:
| Don't some of them have proprietary APIs under NDA? how can
| an open source project support them? I ask because this is
| one of the criticisms towards Godot when compared to Unity.
| cableshaft wrote:
| Love2D can be cross-platform. Balatro was made in Love2D and
| was released on PS4, PS5, Xbox One, Xbox Series X, Switch,
| Desktop, iOS, and Android.
|
| That doesn't mean it's well-supported or easy to fully support
| those other platforms. I'm struggling with getting iOS native
| functions working with Love2D in iOS, for example, although
| Balatro proved that it's definitely possible. The basic game
| (the game as it works on my PC) is working on my iPhone just
| fine, though, and wasn't too difficult to get up and running. I
| also have an APK working on a cheap Android phone I got.
| vlaaad wrote:
| Defold: https://defold.com/
| mattfrommars wrote:
| I'm always amazed how people like author "learn" and "build' so
| quickly. I recently started to dabble with unity on basics and no
| way on earth I can build, say something like Heartstone clone or
| the interaction. My background is web back end mostly.
|
| Good stuff OP.
| Pufferbo wrote:
| I've found using frameworks like Love, or Pixijs more
| approachable when coming from a programming background. It's
| more like learning the library rather than an entirely new
| approach to building software.
| pull_my_finger wrote:
| I'm a big fan of Love and Lua, but one thing that always bothered
| me was that there's no real "great" solutions for a) cross
| platform/web/mobile distribution. I know there are 3rd party
| solutions but for as mature as the framework is, you'd think it
| could get a first party solution. The same goes for several API's
| that you'd think are core to game making, like sprite animations.
| There are fairly mature libraries, but I always hate having a
| bunch of patchwork libraries that should be included batteries
| instead of 3rd party boilerplate.
| dartharva wrote:
| Balatro is available on Android though?
| rollcat wrote:
| > cross platform/web/mobile distribution
|
| Unfortunately, _each and every_ platform has its own unique
| quirks[^], and I think the problem is too large for a project
| like LOVE to tackle.
|
| In fact, LOVE's authors have already done "90% of the work in
| 10% of the code": you can make a ZIP file, change the extension
| to .love, and just distribute that. Install LOVE, double-click
| YourGame.love, and you're done. You can also concatenate the
| game executable with the ZIP file to create a self-contained
| binary distribution for that target platform (super old & cute
| trick; it's possible because ZIP's "header" is in fact, at the
| end of the archive).
|
| [^]: In 2016 I've attempted a "one game per month" challenge;
| but I also wanted to distribute executables for Windows, macOS,
| and Linux, so that all of my friends could just play them. It
| went something like this:
|
| - Windows: distributing executables from your personal domain
| is considered a crime; the browser _and_ the OS will yell at
| the user, block the download, blacklist you, etc.
|
| - macOS: simply concatenating won't work; you need an elaborate
| dance to create a .app bundle, and distribute that in a .dmg -
| good luck building that on a Linux host, also good luck
| debugging without an actual Mac. Nevermind code signing, you
| can bypass that with shift-right-click-open. Oh wait, macOS 15
| won't let you.
|
| - Linux: are you ready for the .so hell?
|
| - BSD: bonus! The documentation for SDL_GetPlatform doesn't
| even enumerate all of the possible values! You need to source-
| dive to get them: https://github.com/libsdl-
| org/SDL/blob/f45ce45603a00e92332f9... - plus any possible
| patches in ports; most developers won't ever care, and will
| just hardcode "Linux". Checking for $DISPLAY is also
| unreliable: macOS users may have XQuartz installed, Wayland
| purists may run without XWayland, etc.
| trevorhinesley wrote:
| DragonRuby did it: https://dragonruby.org/
| rollcat wrote:
| And many other frameworks did it too. LOVE decided it's out
| of scope, and that's a 100% valid choice, considering the
| breadth and complexity of the problem. They still went
| quite far in ensuring it's no more difficult than it
| actually needs to be. Similar with e.g. cross-compiling Go
| programs (unfortunately, no cgo-less, cross-platform
| framework for interacting with windowing systems/video
| hardware exists).
| trevorhinesley wrote:
| Yes, but most other engines are much larger scope and
| fundamentally different purpose than LOVE. DragonRuby,
| however, is in the same camp: code-first, scripting
| language (Ruby vs Lua), beginner-to-expert friendly. So
| my point was there are (at least one) project(s) very
| similar in purpose and size/scope to LOVE that did solve
| for cross platform.
| vlaaad wrote:
| Defold is not as well-known as Love, but it seems to fit your
| description: https://defold.com/
| cannibalXxx wrote:
| what an interesting article! outside of programming in my day
| I've written a few articles about guides on my blog
| https://playstationcouch.com/home.php
| lisp2240 wrote:
| Are there any 3d frameworks worth learning?
___________________________________________________________________
(page generated 2025-01-01 23:01 UTC)