用户登录
|忘记密码

新用户注册

登录

其他登陆



弧光法术

作者:alexguldemond
发布:LUOHUISHU98
发布日期:2020-05-20 14:29:47
更新时间:2020-05-20 14:29:47
头像
2361
1071 人收藏
3747 次下载
10400 次浏览
1.0.1
上古卷轴5:重置版
本地下载 高速下载 需要优先下载下载器,50%提速

3465/5000这个mod使弹丸类型的咒语能够在各种非线性路径中移动。当前,支持三种不同的路径。第一个是围绕脚轮的向外螺旋形轨迹。第二个是绕圈旋转时向前移动的路径。第三个是抛物线弧,它从施法者处开始向目标移动。这些和香草铸造之间的切换通过可通过MCM分配的热键进行管理。

电弧轨迹是该模块的主要目标。如果您曾经玩过《质量效应2和3》,请考虑一下。在开发过程中,其他两个是简单的概念证明,我决定离开,以防人们发现它们很有趣。

怎么运行的:
在飞弧模式下施放法术时,MOD首先选择最接近您瞄准目标的敌对目标。如果此目标足够接近,并且瞄准位置与目标之间的角度足够小,则在脚轮和目标之间会插入二次弧。然后,弹丸沿着该轨迹行进,直到与某物碰撞为止。这意味着在以电弧模式投射时仍然很可能会错过,因为弹丸瞄准的是目标所在的位置,而不是目标所在的位置。我这样做是为了使这个mod能够做到,使瞄准弧线需要一些练习,而不仅仅是在施放咒语时自动命中。目前,此模组仅适用于玩家,其他所有演员仍会正常施放咒语。

兼容性:
这个Mod应该与一切兼容。它通过覆盖MissileProjectiles上的GetLinearVelocity方法来工作,因此执行此操作的任何其他操作显然都是不兼容的。但是,我不知道有什么其他方法可以覆盖此方法,因此其他所有方法都应该兼容。

这样添加中游安全吗?
据我所知,是的。

这样消除中游安全吗?
嗯,没有什么比大多数mod更好的了。 MCM和切换键的脚本非常简洁,使用脚本删除任何内容始终会带来风险。如果您不喜欢它,只需使用切换开关将其更改回普通模式,然后将热键分配给您从未使用过的功能。

这是我有史以来的第一个mod,所以任何反馈将不胜感激。我也乐于接受关于其他轨迹的任何要求。

弧光背后的数学:
令向量v为代表您瞄准目标的向量。
设p0为玩家的位置。
令P为细胞中所有敌对行动者的位置集合。
令d(p)= min || x-p || ^ 2,其中x位于v生成的仿射子空间上,即从目标到目标的距离。 (此优化问题在p0,v和p方面有明确的解决方案)
令p1 = argmin {d(p):p在P中}。
令v2 = p1-p2。
如果|| v2 ||足够小,并且v.v1 /(|| v || * || v1 ||)足够大(即它们之间的角度足够小),然后继续前进,否则让弹丸沿着香草轨迹行进。
Graham-Schmidt处理步骤:
令q1 = v
令q2 = v1-(v1.q1 / q1.q1)* q1
令e1 = q1 / / || q1 ||
令e2 = q2 / || q2 ||

插值步骤(具有差分的牛顿插值):
令f0 = 0
令f1 = 0
令f00 = sqrt(1-(v.v1 /(|| v || * || v1 ||))^ 2)/v.v1/(|| v || * || v1 ||)
令f01 =(f1- f0)/ || v2 ||
令f001 =(f01-f00)/ || v2 ||

令x(t)= f0 + f00(x-0)+ f001(x-0)^ 2
设p(t)= p0 + t * e1 + x(t)* e2

那么p(t)是轨迹——————————————————————————————————————————————————————————————

This mod enables projectile-type spells to move in various non-linear paths. Currently, there are three different paths supported. The first is an outward spiraling trajectory centered around the caster. The second is a path that moves forward while spinning in circles. The third is a parabolic arc starting at the caster and moving towards a target. Toggling between these and vanilla casting is managed via hotkeys which can be assigned via the MCM.

The arcing trajectory is the primary goal of this mod. If you've ever played Mass Effect 2 & 3, think something like that. During development, the other two were simple proofs of concept that I decided to leave in in case people found them fun to play with.

How it works:
When casting a spell in arcing mode, the mod first chooses the hostile target that is closest to where you are aiming. If this target is sufficiently close, and the angle between where you are aiming and the target is sufficiently small, a quadratic arc is interpolated between the caster and the target. The projectile then travels along this trajectory until it collides with something. This means that it is still very possible to miss when casting in arcing mode, as the projectile aims for where the target was, not where it is going to be. I did it this way so that this mod would make it so that aiming the arc would take some practice and not just automatically hit whenever a spell is cast. Currently, this mod only works for the player, all other actors still cast spells normally.

Compatibility:
This mod should be compatible with everything. It works by overwriting the GetLinearVelocity method on MissileProjectiles, so anything else that does this will obviously be incompatible. However, I am not aware of anything else that overwrites this method, so everything else should be compatible. 

Is this safe to add midgame?
As far as I can tell, yes.

Is this safe to remove midgame?
Eh, no more so than most mods. There is a very light script for the MCM and the toggle keys, and removing anything with scripts always comes with risks. If you don't like it, just use the toggles to change it back to vanilla mode, then assign the hotkeys to something you never use.

This is my first ever mod, so any feedback would be most appreciated. I am also open to any requests on other trajectories.

Math behind arcing:
Let the vector v be the vector that represents where you are aiming. 
Let p0 be the player's position. 
Let P be the set of positions of all hostile actors in the cell. 
Let d(p) = min ||x - p||^2 subject to x being on the affine subspace generated by v, i.e. the distance from the target to where you are aiming. (This optimization problem has an explicit solution in terms of p0, v, and p)
Let p1 = argmin { d(p) : p is in P}.  
Let v2 = p1 - p2.
If ||v2|| is sufficiently small, and v.v1/(||v|| * ||v1||) is sufficiently large (i.e. the angle between them is sufficiently small), then proceed, else let the projectile travel along the vanilla trajectory.
Graham-Schmidt process step:
Let q1 = v
Let q2 = v1 - (v1.q1/q1.q1)*q1
Let e1 = q1 / ||q1||
Let e2 = q2 / ||q2||

Interpolation step (Newton interpolation with divided differences):
Let f0 = 0
Let f1 = 0
Let f00 = sqrt(1 - (v.v1/(||v|| * ||v1||))^2)/v.v1/(||v|| * ||v1||) 
Let f01 = (f1- f0)/ ||v2||
Let f001 = (f01 - f00)/||v2|| 

Let x(t) = f0 + f00(x - 0) + f001(x - 0)^2
Let p(t) = p0 + t*e1 + x(t)*e2

Then p(t) is the trajectory

原贴地址
1.版本号: 1.0.1   更新时间: 2020-05-20 14:40:57

选择快速回复类型:
  • 感谢
  • 支持
  • 疑问
  • 卖萌
  • 关心
  • 傲娇
评论


    作者精品
    logo

    弧光法术


    Mod大小:230.62KB
    上传时间:2020-05-20 14:29:48

    Mod简介:

    暂无更多介绍

    本地下载
    选择快速回复类型:
    • 感谢
    • 支持
    • 疑问
    • 卖萌
    • 关心
    • 傲娇
    回复

    closeAD