如果从头开发新的 3d engine
最近闲了下来。断断续续的再想,如果业余时间弄一个开源项目玩儿,什么是比较好的题材,适合自己来做。想来想去,3d engine 是一个比较好的选择。以我来看,对外开源如果要吸引到足够的有经验的同学参加,必须项目有一定价值。要可以迅速的搭建工作环境并直接看到结果,这样才能有兴趣迭代做下去。起步必须自己一个人来做,东西得有个雏形。所以必须是自己比较熟悉的领域。
若论熟悉,其实游戏服务器的架构和实现,我这些年考虑的更多,也做的更多。但这个东西不适合做成开源项目。因为受众太小(不是每个人都有机会和意愿去架设网络游戏服务器的),而且它不能单独运行看到结果。没有玩家的游戏服务器是没有意义的。
3d engine 这些年也有在开发。但是公司不可能允许开源已有项目。如果想玩儿,从头做是唯一选择。而且重新开始有更多的乐趣,再造轮子原本就是程序员们的欢乐源泉之一。如果自娱是唯一目的的话,就不必过多考虑商业引擎必须考虑的问题。比如兼容更多的底层 3D API ,做全平台兼容,支持低端硬件等等。甚至于还要去考虑日后防外挂等无聊的问题。
昨天在 buzz 上提起 game engine 开发的话题,miloyip 同学立刻发了份他的一些想法。有很多的记录,想来也是思考多日。对于 engine 特性方面列的很全了。不过我的出发点不太一样。我更多的考虑的是,如果是做为一个开源项目,怎样可以以最小代价启动起来,让项目自然成长。也就是说,可以在质量和特性上有个高起点,但从一个很小的功能集合开始。而且,如果做这个,没有商业上的目的。所以,不必屈就于进度压力。不必为特别的需求必须去加上什么功能。一切以好玩为目的。只要写代码开心即可。
考虑了一晚上,我觉得如果动手做的话,大概是这样的。
Git 是最近我比较中意的 VCS 工具,如果比较 google code 和 github 的,我比较倾向后者。
开发语言,我希望是 C + Lua 的组合。因为这两个都是我最为熟悉的语言,使用起来最为得心应手。C++ 也很熟悉,某些方面 C++ 写起来要比 C 更方便。尤其是采用 D3D 的底层 API 的话,C 要麻烦的多。而且还有许多第三方组件也是 C++ 接口的。不过我用 C 搭建大的系统已经有多年的经验了,我相信我的经验可以弥补 C 语言的诸多不足。而 Lua 会是对 C 语言很好的一个补充。
Engine 的核心部分,可以以 C 语言写成的库提供,再由独立的 lua 封装层包装起来,二次开发在 Lua 中进行。如果需要在外层使用非 Lua 的接口,比如用 QT/C++ 开发工具,则可以在 Lua 层绕一下,或是再单独开发一个薄的 C++ 的粘合层。
不用太在意粘合层的性能,但需要把粘合层和核心库设计上隔离开。
3d api 可以暂时只支持 DX11 ,openGL 的支持待考虑。不过最好能留下余地。在代码编写上,初期的代码量不宜过大,做好至少一次重构的准备。所以第一期代码不需要面面俱到。这主要是因为我在 3d 领域方面经验不足。
构建工具采用 GNU Make ,这个工具我有比较多的使用经验,也更大众。不必要求所有开发人员都精通 GNU Make 的使用,整体的框架可以一个人先做好即可。
编译工具使用 gcc 。可以考虑兼容 VC 编译。
功能上,Audio/GUI/Input/Network 等都不是先期必要模块,一开始都不必设计和实现的。也不必去抽象窗口管理的部分。但需要搭建一个运行环境,有基本的窗口启动,简单的 GUI (不可定制),方便的 Log 输出。
工具是应该第二步考虑的事情。
至于 3d engine 将支持的特性,那个应该是逐步添加的事情。虽然说,新特性的添加方便于否和 engine 的基础设施的可扩展性很有关系。但,从一个小规模的项目开始,逐步重写和完善,我觉得是更实际的方式。
现在缺少的东西主要有这些:
不知道项目该用什么名字以及项目代号是什么。
对近年的 3d 技术发展没有细致了解,领域知识的缺乏导致很难很好的做基础设计。
还没有下决心开启项目。
Comments
Posted by: jojo59516 | (119) February 15, 2022 06:26 PM
Posted by: asdf | (118) June 28, 2015 08:55 PM
Posted by: Cloud | (117) April 11, 2014 11:27 AM
Posted by: 白泽 | (116) April 10, 2014 11:30 AM
Posted by: 阿福 | (115) December 26, 2013 06:56 PM
Posted by: 阿福 | (114) December 26, 2013 06:55 PM
Posted by: 阿福 | (113) December 26, 2013 06:55 PM
Posted by: go4 | (112) February 2, 2013 04:46 PM
Posted by: ZoZ | (111) January 27, 2013 07:50 PM
Posted by: hwt | (110) July 25, 2012 02:40 AM
Posted by: zh | (109) October 31, 2011 08:59 PM
Posted by: 免费打工仔 | (108) October 31, 2011 04:00 PM
Posted by: 免费打工仔 | (107) October 31, 2011 03:56 PM
Posted by: 免费打工仔 | (106) October 31, 2011 03:46 PM
Posted by: 免费打工仔 | (105) October 31, 2011 03:42 PM
Posted by: gl | (104) September 11, 2011 07:29 PM
Posted by: proguser | (103) September 11, 2011 04:54 PM
Posted by: 问鼎中原 | (102) September 3, 2011 10:32 PM
Posted by: billin | (101) July 22, 2011 01:36 PM
Posted by: Anonymous | (100) May 24, 2011 10:55 AM
Posted by: 友好的建议 | (99) May 24, 2011 09:07 AM
Posted by: 大笨猫同学 | (98) May 22, 2011 06:29 PM
Posted by: Anonymous | (97) May 22, 2011 03:51 PM
Posted by: 徐州信誉网络 | (96) May 19, 2011 02:37 PM
Posted by: Samson | (95) May 13, 2011 05:26 PM
Posted by: sliz | (94) May 9, 2011 04:55 PM
Posted by: H3D | (93) May 6, 2011 11:50 AM
Posted by: Anonymous | (92) May 5, 2011 09:29 PM
Posted by: Anonymous | (91) May 4, 2011 11:16 PM
Posted by: 匿名 | (90) May 2, 2011 10:02 PM
Posted by: zhanxw | (89) April 29, 2011 04:51 AM
Posted by: xuzhouweb | (88) April 25, 2011 06:54 PM
Posted by: tgame | (87) April 24, 2011 08:29 PM
Posted by: naked | (86) April 23, 2011 08:41 PM
Posted by: vical | (85) April 22, 2011 02:03 AM
Posted by: xtypebee | (84) April 22, 2011 01:10 AM
Posted by: lk | (83) April 21, 2011 04:56 PM
Posted by: fish | (82) April 21, 2011 03:25 PM
Posted by: 风的博客 | (81) April 21, 2011 09:52 AM
Posted by: ever | (80) April 20, 2011 04:32 PM
Posted by: yushan | (79) April 18, 2011 11:37 AM
Posted by: 盖猪猪 | (78) April 18, 2011 10:22 AM
Posted by: Darkside | (77) April 17, 2011 06:45 PM
Posted by: 我是人类 | (76) April 17, 2011 03:43 PM
Posted by: xxxx | (75) April 17, 2011 12:00 PM
Posted by: bing314 | (74) April 15, 2011 11:37 PM
Posted by: ot512 | (73) April 15, 2011 09:57 PM
Posted by: 盖猪猪 | (72) April 15, 2011 06:26 PM
Posted by: wp | (71) April 15, 2011 02:03 PM
Posted by: hust_ruan | (70) April 15, 2011 12:11 AM
Posted by: 叶起涟漪 | (69) April 14, 2011 09:11 PM
Posted by: kmplayer | (68) April 14, 2011 10:13 AM
Posted by: Yao | (67) April 13, 2011 10:03 AM
Posted by: 池中物 | (66) April 13, 2011 09:58 AM
Posted by: toanso | (65) April 13, 2011 02:23 AM
Posted by: tanxw | (64) April 12, 2011 11:24 PM
Posted by: bigship | (63) April 12, 2011 11:15 PM
Posted by: xuruoji | (62) April 12, 2011 10:03 PM
Posted by: daseny | (61) April 12, 2011 05:27 PM
Posted by: 云开 | (60) April 12, 2011 03:15 PM
Posted by: chansey | (59) April 12, 2011 02:56 PM
Posted by: halflifeyexin | (58) April 12, 2011 02:37 PM
Posted by: halflifeyexin | (57) April 12, 2011 02:14 PM
Posted by: gthief | (56) April 12, 2011 02:12 PM
Posted by: halflifeyexin | (55) April 12, 2011 02:12 PM
Posted by: go4 | (54) April 12, 2011 01:34 PM
Posted by: Kaleidos | (53) April 12, 2011 12:59 PM
Posted by: madlax | (52) April 12, 2011 12:53 PM
Posted by: Anonymous | (51) April 12, 2011 12:32 PM
Posted by: dwing | (50) April 12, 2011 12:29 PM
Posted by: 红色警戒 | (49) April 12, 2011 12:03 PM
Posted by: 无限 | (48) April 12, 2011 11:43 AM
Posted by: Rainssa | (47) April 12, 2011 11:22 AM
Posted by: Copy | (46) April 12, 2011 11:17 AM
Posted by: SeanQian | (45) April 12, 2011 11:16 AM
Posted by: nothanks | (44) April 12, 2011 10:57 AM
Posted by: sword007 | (43) April 12, 2011 10:53 AM
Posted by: anymouse | (42) April 12, 2011 10:43 AM
Posted by: Garuda | (41) April 12, 2011 10:32 AM
Posted by: lusin | (40) April 12, 2011 09:41 AM
Posted by: 楼兰 | (39) April 12, 2011 09:25 AM
Posted by: lk | (38) April 12, 2011 09:08 AM
Posted by: mhsy2003 | (37) April 12, 2011 09:05 AM
Posted by: veavla | (36) April 12, 2011 09:05 AM
Posted by: calmhe | (35) April 12, 2011 08:33 AM
Posted by: paul | (34) April 12, 2011 08:29 AM
Posted by: foxriver | (33) April 12, 2011 12:32 AM
Posted by: hite | (32) April 12, 2011 12:22 AM
Posted by: thejinchao | (31) April 12, 2011 12:20 AM
Posted by: Lovebird | (30) April 12, 2011 12:08 AM
Posted by: ShinyWang | (29) April 11, 2011 11:27 PM
Posted by: junhao | (28) April 11, 2011 10:44 PM
Posted by: joe | (27) April 11, 2011 10:40 PM
Posted by: junhao | (26) April 11, 2011 09:37 PM
Posted by: bingo | (25) April 11, 2011 09:26 PM
Posted by: yunge | (24) April 11, 2011 08:10 PM
Posted by: yunge | (23) April 11, 2011 08:06 PM
Posted by: 枫之羽 | (22) April 11, 2011 06:58 PM
Posted by: Fenng | (21) April 11, 2011 06:48 PM
Posted by: zhiji | (20) April 11, 2011 06:38 PM
Posted by: JiChong | (19) April 11, 2011 06:37 PM
Posted by: belleveinvis | (18) April 11, 2011 06:37 PM
Posted by: final | (17) April 11, 2011 06:36 PM
Posted by: yangg025 | (16) April 11, 2011 06:24 PM
Posted by: tcdona | (15) April 11, 2011 05:54 PM
Posted by: Atry | (14) April 11, 2011 05:37 PM
Posted by: 柒笑侠 | (13) April 11, 2011 05:29 PM
Posted by: price_atlas | (12) April 11, 2011 05:27 PM
Posted by: iiiiuuuu | (11) April 11, 2011 05:24 PM
Posted by: Coollen.MMX | (10) April 11, 2011 04:55 PM
Posted by: cocobear | (9) April 11, 2011 04:47 PM
Posted by: Dimitar | (8) April 11, 2011 04:36 PM
Posted by: lichking | (7) April 11, 2011 04:33 PM
Posted by: lichking | (6) April 11, 2011 04:27 PM
Posted by: lichking | (5) April 11, 2011 04:25 PM
Posted by: ysorigin | (4) April 11, 2011 04:23 PM
Posted by: atusoft | (3) April 11, 2011 04:14 PM
Posted by: Cloud | (2) April 11, 2011 04:08 PM
Posted by: srdgame | (1) April 11, 2011 04:02 PM