Coding a MUSH with Go?

polaris · · 624 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>I&#39;m familiar with C#, php and python. I&#39;m debating picking up GoLang for a networked <a href="https://en.wikipedia.org/wiki/MUSH">MUSH</a>. For those familiar with MUSHes and Go, does this sound feasible?</p> <hr/>**评论:**<br/><br/>xenith87: <pre><p>It works fine, I&#39;ve built one myself in Go. It was much nicer working with Go than C, but that was probably more due to the aging C codebase than anything.</p></pre>butwithrobots: <pre><p>Thanks much! Can I ask some things like what you use for deployment and DB stuff?</p></pre>robertmeta: <pre><p>Start with SQLite and &#34;scp binary&#34;. :) </p></pre>xenith87: <pre><p>Go compiles down to a single binary, so either compile the binary on the target server, or make sure you cross compile it correctly if developing on a different platform. Then its just a matter of copying it to the server and building an appropriate startup script (sysvinit, upstart, supervisor, systemd, etc).</p> <p>Like <a href="/u/robertmeta" rel="nofollow">/u/robertmeta</a> said, you should just start with sqlite if you want to use a database, or you can just keep it simple and start with filesystem storage (perhaps using json as the data format).</p></pre>robertmeta: <pre><blockquote> <p>or you can just keep it simple and start with filesystem storage (perhaps using json as the data format).</p> </blockquote> <p>I think an argument could be made SQLite is simpler than custom marshaling. Heck, if nothing else for having ACID for multiplayer transactions I feel it gives a great simplification over custom marshaling. </p></pre>xenith87: <pre><p>Heh, I just use the DB/files as a cold storage. Anything active is kept in memory, and just saved/written to disk every 15 minutes. No need to sync reads/writes/transactions. Works fine for something small scale like this.</p></pre>robertmeta: <pre><p>You still have to deal with order of operations even in memory. Transactions and guaranteed order are awesome for this. Additionally, SQLite can be an in-memory database!</p></pre>everdev: <pre><p>What was your game? Would be curious to check out the code too of its open source.</p></pre>fubo: <pre><p>Just make the in-game scripting language something slightly saner than TinyMUSH/PennMUSH has, please. :)</p></pre>natefinch: <pre><p>A MUD was one of the first things I worked on in Go, just as a way to feel my way around the language. I have no experience coding a MUD, but played them a lot in college, so figured, why not? Go is a great language for it... possibly the perfect language, honestly. High concurrency and all text-based networking stuff is perfect for Go. Here&#39;s my repo: <a href="https://github.com/natefinch/claymud" rel="nofollow">https://github.com/natefinch/claymud</a>, though it&#39;s no where near complete... I honestly don&#39;t even remember what state I left it in. At one point I could walk around in the world, but then I started refactoring some stuff and I&#39;m not sure where I ended up.</p> <p>I started using boltdb (<a href="https://github.com/boltdb/bolt" rel="nofollow">https://github.com/boltdb/bolt</a>) for storage, since it required zero setup and is pure go, so I didn&#39;t need any external dependencies. It&#39;s technically a key value store, but it works well enough for a MUD if you&#39;re not too worried about the integrity of highly relational data... which I suspect you&#39;re not.</p> <p>Check out wolfmud: <a href="http://www.wolfmud.org/" rel="nofollow">http://www.wolfmud.org/</a> That guy wrote his original MUD in Java back in the day and is now rewriting it from scratch in Go. He and I have talked back and forth some. He seems a lot more dedicated than I could really be on mine, though it&#39;s obviously still a side project for him.</p> <p>As for scripting languages, I highly recommend looking into Lua - it&#39;s what a lot of MMOs use, and it&#39;s a lot more sane than most hand-rolled scripting languages. There are a couple Lua interpreters in Go, I recommend <a href="https://github.com/Shopify/go-lua" rel="nofollow">https://github.com/Shopify/go-lua</a>, since it was written by a large company and should be well supported and complete.</p></pre>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

624 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传