网站公告列表

  没有公告

加入收藏
设为首页
联系站长
您现在的位置: 网络学院 >> 程序设计 >> VC编程 >> 文章正文
  绑定HGE到AngelScript脚本系统            【字体:
绑定HGE到AngelScript脚本系统
作者:佚名    文章来源:不详    点击数:    更新时间:2007-9-12    

 

    关于脚本系统,以前接触过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即可。




本文来源:http://blog.csdn.net/kevinlynx/archive/2007/08/26/1759498.aspx
站内文章搜索 高级搜索
文章录入:admin    责任编辑:admin 
  • 上一篇文章:

  • 下一篇文章:
  • 发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
    最新热点 最新推荐 相关文章
     directx 图形接口指南(…
     win2k下的api函数的拦截
     用crypto  api  实现公钥…
     根据别人的md5源码封装的…
     vc中使用gdi+合并jpg图片
     document/view的交互 --…
     windows下的函数hook技术
     windows api函数大全一
     用vc 6.0实现串行通信的…
     vc++技术内幕(第四版)…
  • page、request、session、ap…

  • genexus中对字符串的格式补空…

  • cximage介绍

  • 不知道是不是TpageControl的…

  • MapX数据绑定后,读取属性的…

  • CodeGear的RAD Studio 2007发…

  • Commons-Digester简介

  • 用Digester解析xml到bean

  • AtionErrors和ActionMessage…

  • pager-taglib 体验

  •   网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
    网络学院©2007 www.23book.net
    为您提供web编程,vb编程,vc编程,服务器架设管理,数据库设计等方面的知识 站长:David