Converting Pac-Man to Jr Pac-Man #12 - Playthrough #2

preview_player
Показать описание
I've made some adjustments, having gotten access to some ways to figure out how the arcade code works.

I've made the following adjustments:
- When the toy appears, it will start moving in whichever direction the screen has scrolled to. It wasn't random like I thought.
- The toy eat collision logic was changed to match the arcade code - it watches for the X,Y absolute value distances between Jr Pac-Man and the toy to be within [4,4]. The scared ghost eat logic, however, remains the same (scared ghost XY minus Jr Pac-Man XY must be between [0,0] and [4,4]). Previously I thought this would make Jr Pac-Man go through a ghost if they were in just the right orientation opposite each other. But I realized once they pass through each other, their coordinates would swap and the formula would catch the eat on the next frame. So it still works.
- I updated the RNG seed bank of 8000 bytes with the bytes that Jr PacMan uses. It likely won't make much of a difference in how the scared ghosts move, but at least it's more equal with arcade Jr Pac-Man.
- The storage for eaten pellets in Pac-Man was only 1-byte with a max of 255 (Pac-Man and Ms Pac-Man pellet counts never got that high). There are over 500 pellets to eat in the Jr Pac-Man mazes, so a 2-byte storage had to be used. However, the original 1-byte storage is still used in secondary fashion. It's just only incremented when the pellet counts becomes odd, so it increases half as fast as before. The 2-byte storage is used to decide when the toy will appear and when levels end, but red's elroy speed up and the choice of siren in the maze still use the 1-byte storage. Because it advances half as fast, it slows down the progression of red's elroy speedup and the faster sirens.
- I moved orange ghost's scatter target to the left 1 cell. My initial guess was close - I had it narrowed down to 3 possible cells, and the correct one was one of them. I think all 3 of these cells would generate the same result anyway, but I might as well use the correct one.
- Previously my first guess at the random ghost scattering at the start of each level was to have them pick a random quadrant to move towards. I figured out that they actually use a pseudo random number and just pick a random direction at each intersection. So I changed my code to match - I'll never be able to equal the RNG source that arcade Jr Pac-Man uses for this, but I matched the methodology as much as I could.
- I tweaked the difficulty settings for the levels used to match what arcade Jr Pac-Man is actually using for them. But I have yet to figure out why the normal Jr Pac-Man never progresses to a map where Jr Pac-Man is slow, except maze 145, which I haven't figured anything out for.

These changes don't very significantly change the game. I'm just combing out the final knots.

I still have unanswered questions, including:
- The timing of toy behavior and how it moves randomly and for how long. This is the big one I'm searching for. (Update: I did manage to find a fair chunk of it, and wow, it is complicated and not at all what I guessed - the toy selects a power pellet location (using a rolling number from 0-7 as a seed), with a pellet or not and moves towards it. When it's 14 columns away, it picks another pellet location (with a pellet or not) from a different set of indices. Then within 7 columns of that one, it starts to watch if that pellet is gone, and if so, picks the first power pellet in the list that it can find starting at the upper right, then down then left. If it can't find any, it targets Jr Pac-Man. That's the basic summary.)
- Coordinates still use 1 byte, so how does the code prevent Jr Pac-Man from eating offscreen toys and scared ghosts when their X coordinate matches Jr Pac-Man because of overflow?
- How does the code detect that ghosts have gone offscreen and tell them to reverse?
- Do scared ghosts reverse when they go offscreen?
- The actual map scrolling formula used to catch up to Jr Pac-Man.
- What is the method for how the code resets squashed pellets on a death?
- What happens if Jr Pac Man dies and the toy is sitting on a power pellet to explode offscreen?
- How do the blank 144 level and the slow 145 blue levels happen?

If I can get these questions answered and work them into my code, I think I'll be satisfied with this conversion. I won't be implementing the kill screen, though - not interested.

I still don't know really how to group ghosts. But I played a lot of games where I only had 3 lives and tried to make the best of them. So I got a bit better here and made it to level 5. Still made a few dumb mistakes, though - I still sometimes focus too much on a place I want to go and less on effectively evading the ghosts. I was almost able to trap 3 ghosts in a turnaround at the screen edge on maze 2 a few days ago, but they reversed on me.

This is just a passion project. It will not be made public. All images and sounds property of Namco, Midway, etc.
Рекомендации по теме
Комментарии
Автор

So, a few things I noticed:
For one, the obvious lack of "Ready" and "Game Over" text, as well as the lack of intermissions. This is a work in progress, so that's to be expected.

Another thing I noticed is that the ghost siren starts at the 2nd tier instead of the 1st. A while ago, I did count manually the amount of dots for each ghost siren tier, so I will post these here in hopes it helps.

1st tier 0 dots - 230 dots
2nd tier 231 dots - 358 dots
3rd tier 359 dots - 422 dots
4th tier 423 dots - 454 dots
5th tier 455 dots - stage clear

In addition, I also counted the dots for the bonus item spawns so I will list these here as well.

1st toy 96 dots
2nd toy 208 dots
3rd toy 320 dots
4th toy 432 dots

Another thing is the large dots, when you died on stage 4, the large dots turned back into normal dots. In the original game, the large dots disappear from the stage, unless they're the only dots left on the maze, then they revert to small dots. The bonus item also destroyed the power pellet off screen when you died. I doubt this happens in the original, but I will have to double check.

One last thing, the orange ghost (Tim in this game) color is a slightly different tint in Jr. Pac-Man compared to in (Ms.) Pac-Man. Difficult to notice unless you look at them side by side.

Other than these, everything else is pretty close to the source material.

olds
visit shbcf.ru