绑定HGE到AngelScript脚本系统
来源:互联网 发布:怎样编程 编辑:程序博客网 时间:2024/06/11 06:31
关于脚本系统,以前接触过GameMonkey,当时的感觉就是要结合进C++,处理类方面比较麻烦。事实上大部分脚本语言要结合进C++,都存在这个问题。后来知道了Angel Script,稍微看了下文档,发现其与C++结合比较容易。
最近都在休息,前天休息疯了,就决定玩玩angel script。后来突然就产生了把HGE和angel scrip结合起来的想法。也就是很多游戏引擎的各类脚本wrappet之类的东西。目的就是通过一些中间代码的桥接,使某个脚本语言也可以使用该引擎。我所要做的,也就是在angel script脚本代码中,也可以使用HGE来编写游戏。
看了些文档,写了些实验代码,就开始这个我认为比较有意思的project。整个过程还是比较顺利,写到后来都是些体力活,没什么意思。
封装了部分HGE的接口,用angel script重写了HGE第7个例子程序,用来测试效率。结果还算好,效率比本地代码慢了几个FPS(绘制1000个zazaka),只是载入速度慢了点,因为需要把脚本代码编译一次,也许在发行时,发行编译好的字节码,载入速度会快很多。
写好后整理了下API文档(即目前我封装了哪些HGE的接口),就草草发到HGE官方论坛去了。以下是我在HGE论坛发的帖子:
帖子原文地址: http://relishgames.com/forum/viewtopic.php?t=2766
angel script 地址:http://www.angelcode.com/angelscript/
帖子原文:
Hi, all
i'm glad that i can use hge engine to create games .Besides hge is an easybut powerful engine.
And yet AngelScript is also easy use script engine. It's a c++-like script
language and it's very easy to embed into c++ native application .
And now i bind hge and AngelScript together . That means i wrapped some hge's functions classes and you can write AngelScript to make your hge games.By using script language, your most convenient is you donot need compile your code and link your code like in c++.
The most important thing is the speed, yes, i wrote hge tutorial 7(thousand of hares) in AngelScript (download below) and see what 's the difference between them. The result on my computer is the speed is almost same . But the loading time is different: the AngelScript version is slower that because the script engine should compile the script first .
You can download the demo here http://blog.blogwhy.com/azjex/upload/ashge_demo_7.rar. And there is a file named apireference.txt that document the current api i wrapped. So you can change game.as whatever you want.
So, is there somebody interested in this project ? If somebody is interested in it i will continue this work, i mean continue to wrap more hge functions(classes).
Best regards,
Kevin Lynx
DEMO演示下载(包含API文档):
http://blog.blogwhy.com/azjex/upload/ashge_demo_7.rar
比较有趣的事是,现在用HGE写游戏,都不需要编译器了。只需要例子程序中的可执行文件,直接改game.as即可。
- 绑定HGE到AngelScript脚本系统
- 绑定HGE到Lua中
- HGE粒子系统DEMO
- AngelScript实践
- HGE学习(1) 粒子系统
- HGE引擎的粒子系统
- 如何将MyGUi整合到HGE里面
- 让AngelScript运行起来
- AngelScript基本用法
- HGE系列之八管中窥豹(粒子系统)
- 使用HGE粒子系统编辑器界面
- CSS绑定js脚本
- Python网卡绑定脚本
- Cocos 中的脚本绑定
- ContentProvider获取系统的电话号码绑定到ListView以及跳转通讯录获区联系人信息绑定到前台。
- tomcat添加到系统服务,提供启动脚本
- HGE 丢失hge.dll
- 脚本系统
- 从《亮剑》之李云龙看4E管理者
- CFile 和 CStdioFile 区别以及 CString 中的 '/r/n'
- 如何定义项目目标
- DoDataExchange 函数简单说明
- 软件开发活动评估需要考虑的问题
- 绑定HGE到AngelScript脚本系统
- mysql升级到5.x版本
- 翻译《real-time 3d terrain engines using C++ and DX9 》(2)
- 如何组织软件团队的人员
- GridView 的常用事件
- RFC868--时间协议客户机与服务器的实现
- velocity+struts+spring+ibatis
- 垃圾收集
- shell 编程