Sign in to follow this  
Brodeur30

HOW TO : Make Puck Hit Boards Instead of Invisible Barrier

Recommended Posts

I found a very interesting code that I'd like to share. I converted it to a ROM code to make it easy to apply to your NHL 94 Genesis roms. What this code does is that it adjusts the physical barrier that exists between the puck and the boards all the way around the rink. So if you apply this code, when the puck hits the boards, now it'll actually appear to hit the boards flush instead of bouncing off that invisible barrier. This is particularly noticeable when the puck collides with the side boards, as the puck just didn't come close to actually hitting the yellow line. The collision just wasn't accurate, pucks were bouncing off the edge of that grey shadow of the side board which is several pixels off the yellow line. Now with this code adjustment, pucks will actually hit the side board in line with the artwork and it looks fantastic. I hope you test this so you can experience it for yourself. It may seem like a small detail, but it greatly enhances NHL 94 Genesis visually and it affects gameplay, you'll see.

Without this code, when the puck hit or wrapped around the boards behind each goal. . . well, at the top of the rink, it looked OK but the puck didn't appear to fully collide with the yellow line. And when the puck hit the bottom edge of the rink, it clearly was hitting an invisible barrier well off the board.

But now, with this code, all those invisible barriers are gone and the puck will actually appear to hit the board, which gives the puck more space to travel along the ice before colliding with the barrier. So with this extra space for the puck to travel, you get new angles when you send the puck off the boards. Note that this code doesn't affect the collision of the players with the boards, only the collision between the puck and the boards.

This code essentially allows you to have a bigger rink as far as the puck is concerned. Finding this code has me now looking for a code to adjust the barrier between the players and the boards, which I haven't been able to locate yet. But as it stands, if we were to edit the artwork of the boards to move them back a few pixels, we now have a code that would allow us to adjust the physical barrier of the puck to be inline with that.

To apply this, you need to hex edit a rom at the following offsets :

Change 017012:0005 to 017012:0000

Change 017014:0005 to 017014:0000

The default value of 05 is what causes the puck to bounce off that invisible barrier when it gets close to the boards. Lowering the value to 00, well it gives the puck more space to travel before colliding with the barrier. Please provide your feedback if you test this for yourself.

 

Bonus :

In case you were wondering, you can adjust this code further and increase the barrier of the puck and the boards to go well beyond the artwork of the boards. If you want the puck to travel even farther like into the crowd before hitting the barrier, here's what you do :

Change 017012:0000 to 017012:FFxx

Change 017014:0000 to 017014:FFxx

with xx starting with FF and reducing the value further to allow the puck to travel farther beyond the boards before hitting the barrier.

So like 017012:FFFC and 017014:FFFC allows the puck to travel further before hitting the boards, 017012:FFF8 / 017014:FFF8 allows the puck to travel even further, and by 017012:FFF0 and 017014:FFF0 the puck travels all the way to the feet of the spectators before colliding with the barrier, and the puck is barely still reachable by players. If you go beyond that like into FFEx the puck is hitting the spectators and at that point is too far away for players to retrieve the puck at that point, due to the player / boards barrier.

With normal artwork it's best to just leave the codes at 0000 but the fact that you can adjust it further is very encouraging. In finding this code, it really has me thinking about editing some of the artwork to make the NHL 94 Genesis rink bigger.

  • Like 2

Share this post


Link to post
Share on other sites

That's really cool! I never noticed that.

Just double-checking: the address 017012, that's an offset in hexadecimal, or decimal/base-ten?

Do the player animations have a similar issue? EDIT: oh you mentioned this already :) 

Share this post


Link to post
Share on other sites

This allows the creation of an international-size rink ROM for Olympics ROMs, European leagues..

Share this post


Link to post
Share on other sites
2 minutes ago, smozoma said:

That's really cool! I never noticed that.

Just double-checking: the address 017012, that's an offset in hexadecimal, or decimal/base-ten?

Do the player animations have a similar issue?

Oh yeah, it's awesome. I was thrilled when I found this code, I pretty much just stumbled across it in RAM when searching for other codes, then I found it in the ROM.

The address 017012, that's a hexadecimal offset. It's 017012 and 017014. If you search a rom for "00 05 00 05" in hex (00050005) it's the first result that comes up. Just change those two 05's to 00 and you're good to go, fire up that rom and start lobbing pucks into the boards. It's a huge improvement !

Share this post


Link to post
Share on other sites
2 minutes ago, smozoma said:

This allows the creation of an international-size rink ROM for Olympics ROMs, European leagues..

Exactly ! This is why I am so excited about it because it opens up a lot of possibilities. I mean editing the artwork is one thing but having found the collision barrier in code for the puck is huge. As it stands, we can now move the board artwork several pixels back to make it slightly bigger, and adjust this code, but this code only affects the barrier that the puck meets the boards, not the players. So there still is the barrier of the players and the boards that we need to try to find a code for. If you test this code you'll start to notice how when free skating players can only really touch the boards with the end of their stick, not with their bodies. But this code is a great first step to the creation of an international-size rink, or at least a slightly bigger / wider rink.

  • Thanks 1

Share this post


Link to post
Share on other sites

I'm testing it a bunch trying to find the best value. I am using a horizontal puck I made for NHL 94 Genesis and with the rom I'm liking values of 017012:FFFE and 017014:FFFE. With "FF FE FF FE" the collision looks good especially when the puck hits higher up on the boards and bounces off. On ice level FF FE FF FE cuts into the boards slightly before bouncing off but I like the extra space and the new angles it creates.

So I suggest try 00 00 00 00 and FF FE FF FE and see which one you like best. It depends I think on the shape / size of your puck and the rom you are using which may have different board art placement. I'm having a lot of fun with this !

Share this post


Link to post
Share on other sites

If it helps, I believe the home team centre's X position is stored in FFB14A (2 bytes?). Could maybe put a RAM trace on there and then also do a code trace. Shouldn't be too hard to find the comparison code that prevents the game from increasing the player's X position (when skating to the right)

Y position is  00FFB15E

X speed 00FFB172
Y speed 00FFB174

Share this post


Link to post
Share on other sites
1 hour ago, smozoma said:

If it helps, I believe the home team centre's X position is stored in FFB14A (2 bytes?). Could maybe put a RAM trace on there and then also do a code trace. Shouldn't be too hard to find the comparison code that prevents the game from increasing the player's X position (when skating to the right)

Y position is  00FFB15E

X speed 00FFB172
Y speed 00FFB174

Those are very useful. Thank You. I was trying to find those earlier but was unsuccessful in my code searches. I plugged those into RAM Watch in Gens and moved around the player to see all the values.

Now that I can see the values, it looks like the left most X point is FF80 and the right most X point is 0080.

I had a look in memory editor. I can get the player on the other side of the boards by editing the value of FFB14A, i.e. changing FF80 to FF60. or changing 0080 to 00A0. If I do that, the player warps to the location beyond the boards, but then you try to move him from there and he starts sliding back towards the ice. There may be a value somewhere near there that removes or extends the barrier, so you can freely skate from FF80 to FF60 for example, but that X position code may need to be traced to find that. Generally the methods I use to find codes are by searching.

I attempted to edit those X and Y speed addresses but I haven't been able to edit the player's speed like I was able to move the player with the position codes.

Edited by Brodeur30

Share this post


Link to post
Share on other sites

I wonder if there's a way to prevent the puck from going out of play at all? Just for fun...

  • Like 1

Share this post


Link to post
Share on other sites

Good stuff bud!!

Share this post


Link to post
Share on other sites
On 4/10/2019 at 1:17 PM, Brodeur30 said:

Those are very useful. Thank You. I was trying to find those earlier but was unsuccessful in my code searches. I plugged those into RAM Watch in Gens and moved around the player to see all the values.

Now that I can see the values, it looks like the left most X point is FF80 and the right most X point is 0080.

I had a look in memory editor. I can get the player on the other side of the boards by editing the value of FFB14A, i.e. changing FF80 to FF60. or changing 0080 to 00A0. If I do that, the player warps to the location beyond the boards, but then you try to move him from there and he starts sliding back towards the ice. There may be a value somewhere near there that removes or extends the barrier, so you can freely skate from FF80 to FF60 for example, but that X position code may need to be traced to find that. Generally the methods I use to find codes are by searching.

I attempted to edit those X and Y speed addresses but I haven't been able to edit the player's speed like I was able to move the player with the position codes.

If you have any luck with extending the barriers I volunteer to redo the rink graphics.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Who's Online   0 Members, 0 Anonymous, 8 Guests (See full list)

    There are no registered users currently online