Skip to content
This repository was archived by the owner on Jun 2, 2024. It is now read-only.

Real Examples

meleu edited this page Nov 28, 2017 · 21 revisions

Using ResetIf

Let's see how Super Hang-On's achievement Speed Freak (15) - Maintain at least 300kph for 10 seconds looks like in Achievement Editor dialog:

speedfreak-example

In this achievement, we wish for there to be a fact or condition that is true 600 times consecutively. The reason for this is that the genesis is locked into processing 60 frames of logic per second (NTSC at least?). And the fact we're looking for is "speed is over 300". Also, we want the player to keep the speed above 300 without pausing the game.

0x0055a: is the speed.

0x0c757: is 0x00 when the game is unpaused.

Condition 1: player's speed is above 300 for 600 frames (or 10 seconds have passed).

Condition 2: reset the hit counter if speed is under 300.

Condition 3: reset the hit counter if the player pause the game.

Delta Values and ResetIf

Let's take Streets of Rage 2 (Mega Drive) as a case study, and Steel Grip (20) - Defeat 10 enemies without dropping your weapon achievement. This relies on four conditions:

ID Special? Size Memory Cmp Type Size Mem/Val Hits
1 8-bit 0xef33 = 1 (1)
2 16-bit 0xef4e > delta 16-bit 0xef4e (10)
3 ResetIf 8-bit 0xef37 != delta 0xef37
4 ResetIf 8-bit 0xef33 != 1

Detailing each condition:

Condition 1: This value is the flag to say whether the player is holding a weapon. We require this to be true, once. This is actually not necessary, but it's useful to show the progression. We are saying that require the player to hold a weapon, at least once.

PLEASE NOTE: if a condition has a hit count, and reaches the number required, this condition is no longer tested. It is true and remains true, UNLESS you have a Reset If, which we will discuss below.

Condition 2: The memory value shown twice here is the number of KOs that the player has made. It's 16-bit (meaning the value can be more than 255), and by using the delta and 'greater than' symbols, we are saying that we require the number of KOs to be bigger than the previous value, and we need this to happen 10 unique times.

Every time the current value is bigger than the previous value, the hit count will go up by one. The next frame, the 'delta' value will have increased to be the same as the current value, this ensures that after every kill, the KO counter will go up by one, and the hit count will go up by one.

There is a slight caviat with this... if the number of KOs goes up by two in the same frame, the hit count will only go up by one. It's a slight flaw that does happen a little more often than expected... in future there may be a way around this but for now it's a fairly close estimate to your number of kills.

Condition 3: The Reset If special flag essentially tells the emulator, if I read a 'reset if' condition, and this condition is true, please reset ALL my hit counts on this achievement.

For this condition, we are saying that we wish to reset all our progress, if the weapon type is different to the last known weapon type.

Condition 4: Here we are saying reset all our progress, if the player is no longer carrying a weapon.

Guidelines

General

Achievement Development

WIP


Portugues

Geral

Desenvolvedores


Español

General

Desarrolladores

Clone this wiki locally