Gamesparks SDK

I was wondering if anyone had used the Gamesparks SDK for Defold. Gamesparks has a repo for this here https://bitbucket.org/gamesparks/gamesparks-defold/overview but I am having an issue finding any information on implementing it. I tried setting it up based on the example they have for Corona on their site since a Defold one is not there (making the necessary small changes to work within Defold).

It seems like it may just be in an early form and not usable yet, but I was curious to see if any others have had success with it.

Did you include all of the library dependencies listed here?

https://bitbucket.org/gamesparks/gamesparks-defold/src

It looks like if you study the tests folder you can get a good idea of how to use it.

Unfortunately, some of those dependencies are not currently setup to build on Win. I contacted the repo owner. Someone might need to fork and make changes if repo owner doesn’t respond timely.

@gamesparksclare is the rep.

2 Likes

I think I have all of the dependencies set up correctly. I was just doing a simple test on android. It is basically an entirely empty project with the required dependencies as well as the Gamesparks LUA SDK linked above. It is failing to build since it does not have access to a file (dmc_corona.cfg I believe… not at my machine to be able to check currently). At this point, I wasn’t sure if it was an android issue or not and had not tried building for Windows (developing on Linux and apparently trying to build for that target won’t work because I am getting a build error stating that Native Extensions are not supported for that platform.

I tried reaching out via their general inquiries webform on the Gamesparks site. I will try contacting the repo owner as well, and maybe if @gamesparksclare is able to comment that would be helpful. I am not super familiar with LUA, but I am a developer by trade, so I should be able to assist on getting it up and running for Defold as long as it isn’t a massive undertaking. I think it would be interesting to get it working since it supports real-time multiplayer and seems more accessible for writing a multiplayer game without having to roll your own server in node.js or the like, which is going to be my fallback option.

Again, if anyone has gotten an example up an running, I would be very interested in seeing the example project for it! Mainly interested in mobile right now so a lack of a Windows build option isn’t that much of a hindrance for me.

We are using Gamesparks for our mobile game and it seem to work great so far even if todays design of the code is not really taking advantage of Defold and Lua’s nice features.
I will look if I can strip it down to something I can publish as an example.

In your case, you must make sure that the dmc_corona.cfg file is included as a resource in game.project (where you also include the extensions)
eg.
custom_resources = gamesparks/dmc_corona.cfg
dependencies = https://github.com/britzl/defold-timer/archive/master.zip https://github.com/sonountaleban/defold-luasec/archive/master.zip https://github.com/sonountaleban/defold-crypto/archive/master.zip https://github.com/britzl/defnet/archive/master.zip

EDIT
Yes I am developing on OSX so I cannot tell if it’s a problem with other os. Also having britzl’s lib defnet only for the crypto module feels a little weird. (No offense Britzl :slight_smile: )
In our project I’ve wrapped all in coroutines if needed and also are putting it all in a script so we can leverage the messaging system.

3 Likes

Thanks for the reply :slight_smile: Glad to know that someone is able to use it. Nice to have just that little bit of validation which means I can push forward with implementing it.

I will look into the custom resources (I am pretty sure I saw it listed somewhere). It might have been in the game.project file on the repo but maybe I didn’t add it to the main game.project. I will check tonight and report back. Pretty sure I have all of those dependencies, there was just an issue accessing that .cfg file so hopefully that is all that is missing.

1 Like

We’re (that is @Mathias_Westerdahl) working on native extension support for Linux. It should be available a few releases from now.

2 Likes

I agree. I believe it’s actually files from the LuaSocket project and those should probably be included in the main repo instead of included as a dependency.

Nice good to hear!

So I think that fixed my issue but now I am having problems with the timer not working with dmengine. Britzl in another thread mentioned this won’t work with dmengine, so I will try and package an apk to test it.

I did? The timer should work on all supported platforms when building from within the editor and when bundling. Are you using Linux?

Well, it won’t work with the default dmengine if that is what you mean. You need to build and use the one that includes the native extensions. This is the one bundled when bundling from the editor. If (as we are) using dmengine outside of a bundle make sure to use the one in the #project/build/#OS/ folder

Yes this is what I meant. The default dmegine won’t work. I am still getting used to the whole process in Defold.

I am having an odd issue after adding the ‘custom_resources = gamesparks/dmc_corona.cfg’ to the game.project. When I try to build a package, I am getting a build error that says that the gamesparks/dmc_corona.cfg is being created twice (something along those lines). I opened the project on my old Macbook and just used Build and Run which built and opened the project fine, but if I try to package it, it fails to build. At this point, I am just trying to get the project to build ad run on Android but I can’t seem to figure out how to do that.

I tried using both the old editor and the new editor and they are both giving me the same issue. Are there any additional steps to building when using native extensions or something that I might be missing? I can upload the project files if necessary. All my project is at this point is a default project with the required dependencies, a script that instantiates a Gamesparks instance, and the changed to the game.project file to include the gamesparks/dmc_corona.cfg. I know the project works and is able to connect since I was able to build and run on my Mac.

EDIT: Here is a picture of the error I am getting. This happens when trying to build a package for any of the platforms available.

And a link to the zipped project https://drive.google.com/file/d/0B0KXcpnPEFslNjhHYVNIUmRnMHc/view?usp=sharing

Edit2: I think I found out the issue but I will need to wait until later to confirm. I had to add a leader slash to the custom resources ie ‘custom_resources = /gamesparks/dmc_corona.cfg’ and I was able to package for android without it complaining. I installed it on my phone and it didn’t crash. What is odd though, is I was able to build and run on osx just fine using build and run, without needing that leading slash

Hi,

Sorry for bumping it up, but all the posts about GameSparks are pretty outdated and I can’t find a starting point :confused: I would like to use it, but all the branches with SDK I tested aren’t working, so I don’t know which is the best candidate to be fixed.

The link with the official SDK is broken.

I found @britzl’s branch, @amel’s branch but those has no collections to run - is any of these proper to be used in some example?

@Pkeod’s branch has an example, but after fixing a problem with timer I have even more problems with LuaSec, so if anyone could help me here, I would be very thankful, I pasted the errors and warnings here:

errors.txt (9.7 KB)

Perhaps some of you have some actual example?

Problem right now with Gamesparks is that they are in a “position” where they are transferring it all into the AWS ecosystems. Parallell to this they really dont support Defold at all atm. Blastlands is running on Gamesparks but as we discontinued it I havent really built a new build in ages. Still the “old” one still seems to work. I believe that is Pkeod’s branch

1 Like

If they are making this kind of shift I’d wait until it’s done and they have announced it properly. When it is announced we can look into a new native extension, based on their official C++ extension. It may be possible to generate the extension bindings from an API definition like it’s done with PlayFab, Steam and the AWS Lua SDK.

1 Like