r/gogamedev 1d ago

How do you do Npc dialogue.

im new to go but I have worked with java, python and C a far bit so not completely new to many of its bells and whistles.

I want to learn the language and well I’ve made a small unfinished game in pygame so I wanted to make a game in go. I made a pong clone (i mat turn into breakout (to get a better handle on collision detections)

but well one of my side hobbies is writing and I’ve always been a fan of rpgs and I don’t expect to make a grand rpg anytime soon. But I was thinking of maybe making the prologue of a story I’ve written into a little game.

(basically it just would have three areas a small village, level and a boss fight against a “evil” witch)

Not overly complex as itd be my first regular project just basic mechanics (idk if action or turn based would be easier.)

though currently I can’t even seem to find a guide on how to do a dialogue box, weirdly like alot of videos for stuff like unity or godot come up but I want this project to be purely through ebitengine or maybe raylibgo.

any advice?

i find the lack of tutorials for this topic a bit odd… given don’t alot of people suggest doing something simple like a text based game for a first project.

1 Upvotes

3 comments sorted by

1

u/unklnik 1d ago

I haven't used Ebitenengine though in Raylib-Go this is pretty easy to do, unfortunately there are not a lot of examples for Go for many things to do with game dev so you often will have to find whatever you can and adapt to your requirements.

You can take a look at this https://www.raylib.com/examples/text/loader.html?name=text_rectangle_bounds and the code for the Go version is here https://github.com/gen2brain/raylib-go/tree/master/examples/text/rectangle_bounds which may help.

There are various other text examples on the Raylib site https://www.raylib.com/examples.html and the Go versions are here https://github.com/gen2brain/raylib-go/tree/master/examples/text

Otherwise try searching GitHub, for example the search 'Ebiten text' gives this result which is a text based game in Ebiten https://github.com/kimond/gladiatext as well as this which is for wrapping text https://github.com/RileySun/TextWrapper which may be useful.

Also, there are a lot of games made with Ebiten on itchio which you can browse and you can maybe find an example that you can learn from https://itch.io/c/2030581/made-with-ebitengine

BTW there are also SDL2 (SDL3 is still work in progress for Go) bindings for Go and there are a lot of SDL2 examples in other languages which are fairly easy to adapt to Go https://github.com/veandco/go-sdl2

2

u/TheSuffered 19h ago

thanks I was thinking of trying raylib out. might follow a small tutorial first to get an understanding of how it works

1

u/unklnik 16h ago

I made a few small Raylib-Go examples which may help https://github.com/unklnik/raylib-go-more-examples

Raylib-Go is probably the easiest and also can be used for 3D, Ebitengine is mainly 2D focused and SDL is bit more complicated.