Strange game behavior [SOLVED]


(Yatta_Yatta-O_o) #1

I have a weird problem in my map when building the command post : suddendly the game get a strange lag feeling (altough devmap local test), irregular player movement (especially when jumping), bullets stopped/hiting on nothing in mid air …
g_scriptdebug doesnt indicate any script loop and theres no related warning or errors noticeable. When destroying the command post, everything is fine again.

Command post script :


const_cpx_canyon
{
	spawn
	{
		wait 200
		constructible_class 2
	}
	trigger setup
	{
		setstate const_cpa_canyon_built invisible
		setstate const_cpx_canyon_built invisible
		setstate const_cpa_canyon_model invisible
		setstate const_cpx_canyon_model invisible
		setstate const_cp_canyon_antena invisible
		setstate const_cp_canyon_closed_model default
		setstate const_cp_canyon_t default
	}	
	buildstart final
	{
		setstate const_cpx_canyon_built underconstruction
		setstate const_cpx_canyon_model underconstruction
		setstate const_cp_canyon_antena underconstruction
		setstate const_cp_canyon_closed_model invisible
	}
	built final
	{
		setstate const_cp_canyon_t invisible
		setstate const_cpx_canyon_built default
		setstate const_cpx_canyon_model default
		setstate const_cp_canyon_antena default
		wait 100

		wm_announce	"<> Axis Command Post constructed. Charge speed increased!"

		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 0 "axis_hq_compost_constructed"

		wm_teamvoiceannounce 1 "allies_hq_compost_constructed_axis"

		wm_removeteamvoiceannounce 0 "axis_hq_compost_construct"
		// *----------------------------------- vo ------------------------------------------*
		wait 100
		sethqstatus 0 1
		setchargetimefactor 0 soldier 0.7
		setchargetimefactor 0 lieutenant 0.7
		setchargetimefactor 0 medic 0.5
		setchargetimefactor 0 engineer 0.6
		setchargetimefactor 0 covertops 0.6
		wait 200
		}

	death
	{
		trigger self setup
		setchargetimefactor 0 soldier 1
		setchargetimefactor 0 lieutenant 1
		setchargetimefactor 0 medic 0.8
		setchargetimefactor 0 engineer 0.9
		setchargetimefactor 0 covertops 0.8
//		alertentity const_cpx_canyon_obj
		sethqstatus 0 0
		wm_announce	"<> Allies team has destroyed the Axis Command Post!"

		// *----------------------------------- vo ------------------------------------------*
		wm_addteamvoiceannounce 0 "axis_hq_compost_construct"

		wm_teamvoiceannounce 0 "axis_hq_compost_damaged"
		// *----------------------------------- vo ------------------------------------------*
	}
	decayed final
	{
		trigger self setup
	}

Note that theres two different constructible built from the same trigger_objective_info :
The allied command post (flaged allied constructible, script shown here) and the axis command post (axis constructible, same script except adapted for axis).

Ever had this problem ?


(]UBC[ McNite) #2

Regarding what u said about your huge map… what s the FPS in that area, and did you check your amount of ingame-entities yet? Maybe you reach some limits or are close to it, and it gets noticeable at that point.
Is it while the cp is under construction or after it has been built?
To check whether its the “underconstruction” shader I d probably put in some brushes with a siwa-water and see whether that gives the same laggy feeling.


(Yatta_Yatta-O_o) #3

The whole map has decent fps afaik (altough I dont remember the command to show fps -please?-, framerate is fluid). Everything is fine until I specificaly build the CP. If I leave it unconstructed, I have no such problem in the whole map. Im already using the siwa-water shader elsewhere in the map, but Im not sure I understand how it could be related to the problem. To make things clear, the game doesnt slow down (still fluid fps) but firing and moving players gets erratic.


(]UBC[ McNite) #4

Well, forget my post :bump: what you describe now doesn’t sound FPS-related, i thought it just occured while cp is underconstruction.
The command for FPS should be /seta cg_drawfps 2.


(Yatta_Yatta-O_o) #5

thanks for the command, nite.

I’ve found what was causing the ‘lag’ but didnt understood why. This command post thing was one of the earlier constructibles I did in the map (and somehow my first ET map) so I did it quite blindly. I had set “track” key to every part (both clip constructibles, models, and a linked brush antena I linked with the construction) so I tought there was something like a inner non-script loop with elements in track group calling again the track action, therefore doing the loop. Im not sure im clear but whatever, that wasnt the problem. Ive checked my script and did a step by step check, until I found out the culprit : doing a setstate cp_antena undersconstruction caused the (and lag was still on once construction is completed). Checking the antena brush entity, Ive found that I made it a func_constructible as well (with both axis and allied constructibles flagset), I converted it to a func_static (didnt knew that back then) an dit works perfectly fine now.

Conclusion :
Either it was caused because the antena func_constructible was scriptless, or had both the axis and allied constructible flags set, or even because of some loopback because it was constructed at the same time as the command post constructible … anyways it was an error to use a constructible just for an extra part of the constructible, but I didnt know how to do else back then. =P