Duplicator DRAY

  • minecraft-physics
    29th Apr 2014 Member 9 Permalink

    We have ARAY, BRAY and CRAY, why not add DRAY :P



    Seriously though, what about an element that creates an exact replica of a given line of pixels, however you want it to?
    The idea with this element is to make it easy for a newbie to use superficially, but also widely customisable and versatile.


    Like CRAY, it is solid, indestructible (except for BOMB and DEST) and non-thermally conductive, and its behaviour is controlled by tmp, ctype, the conductor that sparks it and tmp2. Like ARAY, it can function in the standard 8 directions. tmp2 sets the scanning range of the particle (the length of the beam it will copy), and tmp sets the distance from the last particle (exclusive) that the DRAY copied. If tmp2=0 and ctype=0, the length of the beam is determined by the first empty space that the scanning beam encounters, but if ctype is nonzero the copy beam will only stop once it hits a particle of that type. tmp=0 causes the copy to appear directly at the end of the line.

    In short, tmp2 tells the particle how many pixels to copy, and tmp tells the particle how many pixels away to put the copied line of pixels from the end of the copy zone. When tmp2 is zero, the particle defaults to its ctype to tell it where to stop copying (it stops copying when it finds a pixel of its ctype, without copying said pixel).

    When tmp is greater than 0, the 'beam' can cross any particle except DMND and WALL.

    Note that DRAY copies EVERYTHING– tmp, ctype, flags, even PAVG.




    Normal mode
    DRAY, sparked by a standard conductor, takes a copy of all of the particles in front of it until it reaches an empty pixel, then pastes this line on the end of the copied section. When pasting, does not overwrite existing particles, but will ignore them and paste the corresponding pixels in the empty spaces that exist between the existing particles.


    PSCN mode
    Same as above, but overwrites existing particles (that is, it'll clear the region in front of it and put whatever it copied in its place).


    INST/INWR (swap) mode This probably won't be added
    Rather than taking a copy of the particles directly opposite the side it is sparked on, this mode exchanges the two lines 45° from the adjacent line. For example:

    [ ] B [ ] [ ]
    [ ] A [ ] [ ]
    [ ] D C ?
    S [ ] [ ] [ ]

    Where S = SPRK(INST) and D = DRAY, particles A and C would swap and particles B and ? would swap. That is, you'd get

    [ ] ? [ ] [ ]
    [ ] C [ ] [ ]
    [ ] D A B
    S [ ] [ ] [ ]


    Uses

    • Self-Replicating Machine finally possible (I think)
    • Rotation devices
    • City-building saves can increase dramatically in complexity
    • Production of particles at significant distance from the creation device
    • Enable RAM to be made using CRAY-ctypes
    • Advanced electronics become advanced-er
    • PSTN ship making machines drastically reduced in size
    • Plane/Submarine/Ship saves can generate their own powerful, PSTN-moved weapons
    • Create OCD (Aray, Bray, Cray, Dray, [ ]ray, Fray....)
    • A lot more....
    Edited 9 times by minecraft-physics. Last: 5th Aug 2014
  • boxmein
    29th Apr 2014 Former Staff 0 Permalink
    That's actually a pretty nice idea. Sounds like the regular (not-rotating) modes aren't at all a bother to figure out, except for getting time/memory complexity right.

    Following the order, ERAY exists in my branch:
    https://github.com/boxmein/The-Powder-Toy/tree/eray

    Edited once by boxmein. Last: 29th Apr 2014
  • minecraft-physics
    29th Apr 2014 Member 0 Permalink
    I kind of came up with that at the last minute, because a CRAY-like 'go through everything' mode doesn't seem very useful here.
    Edited once by minecraft-physics. Last: 5th Aug 2014
  • jacob1
    29th Apr 2014 Developer 0 Permalink
    This sounds really cool, maybe even better than ERAY :P. It doesn't rely on how things are implemented and is a lot easier to set up, and can do basically the same thing. Maybe at the least I could try adding it to my mod.

    For the normal mode, are you saying it will create stacked particles? Also the swap mode sounds cool. There are also double uses for .tmp2, but it should be easy to fit the extra GOL information inside of ctype this time ... I don't completely understand .tmp and .tmp2 anyway.
  • h4zardz1
    29th Apr 2014 Member 0 Permalink
    @minecraft-physics (View Post)
    but are it will EVEN-EVEN copy PAVG‽‽‽

    if you don't know about PAVG: tpt.io/.262203
    Edited 2 times by h4zardz1. Last: 29th Apr 2014
  • greymatter
    29th Apr 2014 Member 0 Permalink
    @minecraft-physics (View Post)
    Hmmmm.....good +1.
    I would like to see this in the game.
  • NF
    29th Apr 2014 Member 0 Permalink
  • minecraft-physics
    1st May 2014 Member 0 Permalink
    @jacob1 (View Post)
    By "Does not overwrite" I mean that it preserves all of the particles that were there already, rather than replacing them with the particles it's pasting.
    Edited once by minecraft-physics. Last: 1st May 2014
  • jacob1
    1st May 2014 Developer 0 Permalink
    @minecraft-physics (View Post)
    ok, but I asked about .tmp and .tmp2 :P
  • minecraft-physics
    1st May 2014 Member 0 Permalink
    oh, lol, oops. It's kinda hard to explain, but here's some detail —
    .tmp
    This sets the 'range' of the scanning beam- the number of cells to be duplicated. For example, a .tmp of 4 will copy 4 particles, and 4 particles only. If tmp=0, the element scans until the first 'invalid' cell This invalid cell type is set by ctype, i.e. a ctype of 0 stops it at the first empty spot, or a ctype of ARAY will make it continue scanning until it reaches a pixel of ARAY.

    .tmp2
    This sets the distance from the end of the copy region that the particles are pasted at. tmp2=0 means that the particles are pasted directly on the end of the copy region, i.e. at tmp2 and tmp =0

    D = DRAY S = SPRK(METL) [ ] =empty cell
    S D Q W E [ ] [ ] [ ]
    becomes
    S D Q W E Q W E

    And at tmp2=3
    S D Q W E [ ] [ ] [ ] [ ] [ ] [ ]
    becomes
    S D Q W E [ ] [ ] [ ] Q W E