哪种编程语言最适合创建 Roguelike 游戏?
如果有兴趣创建 Roguelike RPG(例如 Nethack、Rogue 和 ADOM),哪种编程语言最合适?为什么?
对于您选择的语言,请务必列出该语言特别适合的所有库或方面。
With the interest of creating a roguelike RPG (such as Nethack, Rogue, and ADOM), which programming language would be most suitable and why?
With the language that you choose, be sure to list any libraries or facets of the language that make it particularly well-suited.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(11)
早在那天,我尝试使用 QuickBASIC 编写 Roguelike 游戏(它是1988。)不是推荐的方法...
仍然有一些开发圈子。 这是Roguelike 开发常见问题解答以及致力于同一内容的博客。
Way back in the day I tried to write Roguelike games using QuickBASIC out of all things (it was 1988.) Not the recommended approach...
There are still some development circles out there. Here's an FAQ on Roguelike Development and also a blog dedicated to the same.
我使用的语言(我也在尝试创建 roguelike)是 Python,因为:
My language of use (I'm trying to create roguelike too) is Python, because:
一如既往,这是一个非常个人的选择:-)
我用 Java 编写了我的 Roguelike 游戏(Tyrant),原因如下:
编辑:对于感兴趣的人它是开源的,所有代码均可在 SourceForge 获取
That's a very personal choice as always :-)
I wrote my Roguelike game (Tyrant) in Java for the following reasons:
EDIT: For those interested it is open source, all code is available at SourceForge
嗯,我用 C 语言制作了几个 Roguelike 游戏,在 roguebasin 上花了相当多的时间,这是一个很棒的网站任何与 Roguelike 开发相关的内容。
至于你应该使用什么语言,我并不认为它有很大的区别。 我选择 C 是因为它的可移植性,并且很多库都可以很好地使用它。但是面向对象的语言可以清理一些您可能不想跟踪的东西。
对于 Roguelike 游戏来说,我认为没有任何一种语言比其他语言更优秀。 如果您要使其图形化,您可能更喜欢内置的东西,例如 flash / silverlight。 但即便如此,任何其他语言的库都会使它们在这方面面临同样程度的困难。
所以我想说选择一种你知道并喜欢的语言,或者你不知道但想学习的语言。
Well I've made a couple roguelikes in C, spending a fair amount of time at roguebasin, which is a great site for anything related to roguelike development.
As for what language you should use, I don't really see it making a huge difference. I pick C because of the portability, and a lot of libraries work well with it.. But an object oriented language can clean up some things that you may not want to keep track of.
There aren't any languages that I would consider to be specifically greater than the rest for roguelikes. If you're making it graphical, you may prefer something that has that built-in, such as flash / silverlight. But even then there are libraries for any other languages that bring them to about the same degree of difficulty in that regard.
So I'd say take a language you know and like, or that you don't know and want to learn..
这些答案中的大多数都很好,但是对于在 C++ 中可能被滥用的面向对象的东西和低级命令的综合威力,还是有一些话要说。 如果您正在寻找一些灵感,NetHack 的 C 源代码可以广泛使用,并且文档记录得足够好,您当然可以通过浏览来学习一些东西。 也就是说,这是一个已经发展了数十年的庞大项目,并不是所有东西都像您想要为自己的项目提供的东西一样干净 - 不要根据您在 NetHack 中找到的内容做出糟糕的设计选择。
不过,老实说,就您使用的内容而言,它可能根本不重要——尽管我强烈建议使用面向对象语言。 在 Roguelike 游戏中(哎呀,任何 CRPG 都是如此),有太多的垃圾需要处理,因此 OOP 是保持理智的最简单方法。
Most of these answers are great, but there's something to be said for the combined power of object-oriented stuff and low-level commands that can be abused in C++. If you're looking for some inspiration, the C sourcecode to NetHack is widely available and documented well enough that you can certainly poke around to learn some things. That said, it's a huge project that's been growing for decades, and not everything is as clean as you're going to want things for your own project - don't get roped into making poor design choices based off of what you find in NetHack.
Honestly, though, in terms of what you use it probably doesn't matter at all - though I'd highly recommend using an OO language. There's so much crap to handle in a roguelike (heck, any CRPG really) that OOP is the easiest way of staying sane.
最初的 nethack 是用 C 语言编写的,如果您想了解它是如何实现的,源代码是可用的书面的,以及您可能遇到的挑战,这可能是开始决定语言的好方法。
The original nethack was written in C, and the source is available if you want to get some ideas about how it was written, and the challenges you may find which might be a good way to start deciding on a language.
我的第一个问题是,这款游戏是否会有基于网络的用户界面,或者像最初的 Rogue-like 游戏一样,是某种控制台/窗口事件? 如果是前者,我会说任何您熟悉的语言都是不错的选择。 Ruby on Rails、Python/Django、PHP/CakePHP 等都很棒。
但如果答案是后者,这是一款你希望人们能够在本地下载并安装的游戏,我将选择 Java。 这是一种很棒的语言,无需您处理内存管理。 由于及时编译和优化,它实现了非常高的性能,并且它拥有极其丰富的库来帮助您处理数据结构,Swing 可以实现一些非常漂亮的 UI,2D 库允许最丰富的跨平台在 PostScript 之外渲染。 它还具有跨 Windows、Mac OS X 和 Linux 的可用性,这是其他选择所无法提供的。
最后,通过 Java Web Start 也可以轻松分发应用程序,因此人们一旦拥有 Java,只需单击几下即可下载并安装游戏,并将其保留在自己的计算机上,想运行多久就运行多久。
My first question would be whether the game is going to have a web based UI or be some kind of console/window affair like the original Rogue-like games? If the former I would say that any language you're comfortable with would be a good choice. Ruby on Rails, Python/Django, PHP/CakePHP, etc. would all be great.
But if the answer is the latter, this is a game that you want people to be able to download and install locally, I'm going to go with Java. It's a great language with no memory management for you to deal with. It achieves very high performance thanks to just-in-time compilation and optimization, and it has an extremely rich library to help you with data structures, Swing makes for some really beautiful UIs, and the 2D library allows for the most rich cross-platform rendering outside of PostScript. It also has the availability across Windows, Mac OS X, and Linux that you're not going to get from some other choices.
Finally, distribution of your application is easy via Java Web Start as well, so people can download and install the game with just a couple of clicks once they have Java and keep it on their machine to run as long as they like.
对于制作任何游戏,任何语言都将是正确的,如果:
我认为对于 Rogue-Like 游戏来说,只要能在你的目标上运行,你所知道的任何语言都是正确的。 在这种游戏中,性能并不是真正的问题。 如果你的世界生成真的很复杂,世界生成可能需要高性能......
For making any game, any language will be right if :
I think that for a Rogue-Like, any language you know will be right as far as it runs on you target. Performances are not really a problem in this kind of game. World generation can require high performance if your world generation is really complex though...
只需选择能够为您处理底层细节的东西即可。 无论你知道什么都应该有效。
嘿,他们可以用 JavaScript 写一个。
just go with something that will handle the low-level details for you. whatever you know should work.
hey, they can write one in javascript.
对于这些游戏,我推荐使用
Actionscript
。I recommend
Actionscript
for those games.你可以考虑Silverlight。
它位于 C# 和 .Net 之上,因此无需过多担心内存管理。 使用 SL,您将获得对场景图形类型渲染的内置支持 - 剔除不在屏幕上的事物、键盘、鼠标事件、点击对象等。
有一个初始学习曲线,但我发现这是一个很好的工作环境。
You could consider Silverlight.
It sits on top of C# and .Net so theres not much need to worry about memory management. With SL you'll get built in support for scene graph type rendering - culling of things not on screen, Key board, mouse events, clicks on objects etc.
There's an initial learning curve, but I find it's a great environment to work in.