Online Game with GateEngine targeting all viable platforms, including Wasm

As I started to build my game with GateEngine and it requires connection over web socket
I've updated my Web socket lib to support WASM

To come is my API lib adding similar support but for CRUD requests
will post here how it goes :)

Feel free to give it a go and test it out. Also Any feedback is appreciated. So far usage looks exactly the same to other platforms besides one minor difference which is init:

#if os(WASI)
let request = "ws://127.0.0.1:8080/game?name=WASI&team=B"
#else
let request = URLRequest(url: URL(string: "ws://127.0.0.1:8080/game?name=Szymon&team=A")!)
#endif

where on other platforms where URLRequest is supported you can work with headers and stuff. Under WASM It is not possible, due to that limitation of using String as URL

Screenshot from browser console:

7 Likes

Working on a GUI system, that I can use With in my game
So far got VStack & Stack with a button supporting image, label and action

3 Likes

Sorry for the quality! but there is a limit of 4MB max lol
Anyway, investing a little bit more into UI part of the "internal" framework

IMB_avWcVZ

2 Likes

Love this! I've got it on my TODO to start working on a menu "system" also. Would love to glance at your code, if you've got it in a public repo anywhere.

Personally, I think this is the kind of thing that should go into the GateEngine repo itself. I was planning to do a first pass in some helper repository, and then create an issue that suggests moving it.

I'm essentially imagining two classes, a MenuSystem parent class, much like you have here, as well as a MenuButton class. There would be functions for adding buttons to the system with focus intent, so the input handling can all be abstracted away. (Ideally you wouldn't need to think about input or rendering when implementing a Menu or its buttons, just focus paths and absolute (or relative?) positions.)

Yes! A complex UI system is already in development in the main branch. You can check out its capabilities in the UI Devlog discord thread

3 Likes

Might package it up and share over the weekend. Will have to extract my "communication" logic with server so it stays private :P