基于WebAssembly的Web游戏空间划分  

Web Games Space Division Based on WebAssembly

在线阅读下载全文

作  者:张家骞 ZHANG Jiaqian(No.21,Unit 3,Building 54,Yunhuazhuang Community,Nanzhonghuan Street,Xiaodian District,Taiyuan 030006,China)

机构地区:[1]太原山西030006

出  处:《山西大学学报(自然科学版)》2023年第6期1315-1321,共7页Journal of Shanxi University(Natural Science Edition)

摘  要:WebAssembly(Wasm)是一个高效、安全、开放、标准的虚拟指令集体系架构,在Web前端领域中有着广泛的应用。在Web游戏中,由于JavaScript语言的限制和浏览器JavaScript引擎对解析代码优化的不同,导致空间划分和碰撞检测等需要大量运算的部分效率较低。本文提出采用WebAssembly进行大规模运算,尤其是Web游戏中常见的空间划分和碰撞检测等运算。分析并验证了对于大规模数据结构如四叉树/八叉树、层次包围树等的遍历和计算而言,使用WebAssembly可以得到大幅提升。此外,对于大量实体碰撞算法,可以以原生速度进行快速运算,在保证画质的情形下运算效率提升到原先的两倍,游戏运行帧数在5000实体的情形下提升到原先的两倍,显著提高了运算效率和质量,从而提升了Web游戏的运行速度并减少了Web游戏的卡顿情形。WebAssembly(Wasm)is an efficient,safe,open,and standard virtual instruction set architecture,which is widely used in the field of Web front-end.In web games,due to programming language limitation(JavaScript)and the optimization of parsing code by different JavaScript engine,the efficiency of space division and collision detection,which required a lot of calculations,was relatively low.This paper proposes to use WebAssembly for large-scale calculations,especially for algorithms of space division and collision detection in Web games.It is analyzed and verified that using WebAssembly can greatly improve the traversal and calculation of large-scale data structures such as Quadtree/Octree,BVH tree,etc.In addition,for a large number of entity collision algorithms,fast calculation can be performed at native speed,which makes the calculation efficiency doubled while the image quality is guaranteed and frame rating doubled in 5000 entities rendering while game is running,and then significantly improves the calculation efficiency and quality,thereby improving the running speed of web games and reducing the lagging of web games.

关 键 词:前端加速 空间划分 碰撞检测 跨平台游戏 

分 类 号:TP391[自动化与计算机技术—计算机应用技术]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

相关的主题
相关的作者对象
相关的机构对象