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.


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

查看所有标签

猜你喜欢:

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

U一点·料

U一点·料

阿里巴巴集团 1688用户体验设计部 / 机械工业出版社 / 2015-7-13 / 79.00元

《U一点·料——阿里巴巴1688UED体验设计践行之路》是1688UED团队历经多年实践之后的心血之作,书中以“道─术─器”的思路为编排脉络,从设计观、思考体系、方法论上层层剖析,将零散的行业knowhow串成体系,对“UED如何发展突破”提出了自己的真知灼见。该书重实战、讲方法、求专业、论文化,是一部走心的诚意之作。 本书作者从美工到用户体验设计师,从感性随意到理性思考,从简单的PS做图到......一起来看看 《U一点·料》 这本书的介绍吧!

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具