User:Rowett: Difference between revisions

From LifeWiki
Jump to navigation Jump to search
mNo edit summary
 
(27 intermediate revisions by the same user not shown)
Line 7: Line 7:
A list of recent enhancements and fixes can be found in the [https://lazyslug.com/lifeview/plugin/version.txt Release Notes].
A list of recent enhancements and fixes can be found in the [https://lazyslug.com/lifeview/plugin/version.txt Release Notes].


== URLE ==
== Golly ==


URLE is an experimental text-based compression format for pattern files with 2 to 256 states.
Contributions to [[Golly]]:


=== Goals ===
=== Golly 5.0 ===
* GUI
** Reduced the number of GDI objects used on Windows.


# It should be text-based so easy to share, post to forums, Discord etc.
=== Golly 4.3 ===
# It should be easy to implement
* Rules
# It should be fast to decode
** added [Rule]Investigator to the Super algo which generalizes the [[Rule:StateInvestigator|StateInvestigator]] rule.
# It should provide on average twice the compression of [[RLE]]
** fixed HROT Custom neighbourhood orientation.
** various changes to the RLE parsing code to improve compatibility and headerless RLE paste.
** the [[Larger than Life]] algorithm now supports Aligned Checkerboard neighborhood (ND).
* Scripts
** new script '''safeopenclip.lua''' will attempt to open the clipboard as a pattern. If the pattern contains a legacy rule it will first be converted into a supported rule. If the pattern contains an unsupported rule it will be opened in a benign 256 state rule so it can be manually manipulated and an HTML page with a download link to the [https://www.conwaylife.com/w/index.php?title=Special:AllPages&namespace=3794&from=|LifeWiki rule repository] will appear.
* GUI
** fixed a bug that could cause a crash on Windows in the NVIDIA driver if Golly was opened with a rule with a bounded grid and without the grid displayed.
** fixed an assertion in progress bar update when downloading a file from a web server using gzip compression.


The table below shows ratings against these goals:
=== Golly 4.2 ===
<table border=1 cellspacing=0 width=500>
* Rules
<tr><th colspan="3">Attainment</th></tr>
** Improved performance for [[Larger than Life]] Triangular and Checkerboard neighbourhoods.
<tr><td bgcolor=#c0c0c0>Goal</td><td bgcolor=#c0c0c0>Rating</td><td bgcolor=#c0c0c0>Notes</td></tr>
<tr><td>Text-based</td><td bgcolor=#00f000>High</td><td>Not web safe</td></tr>
<tr><td>Easy to implement</td><td bgcolor=#f0f000>Medium</td><td>JS implementation is 1000 lines of code</td></tr>
<tr><td>Fast to decode</td><td bgcolor=#00f000>High</td><td>2-state decode 5x faster than RLE</td></tr>
<tr><td>2x the compression of RLE</td><td bgcolor=#00f000>High</td><td>&gt; 4x for some patterns</td></tr>
</table>
 
=== Advantages ===
 
URLE format in almost all cases creates a smaller representation of a pattern than RLE format.
 
It's especially good at compressing 2-state patterns where typically it creates a file '''1/3 of the size''' of the RLE format.
 
For patterns with more states (up to 256) it typically creates a file '''1/2 the size''' of the RLE format.
 
For very small patterns it compresses similarly to [[apgcode]] in size.
 
Smaller pattern files mean:
* Less storage required
* Faster to transfer
* Faster to decode
* Larger patterns can be posted on the forum, Discord, etc.
 
=== Disadvantages ===
 
The RLE format is widely adopted, vaguely human-readable, and simple to implement.
 
The URLE format is not.
 
=== Example Savings ===
 
Here are some examples of patterns showing a comparison between RLE and URLE file size:
 
<table border=1 cellspacing=0 width=500>
<tr><td bgcolor=#c0c0c0>Pattern</td><td bgcolor=#c0c0c0>Width</td><td bgcolor=#c0c0c0>Height</td><td bgcolor=#c0c0c0>States</td><td bgcolor=#c0c0c0>RLE size</td><td bgcolor=#c0c0c0>URLE size</td><td bgcolor=#c0c0c0>% of RLE</td><td bgcolor=#c0c0c0>Saving</td></tr>
<tr><td>[https://www.conwaylife.com/forums/viewtopic.php?f=2&t=4911#p113168 Exploratorium]</td><td>2297</td><td>1689</td><td>27</td><td>228909</td><td>110725</td><td>48%</td><td>118184</td></tr>
<tr><td>[https://www.conwaylife.com/forums/viewtopic.php?f=2&t=5286&start=25#p131341 Oscillator Stamp Collection]</td><td>3047</td><td>649</td><td>2</td><td>242359</td><td>82833</td><td>34%</td><td>143K</td></tr>
<tr><td>[https://www.conwaylife.com/forums/viewtopic.php?f=11&t=3120&start=600#p123885 Chaotic Checkerboard]</td><td>124</td><td>126</td><td>2</td><td>15808</td><td>230</td><td>1%</td><td>15175</td></tr>
</table>
 
The following table shows a comparison between RLE and URLE file size for a 1024x1024 50% random fill pattern with the minimum and maximum number of states. A 50% random fill is typically a worst case since it doesn't allow long runs. The states were also randomized.
 
<table border=1 cellspacing=0 width=500>
<tr><td bgcolor=#c0c0c0>States</td><td bgcolor=#c0c0c0>RLE size</td><td bgcolor=#c0c0c0>URLE size</td><td bgcolor=#c0c0c0>% of RLE</td><td bgcolor=#c0c0c0>Saving</td></tr>
<tr><td>2</td><td>793394</td><td>174737</td><td>22%</td><td>577K</td></tr>
<tr><td>256</td><td>1401887</td><td>1237138</td><td>88%</td><td>162K</td></tr>
</table>
 
It's also very good at compressing patterns with repeated consecutive single or double rows.
 
A 1024x1024 pattern filled completely with state 1 cells compresses as follows:
 
<table border=1 cellspacing=0 width=500>
<tr><td bgcolor=#c0c0c0>States</td><td bgcolor=#c0c0c0>RLE size</td><td bgcolor=#c0c0c0>URLE size</td><td bgcolor=#c0c0c0>% of RLE</td><td bgcolor=#c0c0c0>Saving</td></tr>
<tr><td>2</td><td>6229</td><td>11</td><td>0.18%</td><td>6218</td></tr>
</table>
 
A 1024x1024 checkerboard pattern of state 0 and 1 cells compresses as follows:
 
<table border=1 cellspacing=0 width=500>
<tr><td bgcolor=#c0c0c0>States</td><td bgcolor=#c0c0c0>RLE size</td><td bgcolor=#c0c0c0>URLE size</td><td bgcolor=#c0c0c0>% of RLE</td><td bgcolor=#c0c0c0>Saving</td></tr>
<tr><td>2</td><td>1039K</td><td>414</td><td>0.04%</td><td>1039K</td></tr>
</table>
 
=== Format Specification (draft) ===
 
This section defines the format specification for URLE.
 
Note the specification is currently in Draft status and subject to change.
 
==== Count ====
 
In run-length encoding each symbol can be prefixed by an optional count defining the number of repetitions for the symbol. A count of 1 is omitted. The count is encoded as decimal digits (ASCII character <b>48 "0"</b> to <b>57 "9"</b>).
 
==== 2-State Cell Encoding ====
 
For 2-state patterns URLE will encode 6 cells into a single character. If the row width is not a multiple of 6 then extra cells are guaranteed to be state 0.
 
ASCII characters <b>63 "?"</b> to <b>126 "~"</b> are used to encode each 6 cell group with state values 000000 to 111111.
 
==== Multi-State Cell Encoding ====
 
For multi-state patterns the state numbers are encoded in base 32. If the state is >= 32 then the 32s digit is encoded from ASCII <b>63 "?"</b> to <b>70 "E"</b> representing 1x32 to 7x32.
 
The units digit is encoded as the relevent ASCII character from <b>95 "_"</b> for 0 through <b>126 "~"</b> for 31.
 
==== End of Row ====
 
The end of each row is marked with ASCII <b>58 ":"</b>.
 
==== Dead Cell Groups ====
 
URLE encodes specific runs of dead cell groups into single characters.
Longer runs will be multiples of these groups and reduce the [[#Count]] accordingly.
<table border=1 cellspacing=0 width=500>
<tr><th colspan="2">Dead Cell Group Encoding</th></tr>
<tr><td bgcolor=#c0c0c0>Item</td><td bgcolor=#c0c0c0>URLE</td></tr>
<tr><td>2 dead cell groups</td><td><pre>"</pre></td></tr>
<tr><td>2 dead cell groups + final dead cell group</td><td><pre>#</pre></td></tr>
<tr><td>4 dead cell groups</td><td><pre>$</pre></td></tr>
<tr><td>4 dead cell groups + final dead cell group</td><td><pre>%</pre></td></tr>
<tr><td>6 dead cell groups</td><td><pre>&amp;</pre></td></tr>
<tr><td>6 dead cell groups + final dead cell group</td><td><pre>'</pre></td></tr>
<tr><td>8 dead cell groups</td><td><pre>(</pre></td></tr>
<tr><td>8 dead cell groups + final dead cell group</td><td><pre>)</pre></td></tr>
<tr><td>10 dead cell groups</td><td><pre>*</pre></td></tr>
<tr><td>10 dead cell groups + final dead cell group</td><td><pre>+</pre></td></tr>
<tr><td>12 dead cell groups</td><td><pre>,</pre></td></tr>
<tr><td>12 dead cell groups + final dead cell group</td><td><pre>-</pre></td></tr>
<tr><td>14 dead cell groups</td><td><pre>.</pre></td></tr>
<tr><td>14 dead cell groups + final dead cell group</td><td><pre>/</pre></td></tr>
</table>
 
==== Repeated Rows ====
 
URLE efficiently encodes repeated single or double rows as well as copies of rows seen earlier in the pattern.
<table border=1 cellspacing=0 width=500>
<tr><th colspan="2">Repeated Row Encoding</th></tr>
<tr><td bgcolor=#c0c0c0>Item</td><td bgcolor=#c0c0c0>URLE</td></tr>
<tr><td>Blank row</td><td><pre>:</pre></td></tr>
<tr><td>Repeated row</td><td><pre>;</pre></td></tr>
<tr><td>Repeated row pair</td><td><pre>&lt;</pre></td></tr>
<tr><td>Copy of earlier row (count indicates row number)</td><td><pre>=</pre></td></tr>
</table>
 
==== End of Pattern ====
 
URLE uses a single character to mark the end of the pattern. This character is optional and is primarily used so comments can be added after the pattern definition.
<table border=1 cellspacing=0 width=500>
<tr><td bgcolor=#c0c0c0>Item</td><td bgcolor=#c0c0c0>URLE</td></tr>
<tr><td>End of Pattern</td><td><pre>&gt;</pre></td></tr>
</table>
Note that the URLE format does not use ASCII character <b>33 "!"</b> which is the RLE end of pattern character. This is to make it easy for decoders to differentiate between the formats.
 
==== Multi-state Alternate Encodings ====
 
For some multi-state patterns better compression can be obtained by compressing state by state rather than with all states at once.
 
The encoder will try both methods and pick the smallest encoding.
 
===== All States =====
 
Multi-state patterns encoded with all states at once are prefixed with two ASCII <b>48 "0"</b> characters followed by [[#Multi-State Cell Encoding]] and finally [[#End of Pattern]].
 
===== State by State =====
 
Patterns encoded state by state have a separate section for each used state in the pattern. Each of these sections starts with ASCII <b>48 "0"</b>, the state number, and then [[#2-State Cell Encoding]].
 
After all used states are encoded in these sections the [[#End of Pattern]] is added.
 
State numbers are encoded in base 32. If the state is >= 32 then the 32s digit is encoded from ASCII <b>63 "?"</b> to <b>70 "E"</b> representing 1x32 to 7x32.
 
The units digit is encoded as the relevent ASCII character from <b>95 "_"</b> for 0 through <b>126 "~"</b> for 31.
 
==== Whitespace ====
 
The encoder does not add whitespace (spaces, tabs or newlines) to the encoding apart from a final newline after [[#End of Pattern]].
 
The decoder will ignore any whitespace so can happily decode any formatted encoded strings (for example if they have been formatted to 70 characters per line).
 
=== Software Support ===
 
There is a prototype implementation of URLE in LifeViewer. Press Ctrl-E to display metrics on compressing the current pattern in RLE and URLE.
 
== Golly ==
 
Contributions to [[Golly]]:


=== Golly 4.1 (not yet released) ===
=== Golly 4.1 ===
* GUI
* GUI
** The cell population inside and outside of a selection can now be displayed in the status bar. Use Edit Preference: "Show selection population" to enable (default is disabled). To prevent lag the population is only displayed if the calculation takes less than 5ms while selecting or less than 500ms when the selection is complete.
** The cell population inside and outside of a selection can now be displayed in the status bar. Use Edit Preference: "Show selection population" to enable (default is disabled). To prevent lag the population is only displayed if the calculation takes less than 5ms while selecting or less than 500ms when the selection is complete.
Line 196: Line 38:
* Rules
* Rules
** Fixed a bug in Larger than Life weighted neighborhoods with negative counts.
** Fixed a bug in Larger than Life weighted neighborhoods with negative counts.
* Audio
** Sounds and music for '''pop_sounds.lua''', '''pop_sounds.py''', '''breakout.lua''' and '''credits.lua'''.


=== Golly 4.0 ===
=== Golly 4.0 ===

Latest revision as of 04:19, 27 October 2025

  • Real name: Chris Rowett
  • My location: United Kingdom

LifeViewer

Author of LifeViewer, a scriptable pattern viewer and editor used here on the Wiki, the Forums, Catagolue and other places. A list of recent enhancements and fixes can be found in the Release Notes.

Golly

Contributions to Golly:

Golly 5.0

  • GUI
    • Reduced the number of GDI objects used on Windows.

Golly 4.3

  • Rules
    • added [Rule]Investigator to the Super algo which generalizes the StateInvestigator rule.
    • fixed HROT Custom neighbourhood orientation.
    • various changes to the RLE parsing code to improve compatibility and headerless RLE paste.
    • the Larger than Life algorithm now supports Aligned Checkerboard neighborhood (ND).
  • Scripts
    • new script safeopenclip.lua will attempt to open the clipboard as a pattern. If the pattern contains a legacy rule it will first be converted into a supported rule. If the pattern contains an unsupported rule it will be opened in a benign 256 state rule so it can be manually manipulated and an HTML page with a download link to the rule repository will appear.
  • GUI
    • fixed a bug that could cause a crash on Windows in the NVIDIA driver if Golly was opened with a rule with a bounded grid and without the grid displayed.
    • fixed an assertion in progress bar update when downloading a file from a web server using gzip compression.

Golly 4.2

  • Rules
    • Improved performance for Larger than Life Triangular and Checkerboard neighbourhoods.

Golly 4.1

  • GUI
    • The cell population inside and outside of a selection can now be displayed in the status bar. Use Edit Preference: "Show selection population" to enable (default is disabled). To prevent lag the population is only displayed if the calculation takes less than 5ms while selecting or less than 500ms when the selection is complete.
  • Scripts
    • The Lua setoption and Python setoption commands now recognize "showcellborders" for showing or hiding cell borders when zoomed in >2x.
  • Rules
    • Fixed a bug in Larger than Life weighted neighborhoods with negative counts.
  • Audio
    • Sounds and music for pop_sounds.lua, pop_sounds.py, breakout.lua and credits.lua.

Golly 4.0

  • Rules
    • Added the new Super algo which supports [Rule]History and [Rule]Super rules.
    • Added support to Larger than Life algo for HROT format rules, B0 emulation, and many new neighborhoods:
      • Square neighborhoods:
        • Checkerboard
        • Cross
        • Euclidean (L2)
        • Gaussian
        • Hash
        • Saltire
        • Star
      • Hexagonal neighborhoods:
        • Aterisk
        • Hexagonal
        • Tripod
      • Triangular neighborhoods:
        • Triangular
      • All neighborhoods:
        • Custom
        • Weighted (with optional state weights)
  • Scripts
    • showinviewer.lua - LifeViewer now fills the browser window and resizes with the browser.
    • update-viewer.lua - downloads the latest version of LifeViewer to use with showinviewer.lua.
    • browse-patterns.lua - can now open the current slideshow pattern in LifeViewer.
  • Script commands
    • Added getgridtype command to get the current grid type.

Golly 3.4

  • Rules
    • Improved runtime performance of RuleLoader @TABLE rules.
  • Scripts
    • showinviewer.lua - launches the current pattern in LifeViewer in your default browser.

Golly 3.3

  • 3D
    • Major speed improvement to 3D.lua via custom-purpose ovtable commands.
    • Added cell history with fading.
  • GUI
    • Fixed a bug caused by simultaneous clicks of different mouse buttons.
  • Overlay
    • The optimize command now returns the minimum non-zero alpha bounding box of the clip.
    • The blend command now has a new faster blend mode ("blend 2") which should be used when the destination is opaque.
    • Improved the performance of the drawcells command.
    • Fixed a bug in and made several enhancements to the replace command.
  • Rules
    • Fixed a bug where the canonical form of Generations rules in MAP format was incorrect.

Golly 3.2

  • Rules
    • MAP rules now support base64 padding.
  • Overlay
    • The paste command now supports multiple locations for batch draw.
    • Added a new command lines which can draw multiple unconnected lines.
    • Added a new ovtable script command which provides a high performance table API for a subset of the overlay commands:
      • fill, get, line, lines, paste, rgba and set.
    • Added radio buttons to the oplus package.
    • Menu buttons now support custom colors and shadows.
    • Added timing function to the gplus package.
  • Bounded grids
    • Fixed a bug where patterns larger than bounded grids were not correctly clipped.
  • Scripts
    • credits.lua - animated credits that can be launched from Help > Credits page.
    • 3D.lua - improved generating and rendering speed, added depth shading and canonical rule format.

Golly 3.0

  • Rules
  • GUI
    • Drawing cell borders when zoomed in >2x is now controlled by a View Preference: "Zoomed cells have borders".
    • Significantly improved pattern rendering speed when zoomed in.
    • Added support for OpenGL 1.x
  • Overlay
    • Many improvements to the Overlay including the ability to play audio files.
  • Script Commands
    • Added getinfo command to get the comments from the current pattern.
    • Added getpath command to get the pathname of the current pattern.
    • The getevent command can now detect the release of a key.
  • Scripts
    • lifeviewer.lua - a Lua version of LifeViewer which runs in Golly using the Overlay (work in progress).
    • Co-wrote overlay-demo.lua which demonstrates most of the Overlay functions.
    • breakout.lua - a working game as a more sophisticated example of the Overlay functions.
    • browse-patterns.lua - allows you to browse through patterns in a folder (and optionally any sub-folders) manually or automatically.

Golly 2.8