Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doubt #37

Open
denisdemaisbr opened this issue Apr 13, 2023 · 3 comments
Open

doubt #37

denisdemaisbr opened this issue Apr 13, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@denisdemaisbr
Copy link

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

@Quacky2200
Copy link

Quacky2200 commented Sep 14, 2023

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

@paladin-t
Copy link
Owner

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.

@paladin-t paladin-t added the enhancement New feature or request label Sep 14, 2023
@paladin-t
Copy link
Owner

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

Will add an option to specify this policy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants