Slick2D和直LWJGL [英] Slick2D vs Straight LWJGL

查看:109
本文介绍了Slick2D和直LWJGL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在研究Slick2D的游戏编程,并且从长远来看,我开始怀疑是否知道LWJGL会更有帮助.一方面,Slick2D既快速又简单,但是LWJGL似乎具有2D和3D功能,因此更具适应性.对于精通Java并想做游戏的人来说,立即学习LWJGL是否值得付出额外的努力?

I've been delving into game programming with Slick2D, and I've began to wonder if in the long run, knowing LWJGL would be more helpful. On one hand, Slick2D is fast and simple, but it seems LWJGL is more adaptable in the sense that it has both 2D and 3D capabilities. For someone who is intermediate in java, and wants to make games, would it be worth the additional effort to learn LWJGL right off the bat?

推荐答案

我认为这两者并没有真正的联系.我的意思是,我知道Slick是建立在LWGJL之上的,但这不是我要讲的.

I don't think the two are really related. I mean, I know Slick is built on top of LWGJL, but that's not what I'm getting at here.

Slick的存在是为了利用硬件图形和声音加速,并为2D游戏提供这种功能,其中包含一组对2D游戏有意义的对象和类(与几何模型和3D坐标相反的对象和图块)空间).就是这样-这就是它的任务,并且它在解决这个问题方面真是太棒了. Slick基于LWJGL的事实仅仅是LWJGL是一个可以在其上构建诸如Slick之类的库的问题.在人们尝试用Java制作游戏的历史上,图形性能一直是将任何质量的产品投放市场的主要问题. Slick本质上消除了台式机(以及希望有一天在Android上)进行2D游戏的障碍.

Slick exists to take advantage of the hardware graphics and sound acceleration, and to give that power to 2D games with a set of objects and classes that make sense for 2D games (sprites and tilemaps, as opposed to geometric models and 3D coordinate space). That's it - that's its mission, and it's built to be awesome at solving that problem. The fact that Slick is based on LWJGL is simply a matter of LWJGL being a library upon which you could build something like Slick. In the history of people trying to make games in Java, graphics performance had always been a major problem to getting anything of quality out on the market. Slick essentially removes that hurdle for 2D games on the desktop (and hopefully on Android, someday).

在考虑使用Slick和LWJGL时,这是正确的工具,可以完成正确的工作".如果您正在用Java开发2D游戏,那么Slick是不错的选择.如果您实际上是在构建3D游戏(或具有自上而下的2D视图的游戏,但是您需要以3D实际渲染场景),那么LWJGL可能是您的最佳起点.

When considering Slick vs. LWJGL, it's a "right tool for the right job" sort of thing. If you're building a 2D game in Java, Slick is an awesome way to go. If you're actually building a 3D game (or a game with a top-down 2D sort of view, but you have a requirement to actually render your scenes in 3D), then LWJGL may be your best starting point.

但是,如果您正在构建2D游戏,并且您认为值得在LWJGL中进行构建,那么为使该作品能够完成的99%的制作将是Sprites,动画,按键输入,寻路和声音. Slick已经为您构建了这些东西-几乎可以肯定,您会重新发明轮子,并且如您所愿,即使您花了很多年的时间在Slick上工作,他们也做不到. 2D游戏渲染是一个已解决的问题-不要浪费时间.除非您认真认真研究渲染引擎(我什至不是在谈论游戏引擎,您花时间在其中研究游戏玩法和机制,而是实际的渲染技术),否则您不会会发现它不但令人沮丧.挫败感不会源于解决问题太难了(您当然可以解决),只是您要花费数月的时间来构建它,完成后您将已经拥有一些功能的子集包含在Slick中,但没有游戏可以显示.制作Slick的聪明人已经为您解决了Java 2D游戏引擎的要素-充分利用他们的工作,而无需花费数月的时间来尝试构建就在您眼前的东西.

If, however, you're building a 2D game, and you think it's worth your time to build it in LWJGL, 99% of what you're going to build in order to make that work is going to be Sprites, animation, key input, pathfinding, and sound. Slick has already built these things for you - you're pretty much guaranteed to be reinventing the wheel, and as well intentioned as you are, you won't do it as well as the developers who have spent years working on Slick. 2D game rendering is a solved problem - don't waste your time. Unless you're seriously into rendering engines (I'm not even talking about game engines where you spend your time working out game play and mechanics, but actual rendering technology) you're going to find it more than a little frustrating. The frustration won't come from it being too difficult a problem to solve (you can certainly solve it), it's just that you'll spent months building it, and when you're done you'll have some subset of the features already included in Slick, but no game to show for it. The smart people that made Slick already solved the elements of a 2D game engine in Java for you - take advantage of their work and don't spend months trying to build something that's right there in front of you.

最后一个例子是,DirectX进入市场时,实际上是在90年代初期PC上的游戏大爆炸.当然,从Atari,Apple [],Commodore等到处都有视频游戏,但是当DirectX出现并让开发人员免于编写自己的东西时,就出现了爆炸式增长,游戏和技术上的巨大飞跃.声音和视频的驱动程序.从字面上看,这就是开发人员在编写游戏时必须做的事情-为希望运行游戏的每个声卡和视频卡编写或许可单独的驱动程序. DirectX为开发人员提供了一个不必再担心的机会-只需担心硬件与特定版本兼容DirectX",而其功能却不足以提供所需的性能,就是这样.

To make one final analogy, the huge explosion of gaming on the PC in the early 90's really happened when DirectX hit the market. Sure there were video games around all the way back to the Atari, the Apple ][, the Commodore, etc., but there was an explosion, an absolutely huge jump in games and technology when DirectX came aboard and saved developers from writing their own drivers for sound and video. That's literally what developers had to do back then if they were writing games - write or license individual drivers for each sound and video card that they wanted their game to run on. DirectX gave developers a chance to stop worrying about that - to only worry that hardware was "DirectX compatible" to a certain version, and was minimally powerful to deliver the performance they needed, and that was it.

很难解释它的大小-但是,如果您正在用Java开发2D游戏- Slick(或其他游戏工具之一)就是您的DirectX!

It's hard to explain just how big this was - but if you're developing 2D games in Java - Slick (or one of the other game tools out there) is your DirectX!

这篇关于Slick2D和直LWJGL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆