luasteam - SteamWorks API Integration

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
groverburger
Prole
Posts: 49
Joined: Tue Oct 30, 2018 9:27 pm

Re: luasteam - SteamWorks API Integration

Post by groverburger »

pauljessup wrote: Thu Jan 21, 2021 6:57 pm using on a Mac, and I'm having an issue making a .love. Whenever I just drag and drop and run it in love by itself, it finds. the .so just fine (in the same directory as my .lua source files). But when I zip up and archive into a .love file, it can no longer find the .so. Not sure how to fix it, it says it's looking in the lua path files for it, but still not finding it. Yet it works fine if I just run the source through the Lua app.
I would also like to know the answer to this - I'm running into the same issue. I think the problem is more in how love2d is handling files in fused mode vs non-fused mode, but still I would like to know how others solved this problem.

For what it's worth, I found out through some trial and error that having .so files in the saves folder works. However, this would then require an install script to set up this dependency before the game is initially launched which is not ideal.

TLDR: if somone knows and could explain a way to bundle .so and .dylib files in the fused mode love2d game app for distribution on Steam, it would be greatly appreciated.
User avatar
ivan
Party member
Posts: 1911
Joined: Fri Mar 07, 2008 1:39 pm
Contact:

Re: luasteam - SteamWorks API Integration

Post by ivan »

You could try my library which is FFI-based, using only the binaries provided by Valve:
https://love2d.org/forums/viewtopic.php?f=5&t=87917
pauljessup
Party member
Posts: 355
Joined: Wed Jul 03, 2013 4:06 am

Re: luasteam - SteamWorks API Integration

Post by pauljessup »

Tried it, and had other issues.
User avatar
zorfmorf
Prole
Posts: 35
Joined: Sat Mar 10, 2012 12:31 pm

Re: luasteam - SteamWorks API Integration

Post by zorfmorf »

Hello! I've gone through the trouble and implemented most of the Steam Networking interfaces. It works fine on Windows and Linux as far as I can tell, but I'm looking for any people interested in testing it out before I make a merge request with the maintainer.

https://github.com/zorfmorf/luasteam

I also added documentation for everything including examples, though you will have to build the library and documentation by yourself as per the instructions.

High points
  • Encrypted, fast networking over UDP. Reliable or unreliable, connection oriented. The library does all the heavy lifting for you.
  • Connect diretly to other steam users (2P2) without worrying about any ports, NAT punching or anything
  • Standalone server support without having to run steam in the background
User avatar
zorfmorf
Prole
Posts: 35
Joined: Sat Mar 10, 2012 12:31 pm

Re: luasteam - SteamWorks API Integration

Post by zorfmorf »

I've opened a PR and it's finished as far as I'm concerned.

Still looking for feedback from anybody willing to try it out.

https://github.com/uspgamedev/luasteam/pull/27
Mertcan_Krdm
Prole
Posts: 2
Joined: Wed May 22, 2024 8:23 pm

Re: luasteam - SteamWorks API Integration

Post by Mertcan_Krdm »

Hi, for some reason starting my game with luasteam I get the following error: " main.lua:43: module 'libraries/steam/luasteam' not found: no field package.preload.." (So basically love is missing the file) and even when I am creating a new folder including only a main.lua file and the luasteam.dll this error still occurs. :x

Also requiring luasteam after the game has already launched gives the same error. :cry:

Are there some basic troubleshooting I could do? I might have missed a single step in the docs, but I don't see which one if there is one missing.
luasteam.dll is included in the folder and steam_api64.dll.
The folder requiring luasteam (Steam = require 'libraries/steam/luasteam') is also correct.
MrFariator
Party member
Posts: 525
Joined: Wed Oct 05, 2016 11:53 am

Re: luasteam - SteamWorks API Integration

Post by MrFariator »

Could always provide the full error, to see if it gives a better hint. I've found that when loading any DLLs or .so, it's better to look at the whole traceback to see where lua is trying to find the thing from.
Personally, when making an AppImage following the steps on wiki, I had to place the luasteam.so in squashfs-root/lib/lua/5.1/luasteam.so, and that made the AppImage read the luasteam.so with just the following:

Code: Select all

require("luasteam")
Mertcan_Krdm
Prole
Posts: 2
Joined: Wed May 22, 2024 8:23 pm

Re: luasteam - SteamWorks API Integration

Post by Mertcan_Krdm »

This is the full error:
Error

main.lua:15: module 'libraries/steam/luasteam' not found:
no field package.preload['libraries/steam/luasteam']
no 'libraries/steam/luasteam' in LOVE game directories.
no file 'libraries/steam/luasteam' in LOVE paths.
no file '.\libraries/steam/luasteam.lua'
no file 'C:\Program Files\LOVE\lua\libraries/steam/luasteam.lua'
no file 'C:\Program Files\LOVE\lua\libraries/steam/luasteam\init.lua'
no file '.\libraries/steam/luasteam.dll'
no file 'C:\Program Files\LOVE\libraries/steam/luasteam.dll'
no file 'C:\Program Files\LOVE\loadall.dll'
no file 'C:/Users/mertk/OneDrive/Desktop/Code/LoveGame/libraries/steam/luasteam.dll'


Traceback

[love "callbacks.lua"]:228: in function 'handler'
[C]: in function 'require'
main.lua:15: in main chunk
[C]: in function 'require'
[C]: in function 'xpcall'
[C]: in function 'xpcall'
MrFariator
Party member
Posts: 525
Joined: Wed Oct 05, 2016 11:53 am

Re: luasteam - SteamWorks API Integration

Post by MrFariator »

Ah, I somehow misread your post, thinking it was about .so on linux, rather than .dll on windows. On windows, you need to place the .DLL(s) next to the executable, and it can't be in a subfolder. So, if you are running from source for testing purposes, it needs to be next to the love.exe (wherever it is installed on your system), and if you're running a fused executable, then it needs to be next to your game.exe.

The other alternative I believe is to append the subfolder(s) to the search path (by modifying package.cpath or such), but I've found it easier to just keep DLLs at root level relative to the executable.
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests