#4294 closed defect (fixed)
[PATCH] No retries with the SimpleGroup placer
Reported by: | elexis | Owned by: | Imarok |
---|---|---|---|
Priority: | Must Have | Milestone: | Alpha 23 |
Component: | Maps | Keywords: | |
Cc: | Patch: | Phab:D249 |
Description (last modified by )
On some maps we can notice that the random map placement algorithm just doesn't place the resources we want it to place, even when passing gazillions of retries.
This can be noticed with metal on the map latium or fish on the map corinthian isthmus.
The reason for that being the retry loop used by createObjectGroups
and createObjectGroupsByAreas
of placer.js
being broken if a SimpleGroup
or a RandomGroup
is passed, because these functions just return true
or false
while all other place
functions return an array or undefined
.
The retry loop needs the array to decide how often it has to retry.
The bug exists at least since alpha 19, most likely since the introduction of these functions.
Unfortunately this means that many resource amount numbers in random map scripts are wrong as they hid the bug by increasing the amount of res, leaving us to rebalance all maps.
Attachments (1)
Change History (12)
by , 7 years ago
Attachment: | retry_simplegroups_v1.patch added |
---|
comment:1 by , 7 years ago
follow-up: 3 comment:2 by , 7 years ago
The deprecated approach is definitely more feasible than rewriting all 65+ random maps in one go.
Would result in something like this https://code.wildfiregames.com/P34 but the fixed maps should either use a createObjectGroupsNonDeprecated function or all createObjectGroups calls would have to be renamed to createObjectGroupsDeprecated in one go
comment:3 by , 7 years ago
Replying to elexis:
Would result in something like this https://code.wildfiregames.com/P34 but the fixed maps should either use a createObjectGroupsNonDeprecated function or all createObjectGroups calls would have to be renamed to createObjectGroupsDeprecated in one go
The renaming was planned(otherwise the patch makes no sense), but I first wanted to hear a opinion about the general approach. I'll do it as soon I have time...
comment:4 by , 7 years ago
(The bug is not that important, it's just noticeable on few maps like latium, you can do other things too, review queue being annoying f.e.. I had just posted that ticket in the irc discussion as an example of a patch that shouldn't be committed without fixing it's sideeffects)
comment:5 by , 7 years ago
It's not like I saw this ticket the first time when you posted it in irc. I've thought about this some months ago and forgot about it...
comment:6 by , 7 years ago
Milestone: | Backlog → Work In Progress |
---|
Patch proposed at https://code.wildfiregames.com/D249 by Imarok
comment:7 by , 7 years ago
Description: | modified (diff) |
---|---|
Patch: | → Phab:D249 |
comment:9 by , 7 years ago
Keywords: | patch removed |
---|---|
Milestone: | Work In Progress → Alpha 23 |
We agreed on fixing the bug and add a "deprecated" function with the old behaviour to not have to change all the old maps.