Start with full health

Go down

Start with full health Empty Start with full health

Post by aacroke Thu 15 Sep 2016 - 13:01

What needs to be tweaked in order to start with full health when you load a save file?

aacroke
Bee
Bee

Since : 2016-09-14

Back to top Go down

Start with full health Empty Re: Start with full health

Post by superskuj Thu 15 Sep 2016 - 13:19

There's a table the game checks to determine how many hearts to give you on start-up. It checks your total hearts and uses that as an index in the table. The table is located at $04F4AC on a headerless rom. It's worth noting that there are entries for conditions where you have less than 3 hearts max but this is only to prevent the game having to do an additional calculation on the index before searching the table.

For this task you want to change:
Code:
18 18 18 18 18 20 20 28 28 30 30 38 38 38 40 40 40 48 48 48

to:
Code:
18 18 18 20 28 30 38 40 48 50 58 60 68 70 78 80 88 90 98 A0
Edit: see Puzzledude's post below for a correction to a mistake I made here


Last edited by superskuj on Thu 15 Sep 2016 - 14:36; edited 1 time in total

superskuj

Start with full health Image211

Since : 2015-07-07

Back to top Go down

Start with full health Empty Re: Start with full health

Post by aacroke Thu 15 Sep 2016 - 13:29

Thank you very much!

aacroke
Bee
Bee

Since : 2016-09-14

Back to top Go down

Start with full health Empty Re: Start with full health

Post by qwertymodo Thu 15 Sep 2016 - 13:40

Code:
PC 0x04F562: EA EA EA EA EA EA EA EA

Or, in assembly:
Original
Code:
09f55e lda $7ef36c   [7ef36c]
09f562 lsr a
09f563 lsr a
09f564 lsr a
09f565 tax
09f566 lda $09f4ac,x [09f4bf]
09f56a sta $7ef36d   [7ef36d]

Start with full health:
Code:
09f55e lda $7ef36c   [7ef36c]
09f562 nop
09f563 nop
09f564 nop
09f565 nop
09f566 nop
09f567 nop
09f568 nop
09f569 nop
09f56a sta $7ef36d   [7ef36d]

This actually modifies the save routine, not the game load routine, since that's when it actually sets it to half.

Edit: superskuj ninja'd me while I was in the middle of tracing Razz
qwertymodo
qwertymodo

Start with full health Image212

Since : 2014-10-21

Back to top Go down

Start with full health Empty Re: Start with full health

Post by Puzzledude Thu 15 Sep 2016 - 14:28

Nice find superskuj, however after testing I found out that the game actually starts at 0 for some reason. This means your table is actually 1 byte short. Namely if you have 20 heart containers, we all know from AlttP that you start with 1 row of full hearts= 10 hearts= 50 in hex, while your table ends with 48. If you look at the next row in hex, the 50 is actually there.

So if you start at 04F4AC,

the table is actually
18 18 18 18 18 20 20 28 28 30 30 38 38 38 40 40 40 48 48 48 50

and needs to be changed into
18 18 18 18 20 28 30 38 40 48 50 58 60 68 70 78 80 88 90 98 A0

Your table will actually write a +1 heart at each health, since your A0= 20 full hearts at the position when you have 19 heart containers.

I actually found this when I implemented the start with 10 containers, and when I was defeated and started over, I had 11 containers.



Here some more studies:
ORIGINAL GAME
at 04F4AC
heart containers   00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20
given health (hex) 18 18 18 18 18 20 20 28 28 30 30 38 38 38 40 40 40 48 48 48 50


heart containers      00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20
given health (actual) 03 03 03 03 03 04 04 05 05 06 06 07 07 07 08 08 08 09 09 09 10




MAX HEALTH MOD after save and quit or save and continue
heart containers      00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20
given health (actual) 03 03 03 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20

heart containers   00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20
given health (hex) 18 18 18 18 20 28 30 38 40 48 50 58 60 68 70 78 80 88 90 98 A0


Note:
The values Go to RAM, and thus into SRAM, so once you edit the hex values, play the game and save it, your further changes of the table will Not be in affect on a played file, unless you start a new game.


Last edited by Puzzledude on Thu 15 Sep 2016 - 14:37; edited 1 time in total
Puzzledude
Puzzledude

Start with full health Image213

Since : 2012-06-20

Back to top Go down

Start with full health Empty Re: Start with full health

Post by superskuj Thu 15 Sep 2016 - 14:35

Ah nice catch. I neglected to test it because I thought it was straightforward enough but that's always when these kinds of mistakes happen Razz I'll make a note in my post

superskuj

Start with full health Image211

Since : 2015-07-07

Back to top Go down

Start with full health Empty Re: Start with full health

Post by qwertymodo Thu 15 Sep 2016 - 14:40

I should mention, I also didn't fully test my version (I did an initial test with ~18 heart containers, but if there are other code paths for different numbers of hearts, those would need to be tested as well).

Edit: Ok, I got somewhat un-lazy and tested it for 3, 4, 5, 6, 8, 10, 12, and 19 hearts, all good.


Last edited by qwertymodo on Thu 15 Sep 2016 - 14:50; edited 1 time in total
qwertymodo
qwertymodo

Start with full health Image212

Since : 2014-10-21

Back to top Go down

Start with full health Empty Re: Start with full health

Post by Puzzledude Thu 15 Sep 2016 - 14:46

superskuj wrote:Ah nice catch. I neglected to test it because I thought it was straightforward enough but that's always when these kinds of mistakes happen Razz I'll make a note in my post
Yes, sure no problem, since you were the first to find the Table, which for instance I couldn't.


PC 0x04F562: EA EA EA EA EA EA EA EA
Ah, a coder's solution. I tested this and it works. I would never though of such a solution.

PS
I wonder what happens if you hack the game to start with 1 or 2 heart containers. I actually wanted the player to start in the GoT hack with 2 heart containers and never tested what happens after save and quit.
Puzzledude
Puzzledude

Start with full health Image213

Since : 2012-06-20

Back to top Go down

Start with full health Empty Re: Start with full health

Post by Puzzledude Thu 15 Sep 2016 - 14:54

I wonder what happens if you hack the game to start with 1 or 2 heart containers. I actually wanted the player to start in the GoT hack with 2 heart containers and never tested what happens after save and quit.
As suspected, you always get 3 containers, so the actual table is:
08 08 10 18 18 20 20 28 28 30 30 38 38 38 40 40 40 48 48 48 50

or with full health:
08 08 10 18 20 28 30 38 40 48 50 58 60 68 70 78 80 88 90 98 A0

Now you can also start with 1 or 2 heart containers (instead of normal 3) and get your health reloaded normally.
Note: starting with 0 heart containers will result in game crash.
Puzzledude
Puzzledude

Start with full health Image213

Since : 2012-06-20

Back to top Go down

Start with full health Empty Re: Start with full health

Post by Puzzledude Thu 15 Sep 2016 - 14:56

Edit: Ok, I got somewhat un-lazy and tested it for 3, 4, 5, 6, 8, 10, 12, and 19 hearts, all good.
I tested with your method for 10 and 15 and it was ok.
Puzzledude
Puzzledude

Start with full health Image213

Since : 2012-06-20

Back to top Go down

Start with full health Empty Re: Start with full health

Post by qwertymodo Thu 15 Sep 2016 - 14:59

I just tried setting the number of hearts to 1, the load game screen shows 1 heart, but when you load the game, the HUD shows 3, and weird things happen when you get hit.  Also, $7EF36D still gets saved as $18, so you still have 3 hearts worth of health.

Start with full health 11Tf56o
qwertymodo
qwertymodo

Start with full health Image212

Since : 2014-10-21

Back to top Go down

Start with full health Empty Re: Start with full health

Post by qwertymodo Thu 15 Sep 2016 - 15:02

Also, once you get hit down to 1 heart, then you can't go above it, and if you go into a house, it corrects the HUD to show 1, but the low health beeping plays constantly.

I'd say it's probably doable, but lots of separate pieces you'd need to fix.
qwertymodo
qwertymodo

Start with full health Image212

Since : 2014-10-21

Back to top Go down

Start with full health Empty Re: Start with full health

Post by Puzzledude Thu 15 Sep 2016 - 15:09

qwertymodo wrote:I just tried setting the number of hearts to 1, the load game screen shows 1 heart, but when you load the game, the HUD shows 3, and weird things happen when you get hit.  Also, $7EF36D still gets saved as $18, so you still have 3 hearts worth of health.

Also, once you get hit down to 1 heart, then you can't go above it, and if you go into a house, it corrects the HUD to show 1, but the low health beeping plays constantly.

I'd say it's probably doable, but lots of separate pieces you'd need to fix.

That's odd, it works for me.

Just go to 274F2, and instead of 18 18, type in 08 08, to start the game with 1 heart. Or indeed 10 10, to start the game with 2 hearts. Works normally, calculates health normally and with my remade table above for 1 and 2 hearts, also correctly gives you health if defeated or save and quit.

Start with full health Healthhack1

Start with full health Healthhack2

Start with full health Healthhack3
Puzzledude
Puzzledude

Start with full health Image213

Since : 2012-06-20

Back to top Go down

Start with full health Empty Re: Start with full health

Post by Puzzledude Thu 15 Sep 2016 - 15:15

but the low health beeping plays constantly.
Yes, if you start with 1 heart, ie at 274F2 type in 08 08. You also need to do this: 6DCA1, from 2B to 00, to stop the beaping sound, since it will always beep if 1 heart. If you then get defeated, you also need that new table to correctly restart with 1 or 2 hearts (default is always 3) and if you find a heart container, the game knows to increase from 1 to 2, or from 2 to 3.
Puzzledude
Puzzledude

Start with full health Image213

Since : 2012-06-20

Back to top Go down

Start with full health Empty Re: Start with full health

Post by Floki Thu 15 Sep 2016 - 20:09

So what do I need to change in hex if I want to always start with the right amount of hearts collected?

Too lazy to read the whold thread.... but always wondered why the game behaved like that.

Thx!

Floki

Start with full health Image212

Since : 2012-06-19

Back to top Go down

Start with full health Empty Re: Start with full health

Post by qwertymodo Thu 15 Sep 2016 - 21:48

If you want to load your game with full health, either puzzledude's table edit or my nop slide will work. You don't need both.
qwertymodo
qwertymodo

Start with full health Image212

Since : 2014-10-21

Back to top Go down

Start with full health Empty Re: Start with full health

Post by Floki Thu 15 Sep 2016 - 22:35

Alright awesome qwerty, will add this to my to do list!

Also thanks to aacroke for bringing this to our attention! Smile

Floki

Start with full health Image212

Since : 2012-06-19

Back to top Go down

Start with full health Empty Re: Start with full health

Post by Puzzledude Fri 16 Sep 2016 - 7:06

Lord SePH wrote:Alright awesome qwerty, will add this to my to do list!

Also thanks to aacroke for bringing this to our attention! Smile
I also wanted to ask you SePH, did you plan on making the border on lost hearts (should be a very small gfx edit of 8 bit gfx), since if you for instance have 15 hearts max possible in Conker and loose health, the white lines actually disappear completely. So you then don't know how much you actually can get (or is this how Assasin's creed has it).
Puzzledude
Puzzledude

Start with full health Image213

Since : 2012-06-20

Back to top Go down

Start with full health Empty Re: Start with full health

Post by Puzzledude Fri 16 Sep 2016 - 7:17

So what do I need to change in hex if I want to always start with the right amount of hearts collected?
04F4AC:
08 08 10 18 20 28 30 38 40 48 50 58 60 68 70 78 80 88 90 98 A0

or

04F562:
EA EA EA EA EA EA EA EA


Too lazy to read the whold thread.... but always wondered why the game behaved like that.
But it's logical, you got defeated, you thus can not start with full health, since then the game will be to easy. Imagine you have 19 containers and get defeated. Then you would start with all 19 hearts, which is a lot.

On the other hand original authors made sure you always get some additional health: 3 hearts in the house, fairy in one of the trees at the Pyramid etc. They basically wanted you to at least search for some additional health after defeat. For the same reason the fairy gives you only 7 hearts. Imagine this would be 20, ie fairy (at least flying one) would give you full health - too easy.

But if you intend to make Conker user-friendly, starting with full health after defeat and a flying (but not resurrecting) fairy giving more than 7 hearts, like 12 for instance, is the way to go. There is also the buying factor, if fairy would give 20 hearts, players might not be buying red potion.
Puzzledude
Puzzledude

Start with full health Image213

Since : 2012-06-20

Back to top Go down

Start with full health Empty Re: Start with full health

Post by qwertymodo Fri 16 Sep 2016 - 10:41

I may add this to PW. It seems like the kind of thing that doesn't really skew the difficulty curve much, but when you inevitably die, it means just that much less work to get ready to head out again. Which fits perfectly with my stated goal of "making you hate yourself and/or the game less when you play".
qwertymodo
qwertymodo

Start with full health Image212

Since : 2014-10-21

Back to top Go down

Start with full health Empty Re: Start with full health

Post by Floki Fri 16 Sep 2016 - 10:45

Nope will keep the disapearing hearts as they are. Always meant this to be like this!

The heart containers you have can be seen in the inventory screen at the bottom if you know what to look for.

I won't change the health given by fairies. It is user friendly enough as it is except the final boss....but there's a trick to him and I've put a note in there about it in the best place ever. So people will find him even easier.

If it were just me I'd remove the option to catch fairies and make them hurt you instead but that would fail my goal to make this as user friendly as possible  Wink

Floki

Start with full health Image212

Since : 2012-06-19

Back to top Go down

Start with full health Empty Re: Start with full health

Post by Puzzledude Fri 16 Sep 2016 - 11:24

Nope will keep the disapearing hearts as they are. Always meant this to be like this!
I won't change the health given by fairies.
Yes, sure, your call.

except the final boss....but there's a trick to him and I've put a note in there about it in the best place ever. So people will find him even easier
I found the last boss very difficult, I guess I missed that trick.
Puzzledude
Puzzledude

Start with full health Image213

Since : 2012-06-20

Back to top Go down

Start with full health Empty Re: Start with full health

Post by aacroke Thu 22 Sep 2016 - 16:23

No thanks necessary, it just has bothered me for like 25 years that you don't start with either full health or the amount you saved with.

It's I who says thanks - you guys have empowered me to rid myself of this issue.

aacroke
Bee
Bee

Since : 2016-09-14

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum