4 ms·
I'm currently building a distributed mmo emulator using elixir, and it's going well (performance/bug/effort wise). Distributed via horde/libcluster libraries, r
by gallexme 5y ago
I'm currently building a distributed mmo emulator using elixir, and it's going well (performance/bug/effort wise). Distributed via horde/libcluster libraries, ranch as acceptor pool, using livebooks for debugging and performance testing.
I couldn't really ask for anything better, as solo dev in less than 100h basic distribution solved(one process per map, one per player. Maps are spread around the erlang cluster using horde, if a map crashes players seeemlesly reconnect in less than a second, and the map may actually be on a whole different system, especially when the node becomes non viable)
Basic monster ai, fighting logic. Respawn/monster drops, extensive ddbuggability using observer (gui tool included in erlang, allows me to send messages to processes/see their status/ what they do, maybe kill them in the whole erlang cluster )
Can just use livebooks to do more extensive programming (just connect to cluster, execute a mark down files code blocks, see results live ingame and in the livebook)
It's a very great and easy language for this. I may consider moving couple of things to rust using rustler tho for the fun of learning about nifs
- dsgrillo 5y agoThis sounds quite interesting! Any chance you mind sharing that code on GitHub?
- gallexme 5y agoIt's on gitlab. But a lot stuff isn't on it yet/changes a lot, and I take my time :) https://gitlab.com/zen_core/zen_core https://gitlab.com/zen_core/zen_core And u need assets from the original game to use it I made a small example clip to show how I use livebook to simulate player load(they use exactly the same genserver as real players, just that the packets are already deserialzed ) https://cdn.discordapp.com/attachments/819516082154242048/833612125044867072/2021-04-19_09-54-22.mp4 https://cdn.discordapp.com/attachments/819516082154242048/83...
- klohto 5y agoDamn, HN would be the last place where I would expect to see Metin. Is the community still there? It was huge in Central Europe ~15 years ago.
- gallexme 5y agoNo clue, I left the community around 2010, returned 2014 when the source been leaked for teaching myself about mmo development, I really don't know outside than some private servers still having 10+k players and that a few legitimate businesses /other games came out from the community
- Thaxll 5y agoLooking at your video, performance does not look good though which is expected from Elixir, Erlang is a pretty slow language.
- gallexme 5y agoWhat kind of performance issue do u notice? It's a relatively old video, at 500 simultaneous players lna single map it takes around 25ms to update the ai+quadtree+ a list update of who sees who, meanwhile processing 500 moves + broadcasting these Infos to everyone in the view (which are all 500) This is worst case for it, the other maps do not see any load by this and its basically a single core bottleneck, also it's very unoptimized code 500 processes sending messages to a single map process
- gallexme 5y agoAs soon as the 500 players are spread either around the map (so that it doesn't have to handle 500 entities sending updates to all other 500 ones ) it takes around 3 ms Or if they spread across all 70+ maps we see a good utilization of every scheduled but still most map processing spending most their time idling
- Thaxll 5y agoThe graph we're looking at when it jumps to 75%+ CPU usage is it single core? Also using 700MB+ of memory.
- deleted 5y ago[deleted]
- deleted 5y ago[deleted]
- gallexme 5y agothere u go a updated video of current version https://cdn.discordapp.com/attachments/819516082154242048/837757353154576414/2021-04-30_20-24-56_Trim.mp4 https://cdn.discordapp.com/attachments/819516082154242048/83... 5 times the players(250), tops out at ~35% scheduler utilzation