Page 1 of 2
[SOLVED] How much RadiusGive's max allowed radius value is?
Posted: Sat Jul 13, 2019 9:30 pm
by Void Weaver
Subj.
I've tried to set 0x7FFFFFFF into distance but it have cause game freeze. Anyway I need for maximal value that can cover a map of any size.
---
A_RadiusGive 16384 radius value is allow to cover entire map of any possible size, IF it called from the map center. Look for explanation
here.
Re: How much RadiusGive's max allowed radius value is?
Posted: Sat Jul 13, 2019 11:43 pm
by Blue Shadow
Void Weaver wrote:I need for maximal value that can cover a map of any size.
I'm not sure, but there is this from [wiki]A_RadiusGive[/wiki]:
Note that for very large distances, attempting to give to specific things map-wide may fail. A good range for the entirety of the map would be 16383. A dummy actor can warp to (0,0,0) coordinates to ensure the radius does not overflow from being too close to the map boundaries. Experimentation may be required.
Re: How much RadiusGive's max allowed radius value is?
Posted: Sat Jul 13, 2019 11:57 pm
by Void Weaver
Earlier I've the same thoughts but it more looks like a some kind of pointless subjective advice rather than precise data.
Function accepts for sure value of 1048576 at least, but I can't verify is _RadiusGive really works for this value or maybe its effective range may be much less than allowed value. It is doubtful, but still I would like to know for sure.
EDIT:
Probably I should ask a bit differently. What is maximum possible map size and can it be successfully covered by _RadiusGive radius between farthest edges of map?
Re: How much RadiusGive's max allowed radius value is?
Posted: Sun Jul 14, 2019 12:28 am
by _mental_
Valid map vertex coordinates must be in -32768..32768 range.
Re: How much RadiusGive's max allowed radius value is?
Posted: Sun Jul 14, 2019 12:36 am
by Void Weaver
Oh, then there is no need to assign radius value more than 65536 at all?
And else one important thing for me. Does this diapason counts placement of container-sectors for monsters landing party?
Re: How much RadiusGive's max allowed radius value is?
Posted: Sun Jul 14, 2019 1:16 am
by _mental_
Distance between (-32768,-32768,-32768) and (32768,32768,32768) points is
slightly greater than 65536

Re: How much RadiusGive's max allowed radius value is?
Posted: Sun Jul 14, 2019 8:11 am
by Void Weaver
Oh, of course! It's roughly equal of 113512.

Re: [SOLVED] How much RadiusGive's max allowed radius value
Posted: Sun Jul 14, 2019 10:20 am
by Empyre
Is the Z height even considered for RadiusGive?
Re: [SOLVED] How much RadiusGive's max allowed radius value
Posted: Sun Jul 14, 2019 10:30 am
by Graf Zahl
Never forget that the larger the radius is, the costlier the function becomes, especially on heavily populated maps.
Re: [SOLVED] How much RadiusGive's max allowed radius value
Posted: Sun Jul 14, 2019 10:32 am
by _mental_
Empyre wrote:Is the Z height even considered for RadiusGive?
Yes, it’s a radius of a sphere.
Re: [SOLVED] How much RadiusGive's max allowed radius value
Posted: Sun Jul 14, 2019 10:38 am
by Void Weaver
Graf Zahl wrote:Never forget that the larger the radius is, the costlier the function becomes, especially on heavily populated maps.
Yeah, even 113k radius causes severe lags at map with 1k monsters, 2.5k items and total map length of 32k.
_mental_ wrote:Yes, it’s a radius of a sphere.
Or a cube edge if the flag presented.
Re: [SOLVED] How much RadiusGive's max allowed radius value
Posted: Sun Jul 14, 2019 2:08 pm
by ketmar
>-32768..32768 range
32767.
Re: [SOLVED] How much RadiusGive's max allowed radius value
Posted: Sun Jul 14, 2019 2:31 pm
by Void Weaver
ketmar wrote:>-32768..32768 range
32767.
Why?
Source says that 32768 is't included in the bad range:
Code: Select all
if (sc.Float < -32768 || sc.Float > 32768)
{
sc.ScriptMessage("Value %f out of range for a coordinate '%s'. Valid range is ]-32768 .. 32768]", sc.Float, key);
BadCoordinates = true; // If this happens the map must not allowed to be started.
}
Re: [SOLVED] How much RadiusGive's max allowed radius value
Posted: Sun Jul 14, 2019 2:43 pm
by phantombeta
ketmar wrote:>-32768..32768 range
32767.
No. GZDoom uses floating point, therefore, the limits are entirely arbitrary*. If you look at the source code (which Void Weaver just posted a snippet of above), you'll see that the range is indeed [-32768, 32768].
* (Aside from the nodes format and the nodebuilder)
Re: [SOLVED] How much RadiusGive's max allowed radius value
Posted: Mon Jul 15, 2019 12:23 am
by ketmar
>GZDoom uses floating point
yet most maps are using binary map format. also, i wonder how it managed to represent 32768 in 16.16 2-complement nodes data (which GZDoom is still using internally). i believe that this is a bug that should be fixed, or it will pop up eventually.
p.s.: GZDoom is doing fp<->16.16 conversions internally in more that one place, so the real positive limit is <32768 anyway. having it as 32768 is a bug. prolly not fatal (as code should do correct rounding and clamping, i believe), but still a bug.