简体   繁体   English

Flash RPG引擎问题

[英]Flash RPG Engine Question

I am developing an isometric rpg engine in flash AS3. 我正在Flash AS3中开发一个等距的rpg引擎。 I have decided to separate the engine code completely from the game data, which is in xml. 我已经决定将引擎代码与游戏数据完全分开,该数据是xml。 So I have all the maps in xml files, all the quests and npcs etc. My question is when to parse the xml into actual Actionscript code. 因此,我将所有地图都保存在xml文件中,所有任务和npc等等。我的问题是何时将xml解析为实际的Actionscript代码。 Should I do this at the start of every play session? 我应该在每个比赛开始时这样做吗? Should I only parse the maps as they are called? 我应该只解析地图吗? This is like start up code. 这就像启动代码。 For example, I want to parse every tile into a tile object, then draw it to the map. 例如,我想将每个图块解析为一个图块对象,然后将其绘制到地图上。 Also, I want to parse the quests in the xml into quest objects so that they can be accessed by other code. 另外,我想将xml中的任务解析为任务对象,以便其他代码可以访问它们。 So, when should I do this?? 那么,我什么时候应该这样做?

Interesting, I recently just finished a prototype for an MMORPG engine in Java ;)... 有趣的是,我最近刚刚完成了Java MMORPG引擎的原型;)...

Anyway... if you don't mind the user seeing a loading screen when s/he for example goes to another map, then yes you should load it then. 无论如何...例如,如果您不介意用户在他/他去另一幅地图时看到加载屏幕,那么是的,则应加载该屏幕。 But, if you want the user to freely navigate around the game with minimal loading time, then load it at startup. 但是,如果您希望用户以最少的加载时间自由浏览游戏,则在启动时进行加载。

Parse things when you need to. 在需要时解析事物。

You shouldn't parse things constantly for gameplay. 您不应该为游戏玩法不断解析事物。 But you could parse NPC conversations or quests as they are needed. 但是您可以根据需要解析NPC对话或任务。

You can parse maps as the player gets to a new area, or if its an open world then parse chunks of the map as he gets close to the edge of the map. 您可以在玩家到达新区域时解析地图,或者如果它是开放世界,则在玩家接近地图边缘时解析地图块。

If you parse when you need it you could also set up something server side to stream a large amount of levels efficiently, so a player that plays 10 minutes and gets to level 2, doesn't have to download levels 2-100, saving bandwidth, and it could help the player get into the game easier. 如果您在需要时进行解析,则还可以在服务器端进行设置以有效地传输大量关卡,因此播放10分钟并达到第2级的播放器无需下载2-100级,从而节省了带宽,它可以帮助玩家更轻松地进入游戏。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM