Comments (2)
I think I have found a fix for this issue:
It seems that the main problem is how the friction is computed per frame (either onground or swiming). What I tried now is to use the computation from 'PM_Friction' from bg_pmove code instead of the approach from 'AAS_ApplyFriction' inside the bot code.
Strange enough the results are good, the output AAS file now has both, jump reachabilities as well as swim reachabilities.
To make it clearer I will sum up the issue again:
The default bug was that either jump reachabilities was generated (when compiling an AAS file), or correct swim reachabilities was calculated. The movement prediction code is not only used for generating AAS files, it is also used during bot game, which makes the problem even worse.
This bug was already fixed here: ioquake/ioq3@9c4c363 where the specific friction was reversed. This mainly fixed the 'real-time' computation, but NOT the generation of correct AAS files.
I have to admit that I don't really understand why using a modified version 'AAS_ApplyFriction' is fixing the issue, hence I didn't make a PR yet. In other words, if someone is interested in fixing this issue, than I can make a PR, but I would need help than, to better understand whats going on here.
I think it is worth noting that ALL idtech3 engines are concerned!
Anyways here is a snippet how the reworked 'AAS_ApplyFriction' code would look like:
static void AAS_ApplyFriction(vec3_t vel, float friction, float stopspeed, float frametime)
{
float speed, control, drop, newspeed;
//horizontal speed
drop = 0;
speed = sqrt(vel[0] * vel[0] + vel[1] * vel[1]);
if (speed) {
control = speed < stopspeed ? stopspeed : speed;
drop += control * friction * frametime;
newspeed = speed - frametime * drop; // Tobias NOTE: why is 'frametime * ' needed? See 'PM_Friction'.
if (newspeed < 0) newspeed = 0;
newspeed /= speed;
VectorScale(vel, newspeed, vel);
}
}
The important thing seems to be 'newspeed = speed - frametime * drop;'
from spearmint.
Additionally I will add a small patch I made for World of Padman as a blueprint:
bspc-botlib-friction-fix-showcase.txt (rename the file from .txt to .patch or .diff,).
Please don't ever apply this file directly as a patch, it was only made for demonstration purposes, to track the issue, though it will also fix the bug, I think. The 'new' solution of reworking the 'AAS_ApplyFriction' function seems more reliable.
from spearmint.
Related Issues (20)
- Request: can you add the support to quake 3 cinematic texture HOT 10
- Misleading comment that networked entityState_t weapon bits must be at least 8
- q3map2 "_skybox" entity rendering is broken HOT 1
- Support for Star Trek Elite Force 2 Demo BSPs HOT 1
- Rendering issue in stchdm2 (The State is Not Your Friend), HOT 5
- Rendering Issue Rustgrad HOT 6
- Can't load prerendered font correctly HOT 1
- Team Arena won't play in 1080p HOT 2
- Add support for FAKK/Alice SKB models / SKA animations
- Add support for shader keywords in Q3 IHV and Q3Test 1.03/1.05
- Add a workaround for MAX_PATCH_PLANES HOT 4
- cg_thirdPerson 1 draws crosshair sprite in mirrors
- timescale causes choppiness HOT 2
- S_StopAllSounds() doesn't stop all streaming sounds
- Add com_maxfps to Graphics Settings HOT 1
- OpenGL1: Overbright without gamma ramps
- Spearmint and OBS HOT 1
- OpenGL2: minor fix for Splitscreen view. HOT 1
- Add cvar for zoom sensitivity
- OpenGL2: shader stages for normalmaps/parallaxmaps aren't working. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spearmint.