找回密码
 点一下
查看: 1503|回复: 19

个人记录~一些ScII的杂东西……

[复制链接]
发表于 2010-4-25 15:11:44 | 显示全部楼层 |阅读模式
没有什么方向性,纯粹是测试而已~

不保证我的测试过程中有什么其他变量没有控制……
事先说明一下,我这是在最低配置窗口模式下测试的,可能会影响到我的结论。
以下触发大约看一下就行。
[trigger]
Test1
    Events
        Game - Player Any Player types a chat message containing "test", matching Partially
    Local Variables
    Conditions
    Actions
        Debug - Display (Text((Game play time for player 1)) with Any Precision decimal places) as debug output using Type 1, and Do display it in the game window
        Timer - Start TheTimer as a One Shot timer that will expire in 0.0 Game Time seconds
[/trigger]
[trigger]
Test2
    Events
        Game - Player Any Player types a chat message containing "test", matching Partially
    Local Variables
    Conditions
    Actions
        Debug - Display (Text((Game play time for player 1)) with Any Precision decimal places) as debug output using Type 1, and Do display it in the game window
        General - Wait 0.0 Game Time seconds
        Debug - Display ("Wait" + (Text((Game play time for player 1)) with Any Precision decimal places)) as debug output using Type 1, and Do display it in the game window

[/trigger]
[trigger]
Timer
    Events
        Timer - TheTimer expires
    Local Variables
    Conditions
    Actions
        Debug - Display ("Timer" + (Text((Game play time for player 1)) with Any Precision decimal places)) as debug output using Type 1, and Do display it in the game window

[/trigger]
结果显示貌似Wait0.0之后打印的游戏时间和Wait之前打印的一样,而Timer打印则会比Wait慢0.06s左右。
其中一组数据
186.938
186.938
Wait186.938
Timer187
而如果把时间0.0换成0.0001和1.0时,Timer比Wait还是慢约0.06s。
于是把Wait换成
        General - Wait for TheTimer to have 0.0 seconds Remaining
发现此时Wait打印的时间和Timer相同。
打印一下Timer的ElapsedTime,与设置的倒计时时间分秒不差。
再换一种测试方式,Timer循环3次,间隔1s,打印时间。
TimerStart之前打印的和Timer第一次循环结束打印的时间差了1.0625s……
但是之后循环结束打印的时间和之前的时间都间隔1s。
于是猜测影响timer计时不准确的原因在于TimerStart那一部分。
在TimerStart之后加了Wait0.0625s并打印Timer的ElapsedTime的动作,打印的时候显示ElapsedTimer为0……
[trigger]
Test1
    Events
        Game - Player Any Player types a chat message containing "test", matching Partially
    Local Variables
    Conditions
    Actions
        Debug - Display (Text((Game play time for player 1)) with Any Precision decimal places) as debug output using Type 1, and Do display it in the game window
        Variable - Set Count = 0
        Timer - Start TheTimer as a Repeating timer that will expire in 1.0 Game Time seconds
        General - Wait 0.0624 Game Time seconds
        General - Pick each integer from 1 to 3, and do (Actions)
            Actions
                General - Wait 0.0001 Game Time seconds
                Debug - Display ("Wait" + (Text((Game play time for player 1)) with Any Precision decimal places)) as debug output using Type 1, and Do display it in the game window
                Debug - Display ("Wait Timer" + (Text((Elapsed time of TheTimer)) with Any Precision decimal places)) as debug output using Type 1, and Do display it in the game window
[/trigger]
这回貌似ElapsedTime显示0;0.0625;0.0625。
而打印的GameTime第一次显示t,第二三次就显示t+0.0625……(后来把精度改为10000000输出了一次,数值没有变化)

难道Sc II的时间单位是0.0625s嘛?……还是说我输出时可能有问题?
16*0.0625=1.0s……

好吧…………只是很无聊的测试而已,配置比较好的同学可以把设置调高一点再测试~



————————————————————————————————————
感觉应该是输出或者是其他原因导致显示出来的时间有问题,要不然怎么还能Wait0.0001s呢……
 楼主| 发表于 2010-4-25 16:55:25 | 显示全部楼层
使用Follow Unit Group with Camera
无法避免玩家按下鼠标中键拖动鼠标造成的目标点偏移。
Follow之后,上下左右和鼠标滑动无法改变镜头。
但是点击小地图会镜头会先移到那个地方再回来(回来速度有缓冲)。
鼠标中键的偏移可以通过点击小地图来还原。
像Home,End,Pageup/down和滚动鼠标中键不会受到影响。

使用Camera - Lock camera input for player 1
就可以把所有玩家控制镜头的动作全部禁用掉,而且和Follow Unit Group with Camera完美兼容。

SetCameraBounds这回限制小地图不会出现像War3一样有时出现比较囧的情况了。
回复

使用道具 举报

发表于 2010-4-25 17:22:58 | 显示全部楼层
SC2里所有实数都会近似成1/16的倍数 也就是0.0625

----------- 帖子于 17:22 更新 --------- 之前内容发布于 17:20 ------------

不过不清楚 是输出的值被近似 还是实际timer的循环时间被近似

有待LZ做进一步研究
回复

使用道具 举报

 楼主| 发表于 2010-4-25 17:26:34 | 显示全部楼层
“SC2里所有实数都会近似成1/16的倍数 也就是0.0625”
是吗?
尝试输出“0.001”
结果是0.00097....明显与LS所说相悖。
回复

使用道具 举报

发表于 2010-4-25 17:46:47 | 显示全部楼层
哦 的确我说错了

应该 是 1/256的倍数

----------- 帖子于 17:37 更新 --------- 之前内容发布于 17:35 ------------

不过可能不同数值精度不一样

可能单精度会以1/16 双精度会以1/256

----------- 帖子于 17:46 更新 --------- 之前内容发布于 17:37 ------------

刚刚稍微看了看

所有单位速度以1/256近似 单位加速度以1/16近似 单位旋转率啊 还有很多

这样做 可能是和底层优化有关系

也不能说SC2全部是取近似

不过一些特殊的数值 确实会取近似
回复

使用道具 举报

 楼主| 发表于 2010-4-25 17:48:36 | 显示全部楼层
那么谢谢LS~
回复

使用道具 举报

发表于 2010-4-25 18:02:17 | 显示全部楼层
不是说用的是定点小数吗
回复

使用道具 举报

 楼主| 发表于 2010-4-25 20:09:42 | 显示全部楼层
~
终于有AnyUnitDamaged了~

现在攻击相应的顺序是Attacking->Attacked->Damaged
类似于攻击动作准备开始-投射物射出-投射物到达目标这样的顺序?没有详细测试~有兴趣的同学可以自己试试~~

————————————————————————————

Order现在发布时可以直接对单位的OrderQueue操作了。
放在整个队列之前,或者之后,还可以是清空Queue再进行操作。

----------- 帖子于 20:09 更新 --------- 之前内容发布于 20:01 ------------

补充——
单位队列的大小近乎于无限(至少几百是没问题的)。
回复

使用道具 举报

 楼主| 发表于 2010-4-25 20:17:47 | 显示全部楼层
Pic.jpg
一个基本的演示,WASD和上下左右都可以控制移动(不要同时使用,而且用Wasd的时候建议不要选单位)

纯粹是触发器弄的,触发器比较苦手的人可以看一看。

Camera Test.SC2Map

32 KB, 下载次数: 22

回复

使用道具 举报

发表于 2010-4-25 21:05:56 | 显示全部楼层
左右移动时的镜头移动没跟上,很诡异的感觉

----------- 帖子于 21:05 更新 --------- 之前内容发布于 20:46 ------------

        使用者介面 -玩家任何玩家下W  向下 鍵與shift 鍵開啟,control 鍵 開啟,和 alt 鍵開啟

繁体翻译太我艹了
完全是机翻啊
回复

使用道具 举报

 楼主| 发表于 2010-4-25 21:24:11 | 显示全部楼层
表示美版很好用。

----------- 帖子于 21:24 更新 --------- 之前内容发布于 21:17 ------------

补充一下,现在播放单位的Walk动画不用向War3那样麻烦了,直接播放\"Walk\"就行了
回复

使用道具 举报

发表于 2010-4-25 22:12:14 | 显示全部楼层
Exclude, Allow, Require

三个全翻译成 开启了

而且不能直接点选改变

已经不是翻译错误的问题了,繁体编辑器完全不可以使用

----------- 帖子于 22:12 更新 --------- 之前内容发布于 21:39 ------------

不支持后退移动的角色,还是不要用镜头跟随了吧,否则按S或Down没法处理,只能做成合金装备那种了
回复

使用道具 举报

发表于 2010-4-25 23:17:31 | 显示全部楼层
    表示这个帖子很有趣,要是能解决抛射物路径,NOVA就基本可以做出来了。
是不是可以把抛射物设为有碰撞体积呢
回复

使用道具 举报

发表于 2010-4-25 23:25:02 | 显示全部楼层
抛射物就是单位,你说呢...........
回复

使用道具 举报

发表于 2010-4-26 16:12:08 | 显示全部楼层
missile有触碰体积吗?
回复

使用道具 举报

 楼主| 发表于 2010-4-26 19:53:44 | 显示全部楼层
UI - Hide the mouse cursor for (All players).
这个东西貌似只是隐藏了鼠标而已…………如何用鼠标(即使你看不见)点击地面,单位还是会移动过去的…………还有移动的指示特效-_-
回复

使用道具 举报

 楼主| 发表于 2010-4-26 21:32:35 | 显示全部楼层
稍微弄了点花哨的功能。

Camera Test.SC2Map

37 KB, 下载次数: 1

回复

使用道具 举报

发表于 2010-4-26 22:26:39 | 显示全部楼层
好歹介绍一下花哨在哪里.....
回复

使用道具 举报

 楼主| 发表于 2010-4-26 22:33:46 | 显示全部楼层
其实只是几个UI功能测试而已……比如威武的头目条!
回复

使用道具 举报

 楼主| 发表于 2010-4-27 06:57:08 | 显示全部楼层
再更新一下,MoveBossBar的时候,要注意一下,根据选择原点(Top Left;Left……)的不同,它的坐标轴方向也会不同。
比如Bottom Left,Y轴正方向就是向上的,而Top Left,Y轴正方向就是向下的。
也就是说……选择合适的原点,填正数就可以避免把BossBar弄到屏幕外头去了。

更新一下地图,稍微完善了BossBar的功能。

Camera Test.SC2Map

39 KB, 下载次数: 0

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 点一下

本版积分规则

Archiver|移动端|小黑屋|地精研究院

GMT+8, 2024-9-28 19:16 , Processed in 0.038929 second(s), 21 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表