Game of Life simulation can leave behind invisible tiles if "neighbors to create" options are adjusted

Found a bug in R'n'D? Report it here!

Moderators: Zomis, Flumminator

Post Reply
ncrecc
Posts: 25
Joined: Thu Jul 12, 2018 12:59 am

Game of Life simulation can leave behind invisible tiles if "neighbors to create" options are adjusted

Post by ncrecc » Mon Sep 24, 2018 8:04 pm

Here's an example level you can use to test this behavior. Set the properties of Game of Life to, say, min 3 max 4 to create, and you'll see that there are some tiles that you can't walk on. It's most noticeable if you set it to min 0 max 8 to create.

This is what it looks like at min 2 max 3 to survive, min 0 max 8 to create:
Image
There are also some weird asymmetrical patterns (like how the gaps are shaped as the GoL expands) but that seems like another issue entirely.

User avatar
Holger
Site Admin
Posts: 2953
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: Game of Life simulation can leave behind invisible tiles if "neighbors to create" options are adjusted

Post by Holger » Thu Oct 11, 2018 8:05 am

First of all, thanks for the example level and the animated GIF which demonstrate the problem very well.
It's most noticeable if you set it to min 0 max 8 to create.
Indeed, when using the "usual" Game of Life parameters of "2333", everything seems to work as expected, but with "2308" the problem becomes very obvious! :-o
There are also some weird asymmetrical patterns (like how the gaps are shaped as the GoL expands) but that seems like another issue entirely.
That's right -- after debugging the problem using your test level, I've found out that there are indeed two different problems involved: Incomplete redrawing of tiles in certain situations (that's the apparently empty tiles which are in fact Game of Life elements), and a buggy implementation of the calculation of the next Game of Life generation. :shock:

Fixing the redraw problem was quite easy and straightforward.

Fixing the calculation problem was a bit more complicated (especially as changing the game engine behaviour always potentially breaks existing tapes and levels). The main problem was that calculating the next GoL generation contained a bug when checking if an empty tile should create a new GoL element from its neighbours -- in this case, it could happen that a GoL element that just died was resurrected where it shouldn't, resulting in lots of GoL elements on the playfield that should be empty tiles if done correctly.

Another problem (not demonstrated by your test level) occurred when putting "Game of Life" elements and "Biomaze" elements next to each others. These elements should be calculated independently (so that a Biomaze element should have no effect on the creation or death of a Game of Life elements), but in fact there were some cases in which they interacted with each others where they shouldn't.

This should all be fixed now (together with the usual "[x] use old bug" setting in the level editor for the Game of Life and Biomaze elements to be able to see that existing levels (and tapes) still use and depend on the old, buggy behaviour, which might be required for these levels to be solvable).

The fix will (hopefully soon) be available with the next patch release!

Post Reply