防止战场跳出及降低游戏配置的方法
本帖最后由 lanson 于 2010-12-19 12:56 编辑前言:这是在打造自己的三国1.8时发现的问题,在疯狂地大量地替换与添加原有的模型后,发现进行游戏进入战斗读取时经常逢三跳一,结束战斗时也经常逢四跳一,特别是在大规模战斗时(4000人以上),那个抓狂!!!本着求人不如求己的精神(其实是游戏已经被改的那个乱阿,基本上bi/data文件夹下所有的txt都被我改过,想问没法问了)
正文:
原理:所有的全战系统都有sprite文件,这个文件的作用是远景2d贴图,近镜头是3d贴图,就是说当你把细节系列(植被,建筑,单位)设置设成最高时,系统会放弃2d贴图sprite文件,全部用3d贴图显示,而把细节设置成高或以下,则是远景2d,近景3d,使游戏更顺畅,而一般游戏的preferences.txt是关闭最高效果的,导致游戏都会读取2d贴图,这就造成单位数量巨大时,而游戏找不到对应贴图或贴图过多而更容易跳出(罗马的引擎就这种水平)。preferences.txt下GLOSS_MAPPING:TRUE是否允许远景贴图,就是这个选项(冒似是),同时如果补全spr文件,将会降低电脑的运算负担,使得游戏配置降低,这方面已经在某些mod验证过。
关键:
发现游戏跳出的关键是游戏模型与贴图的对应问题。
例如:
打开bi/data/descr_model_battle.txt(记得备份)
原版1.8下新兵种
;高句丽弓
type choson_archer
skeleton fs_fast_archer, fs_fast_swordsman
indiv_range 40
texture data/models_unit/textures/KOREAARCHER.tga
model_flexi data/models_unit/koreaarcher.cas, 8
model_flexi data/models_unit/koreaarcher.cas, 15
model_flexi data/models_unit/koreaarcher.cas, 30
model_flexi data/models_unit/koreaarcher.cas, max
model_sprite 60.0, data/sprites/spain_choson_archer_sprite.spr
model_tri 400, 0.5f, 0.5f, 0.5f
上面这个兵种在自定义战斗时使用绝对会跳出,这是由于texture,model_sprite地方没有相对应的使用势力,原版中一共有24个势力,分别有
alemanni ;张燕
burgundii ;马腾
celts ;严白虎
franks ;李傕
lombardi ;袁绍
saxons ;公孙瓒
sassanids ;孙策
huns ;孟获
goths ;吕布
ostrogoths ;曹操
sarmatians ;袁术
vandals ;陶谦
slavs ;张绣
empire_east ;刘备
empire_east_rebels ;刘璋
empire_west ;刘表
empire_west_rebels ;韩玄
roxolani ;孔融
romano_british ;张鲁
berbers ;在野
;;;;;;;;;;;;;;;;;;;;;
slave(叛军)
merc (雇佣)
moors(求解)
white_huns(究竟是啥?)
就是要在模型引用中加入相应的势力,如修改后的高弓
;高句丽弓
type choson_archer
skeleton fs_fast_archer, fs_fast_swordsman
indiv_range 40
texture saxons, data/models_unit/textures/KOREAARCHER.tga
texture franks, data/models_unit/textures/KOREAARCHER.tga
texture sassanids, data/models_unit/textures/KOREAARCHER.tga
texture slavs, data/models_unit/textures/KOREAARCHER.tga
texture slave, data/models_unit/textures/KOREAARCHER.tga
texture empire_east, data/models_unit/textures/KOREAARCHER.tga
texture empire_west, data/models_unit/textures/KOREAARCHER.tga
texture empire_west_rebels, data/models_unit/textures/KOREAARCHER.tga
texture empire_east_rebels, data/models_unit/textures/KOREAARCHER.tga
texture romano_british, data/models_unit/textures/KOREAARCHER.tga
texture sarmatians, data/models_unit/textures/KOREAARCHER.tga
texture alemanni, data/models_unit/textures/KOREAARCHER.tga
texture vandals, data/models_unit/textures/KOREAARCHER.tga
texture celts, data/models_unit/textures/KOREAARCHER.tga
texture goths, data/models_unit/textures/KOREAARCHER.tga
texture ostrogoths, data/models_unit/textures/KOREAARCHER.tga
texture berbers, data/models_unit/textures/KOREAARCHER.tga
texture moors, data/models_unit/textures/KOREAARCHER.tga
texture huns, data/models_unit/textures/KOREAARCHER.tga
texture white_huns, data/models_unit/textures/KOREAARCHER.tga
texture burgundii, data/models_unit/textures/KOREAARCHER.tga
texture lombardi, data/models_unit/textures/KOREAARCHER.tga
texture roxolani, data/models_unit/textures/KOREAARCHER.tga
texture merc, data/models_unit/textures/KOREAARCHER.tga
model_flexi data/models_unit/koreaarcher.cas, 8
model_flexi data/models_unit/koreaarcher.cas, 15
model_flexi data/models_unit/koreaarcher.cas, 30
model_flexi data/models_unit/koreaarcher.cas, max
model_sprite empire_east,60.0, data/sprites/spain_choson_archer_sprite.spr
model_sprite saxons,60.0, data/sprites/spain_choson_archer_sprite.spr
model_sprite franks,60.0, data/sprites/spain_choson_archer_sprite.spr
model_sprite sassanids,60.0, data/sprites/spain_choson_archer_sprite.spr
model_sprite slavs,60.0, data/sprites/spain_choson_archer_sprite.spr
model_sprite empire_west,60.0, data/sprites/spain_choson_archer_sprite.spr
model_sprite slave,60.0, data/sprites/spain_choson_archer_sprite.spr
model_sprite empire_west_rebels,60.0, data/sprites/spain_choson_archer_sprite.spr
model_sprite empire_east_rebels,60.0, data/sprites/spain_choson_archer_sprite.spr
model_sprite romano_british,60.0, data/sprites/spain_choson_archer_sprite.spr
model_sprite sarmatians,60.0, data/sprites/spain_choson_archer_sprite.spr
model_sprite alemanni,60.0, data/sprites/spain_choson_archer_sprite.spr
model_sprite vandals,60.0, data/sprites/spain_choson_archer_sprite.spr
model_sprite celts,60.0, data/sprites/spain_choson_archer_sprite.spr
model_sprite goths,60.0, data/sprites/spain_choson_archer_sprite.spr
model_sprite ostrogoths,60.0, data/sprites/spain_choson_archer_sprite.spr
model_sprite berbers,60.0, data/sprites/spain_choson_archer_sprite.spr
model_sprite moors,60.0, data/sprites/spain_choson_archer_sprite.spr
model_sprite huns,60.0, data/sprites/spain_choson_archer_sprite.spr
model_sprite white_huns,60.0, data/sprites/spain_choson_archer_sprite.spr
model_sprite burgundii,60.0, data/sprites/spain_choson_archer_sprite.spr
model_sprite lombardi,60.0, data/sprites/spain_choson_archer_sprite.spr
model_sprite roxolani,60.0, data/sprites/spain_choson_archer_sprite.spr
model_sprite merc,60.0, data/sprites/spain_choson_archer_sprite.spr
model_tri 400, 0.5f, 0.5f, 0.5f
注意红字部分,以上改后是全势力都能用的,嫌麻烦的地就只改merc这个雇佣势力,改后这个兵种才能使用。
在原版1.8中,descr_model_battle.txt文件中有部分兵种编辑的有点那个啥,自己看吧,原版中:
;增加的三国北方雇佣兵;-ok-------------------------------------
type merc_camel_raiders
skeleton fs_Prome_hc_spearman
indiv_range 40
texture slave, bi/data/models_unit/textures/BI_unit_berber_lancer_slaves.tga
texture berbers, bi/data/models_unit/textures/BI_unit_berber_lancer_slaves.tga
texture huns, bi/data/models_unit/textures/BI_unit_berber_lancer_slaves.tga
texture merc, bi/data/models_unit/textures/BI_unit_berber_lancer_mercs.tga
model_flexi bi/data/models_unit/Bi_unit_berber_lancer_lod1.CAS, 15
model_flexi bi/data/models_unit/Bi_unit_berber_lancer_lod2.cas, 30
model_flexi bi/data/models_unit/Bi_unit_berber_lancer_lod3.cas, 40
model_flexi bi/data/models_unit/Bi_unit_berber_lancer_lod4.cas, max
model_sprite 60.0, bi/data/sprites/merc_camel_raiders_sprite.spr
model_sprite slave, 60.0, bi/data/sprites/slave_merc_camel_raiders_sprite.spr
model_sprite berbers, 60.0, bi/data/sprites/slave_merc_camel_raiders_sprite.spr
model_sprite huns, 60.0, bi/data/sprites/slave_merc_camel_raiders_sprite.spr
model_tri 400, 0.5f, 0.5f, 0.5f
以上模型model_sprite中没有相应的merc雇佣势力。
就是这种问题的存在使得在对战北方匈奴势力雇佣时经常跳出。
本帖最后由 lanson 于 2010-12-4 01:37 编辑
跟上
上面原理懂了,以下可以忽略
在后来添加的貂婵等武将时都会存在这种问题,小弟在引用雾隐大大的赵云模型时也遇到这种问题,修改后的赵云是
;赵云
type ZhaoYun_general
skeleton fs_spearman
skeleton_horse fs_Prome_hc_spearman
skeleton_elephant fs_forest_elephant_rider
skeleton_chariot fs_chariot_sword
skeleton_camel fs_Prome_hc_spearman
skeleton_scorpion_cart fs_carriage_ballistae_crew
indiv_range 40
texture empire_east, bi/data/models_unit/sanguo/textures/ZhaoYun.tga
texture saxons, bi/data/models_unit/sanguo/textures/ZhaoYun.tga
texture franks, bi/data/models_unit/sanguo/textures/ZhaoYun.tga
texture sassanids, bi/data/models_unit/sanguo/textures/ZhaoYun.tga
texture slavs, bi/data/models_unit/sanguo/textures/ZhaoYun.tga
texture slave, bi/data/models_unit/sanguo/textures/ZhaoYun.tga
texture empire_west_rebels, bi/data/models_unit/sanguo/textures/ZhaoYun.tga
texture empire_east_rebels, bi/data/models_unit/sanguo/textures/ZhaoYun.tga
texture romano_british, bi/data/models_unit/sanguo/textures/ZhaoYun.tga
texture sarmatians, bi/data/models_unit/sanguo/textures/ZhaoYun.tga
texture alemanni, bi/data/models_unit/sanguo/textures/ZhaoYun.tga
texture vandals, bi/data/models_unit/sanguo/textures/ZhaoYun.tga
texture celts, bi/data/models_unit/sanguo/textures/ZhaoYun.tga
texture goths, bi/data/models_unit/sanguo/textures/ZhaoYun.tga
texture ostrogoths, bi/data/models_unit/sanguo/textures/ZhaoYun.tga
texture berbers, bi/data/models_unit/sanguo/textures/ZhaoYun.tga
texture moors, bi/data/models_unit/sanguo/textures/ZhaoYun.tga
texture huns, bi/data/models_unit/sanguo/textures/ZhaoYun.tga
texture white_huns, bi/data/models_unit/sanguo/textures/ZhaoYun.tga
texture burgundii, bi/data/models_unit/sanguo/textures/ZhaoYun.tga
texture lombardi, bi/data/models_unit/sanguo/textures/ZhaoYun.tga
texture roxolani, bi/data/models_unit/sanguo/textures/ZhaoYun.tga
model_flexi bi/data/models_unit/sanguo/ZhaoYun.cas, 15
model_flexi bi/data/models_unit/sanguo/ZhaoYun.cas, 30
model_flexi bi/data/models_unit/sanguo/ZhaoYun.cas, 40
model_flexi bi/data/models_unit/sanguo/ZhaoYun.cas, max
model_sprite empire_east,60.0, alexander/data/sprites/empire_east_Guanyu_general_sprite.spr
model_sprite saxons,60.0, alexander/data/sprites/empire_east_Guanyu_general_sprite.spr
model_sprite franks,60.0, alexander/data/sprites/empire_east_Guanyu_general_sprite.spr
model_sprite sassanids,60.0, alexander/data/sprites/empire_east_Guanyu_general_sprite.spr
model_sprite slavs,60.0, alexander/data/sprites/empire_east_Guanyu_general_sprite.spr
model_sprite empire_west,60.0, alexander/data/sprites/empire_east_Guanyu_general_sprite.spr
model_sprite slave,60.0, alexander/data/sprites/empire_east_Guanyu_general_sprite.spr
model_sprite empire_west_rebels,60.0, alexander/data/sprites/empire_east_Guanyu_general_sprite.spr
model_sprite empire_east_rebels,60.0, alexander/data/sprites/empire_east_Guanyu_general_sprite.spr
model_sprite romano_british,60.0, alexander/data/sprites/empire_east_Guanyu_general_sprite.spr
model_sprite sarmatians,60.0, alexander/data/sprites/empire_east_Guanyu_general_sprite.spr
model_sprite alemanni,60.0, alexander/data/sprites/empire_east_Guanyu_general_sprite.spr
model_sprite vandals,60.0, alexander/data/sprites/empire_east_Guanyu_general_sprite.spr
model_sprite celts,60.0, alexander/data/sprites/empire_east_Guanyu_general_sprite.spr
model_sprite goths,60.0, alexander/data/sprites/empire_east_Guanyu_general_sprite.spr
model_sprite ostrogoths,60.0, alexander/data/sprites/empire_east_Guanyu_general_sprite.spr
model_sprite berbers,60.0, alexander/data/sprites/empire_east_Guanyu_general_sprite.spr
model_sprite moors,60.0, alexander/data/sprites/empire_east_Guanyu_general_sprite.spr
model_sprite huns,60.0, alexander/data/sprites/empire_east_Guanyu_general_sprite.spr
model_sprite white_huns,60.0, alexander/data/sprites/empire_east_Guanyu_general_sprite.spr
model_sprite burgundii,60.0, alexander/data/sprites/empire_east_Guanyu_general_sprite.spr
model_sprite lombardi,60.0, alexander/data/sprites/empire_east_Guanyu_general_sprite.spr
model_sprite roxolani,60.0, alexander/data/sprites/empire_east_Guanyu_general_sprite.spr
model_tri 400, 0.5f, 0.5f, 0.5
注意红字,这是1.8后才有的新动作,过去的模型没有,这个小弟没测试过对游戏跳出有没有影响
由于对应部分制作都是繁琐的,对于想大量修改游戏模型,而且想令游戏减少跳出,就必须把势力对应起来。
结语:有不对的地方请各位提出,以上被大量修改后的三国1.8至今使用过曹操,孙策势力统一过(大量的特殊将军卫队),战斗前从来没有跳出过,只有在大规模连续战斗后(5000人以上)偶尔跳出。改过后读取时间是增加了,但总比跳出好!!
本帖最后由 506041569 于 2011-9-13 16:51 编辑
其实总结起来就是一句话:在descr_model_battle.txt文件中模型对应势力上下要一致
最近很多童鞋问修改后的将军卫会跳出,其实原理和上面一样的
我再简单举例说说吧,以雾大的1.05版
比如我是用马腾的,想把张辽买过来,如果要防止跳出,你需要改动如下:
export_descr_unit.txt
descr_model_battle.txt
打开export_descr_unit.txt,找到zhangliao
然后找到英文第六和第七项
soldier WY_generaldao, 6, 0, 1………… 这个就是卫队模型
officer ZhangLiao_general…………这个是张辽的模型
最后一句ownership ostrogoths, goths…………使用势力
马腾势力代码为burgundii
改为ownership ostrogoths, goths, burgundii
然后在descr_model_battle.txt中找到WY_generaldao有
type WY_generaldao ; A General
skeleton fs_hc_swordsman
indiv_range 40
texture empire_east, bi/data/models_unit/textures/wujiangjunliubeidao.tga
texture ostrogoths, bi/data/models_unit/textures/wufujiangcaocaodao.tga
texture sassanids, bi/data/models_unit/textures/wufujiangsunquandao.tga
texture goths, bi/data/models_unit/textures/wujiangjunlvbudao.tga
model_flexi bi/data/models_unit/wujiangjundao.cas, 15
model_flexi bi/data/models_unit/wujiangjundao.cas, 40
model_flexi bi/data/models_unit/wujiangjundao.cas, max
model_sprite goths, 60.0, bi/data/sprites/goths_Xuangeqibin_Lvbu_sprite.spr
model_sprite ostrogoths, 60.0, bi/data/sprites/ostrogoths_Hubaoji_Wei_sprite.spr
model_sprite sassanids, 60.0, bi/data/sprites/goths_Xuangeqibin_Lvbu_sprite.spr
model_sprite empire_east, 60.0, bi/data/sprites/empire_east_Wudangfeijun_Liubei_sprite.spr
model_tri 400, 0.5f, 0.5f, 0.5f
注意,上面的WY_generaldao没有马腾势力burgundii如果进入战场必定跳出,所以要手动添加
最后改为
ype WY_generaldao ; A General
skeleton fs_hc_swordsman
indiv_range 40
texture empire_east, bi/data/models_unit/textures/wujiangjunliubeidao.tga
texture ostrogoths, bi/data/models_unit/textures/wufujiangcaocaodao.tga
texture sassanids, bi/data/models_unit/textures/wufujiangsunquandao.tga
texture goths, bi/data/models_unit/textures/wujiangjunlvbudao.tga
texture burgundii, bi/data/models_unit/textures/wujiangjunlvbudao.tga
model_flexi bi/data/models_unit/wujiangjundao.cas, 15
model_flexi bi/data/models_unit/wujiangjundao.cas, 40
model_flexi bi/data/models_unit/wujiangjundao.cas, max
model_sprite goths, 60.0, bi/data/sprites/goths_Xuangeqibin_Lvbu_sprite.spr
model_sprite ostrogoths, 60.0, bi/data/sprites/ostrogoths_Hubaoji_Wei_sprite.spr
model_sprite sassanids, 60.0, bi/data/sprites/goths_Xuangeqibin_Lvbu_sprite.spr
model_sprite empire_east, 60.0, bi/data/sprites/empire_east_Wudangfeijun_Liubei_sprite.spr
model_sprite burgundii, 60.0, bi/data/sprites/empire_east_Wudangfeijun_Liubei_sprite.spr
model_tri 400, 0.5f, 0.5f, 0.5f
红字就是添加的势力,只有添加这个而且要上下一致才能防止跳出。其他代码如果不知道什么意思,要不就直接复制,要不自己查资料,这里不解释。
至于officer ZhangLiao_general的模型,一般是不用改的,因为是通用,可以无视。
至于收买的流程看雾大的
http://bbs.1mod.org/thread-28-1-1.html
已经很清楚了,不懂我也没法了 经验精华贴!! 恩,这个问题我也遇到过了,不过工作量太大了,暂时就没改,貌似人数一上去,这些不设置好就爱跳 回复 Evenmov 的帖子
确实,我当时自己搞得都改了很久 应该编写个自动改名和自动生成所有国家的工具 回复 Evenmov 的帖子
呵呵,这个我就不会了 比如输入兵种SPR名,自动生成12个SPR列表= =,一定很安逸! 回复 Evenmov 的帖子
spr倒是没那么烦,烦的是tex文件,一个模型为了不同势力而有不同贴图,这个很烦人
会编程肯定会写,先自动生成个贴图文件全国家列表,然后把1个贴图文件复制为N份,重命名为不同的文件,这样强大啊 你的头像真淫荡...... 回复 Evenmov 的帖子
彼此彼此,你的头像也很猥琐 话说,你会骨骼绑定吗???我是到入原有的兵的骨骼,把自己的模合并,但是绑定后导出cas后又退回原形了,为何?? 本帖最后由 lanson 于 2010-12-5 23:58 编辑
凡是导入合并的骨骼就出问题,我很无奈啊 3DMAX我就会替换兵种的武器和改贴图,还没有接触骨骼部分,我还是看论坛的教程学会的= = 还是比较的深奥啊 Evenmov说的自动生成可以用高级重命名软件的正则表达式来解决,可惜我不会 学习啦谢谢诶 这的确是一件大工程,目前正遇到这样的困扰
页:
[1]
2