[SOLVED] How much RadiusGive's max allowed radius value is?
Moderator: GZDoom Developers
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
- Void Weaver
- Posts: 724
- Joined: Thu Dec 18, 2014 7:15 am
- Contact:
[SOLVED] How much RadiusGive's max allowed radius value is?
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.
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.
Last edited by Void Weaver on Sun Sep 29, 2019 9:21 pm, edited 3 times in total.
-
- Posts: 5043
- Joined: Sun Nov 14, 2010 12:59 am
Re: How much RadiusGive's max allowed radius value is?
I'm not sure, but there is this from [wiki]A_RadiusGive[/wiki]:Void Weaver wrote:I need for maximal value that can cover a map of any size.
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.
- Void Weaver
- Posts: 724
- Joined: Thu Dec 18, 2014 7:15 am
- Contact:
Re: How much RadiusGive's max allowed radius value is?
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?
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?
Valid map vertex coordinates must be in -32768..32768 range.
- Void Weaver
- Posts: 724
- Joined: Thu Dec 18, 2014 7:15 am
- Contact:
Re: How much RadiusGive's max allowed radius value is?
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?
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?
Distance between (-32768,-32768,-32768) and (32768,32768,32768) points is slightly greater than 65536 

- Void Weaver
- Posts: 724
- Joined: Thu Dec 18, 2014 7:15 am
- Contact:
Re: How much RadiusGive's max allowed radius value is?
Oh, of course! It's roughly equal of 113512. 

Re: [SOLVED] How much RadiusGive's max allowed radius value
Is the Z height even considered for RadiusGive?
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49226
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: [SOLVED] How much RadiusGive's max allowed radius value
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
Yes, it’s a radius of a sphere.Empyre wrote:Is the Z height even considered for RadiusGive?
- Void Weaver
- Posts: 724
- Joined: Thu Dec 18, 2014 7:15 am
- Contact:
Re: [SOLVED] How much RadiusGive's max allowed radius value
Yeah, even 113k radius causes severe lags at map with 1k monsters, 2.5k items and total map length of 32k.Graf Zahl wrote:Never forget that the larger the radius is, the costlier the function becomes, especially on heavily populated maps.
Or a cube edge if the flag presented._mental_ wrote:Yes, it’s a radius of a sphere.
Re: [SOLVED] How much RadiusGive's max allowed radius value
>-32768..32768 range
32767.
32767.
- Void Weaver
- Posts: 724
- Joined: Thu Dec 18, 2014 7:15 am
- Contact:
Re: [SOLVED] How much RadiusGive's max allowed radius value
Why?ketmar wrote:>-32768..32768 range
32767.
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.
}
- phantombeta
- Posts: 2163
- Joined: Thu May 02, 2013 1:27 am
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia with Vulkan support
- Location: Brazil
Re: [SOLVED] How much RadiusGive's max allowed radius value
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].ketmar wrote:>-32768..32768 range
32767.
* (Aside from the nodes format and the nodebuilder)
Re: [SOLVED] How much RadiusGive's max allowed radius value
>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.
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.
Last edited by ketmar on Mon Jul 15, 2019 12:36 am, edited 2 times in total.