What it's like to code for Roblox

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

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操作系统

王柏生 / 机械工业出版社 / 2013-10-15 / 89.00

《深度探索linux操作系统:系统构建和原理解析》是探索linux操作系统原理的里程碑之作,在众多的同类书中独树一帜。它颠覆和摒弃了传统的从阅读linux内核源代码着手学习linux操作系统原理的方式,而是基于实践,以从零开始构建一个完整的linux操作系统的过程为依托,指引读者在实践中去探索操作系统的本质。这种方式的妙处在于,让读者先从宏观上全面认清一个完整的操作系统中都包含哪些组件,各个组件的......一起来看看 《深度探索Linux操作系统》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

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

在线压缩/解压 JS 代码

html转js在线工具
html转js在线工具

html转js在线工具