go in game development

blov · · 1483 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>by game development, I mean mostly AAA titles, considering how important performance and latency is important in such titles, do anybody see a future for golang in such market. maybe the question could be breaked down to multiple questions: 1- will go ever reach to performance charachtristics of c++? 2- will GC pauses go down to negligible (sub milisecond or few) 3- performance aside, what is the advantage for any engine/game developer to switch from c++</p> <p>I am very curious to see if Golang (marketed as system programming language) could find any place out of network/web programming sphere.</p> <hr/>**评论:**<br/><br/>kl0nos: <pre><p>No, for AAA titles Go is not a good idea, because first it has GC and second point is that in AAA titles you program in a way that you need to control everything, even how cache lines are getting filled included. To answer your questions:</p> <ol> <li>Depends on which workloads, for AAA games i don&#39;t think it will.</li> <li>Depends on your data, game design, reuse of objects etc. But for 2016 AAA game i don&#39;t think so.</li> <li>Memory safety thanks to automatic memory management, a lot less complex language than C++ so easier to learn and reason about.</li> </ol></pre>shovelpost: <pre><p>Go Indie and use Go.</p></pre>TheMerovius: <pre><ol> <li>no, 2. yes, 3. the same as for every kind of software: Readability, Maintainability, Memory Safety,…</li> </ol></pre>brogrammingsins: <pre><p>Go isn&#39;t marketed as a systems programming language for a while now, see the website: &#34;Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.&#34; </p></pre>eyecikjou567: <pre><p>Go is very good as a server/backend language or even for scripting something like you&#39;d do with Python.</p> <p>However, Go is <em>not suited</em> for GUI development. Handling events and GUI is awkward at best.</p> <p>Other languages are better suited for GameDev.</p> <p>Concerning your question:</p> <p>1) Maybe one day, hopefully</p> <p>2) Probably, I&#39;m sure the same level as Java is achievable</p> <p>3) Doing away with old baggage. Rewriting the engine means you can rethink how it works and possible use lessons learned when you wrote it in C++</p></pre>Sythe2o0: <pre><p>As someone who is building a game engine in go, I can agree that Go doesn&#39;t have any built-ins right now that are really suited for GUI development or event handling, but with something like <a href="https://godoc.org/golang.org/x/exp/shiny" rel="nofollow">x/exp/shiny</a> it&#39;s definitely doable, and given a few more years there should be some solid frameworks available.</p></pre>mehryaar777: <pre><p>Thanks everybody for answers, in three subquestions, the first one (performance) is specially a curious one, why we cant optimize such bare and simple language to the level of c++? is it compiler maturity problem and one day they get there? or there is fundamental facts and design decisions which makes it impossible to do so (GC effect aside)? it is sad to choose between performance and simplicity, or Go is not designed smartly enough?</p></pre>shovelpost: <pre><blockquote> <p>by game development, I mean mostly AAA titles</p> </blockquote> <p>Let&#39;s be realistic here. Who would ever go and develop a AAA title without going through the standard route of using a battle-tested engine and C++? </p> <p>Nevertheless, the indie scene is big nowadays and those games are written in all kinds of languages and platforms. Minecraft is written in Java which has a garbage collector. There are even games in Python and Ruby which are slower than Go. There&#39;s absolutely no reason Go is less suitable than Python, Ruby or Java for game development as a language. In fact, as a language I could argue that it could be more suitable for certain tasks due to easier concurrency (like calculating AI paths in parallel).</p> <p>That said, the ecosystem and libraries of Go are not nearly there yet, especially compared to other languages (e.g. Python has pygame). Go has a few experimental 3rd party <a href="https://azul3d.org/" rel="nofollow">engines</a> but I am pretty sure that you will have to write lots of code yourself.</p> <p>Of course, what&#39;s undeniably a great candidate for Go for any game, even AAA titles is the backend/network systems.</p> <blockquote> <p>the first one (performance) is specially a curious one, why we cant optimize such bare and simple language to the level of c++</p> </blockquote> <p>This is all about the Go GC and nothing else. It depends on your requirements and the game type aka how CPU intensive it is.</p> <p>P.S. This is written in Go and gopherjs: <a href="https://awakeman.com/27/" rel="nofollow">https://awakeman.com/27/</a></p></pre>egonelbre: <pre><ol> <li>Very unlikely to be at the same speed as C++, however it&#39;s very likely that at some point it doesn&#39;t matter that much.</li> <li>Remember that now AAA means targeting VR, i.e. 120Hz for both eyes, i.e. which roughly leaves 8ms per frame. For something to be negligible it should be below 0.5% i.e 40 microseconds.</li> <li>There likely isn&#39;t much. The reasons Go is nice for servers doesn&#39;t necessarily make it nice for games. Manually managing memory in games isn&#39;t difficult. Goroutines really don&#39;t help that much. And finally, you would lose a lot of prior art by switching to Go. But the language itself is much simpler and more fun to use. And there is fast compilation. Language, like Jai, would have more benefit.</li> </ol> <p>Now this is only about AAA. When you go to AA and lower, the language safety becomes more important since the skill of the developers (probably) decreases. Similarly there&#39;s less pushing of the boundaries, hence more room for inefficiencies.</p></pre>

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

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