Page MenuHomeWildfire Games

Random Maps: scale by map area
ClosedPublic

Authored by Feldfeld on Aug 10 2021, 8:08 PM.

Details

Summary

This function allows scaling by map area instead of its size. The area grows as square of its size, so it is quite different. This is particularly useful in order to place resources or other elements in the same density among all map sizes, something which I believe is not achievable with the scaleByMapSize function. It is quite surprising to me that such a function didn't exist already.

For example, resources such as berries, animals and mines generally should have the same density among all map sizes, and I believe should use that function. It's a different thing for forests however, as their size also depend on map size which makes sense.

Explanation of arguments:

  • base: the quantity you expect for the smallest map, which allows for a good initial guess
  • reduction: The area you would like to substract to the total map area. Useful because the fraction of the area in which you can't place the desired resource can vary indepedently from map area. For example, if you can't place a resource close to a player, then you can make it count by summing area close to player and using this argument. Another example could be if water can take more or less place in the map randomly.

If counting players is a common occurence then there could be another very similar function which takes care of that.

This patch can be useful to discuss D3995, because this can simplify deciding resource quantities as the "max" argument is no longer necessary for many cases since it doesn't make sense

Test Plan

Verify the function works as expected

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Feldfeld requested review of this revision.Aug 10 2021, 8:08 PM
Feldfeld created this revision.
marder added a subscriber: marder.Aug 10 2021, 8:14 PM
lyv added a subscriber: lyv.Aug 11 2021, 8:06 AM

It's a different thing for forests however, as their size also depend on map size which makes sense.

Is it different though? It would make just as much sense to scale forest sizes with areas.

In fact, the whole problem stems from the fact that rmgen tries to work with tile counts everywhere, when tile counts are arbitrary.

The closest API to this one, AoE3, use fractions. Rmgen also borrows the tiles to fractions and fractions to tiles function but lacks the underlying reasons for them and therefore lacks the advantages.

If you consider everything in fractions, regardless of map sizes, scaling things appropriately wouldn't be an issue.

Is it different though? It would make just as much sense to scale forest sizes with areas.

Well maybe, I guess it depends on how we want the map to behave with varying size. If size grows, do we intend the map to be a description in more detail of an area (= zooming, kind of), or a larger area which follows the same pattern? Examples of map which in my mind are like the former would be Jebel Barkal, Meditteranean, meanwhile for the later Hellas is a good example, if memory serves me right. Then there could be a tradeoff between scaling forest size and scaling number of forests, although arguably both could be scaled with area. I also said that because ChainPlacer arguments are a bit hard to reason with, for me.

lyv added a comment.Aug 11 2021, 8:23 PM

I plan on writing an entirely new library from scratch some day under a better paradigm. All ideas and no time.

You should also probably handle square map cases. And then find the resident rmgen committer I guess m

Feldfeld updated this revision to Diff 18393.Aug 17 2021, 9:34 AM

Handle square maps

lyv accepted this revision.Aug 17 2021, 12:49 PM

It now does what it says on the tin.
It doesn't contradict or goes against any conventions or approaches currently used.

This revision is now accepted and ready to land.Aug 17 2021, 12:49 PM
Stan accepted this revision.EditedAug 19 2021, 10:47 AM
Stan added a subscriber: Stan.

Looks good to me. Ternary would hurt readability so code is okay, we don't seem to have tests for these though, but they could be added later if we support that.
Will commit this for A26. Thanks for the review @smiley.

g_MapSettings.Size/2 // I don't suppose we have a constant for this?

is missing a space, but can be added when committing.

bb added a subscriber: bb.Aug 28 2021, 7:17 PM

Refs rP20905. It should be checked if this is really required. Example maps might convince.

Keep this more in line with the function above. This has some other ill-defined behavior.

In D4212#179136, @Stan wrote:

Looks good to me. Ternary would hurt readability so code is okay,

How so?

return g_MapSettings.CircularMap ? 
   base * ((diskArea(g_MapSettings.Size / 2) - reduction) / (diskArea(minMapSize / 2)));
   base * ((g_MapSettings.Size * g_MapSettings.Size - reduction) / (minMapSize * minMapSize));

It should be checked if this is really required. Example maps might convince.

I had this idea shortly before I finished the current version of Alpine Mountains (https://code.wildfiregames.com/D2830). It was very useful for placing snow mists / snow storms particles. I wanted to have different amount depending if the environment was sunny, snowy or night, and I also wanted the density to be the same among all map sizes. I could reach very fast numbers that satisfy me due to knowing that the "base" amount is the amount I expect for the tiny map size.

This function can be used in many existing maps, by placing resources with it. Currently, if I generate a random map with a large size, and look at a fixed size area, it will generally have fewer resources than if I generated with a smaller map size. In my opinion it would be nicer if density remains the same. I could modify mainland, and maybe a few other maps in this patch, I intended to do it later anyway.

Keep this more in line with the function above. This has some other ill-defined behavior.

Is it because an intermediate result can get too big?

lyv added a comment.Aug 29 2021, 8:04 AM

It also should be noted that the fractionsTo and ToFractions group of functions are derived from AoE map API, more specifically AoE3 from what I can tell, where tiles are not as prevalent as fractions. For instance, in AoE3 map scripts, the center is .5, .5 .

That approach is imo superior to what's currently in the game. In fact, if you only work with fractions, and areas, the issue of density wouldn't be an issue.

Moreover, I suspect most cases of density going down can be attributed to improper scaling to size.

That being said, I am still very much for committing this.

bb added a comment.EditedAug 29 2021, 11:09 AM

Keep this more in line with the function above. This has some other ill-defined behavior.

Is it because an intermediate result can get too big?

No, that shouldn't be an issue in the JS code. I mean: the function above takes two points in the plane (min, minMapSize) and (max, maxMapSize) draws the line through those points and interpolates. You here seem to want to have a quadratic interpolation, so one needs to plot a parabola. But for this one needs at least three points. You only pass one (base, minMapSize) and some reduction value which meaning isn't obvious from the caller (I get the physical interpretation, but I am not sure if any map maker would understand). I think something like return min + (max - min) * Math.sign(g_MapSettings.Size - minMapSize) * Math.Square((g_MapSettings.Size - minMapSize) / (maxMapSize - minMapSize)); serves our needs in a more consistent and extendible fashion. This will give the parabola through the two points with an extremum on (min, minMapSize).
Let me know if this would work in the usecases you have in mind. If you wish to set the value on tiny and just say 2x mapSize => 2x value you can set min=minMapSize=0, max=tinyValue and maxMapSize = tinyMapsSize. The reduction you propose can be done with this too, setting minMapSize to the reduction (up to some sqrt maybe)

Feldfeld updated this revision to Diff 18522.EditedAug 30 2021, 1:21 PM

Here I used the function scaleByMapArea in mainland and I will explain my changes and my non-changes.

  • The terrain textures currently scale by map size, however not only their quantity, but also their size scale with map size, so by the same argument used with forests earlier in this patch discussion, even if it is possible to reach a good and natural result using scaling with map area, it is not immediately obvious how to reach it, so I didn't modify this
  • The placement of hunt and berry patches only scale with the number of players. As a consequence it looks unnatural, if I generate a 1v1 in giant size the map will be almost empty of hunt and berry patch, and the probability that one of these resources spawn next to a player is very low. Like I justified in this patch, resource placement would be an improvement using scaling with map area, however since it will be even better with my other player resource balancing patch I decided not to change it yet.
  • The placement of decorative actors scales with map size, and looking at the values it looks like the intent was to preserve the density with map sizes. However it will always be imperfect using linear interpolation as explained in the patch summary. See how straightforward the conversion to using map area was, and how I didn't need to tune a 'max 'argument.
In D4212#180143, @bb wrote:

Keep this more in line with the function above. This has some other ill-defined behavior.

Is it because an intermediate result can get too big?

No, that shouldn't be an issue in the JS code. I mean: the function above takes two points in the plane (min, minMapSize) and (max, maxMapSize) draws the line through those points and interpolates. You here seem to want to have a quadratic interpolation, so one needs to plot a parabola. But for this one needs at least three points. You only pass one (base, minMapSize) and some reduction value which meaning isn't obvious from the caller (I get the physical interpretation, but I am not sure if any map maker would understand). I think something like return min + (max - min) * Math.sign(g_MapSettings.Size - minMapSize) * Math.Square((g_MapSettings.Size - minMapSize) / (maxMapSize - minMapSize)); serves our needs in a more consistent and extendible fashion. This will give the parabola through the two points with an extremum on (min, minMapSize).

The purpose I have in mind isn't to have a generic quadratic function with map size, I don't see how a mapmaker could make use of it (at the very least I think it would be very rare to use it for anything other than this patch's use case). The purpose really is to scale with map area, so because of that there isn't a need of a term of map size, so I would need 2 points to interpolate (but the purpose isn't really to interpolate).

Let me know if this would work in the usecases you have in mind. If you wish to set the value on tiny and just say 2x mapSize => 2x value you can set min=minMapSize=0, max=tinyValue and maxMapSize = tinyMapsSize. The reduction you propose can be done with this too, setting minMapSize to the reduction (up to some sqrt maybe)

Could the reduction in this way be calculated by simply summing the areas where I don't want an object to be placed? Even if this is the case, setting the arguments this way looks quite unintuitive. Also for the function above, scaleByMapSize, I searched its use and the map size arguments are never set. I mean of course it's simpler there, anything can be done using the min and max argument, but I believe the minMapSize and maxMapSize arguments are there to actually reflect what they are and make it intuitive to the map maker to tune the values.

If more examples are needed I could modify hunt / berry distribution in mainland.
Also I added the scaleByMapSizeAndPlayers function which shows one use case of the "reduction" argument, however once again it will only really get useful with the player resource balance patch (because for many resources I will want to avoid a bigger area around the player). Tell me if I should keep this function in this patch or not.

bb added a comment.Sep 3 2021, 3:25 PM

I get your point. My last proposal might be very consistent, but not really useful for any map maker indeed. What I don't like about the current proposal is that we get two similarly named functions (scaleByMapSize and scaleByMapArea) with totally different properties. Meaning different default values and argument options (ofcourse the function should scale differently but that is what the name says). So what about the following code:

/**
 * Interpolate quadratic between (min, minMapArea) and (max, maxMapArea) with respect to the mapSize. Default values set on 128^2 and 512^2 corresponding to the map sizes.
 */
function scaleByMapArea(min, max, minMapArea = 16384, maxMapArea = 262144)
{
	return min + (max - min) * ((g_MapSettings.CircularMap ? diskArea(g_MapSettings.Size / 2) : g_MapSettings.Size * g_MapSettings.Size - minMapArea)) * (maxMapArea - minMapArea);
}
/**
 * Interpolate quadraticly between (0,0) and (base, baseArea) with respect to the map size.
 * @param base - Value we should attain at baseArea.
 * @param disallowedArea - Area deducted from the map area.
 * @param baseArea - Area at which the base value should be attained. Defaults to 128^2, the map area of tiny square maps.
 */
function scaleByMapAreaAbsolute(base, disallowedArea, baseArea = 16384)
{
	return scaleByMapArea(0, base, disallowedArea, baseArea);
}

This way the naming of the scaleSize vs scaleArea stays consistent and the Absolute function does precisely what your proposed function does (yes I renamed some variables, to something I think is a bit more descriptive, but that doesn't change anything for the caller). Does this cover the needs you have in mind for the map maker?

binaries/data/mods/public/maps/random/rmgen/library.js
90 ↗(On Diff #18522)

This name suggests doing something else than expected: from the name I would expect that the value would scale with the number of players (i.e. double the players, double the value). This is not what happens here.

If such a function turns out useful in some maps it will need another name, but it should be in a separate revision anyhow.

Feldfeld updated this revision to Diff 18554.Sep 3 2021, 7:26 PM
Feldfeld set the repository for this revision to rP 0 A.D. Public Repository.

Yes indeed this is what I had in mind.

I added the code and made a few changes to make it work.

There is a little problem however, due to the fact that map areas are directly passed into the parameters, if the map maker doesn't change this parameter then the "base" parameter will reflect the value for the minMapSize for either square or circular maps, but not both. Currently it is tuned for square maps. I would prefer if the default was for circular maps as they are much more common. Or the way this parameter work could be changed

Feldfeld marked an inline comment as done.Sep 3 2021, 7:27 PM
Vulcan added a comment.Sep 3 2021, 7:33 PM

Successful build - Chance fights ever on the side of the prudent.

builderr-debug-macos.txt
ld: warning: text-based stub file /System/Library/Frameworks//CoreAudio.framework/CoreAudio.tbd and library file /System/Library/Frameworks//CoreAudio.framework/CoreAudio are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//AudioToolbox.framework/AudioToolbox.tbd and library file /System/Library/Frameworks//AudioToolbox.framework/AudioToolbox are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//ForceFeedback.framework/ForceFeedback.tbd and library file /System/Library/Frameworks//ForceFeedback.framework/ForceFeedback are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//CoreVideo.framework/CoreVideo.tbd and library file /System/Library/Frameworks//CoreVideo.framework/CoreVideo are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//Cocoa.framework/Cocoa.tbd and library file /System/Library/Frameworks//Cocoa.framework/Cocoa are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//IOKit.framework/IOKit.tbd and library file /System/Library/Frameworks//IOKit.framework/IOKit are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//QuartzCore.framework/QuartzCore.tbd and library file /System/Library/Frameworks//QuartzCore.framework/QuartzCore are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//Metal.framework/Metal.tbd and library file /System/Library/Frameworks//Metal.framework/Metal are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//OpenGL.framework/OpenGL.tbd and library file /System/Library/Frameworks//OpenGL.framework/OpenGL are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//Security.framework/Security.tbd and library file /System/Library/Frameworks//Security.framework/Security are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//OpenAL.framework/OpenAL.tbd and library file /System/Library/Frameworks//OpenAL.framework/OpenAL are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//AppKit.framework/Versions/C/AppKit.tbd and library file /System/Library/Frameworks//AppKit.framework/Versions/C/AppKit are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//CoreData.framework/Versions/A/CoreData.tbd and library file /System/Library/Frameworks//CoreData.framework/Versions/A/CoreData are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//ApplicationServices.framework/Versions/A/ApplicationServices.tbd and library file /System/Library/Frameworks//ApplicationServices.framework/Versions/A/ApplicationServices are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/CommonPanels.framework/Versions/A/CommonPanels.tbd and library file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/CommonPanels.framework/Versions/A/CommonPanels are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox.tbd and library file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Help.framework/Versions/A/Help.tbd and library file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Help.framework/Versions/A/Help are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/ImageCapture.framework/Versions/A/ImageCapture.tbd and library file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/ImageCapture.framework/Versions/A/ImageCapture are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Ink.framework/Versions/A/Ink.tbd and library file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Ink.framework/Versions/A/Ink are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/OpenScripting.framework/Versions/A/OpenScripting.tbd and library file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/OpenScripting.framework/Versions/A/OpenScripting are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Print.framework/Versions/A/Print.tbd and library file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Print.framework/Versions/A/Print are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SecurityHI.framework/Versions/A/SecurityHI.tbd and library file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SecurityHI.framework/Versions/A/SecurityHI are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SpeechRecognition.framework/Versions/A/SpeechRecognition.tbd and library file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SpeechRecognition.framework/Versions/A/SpeechRecognition are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//CoreImage.framework/Versions/A/CoreImage.tbd and library file /System/Library/Frameworks//CoreImage.framework/Versions/A/CoreImage are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLU.tbd and library file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLU.dylib are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.tbd and library file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/PrivateFrameworks/UIFoundation.framework/Versions/A/UIFoundation.tbd and library file /System/Library/PrivateFrameworks/UIFoundation.framework/Versions/A/UIFoundation are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//Foundation.framework/Versions/C/Foundation.tbd and library file /System/Library/Frameworks//Foundation.framework/Versions/C/Foundation are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//CoreGraphics.framework/Versions/A/CoreGraphics.tbd and library file /System/Library/Frameworks//CoreGraphics.framework/Versions/A/CoreGraphics are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//CoreText.framework/Versions/A/CoreText.tbd and library file /System/Library/Frameworks//CoreText.framework/Versions/A/CoreText are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//ImageIO.framework/Versions/A/ImageIO.tbd and library file /System/Library/Frameworks//ImageIO.framework/Versions/A/ImageIO are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//ColorSync.framework/Versions/A/ColorSync.tbd and library file /System/Library/Frameworks//ColorSync.framework/Versions/A/ColorSync are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/ATS.tbd and library file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/ATS are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ColorSyncLegacy.framework/Versions/A/ColorSyncLegacy.tbd and library file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ColorSyncLegacy.framework/Versions/A/ColorSyncLegacy are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//CoreServices.framework/Versions/A/CoreServices.tbd and library file /System/Library/Frameworks//CoreServices.framework/Versions/A/CoreServices are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/HIServices.tbd and library file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/HIServices are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/LangAnalysis.framework/Versions/A/LangAnalysis.tbd and library file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/LangAnalysis.framework/Versions/A/LangAnalysis are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/PrintCore.tbd and library file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/PrintCore are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/QD.framework/Versions/A/QD.tbd and library file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/QD.framework/Versions/A/QD are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/SpeechSynthesis.framework/Versions/A/SpeechSynthesis.tbd and library file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/SpeechSynthesis.framework/Versions/A/SpeechSynthesis are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//CoreFoundation.framework/Versions/A/CoreFoundation.tbd and library file /System/Library/Frameworks//CoreFoundation.framework/Versions/A/CoreFoundation are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//CFNetwork.framework/Versions/A/CFNetwork.tbd and library file /System/Library/Frameworks//CFNetwork.framework/Versions/A/CFNetwork are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/FSEvents.framework/Versions/A/FSEvents.tbd and library file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/FSEvents.framework/Versions/A/FSEvents are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore.tbd and library file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Metadata.tbd and library file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Metadata are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices.tbd and library file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchKit.framework/Versions/A/SearchKit.tbd and library file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchKit.framework/Versions/A/SearchKit are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE.tbd and library file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices.tbd and library file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/DictionaryServices.framework/Versions/A/DictionaryServices.tbd and library file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/DictionaryServices.framework/Versions/A/DictionaryServices are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SharedFileList.framework/Versions/A/SharedFileList.tbd and library file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SharedFileList.framework/Versions/A/SharedFileList are out of sync. Falling back to library file for linking.
ld: warning: object file (../../../libraries/osx/fmt/lib/libfmt.a(format.cc.o)) was built for newer OSX version (10.13) than being linked (10.12)
ld: warning: text-based stub file /System/Library/Frameworks//CoreFoundation.framework/CoreFoundation.tbd and library file /System/Library/Frameworks//CoreFoundation.framework/CoreFoundation are out of sync. Falling back to library file for linking.
builderr-release-macos.txt
ld: warning: text-based stub file /System/Library/Frameworks//CoreAudio.framework/CoreAudio.tbd and library file /System/Library/Frameworks//CoreAudio.framework/CoreAudio are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//AudioToolbox.framework/AudioToolbox.tbd and library file /System/Library/Frameworks//AudioToolbox.framework/AudioToolbox are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//ForceFeedback.framework/ForceFeedback.tbd and library file /System/Library/Frameworks//ForceFeedback.framework/ForceFeedback are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//CoreVideo.framework/CoreVideo.tbd and library file /System/Library/Frameworks//CoreVideo.framework/CoreVideo are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//Cocoa.framework/Cocoa.tbd and library file /System/Library/Frameworks//Cocoa.framework/Cocoa are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//IOKit.framework/IOKit.tbd and library file /System/Library/Frameworks//IOKit.framework/IOKit are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//QuartzCore.framework/QuartzCore.tbd and library file /System/Library/Frameworks//QuartzCore.framework/QuartzCore are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//Metal.framework/Metal.tbd and library file /System/Library/Frameworks//Metal.framework/Metal are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//OpenGL.framework/OpenGL.tbd and library file /System/Library/Frameworks//OpenGL.framework/OpenGL are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//Security.framework/Security.tbd and library file /System/Library/Frameworks//Security.framework/Security are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//OpenAL.framework/OpenAL.tbd and library file /System/Library/Frameworks//OpenAL.framework/OpenAL are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLU.tbd and library file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLU.dylib are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.tbd and library file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//AppKit.framework/Versions/C/AppKit.tbd and library file /System/Library/Frameworks//AppKit.framework/Versions/C/AppKit are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//CoreData.framework/Versions/A/CoreData.tbd and library file /System/Library/Frameworks//CoreData.framework/Versions/A/CoreData are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//ApplicationServices.framework/Versions/A/ApplicationServices.tbd and library file /System/Library/Frameworks//ApplicationServices.framework/Versions/A/ApplicationServices are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/CommonPanels.framework/Versions/A/CommonPanels.tbd and library file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/CommonPanels.framework/Versions/A/CommonPanels are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox.tbd and library file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Help.framework/Versions/A/Help.tbd and library file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Help.framework/Versions/A/Help are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/ImageCapture.framework/Versions/A/ImageCapture.tbd and library file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/ImageCapture.framework/Versions/A/ImageCapture are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Ink.framework/Versions/A/Ink.tbd and library file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Ink.framework/Versions/A/Ink are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/OpenScripting.framework/Versions/A/OpenScripting.tbd and library file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/OpenScripting.framework/Versions/A/OpenScripting are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Print.framework/Versions/A/Print.tbd and library file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Print.framework/Versions/A/Print are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SecurityHI.framework/Versions/A/SecurityHI.tbd and library file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SecurityHI.framework/Versions/A/SecurityHI are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SpeechRecognition.framework/Versions/A/SpeechRecognition.tbd and library file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SpeechRecognition.framework/Versions/A/SpeechRecognition are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//CoreImage.framework/Versions/A/CoreImage.tbd and library file /System/Library/Frameworks//CoreImage.framework/Versions/A/CoreImage are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/PrivateFrameworks/UIFoundation.framework/Versions/A/UIFoundation.tbd and library file /System/Library/PrivateFrameworks/UIFoundation.framework/Versions/A/UIFoundation are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//Foundation.framework/Versions/C/Foundation.tbd and library file /System/Library/Frameworks//Foundation.framework/Versions/C/Foundation are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//CoreGraphics.framework/Versions/A/CoreGraphics.tbd and library file /System/Library/Frameworks//CoreGraphics.framework/Versions/A/CoreGraphics are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//CoreText.framework/Versions/A/CoreText.tbd and library file /System/Library/Frameworks//CoreText.framework/Versions/A/CoreText are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//ImageIO.framework/Versions/A/ImageIO.tbd and library file /System/Library/Frameworks//ImageIO.framework/Versions/A/ImageIO are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//ColorSync.framework/Versions/A/ColorSync.tbd and library file /System/Library/Frameworks//ColorSync.framework/Versions/A/ColorSync are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/ATS.tbd and library file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/ATS are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ColorSyncLegacy.framework/Versions/A/ColorSyncLegacy.tbd and library file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ColorSyncLegacy.framework/Versions/A/ColorSyncLegacy are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//CoreServices.framework/Versions/A/CoreServices.tbd and library file /System/Library/Frameworks//CoreServices.framework/Versions/A/CoreServices are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/HIServices.tbd and library file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/HIServices are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/LangAnalysis.framework/Versions/A/LangAnalysis.tbd and library file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/LangAnalysis.framework/Versions/A/LangAnalysis are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/PrintCore.tbd and library file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/PrintCore are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/QD.framework/Versions/A/QD.tbd and library file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/QD.framework/Versions/A/QD are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/SpeechSynthesis.framework/Versions/A/SpeechSynthesis.tbd and library file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/SpeechSynthesis.framework/Versions/A/SpeechSynthesis are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//CoreFoundation.framework/Versions/A/CoreFoundation.tbd and library file /System/Library/Frameworks//CoreFoundation.framework/Versions/A/CoreFoundation are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//CFNetwork.framework/Versions/A/CFNetwork.tbd and library file /System/Library/Frameworks//CFNetwork.framework/Versions/A/CFNetwork are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/FSEvents.framework/Versions/A/FSEvents.tbd and library file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/FSEvents.framework/Versions/A/FSEvents are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore.tbd and library file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Metadata.tbd and library file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Metadata are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices.tbd and library file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchKit.framework/Versions/A/SearchKit.tbd and library file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchKit.framework/Versions/A/SearchKit are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE.tbd and library file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices.tbd and library file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/DictionaryServices.framework/Versions/A/DictionaryServices.tbd and library file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/DictionaryServices.framework/Versions/A/DictionaryServices are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SharedFileList.framework/Versions/A/SharedFileList.tbd and library file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SharedFileList.framework/Versions/A/SharedFileList are out of sync. Falling back to library file for linking.
ld: warning: object file (../../../libraries/osx/fmt/lib/libfmt.a(format.cc.o)) was built for newer OSX version (10.13) than being linked (10.12)
ld: warning: text-based stub file /System/Library/Frameworks//CoreFoundation.framework/CoreFoundation.tbd and library file /System/Library/Frameworks//CoreFoundation.framework/CoreFoundation are out of sync. Falling back to library file for linking.

Link to build: https://jenkins.wildfiregames.com/job/macos-differential/4891/display/redirect

Vulcan added a comment.Sep 3 2021, 7:35 PM

Successful build - Chance fights ever on the side of the prudent.

Debug: 
Microsoft (R) Build Engine version 15.9.21+g9802d43bc3 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

Release: 
Microsoft (R) Build Engine version 15.9.21+g9802d43bc3 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/5987/display/redirect

bb added a comment.Sep 3 2021, 9:53 PM

There is a little problem however, due to the fact that map areas are directly passed into the parameters, if the map maker doesn't change this parameter then the "base" parameter will reflect the value for the minMapSize for either square or circular maps, but not both. Currently it is tuned for square maps. I would prefer if the default was for circular maps as they are much more common. Or the way this parameter work could be changed

Fair point, changing the default arguments will help you

/**
 * Interpolate quadratic between (min, minMapArea) and (max, maxMapArea) with respect to the mapSize.
 * Default values corresponding to the tiny and giant map sizes.
 */
function scaleByMapArea(
	min,
	max,
	minMapArea = g_MapSettings.CircularMap ? diskArea(64) : 16384,
	maxMapArea = g_MapSettings.CircularMap ? diskArea(256) : 262144)
{
...
}

and the same for the other function will do the job for you. Make sure you keep the comment in line too.

binaries/data/mods/public/maps/random/rmgen/library.js
103 ↗(On Diff #18554)

Indeed the 4th argument is correct like this. Good spot.

Feldfeld updated this revision to Diff 18557.Sep 3 2021, 10:52 PM

Updated, now the function works as I intended.

bb accepted this revision.Sep 4 2021, 11:45 AM

While committing using the new function for decorations (where applicable) for all maps. Also g_MapSettings.CircularMap ? diskArea(size /2) : size *size will get an own function in RandomMap (it is used several times here, nowhere else is such an instance found).

Maps still load with minimum change to the decorations.

Owners added a subscriber: Restricted Owners Package.Sep 4 2021, 11:48 AM