do_local_rebuild(1) producing more than 1 position?

Started by Rav3n_pl

Rav3n_pl Lv 1

Look at undo graph:

Script is doing local_rebuild(1) then shake(1)
But every rebuild makes 2-3 positions!
It is intended? I was sure, that (1) makes one or 0 positions (sometimes rebuild fails).

spvincent Lv 1

Yes do_local_rebuild is a bit quirky in how many rebuilds it does. Mildly painful to workaround: it's the case where it produces 0 new positions that's particularly awkward.

Rav3n_pl Lv 1

Bump.

Look at undo graph.
Script pseudo code:

select(x,y)
for i=1,rebuilds do
local_rebuild(1)
save()
shake(1)
save()
end

It should be yellow/blue/yellow/blue… and we have few yellow (rebuild) and one blue (shake). And we see different score in yellow line graph, so there are produced new positions one by one.
It is intended? I think that rebuild(1) should made 1 new position and stop. Looks like it can produce even 3 positions, and we can use it only in hand work, not in script.

CharlieFortsConscience Lv 1

The png you posted, with 4 or 5 rebuild positions for a rebuild(1)command, is indeed a little curious, unless they're segs with an inherent instability (when the rebuild section snakes and dances like you've got it under a magnifying glass in the sun)

But - bear in mind that a rebuild(1) should only deliver one or two entries on the undo graph anyway. If one, then it didnt find anything, and posted an undo entry when it closed, or two, in that it found one position and then closed (one entry then for each)

If your experience is that rebuild(1) only delivers one entry, then you're trying to rebuild a region that's already settled :-)

CFC

Rav3n_pl Lv 1

I meant, that it should deliver one new position or same position if rebuild fails. It should not make more than one new position. If we need or want more new positions we use more iterations.

CharlieFortsConscience Lv 1

This should be sorted out in the V2 update, now that structure.RebuildSelectedProperly() and structure.RebuildSelectedSlightly() have both been included.

I'd be happier if RebuildSelectedJustmakeitworklikeitusedto or RebuildFtw had made the cut for this update, but fingers crossed for V5!!!!

CFC

Rav3n_pl Lv 1

Nope, looks like we have same functions on different names and looots of new ones. But no different rebuilds… Vote for structure.RebuildFTW ;]