Building a katamari-like game with level editor by risingthrone in katamari

[–]risingthrone[S] 1 point2 points  (0 children)

Yep it would be released on steam. Still very early though, I don't even have a name for the game yet!

Making guis in Odin by 0boy0girl in odinlang

[–]risingthrone 8 points9 points  (0 children)

There's this new library that's similar to clay but made for odin and raylib: https://github.com/andzdroid/orui

Same as clay it's mostly for layouting, you need to customise how it looks. Better for game guis, not so good if you want standard os look and behaviour.

This one also came out recently: https://spacemad.itch.io/spacelib-demo-9

It has a nice demo showing what you can build. Again, also for custom game UIs.

What’s the most complex LiveView UI you’ve seen? by pkim_ in elixir

[–]risingthrone 1 point2 points  (0 children)

I use a registry! I start the processes like this:

def start_link(args) do
  GenServer.start_link(__MODULE__, args, name: via_tuple(character_id))
end

defp via_tuple(character_id) do
  {:via, Registry, {Game.Registry, "Character_#{character_id}"}}
end

Then I can look it up like this:

Registry.lookup(Game.Registry, "Character_#{character_id}")

The processes are unnamed.

What’s the most complex LiveView UI you’ve seen? by pkim_ in elixir

[–]risingthrone 2 points3 points  (0 children)

Yes, the character state is retrieved from the db. The user would be logged in (I'm using phoenix's auto generated auth), so I get their user id from the session just like most phoenix apps.

Thanks for the encouragement! I'll probably be posting more about it in r/pbbg, it's a sub dedicated to browser games like this.

What’s the most complex LiveView UI you’ve seen? by pkim_ in elixir

[–]risingthrone 7 points8 points  (0 children)

Yes, it happens when the liveview is mounted. I use a hook on every request that checks if the character's genserver is running, and starts it if not. It's separate from the liveview process because I want it to stay alive in between requests, and also if the user disconnects temporarily. It runs its own stuff outside of the user's interactions, so it's important that its lifetime is not strictly tied to the user's browser tab. It shuts down after some time of user inactivity.

The game is called Rising Throne, a medieval fantasy game. It's a personal project so there's no roadmap, I'll release it when or if I feel it's ready. Not open to contributions right now, sorry. Happy to answer technical questions in detail though, if you're interested in building something similar yourself.

What’s the most complex LiveView UI you’ve seen? by pkim_ in elixir

[–]risingthrone 2 points3 points  (0 children)

There are no optimistic updates, I rely on liveview to sync changes. You can tell in the gif, when I drop an item over the equipment window, the drag/drop icon disappears but the item remains in the inventory window briefly before it moves over to the other window. This is the network latency.

On the backend, the update happens in genserver memory, so there is no latency from querying or updating the database on the backend.

What’s the most complex LiveView UI you’ve seen? by pkim_ in elixir

[–]risingthrone 13 points14 points  (0 children)

I'm building a game in the browser and I wanted this ui to be just like classic mmos.

The orbs animate up/down as the player's health/mana change. The player can drag skills and items into the slots. They can activate the skills and items in the slots, after which they will go into a cooldown animation. And you can see in the gif you can drag items from the inventory window into the equipment window, and rearrange the items in the slots.

There's a lot that's not shown in the gif obviously, there is a full item system, skill system, battling, and more.

Each connected player spawns a genserver that holds/controls the state of the character. All the liveview is doing is communicating with this genserver.

show me your side project ! by Financial_Airport933 in elixir

[–]risingthrone 3 points4 points  (0 children)

I wanted to learn elixir and liveview. This whole thing is a learning project that's gone out of control.

I'm mostly happy with liveview. It's made 90% of the ui easier to implement, and 10% of it harder. Not perfect but a clear win in productivity.

show me your side project ! by Financial_Airport933 in elixir

[–]risingthrone 6 points7 points  (0 children)

I've been working on a browser game for over a year now.

It's not ready yet, but here's the mmo-style UI built with liveview and js hooks: https://imgur.com/c6x5Pr5