#WASM Graphical Rendering

53 messages · Page 1 of 1 (latest)

stiff cosmos
#

*Btw it lags a lot if there are too many entities on the screen, and this can end up with syscall/js being "overloaded"(?) because if I try to use the keyboard, the inputs will call more stuff and it will end up freezing other parts, like the WS or the canvas

quaint hearth
#

you want to look into webgpu tech

#

it will be significantly lower level than canvas

stiff cosmos
#

Okay thank you. Are there any good places to start for that? And also, is it well supported?

#

My goal is to skip the syscall/js calls because they are slower than just doing it in js

#

And also they are all synchronous

#

Which is bad when I’m trying to run a socket and use inputs too

quaint hearth
#

im not terribly familiar, sorry

#

how i do my stuff is all of my business logic is in go

#

and i just push objects showing the new state for the game and get some js framework to render it

#

but its for a card game so.. no need for 60fps or whatever

stiff cosmos
#

True

#

this has to be able to run at close to 60fps on even crappy laptops or phones

#

which is annoying

#

I really just want something that's simple but doesn't interract with syscall/js

#

WebGL is tough because it's very very difficult to use for me for such a game

quaint hearth
stiff cosmos
#

Rip lmao

#

My only issue with this is I can't get text to work

#

stuff about go module not found

#

Issue is this

#

The package exists

quaint hearth
#

you dont go get that particular package

#

you just need to go get ebiten/v2

#

and then you can import it

stiff cosmos
quaint hearth
#

are you following a particular example?

stiff cosmos
#

Not exactly, but if I copy-paste their text example code, it still errors

quaint hearth
#

can you share

stiff cosmos
#

yes ofc my bad lol

#

Even if I try running that file from github

#

it fails

#

also an issue with this is that a 9.6mb wasm file isn't good for loading

quaint hearth
#

it seems the issue is that the examples are new and that there hasn't been a new enough release of ebiten to reflect those examples just yet. if you want, you can try the older example at https://github.com/hajimehoshi/ebiten/tree/15147490418eba1b073807bf5328cd55d6bee04f/examples/text/main.go
or use the latest version which isn't tagged yet by import github.com/hajimehoshi/ebiten/v2@main

GitHub

Ebitengine - A dead simple 2D game engine for Go. Contribute to hajimehoshi/ebiten development by creating an account on GitHub.

quaint hearth
stiff cosmos
quaint hearth
#

no, its a thing you do with your web server (or something like cloudflare or nginx)

stiff cosmos
#

alr

#

Ngl im considering switching to C for the client but that ain't consistent with the golang server

quaint hearth
#

take a look at this

stiff cosmos
#

wow

#

21mb -> 4mb

#

if that's what that means

quaint hearth
#

it sent 4mb over the network

#

and uncompressed it back to its original size of 20mb

stiff cosmos
#

yeesh

quaint hearth
# stiff cosmos yeesh

fun fac,t this isn't even the max level of compression. brotli max level gets me down to 2.9mb

#

if you have wsl, you can test this yourself using brotli -Z <your wasm file>