This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-06-03
Channels
- # announcements (2)
- # babashka (15)
- # beginners (40)
- # calva (11)
- # cherry (2)
- # cider (3)
- # cljsrn (2)
- # clojure (37)
- # clojure-austin (4)
- # clojure-europe (2)
- # clojurescript (16)
- # core-async (1)
- # datomic (25)
- # hyperfiddle (18)
- # jobs-discuss (9)
- # nbb (7)
- # off-topic (19)
- # pathom (6)
- # podcasts-discuss (4)
- # portal (37)
- # practicalli (1)
- # re-frame (11)
- # releases (1)
- # scittle (13)
- # shadow-cljs (6)
Hey I was wondering if I should use datomic as an in memory database for my videogame which i am developing. The game uses an entity component system and i am finding myself thinking in terms of attributes and transactions. That would also give free time travel, replays, even multiplayer (just send transactions to the players). It should not be a huge game , a rpg roguelike game and gameplay should be slow, not very quick, about 10-30 updates a second would be enough. a few hundred entities max, usually much less. How much writes are possible in a second ?
@U07FCNURX has done something like this for his text-based game engine for Aventur Delux: https://www.adventur.no
For sure, Datomic has been a perfect database for my game, particularly because the main character has the ability to time travel.
I'm playing your game now and it's awesome! And super addictive 😅 Your writing skills might be on par with your Clojure skills! Very cool.
FYI i tried doing it but the latency was too high on local, and even higher on networking
@U01458A7CBX do mind to share your ecs or game? What do you mean with latency was too high? Did you queue transactions till the end of a frame? Read latency ?
Yes, i queued incoming entities/messages until end of frame and processed them. Read/write latency was ok for web apps, but processing hundreds of entities per frame already took around 50-100ms or more so it was unacceptable for a networked game
But wouldn't be both things possible? Just a server using just refs or atoms for speed and at the end of a frame sending transactions to the db? Then every update tick the server sends only the transactions to the client , which does not use datomic ?
yeah, so there’s really not much use for datomic except maybe as a durable data store
the players already can get atomic updates via ecs if you structure it to emit effects to the client
currently im able to serve game updates at 60 fps on local so thats good enough for me
i’m still in the process of rewriting it, but here’s the core https://gist.github.com/danieltanfh95/1a601090059db22a3303bd04791a7c94
@U0ALH6R89 im writing a small hack and slash mmorpg
A slightly different take on this is using a rules engine https://github.com/oakes/odoyle-rules
Here it says millions of writes a second possible
Datomic processes write transactions by sending them to a transactor via queue, which is currently HornetQ. Hornet claims to be able to do millions a second with SpecJms2007.
https://www.dotkam.com/2013/05/31/datomic-can-simple-be-also-fast/
The in-memory storage of datomic-pro is designed for testing, and I think it’s synchronous. I doubt much thought was given to its performance