Engine Of Love

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
User avatar
vitaminx
Citizen
Posts: 95
Joined: Fri Oct 19, 2012 7:16 am
Location: international
Contact:

Engine Of Love

Post by vitaminx »

"Engine Of Love" is a framework for the LÖVE game engine and provides additional functionality

- management of user preferences
- configurable key bindings for changing screen, audio and debug settings while the program is running
- scales and centers the screen to any resolution (needs canvas support)
- FPS capping with configurable key bindings
- OSD (on screen display) of any message with customizable appearance
- debug information which can be shown inside the window, user can add a table with own debug parameters, appearance is fully customizable
- provides a boolean variable for easy (un)pausing game if window is (de)focussed
- release vs. development: if t.release is true, Lua debug functions are disabled

repository and extensive documentation
https://github.com/humansarepuppies/engineoflove

how to use
Just put the "engineoflove" folder into the main directory of your game and put this at the beginning of your main.lua:

Code: Select all

require "engineoflove"
All the additional functions are immediately available.

configuration
Everything which is configurable is inside prefs.lua and keys.lua.
When your game is started for the first time, all preference items with x (exposed) set to true are written to user exposed configuration files in your standard Love save game folder.
Once these files are there, they override the original configuration items (only those with with f (fixed) set to false).

default keys
F1 decrease screen size
F2 increase screen size
F3 toggle fullscreen
F4 toggle vsync
F5 decrease FSAA
F6 increase FSAA
F7 toggle audio mute
F8 decrease volume
F9 increase volume
F11 toggle debug display
F12 switch debug user/system page
ESC quit program
KP- decreases FPS capping
KP+ increases FPS capping

I've attached the framework itself and a demo showcasing some features of EOL.
Would be nice if you could send me any suggestions, also if you find bugs, send them to me :)

Greets,
vitaminx
Attachments
engineoflove_demo_130529.love
(256.29 KiB) Downloaded 169 times
engineoflove_130529.zip
(19.26 KiB) Downloaded 108 times
Last edited by vitaminx on Wed May 29, 2013 8:26 am, edited 5 times in total.
User avatar
easy82
Party member
Posts: 184
Joined: Thu Apr 18, 2013 10:46 pm
Location: Hungary

Re: Engine Of Love

Post by easy82 »

This is really cool stuff! I've just discovered it. Learning about screen scaling, and from your code structure right now. I especially like way you handle the preferences! Thanks for sharing!
User avatar
vitaminx
Citizen
Posts: 95
Joined: Fri Oct 19, 2012 7:16 am
Location: international
Contact:

Re: Engine Of Love

Post by vitaminx »

[UPDATE]

The framework is finished so far, new features:

- much easier to use, only a simple require is needed
- user can define custom table for debug display
- if user debug table is defined, debug pages can be switched with F12
- OSD and debug info's can be horizontally and vertically aligned
- OSD text can be left-aligned, right-aligned or centered
- options to use custom or buildin fonts for all displays
- way more slick and elegant code
- many more small improvements and fixes

have fun :)
User avatar
SiENcE
Party member
Posts: 792
Joined: Thu Jul 24, 2008 2:25 pm
Location: Berlin/Germany
Contact:

Re: Engine Of Love

Post by SiENcE »

Nice nice.

I also created a little framework to me, to have all normal gaming functionality but without a game.

I suggest you to read my blogpost about scaling. Your engine scales the screen and lets the user configure his drivers or monitor to respect the aspect ratio when in fullscreen. This is not very userfriendly. You should also decide between float and integer scaling values. Most pixelartists hate when thier pixels are scaled uneven.
User avatar
vitaminx
Citizen
Posts: 95
Joined: Fri Oct 19, 2012 7:16 am
Location: international
Contact:

Re: Engine Of Love

Post by vitaminx »

SiENcE wrote:Most pixelartists hate when thier pixels are scaled uneven.
Thanks for this hint, it's indeed a good thing to avoid float scaling on pixelart graphics.
I've implemented a parameter prefs.screen.multiscale. If set to true (default value) it will only allow scaling to multiples of canvas size.
I also added a reference to your blog entry to the github project, I hope you don't mind.

I've updated both the zip file and demo love project in the original post, here's the changelog:

- renamed main include for easier "require" (suggested by Yonaba)
- added preference parameter "multiscale" to only scale to multiple sizes of canvas if desired (suggested by SiENcE)
- using a default of 512x384 for canvas size (see SiENcE's blog post)
- more information about canvas size and scaling in system debug window
- added GPLv3 license statements
- added lots of comments all over the code


Greets,
vitaminx
User avatar
JesseH
Prole
Posts: 47
Joined: Mon Nov 19, 2012 6:04 am
Location: Georgia, USA
Contact:

Re: Engine Of Love

Post by JesseH »

Good job keep up the good work. You have a nice project going on.
User avatar
vitaminx
Citizen
Posts: 95
Joined: Fri Oct 19, 2012 7:16 am
Location: international
Contact:

Re: Engine Of Love

Post by vitaminx »

Hello Lövers,

Here an update about this project, I've (hopefully) improved the framework with some features.
Please let me know if you find it useful and if there are bugs, also if you have ideas for features.
I've updated both the zip file and demo love project in the original post.

Changelog:

- possible to use own config files in main game folder, no need to modify preferences inside the "engineoflove" folder anymore
- global variable eol.screen.focus now holds the window focus status
- default line style is "rough" for more pixelart-like appearance
- using pixmap fonts instead TTF for all EOL text, looks much nicer if scaled
- implemented optional FPS capping, value can be changed with KP- and KP+ by default, value of zero disables capping alltogether
- disabled exposure of some debug settings to user prefs file by default
- disable Lua debug functions if t.release is true (recommended by Lua developers)
- global variable "eol.misc.release" reflects t.release settings from conf.lua, e.g. debug functions can be conditionally enabled with the help of this variable
- added a tutorial and example code snippets to github README
- some code beautifications and bug fixes

Much fun,
vitaminx
Post Reply

Who is online

Users browsing this forum: No registered users and 68 guests