Steamworks API and LÖVE

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
ThePC007
Prole
Posts: 36
Joined: Sat Jan 30, 2016 3:00 pm
Contact:

Steamworks API and LÖVE

Post by ThePC007 »

Hey guys,

I am currently far from having a finished (or well-developed enough) game to sell on Steam, however, I've been wondering about how exactly I'd integrate the Steamworks API into a LÖVE game. I've seen Move or Die, a game that has also been made using the LÖVE framework, support Steamworks features such as Steamcloud, the Steam workshop, and Steam achievements.
Do I need to integrate the Steam workshop into the LÖVE source manually and recompile it myself? If so, how would I go about doing that? Would I need to make a new module for that? Is the source code documented anywhere, so that I can learn how to actually make new modules for LÖVE?

Thanks,
ThePC007
Löve is love, Löve is life.
User avatar
slime
Solid Snayke
Posts: 3166
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Steamworks API and LÖVE

Post by slime »

You could either make a traditional Lua-C wrapper DLL (completely independent from LÖVE itself), or use FFI bindings through LuaJIT (also independent from LÖVE itself) - the latter being something like this: https://github.com/CapsAdmin/goluwa/tre ... ries/steam
User avatar
SiENcE
Party member
Posts: 806
Joined: Thu Jul 24, 2008 2:25 pm
Location: Berlin/Germany
Contact:

Re: Steamworks API and LÖVE

Post by SiENcE »

Use this tool to generate Lua - C Bindings.

https://github.com/CapsAdmin/ffibuild/t ... steamworks
User avatar
ThePC007
Prole
Posts: 36
Joined: Sat Jan 30, 2016 3:00 pm
Contact:

Re: Steamworks API and LÖVE

Post by ThePC007 »

Thanks, guys.
Löve is love, Löve is life.
User avatar
Madrayken
Party member
Posts: 126
Joined: Sun May 04, 2014 4:21 pm
Location: Oakland CA
Contact:

Re: Steamworks API and LÖVE

Post by Madrayken »

Hi folks.

Spellrazor was finally Greenlit (Woo!) and now I'm in the hell of trying to get Steam integrated. I've never touched FFI before, I've never made a .dll or .dynlib (though I've written many commercial games in the past). I'm trying to understand how other people have done it and I'm struggling a bit.

Here's how it looks to me, option-wise:
1) Recompile the entirety of löve2d, including links to the Steam libs included in the SDK.
- Pro: Probably the simplest way to incorporate the Steam libs.
- Con: Ties my Steam code to a specific version of my game, making it tougher to debug/modify and update. Requires a totally separate version/compilation for Mac and PC builds. (I have no experience of VC and would rather avoid it if possible).

2) Create a Lua-C wrapper DLL.
- Pro: Simple-ish for the Steam side of things. At least in theory. I've never made a DLL before!
- Con: Still requires VC for Windows and Xcode for Mac. Still requires learning about luaJit/ffi (not a problem, see below)

3) Use luajit/ffi to call the Steam libs included in the SDK directly from the game's 'main' directory.
- Pro: Allows me to keep the game and the Steam implementation details separate. Allows one set of source to work for both PC and Mac.
- Con: I have absolutely no idea how this works. The example code shared so kindly above leaves me more baffled than before.

So, my questions are:
a) Are my assumptions correct?
b) For 3) do I require both FFIBuild to build the bindings and GoLuwa's Steam integration? Or is GoLuwa's Steam lib (8 files) all that's needed? Or is it legacy, and requires FFIBuild to create newer bindings?

I've never done anything like this before, despite having released commercial games in everything from 6502 to Objective-C, so any help would be much appreciated.
Discord: https://discord.gg/tYfHgXc
Bandcamp: https://madrayken.bandcamp.com/
Twitter: @Fluttermind
User avatar
Davidobot
Party member
Posts: 1226
Joined: Sat Mar 31, 2012 5:18 am
Location: Oxford, UK
Contact:

Re: Steamworks API and LÖVE

Post by Davidobot »

I'm pretty sure Those Awesome Guys which made Move or Die will be more than willing to assist you in integrating steamworks into love. I would drop them a message if I were you.
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: No registered users and 4 guests