Code Monkey home page Code Monkey logo

Comments (8)

szapp avatar szapp commented on June 23, 2024

Fix #20 and #1 by linear regression

from gothicfreeaim.

szapp avatar szapp commented on June 23, 2024

Fix #1, #2, #5, #9 implements stable version

The FX scripts are added and changed: Now the aiming FX is managed by
the spell and Wld_PlayEffect was removed. (See #5)

The focus vob is no set to the aim vod which is an oCItem. This works
very consistently now. (See #2)

The mouse is not really frame locked but rather scaled to the fps.
(See #1)

The mouse sensitivity issue seems to be resolved by #1. (See #9)

from gothicfreeaim.

szapp avatar szapp commented on June 23, 2024

Fix #1, #2, #5, #9 implements stable version

The FX scripts are added and changed: Now the aiming FX is managed by
the spell and Wld_PlayEffect was removed. (See #5)

The focus vob is no set to the aim vod which is an oCItem. This works
very consistently now. (See #2)

The mouse is not really frame locked but rather scaled to the fps.
(See #1)

The mouse sensitivity issue seems to be resolved by #1. (See #9)

from gothicfreeaim.

szapp avatar szapp commented on June 23, 2024

It does not help to hook the mouse movement directly.

These are the data collected in-game:

IFI (inter-frame interval) modifier
3 0.048
14 0.19
24 0.44

from gothicfreeaim.

szapp avatar szapp commented on June 23, 2024

The above works for high frame rates (IFI 6), but is to fast for low frame rates (IFI 30).
sigmoid(x*0.1)*0.1 might help, but first of all it's not ideal (does not start at zero) and secondly it is too complicated (I don't know if there exists a sigmoid function in gothic).

from gothicfreeaim.

szapp avatar szapp commented on June 23, 2024

This modifier must be adjusted and tested:

var int frameAdj; frameAdj = divf(MEM_Timer.frameTimeFloat, mkf(100)); // Adjust speed to fps (~= frame lock)
turnDeg = mulf(turnDeg, frameAdj);

from gothicfreeaim.

szapp avatar szapp commented on June 23, 2024

The modifier for different interframe intervals needs to be adjusted. (Lower frame-rate causes to fast movement at the moment).

from gothicfreeaim.

szapp avatar szapp commented on June 23, 2024

Either update the mouse at fixed intervals in the frame function/hook (not every iteration).

var int lastMouseUpdate;
const int mouseUpdateInterval = 50; // Time interval (ms) to update mouse
func void Spell_Invest_Blink(var int casterId) {
    if (MEM_Timer.totaltime > lastMouseUpdate + mouseUpdateInterval) {
        lastMouseUpdate = MEM_Timer.totaltime;
        if (!aimModifier) { aimModifier = FLOATEINS; };
        updateHeroYrot(aimModifier); // Outsourced since it might be useful for other spells/weapons as well (free aim)
    };
    // ...
};

Or create a separarte frame function for that.

// A little redunant but, aimModifier changes and needs to be updated before every call
func void updateMouse() {
    if (!aimModifier) { aimModifier = FLOATEINS; };
    updateHeroYrot(aimModifier); // Outsourced since it might be useful for other spells/weapons as well (free aim)
};

const int mouseUpdateInterval = 50; // Time interval (ms) to update mouse
func void Spell_Invest_Blink(var int casterId) {
    if (!FF_Active(updateHeroYrot) { FF_ApplyExt(updateMouse, mouseUpdateInterval, -1);
    // ...
};

from gothicfreeaim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.