min/max und ein Frame Wartezeit [GER/ ENG]

Posted By: Superku

min/max und ein Frame Wartezeit [GER/ ENG] - 05/29/15 16:46

Ich finde es seither sehr unschön, dass man bei Entities, welche per ent_create() dynamisch erstellt werden, 1 Frame zu warten hat, ehe man die min_x/ max_x (nach einem c_setminmax() Aufruf oder (NARROW | FAT))
ändern kann. Insbesondere ist dies bei Projektilen, Raketen und ähnlichen Dingen unschön, was sich besonders bei niedrigen Frameraten bemerkbar macht. Workarounds (wie ein verspätetes Setzen der Bounding Box Dimensionen und 1-Frame lange c_trace Kollision) sind daher gelegentlich notwendig.

Im Handbuch fand ich unter dem Eintrag zu "min_x" folgenden Hinweis, an welchen ich mich noch grob erinnern konnte:
Quote:
Bei Versionen unter 7.84, warten Sie einen Frame (wait(1)) nach Erstellen der Entity, ehe Sie die Bounding-Box setzen.

Heißt das aber, dass dieses Verhalten nach 7.84 nicht mehr eintreten sollte, das heißt dass ein Code der Form

Code:
void rocket_init()
{
	//c_setminmax(my);
	my.eflags |= NARROW | FAT;
	vec_set(my.min_x,vector(-8,-4,-4));
	vec_set(my.max_x,vector(24,4,4));
}

void rocket_create()
{
	you = ent_create("rocket.mdl",nullvector,rocket_init);
	...
}


die Bounding Box der Rakete ohne ein "wait(1)" tatsächlich manipulieren sollte?
Wenn ja, wo liegt der Fehler (ein Setzen von collision_mode = 2; bewirkt nichts)?
Posted By: Michael_Schwarz

Re: min/max und ein Frame Wartezeit - 05/31/15 00:00

wenn auch ein wenig nervig, ist so ein verhalten garnicht mal so ungewöhnlich auch in anderen engines. Bei vielen AAA spielen kommt es bei sehr niedrigen framerates oft dazu dass die physik anfängt komische sachen zu machen oder das waffen irgendwie zeitverzögerung aufweisen.

Letztens hatte sogar noch wer entdeckt dass in Fallout 3/NV es einen bug gibt beim laden eines Spielstandes wo man für ganze 15 frames keine kollision hat und man so auch toll per quicksave und quickload spam durch wände clippen kann.
Posted By: jcl

Re: min/max und ein Frame Wartezeit - 06/02/15 10:35

As to my knowledge, in A8 you can set the bounding box without a wait(1) before, but call c_setminmax before setting the bounding box. Setting NARROW|FAT is not necessary as it's set automatically by c_setminmax.
Posted By: Superku

Re: min/max und ein Frame Wartezeit - 06/02/15 10:42

Sadly this is not the case, as you can see in the following example:

Code:
///////////////////////////////
#include <acknex.h>
#include <default.c>
///////////////////////////////

void rakete_init()
{
	c_setminmax(my);
	//my.eflags |= NARROW | FAT;
	//wait(1); // <---- !
	vec_set(my.min_x,vector(-0,-4,-4));
	vec_set(my.max_x,vector(24,4,4));
}

void rocket_create()
{
	you = ent_create(CUBE_MDL,nullvector,rakete_init); //"rakete.mdl"
	your.skill30 = 32;
	your.tilt = random(360);
	while(your.skill30 > 0)
	{
		c_move(you,vector(8*time_step,0,0),nullvector,IGNORE_YOU);
		your.skill30 -= time_step;
		wait(1);
	}
	ptr_remove(you);
}

void main()
{
	fps_max = 60;
	video_mode = 9;
	//collision_mode = 2;
	level_load(NULL);
	camera.y = -512;
	camera.pan = 90;
	on_space = rocket_create;
	d3d_lines = 3;
}



EDIT: If this is a bug/ not intended, can it be fixed?
Posted By: Superku

Re: min/max und ein Frame Wartezeit - 07/27/15 16:42

I'm pleased to see all the updates and fixes on the forecast page but could you please have a look at this issue again, too?

Btw. I see the change to path_set but could you please add a warning (on let's say warn_level = 6; ) for multiple paths with the same name on level loading too (as discussed in some other thread some time ago)? Would be neat.
Oh and clicking on "ifelse" leads to OVERLAY on the beta features page.

EDIT: Btw. II will the compiler change (remember the ... I think ent_create related issue which could lead to crashes that could disappear when you change something in your script) be included in the update, too?

EDIT 2: Bumping the joystick reconnect feature again, would be amazing!
Posted By: Superku

Re: min/max und ein Frame Wartezeit - 09/13/15 19:14

Shameless bump regarding that 1 frame issue.
Posted By: jcl

Re: min/max und ein Frame Wartezeit - 09/14/15 07:43

Sorry for not answering earlier. We've looked into it and it can be fixed, but the fix affects several parts of the program and was thus delayed for a future update. It is on our list. But until then you need indeed the wait.
Posted By: Superku

Re: min/max und ein Frame Wartezeit - 09/14/15 11:19

Okay thanks!
© 2024 lite-C Forums