rehlds icon indicating copy to clipboard operation
rehlds copied to clipboard

Stuck on Spawnpoint

Open Maxi605 opened this issue 3 years ago • 22 comments

Same as this, https://forums.alliedmods.net/showthread.php?t=289310

In certain maps the players are stucked in the spawnpoint, can't move, there's like a block on them and you can press E on it (makes a sound). Restarting the server "fixes" the issue, after a few days the issue happens again but in different maps (It can happen on the same ones, but usually is on different ones).

Maxi605 avatar Oct 05 '21 05:10 Maxi605

same as: https://github.com/dreamstalker/rehlds/issues/852 Probably related to some rehlds mistake at entities

Try downgrading rehlds version to find what version has this error.

RauliTop avatar Oct 05 '21 13:10 RauliTop

Hum, I can confirm this bug is real & pretty annoying, and also specify that it is not "ReHLDS" only. I have it from a while on my servers using legit HLDS (build #6153) + ReGameDLL_CS, and I had to set up "two reboots" per day to avoid this, because when it happens, well, that's obviously unplayable and need a change map or reboot as definitive fix. We spawn at our spawns, but it is basically like if we were in a map's wall, we can only move if we use "noclip"... air becomes "solid" as specified in the #852.

I did not took time to make deeper tests to figure out where this crap come from, but I put my config with a different mapcycle (only official maps), and make it turn a lot of hours until "this should happen", and this never happenned. So I am guessing this might be due to some entities (or their settings) present on some specific maps which generate this problem at the end, and where this seems to "fuck up the physics", possibly something in the PM_* functions. But I am wondering if this is not a ReGameDLL_CS issue, I did not tested with legit CS as my config is custom & more adapted for ReGameDLL_CS.

@Maxi605: Do you use ReGameDLL_CS? If yes, can you test with the legit CS & tell if this happens too? Also, do you run some Half-Life Deathmatch maps?

StevenKal avatar Oct 05 '21 17:10 StevenKal

Hum, I can confirm this bug is real & pretty annoying, and also specify that it is not "ReHLDS" only. I have it from a while on my servers using legit HLDS (build #6153) + ReGameDLL_CS, and I had to set up "two reboots" per day to avoid this, because when it happens, well, that's obviously unplayable and need a change map or reboot as definitive fix. We spawn at our spawns, but it is basically like if we were in a map's wall, we can only move if we use "noclip"... air becomes "solid" as specified in the #852.

I did not took time to make deeper tests to figure out where this crap come from, but I put my config with a different mapcycle (only official maps), and make it turn a lot of hours until "this should happen", and this never happenned. So I am guessing this might be due to some entities (or their settings) present on some specific maps which generate this problem at the end, and where this seems to "fuck up the physics", possibly something in the PM_* functions. But I am wondering if this is not a ReGameDLL_CS issue, I did not tested with legit CS as my config is custom & more adapted for ReGameDLL_CS.

@Maxi605: Do you use ReGameDLL_CS? If yes, can you test with the legit CS & tell if this happens too? Also, do you run some Half-Life Deathmatch maps?

Hi there. This issue only happens to me on my Deathrun Server, it used to happen on my MultiMod server where i had a Deathrun Mod (The bug also affected maps from Deathrace and Capture The Flag) but haven't seen it for a while since i moved my deathrun to it's own server (Where the problem didn't continue happening untill i installed more maps). I am running ReGameDLL, i never had this issue happen with HLDS so i assumed it was ReHLDS. I can also confirm that a friend has the same issue but on his case, is on a KZ server.

Maxi605 avatar Oct 05 '21 18:10 Maxi605

O.K., if you can set up back the exact config where this happenned, then if yes, try with legit CS, in order to try "isolating", if this comes from ReGameDLL or not. But as I said this issue happens on both HLDS & ReHLDS, so the source of the problem might be elsewhere.

StevenKal avatar Oct 05 '21 18:10 StevenKal

to "fuck up the physics", possibly something in the PM_* functions

You can check if it is the same as in my case or not with this plugin. Cycler_sprite size should be always zero, but when the issue happens, it will become non-zero. Since cycler_sprite is solid (but we don't notice it because it has no size by default), people will stuck in it when it get enormous sizes.

#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

new g_szMapname[32];

public plugin_init()
{
	register_plugin("Stuck test", "1.0", "Pentalgin");
}

public plugin_precache()
{
	get_mapname(g_szMapname, charsmax(g_szMapname));
	RegisterHam(Ham_Spawn, "cycler_sprite", "Ham_Spawn_Cycler", 1);
}

public Ham_Spawn_Cycler(ent)
{
	new Float:Mins[3], Float:Maxs[3];
	pev(ent, pev_mins, Mins);
	pev(ent, pev_maxs, Maxs);
	log_to_file("stuckdebug.log", "Map: %s ent: %i size: %f %f %f %f %f %f", g_szMapname, ent, Mins[0], Mins[1], Mins[2], Maxs[0], Maxs[1], Maxs[2]);
}

I think the root of the issue is in maps. Maybe there's something wrong when you load a lot of different maps with big list of textures or resources.

PentalginPlus avatar Oct 05 '21 21:10 PentalginPlus

This is also a possibility, but why suddenly a "cycler_sprite" (or another kind of entity) will get a different size than usual (I mean, a size of the whole map...)? Besides to get stuck inside this needs a higher solidity, not only "SOLID_TRIGGER" (as for portals & cie). Also, did you have tested this bug with legit CS?

StevenKal avatar Oct 05 '21 22:10 StevenKal

This is also a possibility, but why suddenly a "cycler_sprite" (or another kind of entity) will get a different size than usual (I mean, a size of the whole map...)? Besides to get stuck inside this needs a higher solidity, not only "SOLID_TRIGGER" (as for portals & cie). Also, did you have tested this bug with legit CS?

Hard to do so, my plugins are dependent from ReHLDS, ReGameDLL and ReAPI so i can't go back to HLDS and test it out

Maxi605 avatar Oct 06 '21 00:10 Maxi605

Bug also mentioned here to 'cycler': https://amxmodx-es.com/showthread.php?tid=18342

Fix code published here: https://github.com/dreamstalker/rehlds/issues/864#issuecomment-1074456427

RauliTop avatar Oct 06 '21 08:10 RauliTop

L 11/05/2021 - 19:08:34: Map: deathrun_yellowbase_remastered ent: 54 size: -128.000000 -128.000000 -128.000000 128.000000 128.000000 128.000000 L 11/05/2021 - 19:09:05: Map: deathrun_woodo ent: 151 size: -3873.000000 -1.000000 -929.000000 3633.000000 3873.000000 1953.000000 L 11/05/2021 - 19:09:52: Map: deathrun_woodo_easy ent: 110 size: -3873.000000 -1.000000 -929.000000 3633.000000 3873.000000 1953.000000

All cyclers (on each map) have the same position

Maxi605 avatar Nov 05 '21 22:11 Maxi605

L 11/05/2021 - 19:08:34: Map: deathrun_yellowbase_remastered ent: 54 size: -128.000000 -128.000000 -128.000000 128.000000 128.000000 128.000000 L 11/05/2021 - 19:09:05: Map: deathrun_woodo ent: 151 size: -3873.000000 -1.000000 -929.000000 3633.000000 3873.000000 1953.000000 L 11/05/2021 - 19:09:52: Map: deathrun_woodo_easy ent: 110 size: -3873.000000 -1.000000 -929.000000 3633.000000 3873.000000 1953.000000

All cyclers (on each map) have the same position

Strange why is happening this... and what is his normal size? 0?

as workaround try setting his sizes to 0.0

RauliTop avatar Nov 08 '21 18:11 RauliTop

L 11/05/2021 - 19:08:34: Map: deathrun_yellowbase_remastered ent: 54 size: -128.000000 -128.000000 -128.000000 128.000000 128.000000 128.000000 L 11/05/2021 - 19:09:05: Map: deathrun_woodo ent: 151 size: -3873.000000 -1.000000 -929.000000 3633.000000 3873.000000 1953.000000 L 11/05/2021 - 19:09:52: Map: deathrun_woodo_easy ent: 110 size: -3873.000000 -1.000000 -929.000000 3633.000000 3873.000000 1953.000000 All cyclers (on each map) have the same position

Strange why is happening this... and what is his normal size? 0?

as workaround try setting his sizes to 0.0

The normal sizes are all 0.0.

Is it possible to force set the size?

Maxi605 avatar Nov 09 '21 08:11 Maxi605

Yes, very strange problem... But this is already good someone figured out a part of the location of the issue. Are all of those entities concerned always "cycler" and not "cycler_sprite" or other cycler type?

StevenKal avatar Nov 09 '21 13:11 StevenKal

The normal sizes are all 0.0.

Is it possible to force set the size?

Yeah of course.

If size is not 0.0, then set it to 0.0 with entity_set_size

RauliTop avatar Nov 09 '21 22:11 RauliTop

Someone asking for help with this issue

This is the possible plugin fix:

#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

//new g_szMapname[32];

public plugin_init()
{
	register_plugin("cycler size fix", "0.1", "RauliTop");
}

public plugin_precache()
{
	//get_mapname(g_szMapname, charsmax(g_szMapname));
	RegisterHam(Ham_Spawn, "cycler", "Ham_Spawn_Cycler", 1);
	RegisterHam(Ham_Spawn, "cycler_sprite", "Ham_Spawn_CyclerSpr", 1);
}

public Ham_Spawn_Cycler(ent)
{
	new Float:Mins[3], Float:Maxs[3];
	pev(ent, pev_mins, Mins);
	pev(ent, pev_maxs, Maxs);
	//log_to_file("stuckdebug.log", "cycler. Map: %s ent: %i size: %f %f %f %f %f %f", g_szMapname, ent, Mins[0], Mins[1], Mins[2], Maxs[0], Maxs[1], Maxs[2]);
	
	if (Mins[0] != 0.0 && Maxs[0] != 0.0)
	{
		set_pev(ent, pev_mins, {0.0, 0.0, 0.0})
		set_pev(ent, pev_maxs, {0.0, 0.0, 0.0})
		set_pev(ent, pev_size, Float:{0.0, 0.0, 0.0, 0.0, 0.0, 0.0})
	}
}

public Ham_Spawn_CyclerSpr(ent)
{
	new Float:Mins[3], Float:Maxs[3];
	pev(ent, pev_mins, Mins);
	pev(ent, pev_maxs, Maxs);
	//log_to_file("stuckdebug.log", "cycler_sprite. Map: %s ent: %i size: %f %f %f %f %f %f", g_szMapname, ent, Mins[0], Mins[1], Mins[2], Maxs[0], Maxs[1], Maxs[2]);

	if (Mins[0] != 0.0 && Maxs[0] != 0.0)
	{
		set_pev(ent, pev_mins, {0.0, 0.0, 0.0})
		set_pev(ent, pev_maxs, {0.0, 0.0, 0.0})
		set_pev(ent, pev_size, Float:{0.0, 0.0, 0.0, 0.0, 0.0, 0.0})
	}
}

RauliTop avatar Mar 21 '22 21:03 RauliTop

I run rehlds & regamedll with Kreedz mod on Windows Server 2022. The error still occurs, one person enters without error, but a second person enters the server and automatically gets stuck in the wall. Screen Center Tip: This command is not available to you at this point. @RauliTop

HebutMrLiu avatar May 04 '23 12:05 HebutMrLiu

Yeah those cyclers which turns very large & solid... But I remember last year, I made a quick test, I removed all of those entities with a test command, I was able to move (no longer stuck), but after that I changed the map to the same one via "amx_rcon restart" (in usual the map should reinitialize entities), but I was still stuck, and, the cyclers were no longer there just like if I had not changed the map.

I run legit GoldSrc with ReGameDLL_CS, I have the feeling this is a ReGameDLL_CS specific-issue and when running some maps (because if we play for example, the legit maps cycle, this normally does not happen). I am wondering if this is not due to the save/restore code or similar, hard to figure out this one! Will need deep tests & investigation. For now, best solution is to program a server reboot, one per day at least, in the night (I personnaly have 2 per day (5AM + 2PM) because this shit can happen before 24h range!).

StevenKal avatar May 04 '23 13:05 StevenKal

Yeah, the same issue. After a while collision starts working incorrectly, weapon boxes start floating, trace lines start returning hit results for void, entities detect touch with air and models disappears. I spent a lot of time to find a pattern and reason for the bug thinking that it was a problem on my side and that maybe my mods breaks entities or work with entities in the wrong way sometimes, but I didn't find why...

P.S.: The bug is reproducible even with the cycler fix.

Hedgefog avatar Jul 01 '23 04:07 Hedgefog

After extensive testing, this "solves" the problem. It'll cause some issues in some maps that rely on the hitboxes of the cycler itself, since it removes said hitbox, if you have other plugins to create blocks (like walkguard) you can patch that up.

#include <amxmodx>
#include <engine>
#include <xs>

/* =================================================================================
* 				[ Global ]
* ================================================================================= */

enum _:Fix_Entity_Struct
{
	Fix_Entity_Index,
	Float:Fix_Entity_Mins[ 3 ],
	Float:Fix_Entity_Maxs[ 3 ]
}

/* =================================================================================
* 				[ Plugin Events ]
* ================================================================================= */

public plugin_init( )
{
	register_plugin( "Random Fixes", "1.0", "Manu" );

	register_logevent( "OnRoundStart", 2, "1=Round_Start" );

	RemoveBigCyclers( );
	MakeCyclersNonSolid( );
}

/* =================================================================================
* 				[ Round Events ]
* ================================================================================= */

public OnRoundStart( )
{
	MakeCyclersNonSolid( );
}

/* =================================================================================
* 				[ Remove Big Cyclers ]
* ================================================================================= */

RemoveBigCyclers( )
{
	new const szClassnames[ ][ ] = {
		"cycler",
		"cycler_sprite"
	};

	new Float:flOrigin[ 3 ];
	new Float:flMins[ 3 ];
	new Float:flMaxs[ 3 ];

	new iEnt;

	for ( new i = 0, j = 0 ; i < sizeof( szClassnames ) ; i++ )
	{
		iEnt = 0;

		while ( ( iEnt = find_ent_by_class( iEnt, szClassnames[ i ] ) ) > 0 )
		{
			entity_get_vector( iEnt, EV_VEC_origin, flOrigin );
			entity_get_vector( iEnt, EV_VEC_mins, flMins );
			entity_get_vector( iEnt, EV_VEC_maxs, flMaxs );

			xs_vec_add( flOrigin, flMins, flMins );
			xs_vec_add( flOrigin, flMaxs, flMaxs );

			for ( j = 0 ; j < 3 ; j++ )
			{
				if ( floatabs( flMaxs[ j ] - flMins[ j ] ) < 1024.0 )
				{
					continue;
				}

				remove_entity( iEnt );

				break;
			}
		}
	}
}

/* =================================================================================
* 				[ Make Cyclers Non Solid ]
* ================================================================================= */

MakeCyclersNonSolid( )
{
	new const szClassnames[ ][ ] = {
		"cycler",
		"cycler_sprite"
	};

	new iEnt;

	for ( new i = 0 ; i < sizeof( szClassnames ) ; i++ )
	{
		iEnt = 0;

		while ( ( iEnt = find_ent_by_class( iEnt, szClassnames[ i ] ) ) > 0 )
		{
			entity_set_int( iEnt, EV_INT_solid, SOLID_NOT );
		}
	}
}

Maxi605 avatar Jul 01 '23 16:07 Maxi605

That's very poorly written. Just restore their sizes to normal on spawn or after a certain time after spawn or set them to solid trigger. If they aren't allowed to be modified in any way you can also fake the properties to the players in addtofullpack.

di57inct avatar Jul 01 '23 18:07 di57inct

That's very poorly written. Just restore their sizes to normal on spawn or after a certain time after spawn or set them to solid trigger. If they aren't allowed to be modified in any way you can also fake the properties to the players in addtofullpack.

Works as intended. You can't restore their size due to them re-sizing again and again, it's pointless. We tried multiple ways to solve the problem, the only useful way is to just remove the hitboxes. We did extensive testing, this is the best way we found so far.

Maxi605 avatar Jul 01 '23 18:07 Maxi605

Check if the solid state changes or not. If it doesn't, set them to SOLID_TRIGGER. If it does, use AddToFullPack. EDIT: You can also set your wanted properties on entity think.

di57inct avatar Jul 01 '23 19:07 di57inct

Have anyone tried setting sv_rehlds_local_gametime to 1 and see if that helps?

justgo97 avatar Jul 01 '23 20:07 justgo97

这写得非常糟糕。只需在生成时或生成后一定时间后将其大小恢复为正常,或将它们设置为固定触发器即可。如果不允许以任何方式修改它们,您还可以在 addtofullpack 中向玩家伪造属性。

按预期工作。由于它们一次又一次地调整大小,您无法恢复它们的大小,这是毫无意义的。我们尝试了多种方法来解决这个问题,唯一有用的方法就是删除碰撞盒。我们进行了广泛的测试,这是迄今为止我们发现的最好方法。

Are you using Linux or Windows? I'm still having problems using your plugin on WindowsOS. ReHLDS version: 3.11.0.767-dev AMX Mod X version: 1.9.0.5271

HebutMrLiu avatar Jul 02 '23 14:07 HebutMrLiu

Have anyone tried setting sv_rehlds_local_gametime to 1 and see if that helps?

yep, it doesn't help me

Hedgefog avatar Jul 03 '23 01:07 Hedgefog