Please create an account or Login! Have fun!

Editing Data resetting

Jump to navigation Jump to search
You are not logged in. While you can edit without logging in, your IP address will be recorded publicly, along with the time and date, in this page's history. It is sometimes possible for others to identify you with this information. Creating an account will conceal your IP address and provide you with many other benefits. Messages sent to your IP can be viewed on your talk page.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
{{MSonly}}
'''Data resetting''' is a [[glitch]] in [[Microsoft's version of Chip's Challenge]] allowing data stored on a virtual 32nd row of the [[grid]] to affect gameplay. It is commonly an element of [[insane level]]s. Data resetting is not emulated by [[Tile World]], and does not exist in [[Lynx]] or in [[Chip's Challenge 2]].
'''Data resetting''' is a [[glitch]] in [[Microsoft's version of Chip's Challenge|MSCC]] allowing data stored on a virtual 32nd row of the [[grid]] to affect gameplay. It is commonly an element of [[insane level]]s. Data resetting is currently not emulated by [[Tile World]], and does not exist in [[Lynx ruleset|Lynx]] or in [[Chip's Challenge 2]].
 
The map of each level has coordinates from (0, 0) to (31, 31). However, due to MSCC not checking array bounds, various data can be thought of as stored in an invisible row just off of the map bottom, namely row 32. This row is not visible in the level and is not intended to be modified at all during the course of gameplay. Nevertheless, the data in this row can be accessed by creating a [[Clone machine|clone]] connection<ref>It can also be done with a monster buried at (x, 0) that's added to the monster list at (x, 32), however it will move and reset the data stored in that position as soon as it has the ability to move and as such is less common and harder to control.</ref> that targets a square of the form (x, 32) with the necessary conditions.


The map of each level has coordinates from [0, 0] to [31, 31]. However, various data are stored in an invisible row, namely row 32. This row is not visible in the level and is not intended to be modified at all during the course of gameplay. Nevertheless, the data in this row can be accessed by creating a clone connection that targets a square of the form [x, 32] with the necessary conditions.
==Specific data stored in row 32==
==Specific data stored in row 32==
Each pair of coordinates (x, 32) and (x+1, 32) (where x is an even number less than 32) corresponds to a short of information<ref>Excepting 30 and 31.</ref>. A short can store any number from -32,768 to 32,767, however as each tile represents a single byte the short is split across 2 tiles (x and x+1), with (x, 32) storing the low-order byte and (x+1, 32) storing the high-order byte.
Each coordinate [x, 32] corresponds to a byte of information. A byte can store any number from 0 to 255 and is adequate for a piece of information such as the x-coordinate of Chip.


However, most data pieces only require a single byte of storage, which means that (x+1, 32) will usually be empty, as such those tiles will be skipped over in the next section.
However, some data, such as the time limit of a level, require two bytes of information, as two bytes can store any number from 0 to 65535. These bigger pieces of data will take up two consecutive squares, [x, 32] and [x + 1, 32] where x is an even number. In this case, [x, 32] stores the low-order byte of the data, and [x + 1, 32] stores the high-order byte of the data. Resetting [x, 32] will only reset the low-order byte, and resetting [x + 1, 32] will only reset the high-order byte.


The specific pieces of information stored in each square in row 32 are as follows:
The specific pieces of information stored in each square in row 32 are as follows:
* '''(0, 32)''' and '''(1, 32)''' store the level number.
* '''[0, 32]''' and '''[1, 32]''' store the level number.
* '''(2, 32)''' and '''(3, 32)''' store the number of levels in the set.
* '''[2, 32]''' and '''[3, 32]''' store the number of levels in the set.
* '''(4, 32)''' and '''(5, 32)''' store the time limit of the level.
* '''[4, 32]''' and '''[5, 32]''' store the time limit of the level.
* '''(6, 32)''' and '''(7, 32)''' store the number of chips required in the level.
* '''[6, 32]''' and '''[7, 32]''' store the number of chips required in the level.
 
Note that the above data, with the exception of the level number, are initial values; resetting them does not change the actual value during gameplay. The exception is level number; in this case, resetting it will cause the "Next Level" command to go to level 1.
Note that the above data, with the exception of the level number, are initial values; resetting them does not change the actual value during gameplay. The exception is level number; in this case, resetting it will cause the "Next Level" command to go to level 1.
* '''(8, 32)''' and '''(10, 32)''' store the x- and y-coordinates of [[Chip]].
* '''[8, 32]''' and '''[10, 32]''' store the&nbsp;x- and y-coordinates of [[Chip]].
* '''(12, 32)''' stores Chip's sliding state: 1 if he is on any [[sliding tile]] and 0 if he is not.
* '''[12, 32]''' stores Chip's sliding state: 1 if he is on any [[sliding tile]] and 0 if he is not.
* '''(14, 32)''' stores the current keystroke's buffer state: 1 if a keystroke is in buffer (more than one keystroke has been attempted within one turn) and 0 if it is not.
* '''[14, 32]''' stores the current keystroke's buffer state: 1 if a keystroke is in buffer (more than one keystroke has been attempted within one turn) and 0 if it is not.
* '''(18, 32)''' and '''(20, 32)''' store the x- and y-directions of the keystroke. Note that one of these must always be zero.<ref name="direction">The directions can be either +1 or -1, in the negative case (moving left or up) both pieces of the short will be used, however resetting the low-order tile (18, 20, 24, or 26) is enough to halt Chip in place when moving/sliding on the respective axis.</ref>
* '''[18, 32]''' and '''[20, 32]''' store the x- and y-directions of the keystroke. Note that one of these must always be zero.
* '''(22, 32)''' stores Chip's [[Death message|autopsy report]] (of note is that this requires very strict timings and usually only works with a north clone block since they clone instantaneously):
* '''[22, 32]''' stores Chip's [[Death message|autopsy report]]:
** 0. Alive
** 0. Alive
** 1. [[Water|Drowned]]
** 1. [[Water|Drowned]]
Line 28: Line 25:
** 5. Killed by a [[monster]]
** 5. Killed by a [[monster]]
** 6. [[Time limit]] expired
** 6. [[Time limit]] expired
* '''(24, 32)''' and '''(26, 32)''' store Chip's x- and y-directions when he is sliding. One of these is always zero, and both are zero when Chip is not sliding.<ref name="direction"/>
* '''[24, 32]''' and '''[26, 32]''' store Chip's x- and y-directions when he is sliding. One of these is always zero, and both are zero when Chip is not sliding.
* '''(28, 32)''' stores the amount of monsters in the monster list before the player starts playing the level.
* '''[28, 32]''' stores the amount of monsters in the monster list before the player starts playing the level.
* '''(30, 32)''' and '''(31, 32)''' store the coordinates of the initial position of the first monster in the [[monster list]].
* '''[30, 32]''' and '''[31, 32]''' store the coordinates of the initial position of the first monster in the [[monster list]].
 
== Necessary configuration==
== Necessary configuration==


In order to reset data stored in a square (x, 32):
In order to reset data stored in a square [x, 32]:
 
*There must be a buried north clone-able [[Object|object]], most commonly [[clone block]]s, at (x, 0).
*A clone connection must be made from a [[red button]] to (x, 32).<ref>A creature can also be added to the monster list with the position (x,32) instead, however this will reset the data on the first tick that monster can move.</ref>
*The square at (x, 31) must be free for an object to clone there.


*There must be a buried north [[clone block]] at [x, 0].
*A clone connection must be made from a [[red button]] to [x, 32].
*The square at [x, 31] must be free for a block to clone there.
When the red button is pressed, the following will occur:
When the red button is pressed, the following will occur:
* The buried north object will move north, wrapping around the map, and appear at (x, 31) as a normal object of the type that was buried.
* The buried north clone block will move north, wrapping around the map, and appear at [x, 31] as a normal block.
* The data stored at (x, 32) will be reset to 0.
* The data stored at [x, 32] will be reset to 0.
* The buried tile in the lower layer of (x, 0) will be replaced with a tile with the index equal to the data formerly occupying (x, 32). This index is written in the infobox on the respective tile's page, (it is possible to create tiles outside the normal range, however most of these tiles have no graphics and all act as walls).
* The buried tile in the lower layer of [x, 0] will be replaced with a tile with the index equal to the data formerly occupying [x, 32]. This index is written in the infobox on the respective tile's page.


== Uses ==
== Uses ==
When these resets are triggered, there can be very interesting effects, altering the very nature of tiles and doing impossible things, such as stopping sliding objects on [[ice]] and creating objects out of thin air.
When these resets are triggered, there can be very interesting effects, altering the very nature of tiles and doing impossible things, such as stopping sliding objects on [[ice]] and creating objects out of thin air.


Resetting the data at (0, 32) will cause Chip's Challenge to read the current level as level the first multiple of 256 before the actual level number. If the actual level number is less than 256, then the current level will be read as 0. In this situation, no [[Chip's Challenge scoring|level bonus]] is awarded on completion, the next level is read as level 1 on completion or moving forwards, and attempting to restart or going back a level will cause the [[Termination Glitch]], as Chip's Challenge cannot load a level 0 or -1. This type of level is known as a [[warp station]], and was developed as a substitute for a [[dummy level]].
Resetting the data at [0, 32] will cause Chip's Challenge to read the current level as level the first multiple of 256 before the actual level number. If the actual level number is less than 256, then the current level will be read as 0. In this situation, no [[Chip's Challenge scoring|level bonus]] is awarded on completion, the next level is read as level 1 on completion or moving forwards, and attempting to restart or going back a level will cause the [[Termination Glitch]], as Chip's Challenge cannot load a level 0 or -1. This type of level is known as a [[warp station]], and was developed as a substitute for a [[dummy level]].
 
Resetting (8, 32) will make Chip warp to the left side of the screen, and with (10, 32) he will warp to the top of the screen. Resetting (12, 32) will make Chip stop sliding, even on ice, though some other [[object]] will have to trigger the [[red button]]. Resetting (22, 32) will make Chip invincible for the next turn, allowing him to pass through [[destructive obstacle]]s.
 
The result of such behaviour also includes changing the tile itself, to create items out of nowhere. If Chip's x-coordinate was 21 and the data at (8, 32) is reset, an [[exit]] will be buried at (8, 0). Note that most data resets are limited, as they only reach up to one. The level number and Chip's coordinates are generally the most useful.
 
===49===
A peculiar effect occurs when performing data resetting where the value being reset equals 49 as 49 is the index of a clone machine. Therefore any time the value being reset is 49, it means the tile effectively 'stores' a clone machine. Performing the steps to reset said data will in fact not reset the data as it normally would. It will instead clone the object to (0, 31) as if there were a clone machine ''underneath'' the buried object. This effect can be utilized by level designers by ensuring that some data piece will always have a value of 49 (ex. the level number) in order to have a "wrapping" clone machine that can continuously clone into the bottom row.


== Technical Explanation ==
Resetting [8, 32] will make Chip warp to the left side of the screen, and with [10, 32] he will warp to the top of the screen. Resetting [12, 32] will make Chip stop sliding, even on ice, though some other [[object]] will have to trigger the [[red button]]. Resetting [22, 32] will make Chip invincible for the next turn, allowing him to pass through [[destructive obstacle]]s.
The underlying cause of data resetting is the same as the [[Wraparound Glitch]], namely unchecked clone connections that can point beyond the map. Every clone (or trap) connection in MSCC can be converted into an offset into the memory for the level grid using the formula (32*y + x). An issue arises however when the y-coordinate is beyond 31, it points outside of the normal map's memory range and into the first row of the bottom layer of the map. As such when a monster or block is buried in a (x, 32) tile and cloned, it moves "up" back into normal map memory, which is the bottom of the map. However whenever an object without a clone machine under it is cloned it pops<ref>Moves the tile that was just under the object to the top layer and sets the bottom layer to floor (index of 0)</ref> the tile beneath it. So when a monster buried in the first row is cloned it tries to pop the tile ''underneath'' the bottom layer, which the game calculates as current tile memory address + 1024 (the size of the grid). However since the game is already in the bottom layer this calculation actually moves outside the map data and into other data stored below, and since its popping the tile it takes whatever tile it thinks is there, moves it to the bottom layer in the x position and sets that memory address to 0.


The reason this doesn't work with objects buried in the second row and a clone connection set to (x, 33) or similar is because MSCC does check that a creature's move/attempted clone is within the top layer map, however due to an object buried on the first row wrapping into the bottom row on the first layer being considered in bounds the move succeeds.
The result of such behavior also includes changing the tile itself, to create items out of nowhere. If Chip's x-coordinate was 21 and the data at [8, 32] is reset, an [[exit]] will be buried at [8, 0]. Note that most data resets are limited, as they only reach up to one. The level number and Chip's coordinates are generally the most useful.
===Level 49===
A peculiar effect occurs when performing data resetting in level 49 of a level set. Recall that 49 is the index of a clone machine. Therefore [0, 32], which stores the current level's number, will store (effectively) a clone machine. Performing the steps to reset [0, 32] will in fact not reset the level number as it does in any other level. It will instead clone the block to [0, 31] as if there were a clone machine ''underneath'' the buried block at [0, 0].


===Data Setting===
The same effect can be achieved if the level set has exactly 49 levels. In this case, [2, 32] will hold the number 49 for any level in the level set.
It's possible to set the values stored in the resettable areas, and even areas past that, to values other than 0. If a level designer can setup the level data within the [https://github.com/magical/CHIPS.EXE/blob/master/structs.asm Game State structure] so that the data that wants to be set has the value of either a [[Teeth|teeth]] or a [[Tank|tank]]. If the designer then creates a monster list entry for that data piece, the game treats it as if there was a teeth or tank actually present there. As such the monster will move/turn as the monster normally does, and when it does it will write its tile value to that area of memory overwriting whatever value was there prior. This only works with teeth and tanks because they're the only monsters who can update their tile when unable to move.


== Famous levels using data resetting ==
== Famous levels using data resetting ==
Line 70: Line 58:
* [[Evan Dummit]]'s ''the most inane level ever!'', ''the right place, part 1-4'', and ''counting''
* [[Evan Dummit]]'s ''the most inane level ever!'', ''the right place, part 1-4'', and ''counting''
* [[Mike Lask]]'s ''The Most Insane Level... in This Set''
* [[Mike Lask]]'s ''The Most Insane Level... in This Set''
* [[User:Chiphome5|ChipHome5]]'s ''[[Delivery Ship]]''
* [[User:Chiphome5|ChipHome5]]'s ''Delivery Ship''
* [[Tyler Sontag]]'s ''Block Factory II''
* [[Tyler Sontag]]'s ''Block Factory II''
* [[User:Icy001|Icy001]]'s ''Icysanity.dat''
== Footnotes ==
[[Category:Glitches]]
[[Category:Glitches]]
Please note that all contributions to Chip's Challenge Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Chip's Challenge Wiki:Copyrights for details). Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)
Your changes will be visible immediately.
  • If you want to test editing, try the sandbox.
  • On talk pages, please sign your posts by typing four tildes (~~~~).

Template used on this page: