What do I need to know when deploying to html5?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
togFox
Party member
Posts: 832
Joined: Sat Jan 30, 2021 9:46 am
Location: Brisbane, Oztralia

What do I need to know when deploying to html5?

Post by togFox »

I see there is a love web page builder that turns a love file into HTML5.

What coding practices should I use or avoid if I start to target that platform? For example - should I assume file operations won't work? I should target a fixed screen size? What screen size?

What are the traps for noobs transitioning to html5?
Last project:
https://togfox.itch.io/hwarang
A card game that brings sword fighting to life.
Current project:
Idle gridiron. Set team orders then idle and watch: https://togfox.itch.io/pad-and-pencil-gridiron
User avatar
GVovkiv
Party member
Posts: 688
Joined: Fri Jan 15, 2021 7:29 am

Re: What do I need to know when deploying to html5?

Post by GVovkiv »

togFox wrote: Sat Jun 17, 2023 2:03 am I see there is a love web page builder that turns a love file into HTML5.

What coding practices should I use or avoid if I start to target that platform? For example - should I assume file operations won't work? I should target a fixed screen size? What screen size?

What are the traps for noobs transitioning to html5?
For screen size, it's same thing as everywhere.
People can run game on different screen resolutions and different browser size (like, you can freely change it size)
And you still can run game in fullscreen. (Which, i think, most people who run game in browser, for some reason, would do)
Just continue making game for resolution that you planing for (i think 1080 is default now) and scale it (*wink*).
If you feel beave enough, you could support several resolutions and add ui scaling (which, again, also useful even outside browser).

And, keep in mind, that browser can be run by anything, including android phones, consoles (hm, is it would be possible to open browser on ps5 and play in game from browser? Huh), tablets, etc.

And, you want to optimize your game to be as fast to load as possible and fast in term of performance.
People, who run your game in browser, is not same, who would run it, for example, in steam or download game for their pc (or whatever toaster they use to play videogames), so they run game in browser to check if it fun in first place, not to sit and play for hours. (Unless you stuck in 2000-2014, where browser games was a thing)
And if game is unfun, they just close tab with your game and never return.

And for performance, running something in browser is slow and inefficient (hello my old dark friend, chronium program. You run my program with browser inside. You take all of my memory. To take all my CPU. And all of this for phantom cross platform support. I hate you.)
So you probably want to add graphics setting in game, if you didn't for some reason.
Also game should have as small as possible loading time, especially with browser.
Because if it would load for very long time, user might lost interest and move on from game.

So, think about browser version of game as glorified demo version (even if it full game).
People taste it, if they like it, they go buy/check game on steam/epic/etc and then play, or download binaries for their specific platform.
Or they don't.
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 9 guests