What it's like to code for Roblox

栏目: IT技术 · 发布时间: 4年前

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.


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

实战Linux编程精髓

实战Linux编程精髓

罗宾斯 / 中国电力出版社 / 2005-7 / 59.80元

编写应用软件,特别是那些比较重要的软件,毫无疑问要涉及到系统调用。在UNIX/Linux环境下编程更是如此。要想编写优秀的软件,就必须熟悉这些系统调用的方方面面。通过阅读这本书,你能够快速地掌握这些重要技术,以构建严谨的Linux软件。全书主要分为三大部分:第一部分讨论了基本的编程问题,包括Linux编程环境、基本的文件和进程管理与操作、内存操作,还介绍了一些基本的库接口。第二部分比较深入地讨论了......一起来看看 《实战Linux编程精髓》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器