Comments (5)
Thanks for your findings. I tried to dig out why that line changed from host_frametime = 0.1 to host_frametime += 0.1 but didn't find anything. In fact, after measurements on 100m (simply straight walk to the exit) it is indeed 1 frame faster, since the server time doesn't start off from that extra frametime. At least this does not make every demo invalid, just having 1 unnecessary frame at the start.
from joequake.
I've done some investigation, and I think I've found the problem. (tl;dr: the frame time for the initial SV_Physics
calls should be fixed to 0.1.)
In SpawnServer
, both the vore and the SSG are loaded and their respective functions are called (monster_shalrath
and weapon_supershotgun
). When monster_shalrath
is called, walkmonster_start
is set as the vore's think function to be triggered randomly between 0.1 and 0.2 seconds in the future. When weapon_supershotgun
is called it calls StartItem
which sets PlaceItem
to be called 0.2 seconds in the future.
The vore's think function (walkmonster_start
) calls monster_teleport
, which sets the vore to be non-solid (since it is teleported in and has to wait to be spawned).
The SSG's think function (PlaceItem
) calls the builtin droptofloor
. droptofloor
does a downwards trace to in order to place the object on the floor. The function fails if the object starts in a solid which results in the SSG being removed.
The bug occurs when the SSG's think function is called before the vore's since in this scenario the vore is still solid and so the SSG (whose bbox intersects with the vore's) is removed.
I put some debug statements in SV_RunThink
to work out which frames the think functions are called on. Here's the result:
ent_num=28 thinktime=1.2000000477 sv.time=1.0000000000 sv_frametime=0.1138890000 (sv.time + sv_frametime)=1.1138890000 not running think
ent_num=204 thinktime=1.1420270205 sv.time=1.0000000000 sv_frametime=0.1138890000 (sv.time + sv_frametime)=1.1138890000 not running think
ent_num=28 thinktime=1.2000000477 sv.time=1.1138890000 sv_frametime=0.1138890000 (sv.time + sv_frametime)=1.2277780000 running think
ent_num=204 thinktime=1.1420270205 sv.time=1.1138890000 sv_frametime=0.1138890000 (sv.time + sv_frametime)=1.2277780000 running think
entity 28 is the SSG, and entity 204 is the vore. The two frames are the SV_Physics calls in SV_SpawnServer. The equivalent code in QuakeSpasm fixes the frame time for these steps to 0.1. Making this change appears to fix the bug:
ent_num=28 thinktime=1.2000000477 sv.time=1.0000000000 sv_frametime=0.1000000000 (sv.time + sv_frametime)=1.1000000000 not running think
ent_num=204 thinktime=1.1893674135 sv.time=1.0000000000 sv_frametime=0.1000000000 (sv.time + sv_frametime)=1.1000000000 not running think
ent_num=28 thinktime=1.2000000477 sv.time=1.1000000000 sv_frametime=0.1000000000 (sv.time + sv_frametime)=1.2000000000 not running think
ent_num=204 thinktime=1.1893674135 sv.time=1.1000000000 sv_frametime=0.1000000000 (sv.time + sv_frametime)=1.2000000000 running think
ent_num=28 thinktime=1.2000000477 sv.time=1.2000000000 sv_frametime=0.2000000000 (sv.time + sv_frametime)=1.4000000000 running think
With a fixed frame time of 0.1, the SSG droptofloor always happens on the 3rd frame, and the vore hiding happens on the 2nd frame, avoiding the bug. This appears to be the same as OG quake, as well as QuakeSpasm, so seems like the right thing to do, but I'm not sure if it'll have any interactions with the cl_independentphysics
logic. What do you think @j0zzz ?
from joequake.
Thinking about it some more, this extra time added at the start means that the first frame where the player has control is pushed back by 2 * physframetime
, which would add the same amount on to any finish times
from joequake.
Fixed in commit 2fb0eb7
from joequake.
Also seen in sm222_mh where a vore spawns on top of the gold key, stopping it from appearing.
from joequake.
Related Issues (20)
- "Bad surface extents" error HOT 3
- Issue with loading some maps from Paril3.0 HOT 3
- "GL_LoadTexture: numgltextures == MAX_GLTEXTURES" error
- Strange model skin issue HOT 2
- Signon buffer fragmentation
- Ghost splits: Rewinding a demo during intermission shows multiple splits per level HOT 1
- anisotropic filtering & anti aliasing support HOT 1
- Ghost splits: End of level splits not shown during finale
- NUMPAD keys don't function with SDL exe HOT 1
- Issue with pitch angles with SDL exe
- Issue with loading mj4m5 from Mjolnir HOT 2
- Ghost doesn't work for levels without a finale/intermission message HOT 4
- Level loading time is added onto game start time (up to 0.1 seconds) HOT 23
- Add GL_DEPTH_CLAMP_NV HOT 2
- glDrawElements fails with GL_INVALID_OPERATION on Intel Corporation Iris Plus Graphics G7 (laptop GPU) HOT 2
- Issue with r_fullbright HOT 1
- Crash when changing `gl_part_telesplash` from 2 to 0 when teleporting HOT 1
- Weapon draw still changes with FOV when cl_gun_fovscale is set to 1
- gfx/mainmenu should be replaced with a diffrent system HOT 2
- Game crashes when screensaver activates
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 joequake.