简体   繁体   English

Java实时策略游戏开发

[英]Java real time strategy game development

I'm coming to the end of my first year of CS and I thought a great way to consolidate all the things I've learnt this year would be a personal game project. 我即将结束我的第一年CS,我认为巩固今年学到的所有东西的好方法将是个人游戏项目。

I would like to implement a 2D based rts, I'm thinking along the lines of starcraft I, warcraft II or even command and conquer. 我想实现一个基于2D的rts,我正在思考星际争霸I,魔兽II甚至命令和征服。 I will have about 3 months without interruptions to implement the game. 我将有大约3个月没有中断来实施游戏。

So to anyone experienced with java game programming, I have a few questions: 所以对于有java游戏编程经验的人来说,我有几个问题:

Is it realistic to design a 2D rts engine from scratch in 3 months? 在3个月内从头开始设计2D rts引擎是否现实? If so what are some good books/resources to get started? 如果是这样,有什么好的书籍/资源可以入手?

Would it be better to modify some existing project? 修改一些现有项目会更好吗? I would think the experience of having to work with a lot of someone else's code would be good since our exposure to such topics in an undergrad cs degree seems very rare, if non-existent. 我认为必须与很多其他人的代码合作的经验会很好,因为我们在大学本科学位课程中接触这些主题似乎非常罕见,如果不存在的话。

Are there any decent open source 2d rts projects that anyone could recommend? 是否有任何人可以推荐的开源2d rts项目? I've looked through a few but most seem to be written in c/c++ 我看过几个,但大多数似乎是用c / c ++编写的

My humble thanks 我的谦虚谢谢

Edit: Thanks for the quick responses, I think that perhaps it was a bad idea to post this in a rush since I think I misrepresented what I want to do. 编辑:感谢您的快速回复,我想也许这是一个不好的主意,因为我认为我歪曲了我想做的事情。

When I say "along the lines of warcraft II etc" I mean more like that style of rts using sprites. 当我说“沿着魔兽世界II等”时,我的意思更像是那种使用精灵的rts风格。 I don't intend to implement a game nearly that complex, more like just a basic prototype. 我不打算实现几乎那么复杂的游戏,更像是一个基本的原型。

My goal would be some thing more like a flat textured map with some basic obstacles like trees, a single unit producing structure like a barracks. 我的目标是更像一个平面纹理的地图,有一些基本的障碍,如树木,一个单位生产结构,如营房。 I'd like to have the units to have health bars, be able to move and attack and die (and possible morph into another unit). 我想让这些单位拥有健康棒,能够移动,攻击和死亡(并可能变身为另一个单位)。

Far off goals would be to implement some basic pathing using a modified version of the dijkstra shortest path algorithm, ranged units with missle attack, etc. 远程目标是使用dijkstra最短路径算法的修改版本,具有导弹攻击的远程单位等来实现一些基本路径。

I don't plan to implement any opponents or ai or networking or anything like that. 我不打算实施任何反对者或ai或网络或类似的东西。

I'm thinking along the lines of starcraft I, warcraft II or even command and conquer 我正在思考星际争霸,魔兽争霸II,甚至命令和征服

Make sure you purge your mind of matching the full scope of any of those. 确保你清醒地想要匹配其中任何一个的全部范围。 They took large teams of developers multiple years to make, with multi-million dollar budgets, so you can't even hope to approach those. 他们花费了大量的开发团队多年来制作数百万美元的预算,所以你甚至不希望接近这些。 They're called AAA for a reason. 他们被称为AAA是有原因的。 That being said, there's no reason you can't very minimally ape their design, or make a tiny game in their genre, assuming you have previous experience making small games. 话虽这么说,假设你以前有过制作小游戏的经验,那么你就没有理由不能将他们的设计做到最低限度,或者在他们的游戏中制作一个小游戏。

A sub-genre of RTS that might be doable in that amount of time is a Tower Defense game. 在这段时间内可能可行的RTS子类型是塔防游戏。 Plants vs Zombies is a good example. 植物大战僵尸就是一个很好的例子。 The reason I suggest this sub-genre is that you can avoid implementing any sort of AI or path-finding, which are notoriously difficult to get working, and I think technically impossible to implement "perfectly", especially with a limited CPU budget. 我建议这个子类型的原因是你可以避免实现任何类型的AI或路径查找,这是众所周知的难以工作,我认为在技术上不可能“完美”实现,特别是在CPU预算有限的情况下。

Make sure to reign in your scope. 确保在你的范围内统治。 Favor a "complete" game over new features, because you can then call it "done" at any time. 支持“完整”游戏而不是新功能,因为您可以随时将其称为“完成”。 Get your game playable ASAP, and don't sweat the polish or details until you have to. 尽快让您的游戏可玩,并且在您不得不这样做之前不要沾沾自喜。 Add one enemy type and one type of player unit (with only one ability, if you were thinking of implementing multiple abilities per unit). 添加一种敌人类型和一种类型的玩家单位(只有一种能力,如果你想要实现每个单位的多种能力)。 Make a title screen, menus (even if the menu is just "click screen to play"), game over screen, level complete or stat screens, cross-level player statistics, etc. Once you have all that ironed out, spend equal time adding new features and polishing the gameplay/graphics/bugs. 制作标题屏幕,菜单(即使菜单只是“点击屏幕播放”),屏幕上的游戏,关卡完成或统计屏幕,跨级玩家统计等等。一旦你完成了所有的解决,花费相同的时间添加新功能并抛光游戏/图形/错误。

Once you have a playable, "complete" game ready (no matter how small in scope), find a real artist to do graphics for you. 一旦你准备好可玩的“完整”游戏(无论范围有多小),找一个真正的艺术家为你做图形。 A shiny game always draws an audience, no matter how simple the gameplay. 无论游戏玩法多么简单,闪亮的游戏总能吸引观众。

It is very unrealistic to think you could implement a 2D RTS engine anywhere even close to the complexity in those kind of games. 认为你可以在任何地方实现2D RTS引擎甚至接近这类游戏的复杂性是非常不现实的。 You could maybe get something very rough if you were experienced, but with only one year I think it's doubtful. 如果你有经验,你可能会得到一些非常粗糙的东西,但只有一年我认为这是值得怀疑的。

I can't help but feel like it would be much better for you if you used an existing engine or framework and built off of it. 如果您使用现有的引擎或框架并使用它构建它,我会情不自禁地觉得它会好得多。 Like you said, working with other code would probably be a good learning experience as well. 就像你说的,使用其他代码也可能是一个很好的学习经验。 It would allow you to experiment without getting bogged down in having to do everything. 这将允许您进行实验,而不必陷入必须做所有事情。

Keep it simple or you will simply drown in complexity before getting around to have anything playable. 保持简单,否则你只会在复杂性之前淹没,然后才能玩得开心。 Since you have not tried it before, you will have a lot of nuts to crack and you don't know how long they will take. 既然你以前没有尝试过,你会有很多坚果要破解,你不知道它们需要多长时间。

Also remember that report writing and documentation takes time too. 还要记住,报告编写和文档也需要时间。

The idea is good, and I think you can pull off a whole game if you find good building blocks. 这个想法很好,如果你找到好的积木,我认为你可以完成整个游戏。 I would suggest discussing this with your teacher to hear what is acceptable for you to use. 我建议与老师讨论这个问题,听听你可以接受的内容。 Would it eg be ok to do a game on an open source engine if you add some non-trivial functionality? 如果添加一些非平凡的功能,是否可以在开源引擎上进行游戏?

Update: Seems to be several engines available from Java at http://www.devmaster.net/engines/list.php?fid=6&sid=1 更新:似乎是Java提供的几个引擎, 网址http://www.devmaster.net/engines/list.php?fid=6&sid=1

Perhaps it would make sense to look at some existing efforts to get a feel for the scope of what you are looking at. 也许有必要考虑一些现有的努力,以了解你所看到的范围。 These should give you some ideas or even code to build on: 这些应该给你一些想法甚至代码构建:

http://www.duncanjauncey.com/btinternet/old/javagame/game.html http://www.duncanjauncey.com/btinternet/old/javagame/game.html

http://en.wikipedia.org/wiki/Lightweight_Java_Game_Library http://en.wikipedia.org/wiki/Lightweight_Java_Game_Library

http://www.ardor3d.com/ http://www.ardor3d.com/

http://en.wikipedia.org/wiki/JMonkeyEngine http://en.wikipedia.org/wiki/JMonkeyEngine

It would be a lot for me to bite off (from scratch) in the time given that is for sure. 对于我来说,在确定的时间内(从头开始)咬一口是很多的。 That is about all I can say. 这就是我能说的全部。

EDIT: I thought maybe JOGRE was not what you are looking for. 编辑:我想也许JOGRE不是你想要的。 Then I thought about it and it seems like it would have all the right kinds of plumbing for what you are trying to do. 然后我想到了它,似乎它会为你想要做的事情提供所有正确的管道。

EDIT AGAIN: After my answer, one of the related questions links on the side seemed relevant: Java Game Programming: JOGL vs LWJGL? 再次编辑:在我的回答之后,侧面的一个相关问题链接似乎相关: Java游戏编程:JOGL与LWJGL?

People often forget, that creating games is MUCH MORE than just coding the technique thing. 人们经常忘记,创造游戏不仅仅是编码技术的东西。 Its about content creation, game design, sound and music, the "fun factor". 它涉及内容创作,游戏设计,声音和音乐,“有趣的因素”。 If you make heavy use of existent APIs or engines, it will be possible, but writing it from scratch with no experience in 3 month is like asking yourself if you can code 100,000 LOC in this time which means 1111 LOC per day. 如果你大量使用现有的API或引擎,那么它是可能的,但是在3个月内没有任何经验从头开始编写就像问自己是否可以在这段时间内编写100,000 LOC,这意味着每天1111 LOC。 This might be possible, but not if you have to desing and think, and just having the code makes no game. 这可能是可能的,但如果你不得不设计和思考,并且只是让代码没有游戏,那就不可能了。

Well if it gives you any hope at all, my team and I are currently working on an RTS game called "The Genesis Project". 好吧,如果它给你带来任何希望,我和我的团队目前正在开发一款名为“创世纪项目”的RTS游戏。 We call ourselves MotherBoard Games, or MBG for short. 我们称自己为MotherBoard Games,简称MBG。 If you would like, I am always looking for more coders. 如果你愿意,我一直在寻找更多的程序员。 You can email me at mpmn5891@gmail.com, I can give you some advice and tips form my 6 year experience, 2 of which have been spent making this game (to give you a scope) 你可以发送电子邮件给我mpmn5891@gmail.com,我可以给你一些建议和提示,形成我6年的经验,其中2个用于制作这个游戏(给你一个范围)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM