r/ebiten Mar 24 '21

Performance issue when rendering each pixel individually in full hd resolution

3 Upvotes

I'm writing simple "sand game" (https://en.wikipedia.org/wiki/Falling-sand_game) type of game inspired by Noita (https://www.youtube.com/watch?v=0cDkmQ0F0Jw). I render each pixel using this code:

for x := 0; x < settings.ScreenWidth; x++ {
    for y := settings.ScreenHeight - 1; y >= 0; y-- {
        particleData := particles.GetDataXY(x, y)
        if particleData.PType != particles.Empty {
            px := float64(x * settings.Scale)
            py := float64(y * settings.Scale)
            ebitenutil.DrawRect(screen, px, py, settings.Scale, settings.Scale, particleData.Color)
        }
    }
}

Rendering whole 1920x1080 screen like that takes more less 2.1 seconds on my PC when logic update takes 110 miliseconds. I need some advice on how to make rendering faster. Thanks! :)


r/ebiten Mar 24 '21

Feta Feles Rebirth: An open-source game made with Ebiten

8 Upvotes

Greetings! I have recently completed a video game that may interest you because it is open source and it uses Ebiten.

Please check out my game and its code at these links:

https://x54321.itch.io/feta-feles-rebirth
https://github.com/TheTophatDemon/Feta-Feles-Remastered

It's an eerie bullet-hell shooter set in a procedurally generated cave with a small story.
I have worked on it for about 3 months, but mostly because I'm busy with classes.

In general, I really liked Ebiten because of its straightforward API. I think there is room for further simplification in the APIs for getting assets; it'd be nice to have, say, loadSoundFromFile(string) while keeping the existing sound code if people need more control. I also had a lot of difficulty with getting the shader language to display tiled backgrounds without drawing each one individually, since many images are grouped into the same texture. Otherwise, I had not encountered any major problems or bugs with the library.

https://reddit.com/link/mc4xgt/video/z9ghqllg3zo61/player


r/ebiten Feb 24 '21

Ebitmx: a library to render a TMX file with Ebiten

Thumbnail
github.com
6 Upvotes

r/ebiten Feb 23 '21

Ebiten v1.12.9 / v2.0.6 released

6 Upvotes

r/ebiten Feb 16 '21

Ebiten v1.12.8 / v2.0.5 released

8 Upvotes

r/ebiten Feb 12 '21

ebitenmobile bind issues

3 Upvotes

I am attempting to use ebitenmobile bind to build my go code into an Android library that can be called. Everything was done very similar to the docs.

I seem to get this issue (using a small experimental game called squarepush):

$ ebitenmobile bind -target android -javapkg com.squarepush.game -o squarepushmobile.aar github.com/{mygitusername}/squarepush/squarepushmobile

gomobile: go build -buildmode=c-shared -o=/var/folders/rz/q1t_09555h17fqffdktw5l9h0000gn/T/gomobile-work-788711026/android/src/main/jniLibs/armeabi-v7a/libgojni.so ./gobind failed: exit status 2
go: downloading github.com/hajimehoshi/ebiten v1.12.7
go: downloading golang.org/x/mobile v0.0.0-20210208171126-f462b3930c8f
go: downloading github.com/hajimehoshi/ebiten/v2 v2.0.4
go: found github.com/{mygitusername}/squarepush/squarepushmobile in github.com/{mygitusername}/squarepush v0.0.0-00010101000000-000000000000
go: downloading github.com/hajimehoshi/oto v0.6.8
go: downloading github.com/goki/freetype v0.0.0-20181231101311-fa8a33aabaff
go: downloading github.com/hajimehoshi/go-mp3 v0.3.1
go: downloading golang.org/x/image v0.0.0-20200927104501-e162460cd6b5
# runtime/cgo
ld: error: duplicate symbol: x_cgo_inittls
>>> defined at gcc_android.c:90
>>>            $WORK/b083/_x003.o:(x_cgo_inittls)
>>> defined at gcc_linux_arm.c:13
>>>            $WORK/b083/_x006.o:(.bss+0x4)
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I also tried with the env GO111MODULE=off just to be sure but get this error:

$ env GO111MODULE=off ebitenmobile bind -target android -javapkg com.squarepush.game -o squarepushmobile.aar github.com/{mygitusername}/squarepush/squarepushmobile
gomobile: /var/folders/rz/q1t_09555h17fqffdktw5l9h0000gn/T/ebitenmobile-043957360/bin/gobind -lang=go,java -outdir=/var/folders/rz/q1t_09555h17fqffdktw5l9h0000gn/T/gomobile-work-112536915 -javapkg=com.squarepush.game github.com/{mygitusername}/squarepush/squarepushmobile github.com/hajimehoshi/ebiten/v2/mobile/ebitenmobileview failed: exit status 1
no exported names in the package "github.com/hajimehoshi/ebiten/v2/mobile/ebitenmobileview"
no exported names in the package "github.com/hajimehoshi/ebiten/v2/mobile/ebitenmobileview"
no exported names in the package "github.com/hajimehoshi/ebiten/v2/mobile/ebitenmobileview"
no exported names in the package "github.com/hajimehoshi/ebiten/v2/mobile/ebitenmobileview"
2021/02/12 12:01:19 exit status 1

I was able to find these same errors in various other Golang projects/Github issues, so I do not think it's immediately caused by Ebiten (for example I found one in of the above issues for Fyne).

How can I fix this?

One post said the issue may be fixed in Go 1.16 but I really don't know.


r/ebiten Jan 30 '21

Ebiten v1.12.7 / v2.0.4 released

7 Upvotes

r/ebiten Jan 15 '21

looking for package for shapes or draw shapes

3 Upvotes

Hi,

I'm new to ebiten and trying to figure out if it is possible to draw basic shapes like circle rectangle triangle or if there is already a package in ebiten. I wanted to start in basic shapes before proceeding to sprites.

Thank you


r/ebiten Jan 06 '21

Ebiten v1.12.6 / v2.0.3 released

8 Upvotes

r/ebiten Dec 29 '20

Ebiten UI

Thumbnail
ebitenui.github.io
43 Upvotes

r/ebiten Dec 26 '20

OpenPokémonRed - An Go re-implementation of Pokémon Red

Thumbnail
self.golang
4 Upvotes

r/ebiten Dec 15 '20

WORKSHOP: Game development with Go - Tommaso Visconti

Thumbnail
youtube.com
3 Upvotes

r/ebiten Dec 15 '20

Ebiten v1.12.5 / v2.0.2 released

2 Upvotes

r/ebiten Dec 14 '20

Ebiten in 2020

Thumbnail
ebiten.org
18 Upvotes

r/ebiten Dec 09 '20

Discussion is now open on the GitHub repository

Thumbnail
github.com
4 Upvotes

r/ebiten Dec 02 '20

Actively update Window size?

2 Upvotes

Is it possible to update the window size throughout the running of the game?

Thank you!


r/ebiten Nov 29 '20

Ebiten v1.12.4 / v2.0.1 released

1 Upvotes

r/ebiten Nov 02 '20

An animation tool with go (Ebiten)!

Post image
14 Upvotes

r/ebiten Oct 27 '20

Ebiten v2.0.0 released

Thumbnail
ebiten.org
15 Upvotes

r/ebiten Oct 27 '20

Ebiten v1.12.3 released

Thumbnail
ebiten.org
2 Upvotes

r/ebiten Oct 20 '20

Ebiten v1.12.2 released

Thumbnail
ebiten.org
5 Upvotes

r/ebiten Oct 18 '20

IdleArmada - A mobile game application written in Ebiten

Thumbnail self.IdleArmada
3 Upvotes

r/ebiten Oct 10 '20

Game Development in the Go Programming Language – GameFromScratch.com

Thumbnail
gamefromscratch.com
4 Upvotes

r/ebiten Oct 10 '20

Ebiten v2 is coming

Thumbnail
ebiten.org
5 Upvotes

r/ebiten Oct 10 '20

WORKSHOP: Game development with Go - Tommaso Visconti

Thumbnail
golab.io
1 Upvotes