哪种编程语言最适合创建 Roguelike 游戏?

发布于 2024-07-13 04:57:53 字数 108 浏览 7 评论 0原文

如果有兴趣创建 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(11

征棹 2024-07-20 04:57:53

早在那天,我尝试使用 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.

白芷 2024-07-20 04:57:53

我使用的语言(我也在尝试创建 roguelike)是 Python,因为:

  • 它是高级编程语言,我不需要一直考虑内存分配等问题,但要专注于算法。
  • 几乎所有东西都有大量有用的库。 最近我发现了 TDL/libtcod 这对于 roguelike 开发很有用。
  • 通过绑定,您可以轻松使用 C/C++ 库,甚至可以在 C/C++ 中编写一些关键函数并使用它们。
  • 这是我见过的最易读的编程语言。
  • 在使用 Python 编程时,我学会了使用内部文档。 这是非常有帮助的事情,几个月后我刚刚阅读了我的代码,我仍然知道它在做什么。

My language of use (I'm trying to create roguelike too) is Python, because:

  • It's high level programming language, I don't need to think about memory allocation all the time, etc, but keep my mind on algorithms.
  • There's tons of useful libraries for almost everything. Recently I've found TDL/libtcod which can be useful for roguelike development.
  • With bindings you can easily use C/C++ libraries or even write few critical functions in C/C++, and use them.
  • It's the most readable programming language I've ever seen.
  • While programming in Python I've learned to use internal documentation. It's very helpful thing, I just read my code few months later and I still know what it's doing.
沫雨熙 2024-07-20 04:57:53

一如既往,这是一个非常个人的选择:-)

我用 Java 编写了我的 Roguelike 游戏(Tyrant),原因如下:

  • 非常便携(即使有图形)
  • 垃圾收集/内存管理
  • 有很多好的免费/开源库可用(对算法很有帮助) ,数据结构和操作保存游戏文件等)
  • 它是一种静态类型语言 - 它具有性能和鲁棒性优势,我认为值得额外的编码复杂性
  • 我想磨练我的Java技能更广泛地用于其他项目

编辑:对于感兴趣的人它是开源的,所有代码均可在 SourceForge 获取

That's a very personal choice as always :-)

I wrote my Roguelike game (Tyrant) in Java for the following reasons:

  • Very portable (even with graphics)
  • Garbage collection / memory management
  • Lots of good free / open source libraries available (helpful for algorithms, data structures and manipulating save game files etc.)
  • It's a statically typed language - this has performance and robustness benefits which I judged to be worth the additional coding complexity
  • I wanted to hone my Java skills more generally for use in other projects

EDIT: For those interested it is open source, all code is available at SourceForge

只是在用心讲痛 2024-07-20 04:57:53

嗯,我用 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..

一笑百媚生 2024-07-20 04:57:53

这些答案中的大多数都很好,但是对于在 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.

旧话新听 2024-07-20 04:57:53

最初的 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.

只有一腔孤勇 2024-07-20 04:57:53

我的第一个问题是,这款游戏是否会有基于网络的用户界面,或者像最初的 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.

明明#如月 2024-07-20 04:57:53

对于制作任何游戏,任何语言都将是正确的,如果:

  1. 您可以使用它(您可以通过知识使用它,或者如果您或您的团队现在很容易学习它)
  2. 它可以生成在您客户的计算机上运行的应用程序
  3. 它可以轻松生成运行速度足以满足您的游戏需求的应用程序。

我认为对于 Rogue-Like 游戏来说,只要能在你的目标上运行,你所知道的任何语言都是正确的。 在这种游戏中,性能并不是真正的问题。 如果你的世界生成真的很复杂,世界生成可能需要高性能......

For making any game, any language will be right if :

  1. you can use it (you are able to use it, by knowledge or if it's easy enough to learn right now for you or your team)
  2. it produce applications that runs on your client's computer
  3. it can easily produce applications that runs fast enough for your game's needs.

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...

命硬 2024-07-20 04:57:53

只需选择能够为您处理底层细节的东西即可。 无论你知道什么都应该有效。

嘿,他们可以用 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.

长梦不多时 2024-07-20 04:57:53

对于这些游戏,我推荐使用 Actionscript

I recommend Actionscript for those games.

梦中楼上月下 2024-07-20 04:57:53

你可以考虑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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文