paladin-t / bitty

Bitty Engine - An itty bitty 2D game engine, with built-in editors, programmable in Lua.

Home Page:https://paladin-t.github.io/bitty

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

doubt

denisdemaisbr opened this issue · comments

have network support, i.e., luasocket or tcp/udp custom based ?
native or dll/so

Hi Denis,

I'm not able to fully answer this question for you since I have not used Bitty yet so I cannot state on the full state of networking support.

However, you may be relieved to hear that there is some visible progress on this front and I believe there's at-least some experimental network support included in this project as specified in the documentation showing some bindings accessible in your Lua scope and already present for you.

src/README.md gives you an overview of Bitty's overall structure. Reading over the web/networking code you can see libcurl functionality is added in src/web* and mongoose http in src/web_mongoose.cpp, and mongoose networking in src/networking* files.

From glancing at these files it's clear Bitty utilises libcurl for web requests and mongoose for TCP/UDP sockets including support for web sockets. There are some visible binding definitions in src/scripting_lua_api.cpp which I believe the documentation references yet you may find you may wish to expand upon the network functionality/bindings depending on the complexity of your network use cases.

Since Bitty is capable of WebGL, I believe there currently isn't any WebGL/HTML5 networking/web socket support. Looking at Tony's Hyper Bullet example on Itch I believe Bitty is utilising WebGL with Emscripten which utilises WASM compilation and it's good news since Emscripten mentions web socket/TCP support in their documentation. This means the functionality just needs to be added to Bitty and this would hopefully mean a game developer would open a web socket connection and Bitty could utilise the correct library for the WebGL build through it's bindings. At this time WebGL games will be limited to singleplayer only; and plenty of good games do not need networking so until then Bitty will still be greatly accessible for game developers.

Hopefully @paladin-t (developer) will know more on the networking status and can correct me if I'm wrong.

You can find the available documentation for Bitty's external network dependencies/libraries here:

Mongoose Networking (libmongoose)

CURL (libcurl):

Emscripten

All in all, Bitty is incredibly small and utilitarian but very versatile and powerful for what is has to offer, and the source code is easily readable.

Note that whilst searching the code; Bitty is currently configured to ignore insecure web hosts during a HTTPS connection which should ideally be turned off for best practice.

There are some political issues with Unity and their pricing at this time so I've posted in haste for people who may wish to explore and utilise Bitty as an alternative after seeing this project referenced on Hacker News.

EDITED formatting

Hopefully @paladin-t (developer) will know more on the networking status

In addition, fetch is available for desktop and HTML builds. It is implemented with the standard JS fetch for HTML, and simulated by libcurl for desktops. Which could be an option to build web/cross-platform multi-player games.

Bitty is currently configured to ignore insecure web hosts during a HTTPS connection

Will add an option to specify this policy.