如何学习游戏开发?

发布于 2024-07-21 17:38:19 字数 1539 浏览 1 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(13

若能看破又如何 2024-07-28 17:38:19

如果这是您的第一款游戏,多人游戏项目可能过于雄心勃勃。

加载屏幕并不是非常困难 - 我通过计算必须“加载”的文件数量来实现它们,然后在每次成功加载另一个文件时推进进度条(并进行屏幕刷新)。 您可以根据需要尽可能多地执行此操作 - 添加 UI 组件可能会使您的加载代码变得复杂。 我暂时不担心这个问题; 也许只是抛出一个基本的“正在加载...”框架,然后当游戏更加稳定时实现一个完整的进度条。 我还看到了一些很好的多线程实现。

另外两人将有经验; 我认为您更需要的是游戏开发的一般教程,而不是具体的答案。 你绝对应该从更小的开始。 一旦您了解了小型游戏的结构和问题,就可以更轻松地将其应用到大型游戏中。

大多数合理的游戏编程书籍都会介绍基本的游戏结构; 我喜欢 Game Coding Complete,但它对于初学者来说相当复杂(它涵盖了处理大型项目的更复杂的方法)。 游戏架构和设计类似,但可能更适合您正在寻找的内容,因为它还涵盖了一些小型项目管理“最佳实践”。

有很多不同的方法来实现 UI,从使用 Java 原始 UI 类型(取决于您使用的其他库)到根据您的需要自行编写自己的“HUD”实现。

If this is your first game, a multiplayer project might be too ambitious.

Loading screens are not terribly hard - I implement them by counting up how many files I have to 'load' and then advancing the progress bar (and doing a screen refresh) every time another file has been loaded successfully. You can do this with as much granularity as you please - it might complicate your loading code to add the UI component. I wouldn't worry about it for now; maybe just throw up a basic "Loading..." frame and then implement a full progress bar later when the game is more solid. I've also seen some good implementations with multithreading.

The other two will come with experience; I think what you need more of is a general tutorial for game development than the specific answers. You should definitely start smaller. Once you understand the structure and problems of a smaller game, it will be easier to apply those to larger games.

Most reasonable game programming books will go over basic game structure; I like Game Coding Complete but it's quite complicated for a beginner (it covers more complex ways to approach large projects). Game Architecture and Design is similar, but might be better suited to what you're looking for since it also covers some minor project management "best practices."

There's a lot of different ways to do UI, from using the Java primitive UI types (depending on what other libraries you're using) to self-writing your own "HUD" implementation with just what you need.

我也只是我 2024-07-28 17:38:19

可能值得熟悉的一件事是多线程。 例如,对于“加载屏幕”,您可能有一个线程显示进度条,而其他线程同时加载数据。

类似地,大部分交互性将通过调度多个线程同时执行许多操作(在屏幕上移动不同的字符)或处理用户输入的中断来实现。

One thing that is probably worth being familiar with is multi-threading. For example, with the "load screen", you might have one thread displaying the progress bar, while other threads simultaneously load data.

Similarly, much of the interactivity will happen by dispatching multiple threads to do many things at the same time (move different characters on the screen) or to handle interrupts by user input.

油饼 2024-07-28 17:38:19

我会看看 O'Reilly Books

Java 杀手游戏编程

有趣的编码

I would look at O'Reilly Books

Killer Game Programming in Java

Coding For Fun

冰雪梦之恋 2024-07-28 17:38:19
  1. 最简单的方法是将所有内容打包到 Jar 文件中。 默认屏幕确实显示了一个进度条,具有一些小功能 定制。 您可以编写自定义代码来跟踪、管理和下载文件,但我个人建议不要这样做。 如果您搜索 applet 加载器,您会找到更多信息。

  2. 我不是 100% 确定你的意思,但你可以使用 Swing 组件,与在应用程序中使用它们的方式相同。 使用带有图像的 JButton 非常简单,然后在 actionPerformed 方法中挂钩事件代码。

  3. 您可能遇到的最大问题是动画和 美国东部时间。 我之前问过这个

页面有一大堆游戏开发的有用链接。 Pulp core 是一个值得一试的开源框架 - 即使您不使用您自己的框架可以研究代码。

是否应该使用 Java 小程序似乎超出了这个问题的范围,但是上面的很多答案都给出了关于是否使用 Java 小程序的客观(或根本没有任何理由)。 如果这是一款用于个人练习 Java 的游戏,那么这是一个很好的方法。 如果您希望将其公开,您需要考虑当前的采用水平是否足以满足您的需求。

最近,小程序世界发生了变化。 自 1.6 update 10 起,它与 Flash 相比更具竞争力 - 下载大小更小(通常低于 4Mb),启动时间减少,并且 引入了新的缩放外观

  1. The easiest route is to package everything in a Jar file. The default screen does show a progress bar with some small ability to customise. You can write custom code to keep track, manage and download files but I would personally advise against this route. If you search for applet loaders you will find more information.

  2. I'm not 100% sure what you mean, but you can use Swing components in the same way you can use them in applications. Use a JButton with an image is quite trivial, then hook the event code in the actionPerformed method.

  3. The biggest problem you will probably come across is animation and the EDT. I asked about this earlier.

This page has a whole bunch of useful links for game development. Pulp core is an open source framework worth checking out - even if you don't use the framework you can investigate the code.

Whether you should use Java applets or not seems out of scope of this question, but a lot of the above answers give objective (or no reasons at all) about whether to use Java applets. If it's a game for a personal exercise to learn Java then it's a great approach. If you wish to make it public you need to consider whether the current adoption levels are high enough for your needs.

Things have changed in the applet world recently. Since 1.6 update 10 it is much more competitive with Flash - the download size is smaller (at typically under 4Mb), the startup time is reduced and a new scaling look and feel was introduced.

若沐 2024-07-28 17:38:19

http://nehe.gamedev.net/

拥有大量从基础到高级的各种语言使用 OpenGL 的教程和系统,从 C 到 C#,从 Python 到 Java。

我发现这非常非常有用,并且是一个很好的书签资源。
它应该可以帮助您开始在您选择的平台/语言上进行游戏/3D 编程的基础知识。

祝你好运!

http://nehe.gamedev.net/

Has tons of tutorials from basic to advanced using OpenGL from various languages and systems, from C to C# and Python to Java.

I found this very very useful and is a great resource to bookmark.
It should get you started with the basics of game/3D programming on your platform/language of choice.

good luck!

猫瑾少女 2024-07-28 17:38:19

正如其他人所说,Java 小程序可能不是您想要展示游戏的媒介。 大多数人一看到小程序开始加载,就会惊慌失措。

如果您根本没有游戏设计经验,那么您就对多人角色扮演游戏设定了很高的标准。 您可能想从一个更简单的项目开始,例如重新创建俄罗斯方块、吃豆人甚至乒乓球等项目,这样您就可以了解创建游戏的所有过程。

如果您打算制作在线游戏,Flash 是很棒的选择,Java 加上 Jogl open-gl 包装器也是一个不错的选择。

我个人建议使用 Microsoft Xna。 C# 与 Java 非常相似,您应该能够相当快地掌握它,并且 Xna 很好地抽象出了图形编程中涉及的一些较低级别的细节。 社区也非常活跃且乐于助人。

As others have said a java applet is probably not the medium in which you want to present your game. The second most people see an applet start to load they run in fear.

If you have no game design experience at all, you are setting the bar very high with a multiplayer RPG. You may want to start with a simpler project such as recreating something like tetris, pacman, or even pong so you can get an idea of all that goes into creating a game.

Flash is great if you are set on doing an online game, Java plus the Jogl open-gl wrappers are also a great option.

Personally I would suggest using Microsoft Xna. C# is similar enough to Java that you should be able to pick it up fairly quickly and Xna does a good job of abstracting away some of the lower level details involved in graphics programming. The community is also very active and helpful.

淡笑忘祈一世凡恋 2024-07-28 17:38:19

不要走java applet 路线。

如果你想做一款快速休闲游戏,就制作Flash; 否则,开发一个成熟的 java 应用程序并通过 java web start 运行它。

尝试 Tower 看看使用 Java 作为平台可以走多远,以及 Java Web Start 的工作原理。

至于进度条的事情,我建议您在使用进度条养眼之前先实现这些文件的加载并实际使用它们:)

Don't go the java applet route.

If you want to make a quick casual game, make it Flash; else, develop a full-blown java app and run it via java web start.

Try Tower to see how far you can go using java as a platform, and also how Java Web Start works.

As for progress-bar thing, I recommend you to implement those files' loading and actually use them before you go for progress-bar eye-candy :)

节枝 2024-07-28 17:38:19

回答问题 3。如果您真的热衷于开始开发游戏,我建议您阅读此杰夫·霍兰的短文

Responding to question 3. If you are really keen to start developing games, I recommend you read this short article by Jeff Howland.

榕城若虚 2024-07-28 17:38:19

Q1 = 您的时间的 1%。

Q2 = 40% 的时间。

Q3 = 59% 的时间。

您可能会问我如何为网络浏览器编写 Halo3。

一开始就把目标定得低一点......

Q1 = 1% of your time.

Q2 = 40% of your time.

Q3 = 59% of your time.

You might as well be asking how could I write Halo3 for a web browser.

Aim a little lower to start with....

木緿 2024-07-28 17:38:19

opencourseware class on game theory and design. It also comes with a reading list.

徒留西风 2024-07-28 17:38:19

由于我无法添加评论,所以我将添加答案。 我建议不要使用线程来移动角色等。对于文件加载、播放声音,甚至服务器端网络,它工作得很好,但任何类型的人工智能/图形,它往往会引起无尽的头痛。

此外,正如其他人提到的,Java 可能不是最佳选择。 人们这么说的原因很简单,因为这很困难。 与 C++ 相比,Java 游戏开发的支持/教程相当缺乏(GameDev.net 很棒资源,但随着时间的推移,它的重点更多地转向专业发展),Flash(Kongregate 上的不错的教程onregate以及可以为您托管游戏的地方),甚至 C#(使用 XNA)。 多年来,Java 游戏开发已经取得了进步,您可以用它做一些令人惊奇的事情,但最终可能会变得更加困难。 无论您选择哪种语言,一定要考虑使用图形/游戏引擎,因为它将减少您的工作量,并让您有希望创建更好的游戏。

Since I can't add a comment, I'll add an answer. I'd recommend NOT using threads for moving characters, etc. For file loading, playing sounds, and even server side networking it works well but any sort of AI/Graphics, it tends to cause endless headaches.

Also, as other people have mentioned, Java may not be the best choice. The simple reason that people say this is that it's difficult. The amount of support/tutorials for Java game development is rather lacking when compared to C++ (GameDev.net is great resource, but it's moved its focus more towards professional development over time), Flash (decent tutorial on Kongregate as well as being a spot that could host the game for you), or even C# (using XNA). Java game development has improved over the years and you can do some amazing things with it, but it may end up being more difficult going that route. No matter which language you choose, definitely look into using a graphics/game engine as it will cut down on the amount of work on your end and allow you to hopefully create a better game.

为你拒绝所有暧昧 2024-07-28 17:38:19

如果您正在寻找一种温和的游戏开发入门途径并且不介意学习 C#,XNA 有围绕学习如何编写游戏而建立的整个社区。 它有各种各样的示例 - 游戏状态管理示例显示实现屏幕转换和加载的好方法,还有类似的网络游戏状态管理 网络内容示例。 他们还提供整个游戏的源代码供下载。

无论您的长期目标是制作 Java 小程序、Flash 游戏,还是想使用 OpenGL 在 C/C++ 中工作,XNA 都是忽略渲染/声音等所有复杂实现细节的好方法。 当你刚刚尝试制作你的第一款游戏时,这非常有帮助,相信我。

If you're looking for a gentle entry path to game development and don't mind learning C#, XNA has an entire community built around learning how to write games. It has samples of all sorts of things -- the Game State Management sample shows a good way to implement screen transitions and loading, and there's a similar Network Game State Management sample for networking stuff. They also have entire games available as source code to download.

Whether or not your long-term goals are to make a Java applet, Flash game, or you want to work in C/C++ with OpenGL, XNA is a great way to ignore all the hairy implementation details of rendering/sound/etc. That's very very helpful when you're just trying to make your first game, believe me.

云醉月微眠 2024-07-28 17:38:19

不要采用 java applet 方法; 小程序通常很烦人,而且速度很慢。

如果你真的希望它可以从浏览器玩,请考虑Flash(actionscript),或者也许是silverlight(我对silverlight中的游戏不太了解)。

Gamedev 是一般游戏编程的一个很好的资源

而且......

我会无耻地从 yx 的答案中窃取链接:

< a href="http://ocw.mit.edu/OcwWeb/Electrical-Engineering-and-Computer-Science/6-972Spring-2005/CourseHome/index.htm" rel="nofollow noreferrer">麻省理工学院开放课件:博弈论与机制设计

Don't go with the java applet approach; applets are generally annoying, and slow.

If you really want it to be playable from the browser, consider Flash (actionscript), or maybe silverlight (I don't know much about games in silverlight).

Gamedev is a great resource for general game programming stuff

And ...

I'll shamelessly steal the link from yx's answer:

MIT Open Course Ware: Game Theory and Mechanism Design

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