🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Hello Unity + WebGL + Kongregate, goodbye sanity.

posted in Septopus for project Unsettled World
Published December 11, 2018
Advertisement

So, it's 2am and I'm writing a blog entry.  I must be waiting on a Unity WebGL build to complete so I can upload it and THEN check if my Kongregate API code hacks are working yet... ;)

Wow, never expected this journey to be like this.  I suppose I never do anything the easy way.  So now I'm integrating a JavaScript API into my c# Unity game...

I'll do a more thorough write up/code share later, this will just be some quick notes.. and something to keep me busy between builds..

Go here first for basic Kongregate API initialization and integration: https://www.kongregate.com/forums/1021798-game-programming-subforum/topics/1673115-guide-kong-api-with-unity-jslib-system

The above uses the new(2017.1+) Unity way of including JavaScript (.jslib), so at least you know it's supported, even if there's no documentation on how to use Kongregate with it yet.

I'm currently working on adding support for kongregate.sharedContent to my game, may even contribute to/fork the above when I'm ready for that..

This will allow players of SlingBot Boarding to Create and Share their own race courses.  With shared leader-boards it will be pretty close to multi-player without all the headache.  I may even simply record race data and use that to generate npcs that actually move like players. ;)

Alright, last build and hopefully I'll have Race Course Save and Load working on Kongregate... :D

If not, I will sleep anyways, because now it's almost 3am..  haha..

Well.. one more..

Haha.. Still not quite there.. I can save items, I can view saved items, I just can't figure out the callback registration for "loading" the saved file.  So the struggle will continue tomorrow.

4 likes 3 comments

Comments

Rutin

I never tried Unity WebGL, let me know how the performance is. :) 

December 11, 2018 11:27 PM
Septopus

I'm incredibly surprised so far, after killing the dynamic lighting and reducing the numbers of objects in the scene(trick glitter, excessive numbers of course barriers), which I needed to do for PC anyhow, I'm hitting 30+fps.  I have it capped there to save cpu/etc.. so I dunno how fast it will go, but no issues..  It plays at least as well as it does compiled for win32, in a browser tab...  haha.  Same performance running locally vs. on Kongregate too, fwiw.(not considering load times that is)..

Hoping I can figure out the JavaScript API bits I'm struggling with and get it published for y'all to check out sometime tonight. 

With how well it's performing so far, I'm thinking that instead of releasing several platforms at once, I'm just going to focus on getting WebGL going with the Kongregate API, then I'll be able to focus more on a solid social gaming experience with one platform and see how successful I can make it. 

Then when I get MY server up and running I can update it with some full client/server goodness that I can make work across all platforms seamlessly. 

December 12, 2018 12:22 AM
Septopus

Hmm, guess I just needed to sleep on it.. 

First change I made and I'm now saving and loading race courses on Kongregate!!  WOOOO!!  okay.. now..  Lots of tweaks still need to happen before I give out the link to anybody.. ;)

 

This is going to be awesome!!  Their system already has a rating system and social sharing for all of the shared content.  Perfect!

December 12, 2018 01:26 AM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement