游戏引擎创作 [英] Game Engine Creations

查看:132
本文介绍了游戏引擎创作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在为大学的最后一年的项目创建一个小型2D游戏引擎,但是每当我认为自己朝着正确的方向前进时,我就会陷入诸如用c#实时渲染,在c#中创建和渲染BSP树之类的事情上我发现要找到的C#是一项艰巨的任务.
所以我把我的问题交给你们....
1:这将是创建实时渲染的最好,最有效的方法...我应该创建一个时间还是坚持使用我的更新方法等?
2:我还创建了与引擎配合使用的编辑器,到目前为止,该编辑器是使用Windows窗体制作的,我希望在此编辑器中具有可用资产的可访问列表,然后可以将其拖放到级别列表中实体等,并且还具有游戏预览效果(有关类似的布局,请参见unity 3d)
3:哪种数据结构对此最合适,请记住,树形结构是我对此进行高级评估所需要的.

预先感谢您的回答.

I am currently creating a small 2D game engine for my final year project at university, but when ever i think im going in the right direction i get stuck on things like real time rendering in c#, creating and rendering a BSP tree in c# which I have come to find is a difficult task.
So i turn my questions to you guys....
1: which would be the best and most efficient way of creating a making it render in real time...should i create a time or stick with my update method etc?
2: Im also creating the editor to go with the engine, which is so far being made using the windows forms, in this editor i hope to have an accessible list of assets available, which can then be dragged and dropped into a list of level entities etc and also have a game preview (see unity 3d for similar lay out)
3: Which data structure would be best for this, baring in mind a tree structure is what i need for a high grade on this.

thanks in advance for your answers

推荐答案

成为程序员的一部分是能够分析问题,然后设计并实施解决方案.如果您问别人*他们*会做什么,那么它将成为该人的解决方案,而不是您的解决方案.如何从别人做的事情中学到什么?

最后,您应该在开发生涯中拥抱这段时间,因为在接下来的5-10年中,您将不再只是代码猴子,而是实现别人的想法,而不是自己的想法.这是您真正从事创意工作的最后机会,直到您在Biz上工作了一段时间为止.
Part of being a programmer is being able to analyze the problem, and then design and implement the solution. If you ask someone else what *they* would do, then it becomes that person''s solution instead of yours. How are going to learn from doing what someone else would do?

Lastly, you should embrace this time in your development career, because you''re not going to be anything more than a code monkey for the next 5-10 years, implementing someone else''s ideas instead of your own. This is truly your last opportunity to be truly creative until you''ve been in the biz for a length of time.


RE:#3

我认为数据结构的选择取决于您打算如何使用游戏引擎.如果您正在考虑像Defender或Asteroids这样的太空射击游戏,那么您可能要考虑使用四叉树进行命中检测.如果是带有墙壁的东西或像PacMan这样的迷宫,则BSP可能更合适.

要注意的一件事是,渲染过程可能不需要树结构,甚至不适合使用树结构.我自己尚未创建任何游戏引擎,但据我了解,这些树用于通过组织所有场景几何来帮助加快渲染过程,以便更轻松,更快速地确定哪些几何不完全需要渲染,什么几何会受到阴影或其他效果的影响,等等.一个小的2D引擎并不需要真正为渲染而担心.在2D模式下,它对于冲突检测或其他功能更有意义.
RE: #3

I think the choice of data structure depends on how you intend to use the game engine. If you''re thinking of games along the lines of a space shooter like Defender or Asteroids, then you may want to consider a quadtree for hit detection. If it''s something with walls or a maze like PacMan, a BSP might be more appropriate.

One thing to note is that a tree structure might not be needed, or even appropriate, for the rendering process. I haven''t created any game engines myself, but from my understanding the trees are used to help speed up the rendering process by organizing all of the scene geometry so that it''s easier and faster to determine what geometry doesn''t need to be rendered at all, what geometry is affected by shadows or other effects, and so on. A little 2D engine doesn''t really need to worry about those things so much for rendering. In 2D it makes more sense for collision detection or some other feature.


#3)我认为这表明您知道如何针对项目的各种任务使用正确的结构和算法.表演将是相当重要的.通常,同样重要的是要表明您已经考虑了这一点,可能显示了不止一种方法,并在论文中讨论了利弊.

#2)设计师很有趣,而且由于您正在构建2D引擎,因此可以尝试将事物与.Net设计环境紧密集成.这是有关此的有用文章:http://msdn.microsoft.com/zh-cn/library/ms973830.aspx

#1)听起来好像您使用的是表格,如果您使用的是GDI +,则可能需要使需要重新粉刷的区域无效.由于您的游戏可能是(或将要)部分地受到定时事件的驱动,因此请不要在计时器事件处理程序中重新绘画-只是无效. Windows合并了需要重绘以减少绘制事件数量的突出区域.

祝你好运
Espen Harlinn
#3) I think demonstrating that you know how to use the right structures and algorithms for the various tasks your project has to perform will be fairly important. It''s often equally important to show that you have thought your way through this, possibly showing more than one approach and discussing pros and cons in your paper.

#2) Designers are fun, and since you are building a 2D engine – it could make sense to take a shot at tightly integrating things with the .Net design environment. Here is a useful article on this: http://msdn.microsoft.com/en-us/library/ms973830.aspx

#1) It sounds like you are using forms, and if you are using GDI+ it will probably make sense to invalidate the areas that need repainting. Since your game probably is, or is going to be, partially driven by timed events, don’t repaint during the timer event handler – just invalidate. Windows combines outstanding regions that need repainting to reduce the number of paint events.

Good luck
Espen Harlinn


这篇关于游戏引擎创作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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