Our son is heavily into two things on the computer right now: Minecraft and Roblox. Of these I only knew about Minecraft before, while Roblox I knew nothing about. Now that I know it better, how would I describe it? It's a bit like Second Life was, a place with user-generated places that you can visit. But not one continuous place, rather you choose what you want to do first, and each 3D experience starts only after that. Most of the places you can visit are created by kids, so it's a really imaginative world. Everything is cross-device multiplayer by default.
After visiting Roblox worlds together, I started noticing that besides being fun 3D environments, each place often had its own rules as well, but much more complicated than most people would have patience for creating from Minecraft logic blocks. So there must be some way to write code on Roblox as well, how does that work? So I downloaded the separate Roblox editor called RobloxStudio to look at how these worlds are created.
After playing around it for some time — actually for over two months at it this point — I'm very impressed with it. I expected something really basic, but RobloxStudio is actually a proper IDE similar to Unity. It doesn't allow you to do everything that Unity would (you can't write shaders for example), but the basic idea is the same. You import 3D models (from Blender via .fbx files in my case), and create scenes out of them.
The secret to why even kids can easily get into the editor (our 5-year old can use it) is that importing 3D models created by others is super easy. You can visually browse models inside of the editor, and import them into your scene with one click. After you get used to this, the way asset packs are imported to Unity starts to seem really kludgy.
Besides creating scenes out of 3D models, you can also script them by writing code. For Roblox, the code is written Lua, which is the same language that is used to script games such as Civilization V, Factorio, Noita, and Dark Souls. I mostly wrote Python before, but getting into Lua was easy, and pleasantly IDE has a decent code editor with features such as setting breakpoints and "jump to definition".
But there is one feature that left me really impressed with RobloxStudio: how much easier it makes network programming.
Because Roblox games are all multiplayer, to create them you end up needing to think about server- and client-side logic. You'll have the server deciding the overall rules of the game, while the client-side code can do things like UI, frame-by-frame visual changes, responding to things like button clicks without lag, and changing the environment when only one player should see the change. Beautifully both of these sides are written in Lua, and as they both manipulate the same data (called the "data model") describing the current state of the game, you can often use the same code on both sides!
Since I'm pretty deep into this, I could write hours about this subject, but I'll leave things here for now. Let me know ( @bemmu or me@bemmu.com) if you'd like me to write more about this.
以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网
猜你喜欢:本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Python算法教程
[挪威] Magnus Lie Hetland 赫特兰 / 凌杰、陆禹淳、顾俊 / 人民邮电出版社 / 2016-1-1 / 69.00元
本书用Python语言来讲解算法的分析和设计。本书主要关注经典的算法,但同时会为读者理解基本算法问题和解决问题打下很好的基础。全书共11章。分别介绍了树、图、计数问题、归纳递归、遍历、分解合并、贪心算法、复杂依赖、Dijkstra算法、匹配切割问题以及困难问题及其稀释等内容。本书在每一章结束的时候均有练习题和参考资料,这为读者的自我检查以及进一步学习提供了较多的便利。在全书的最后,给出了练习题的提......一起来看看 《Python算法教程》 这本书的介绍吧!