News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Notes for editing levels in Pac-Man? (NES)  (Read 1139 times)

Dr. Chill

  • Jr. Member
  • **
  • Posts: 18
    • View Profile
Notes for editing levels in Pac-Man? (NES)
« on: October 18, 2020, 12:51:49 am »
Back in April I released a hack for the NES port of Pac-Man, aiming to "restore" the graphics and generally make the presentation closer to arcade standards. In truth, I'm not very satisfied with it for one simple reason: the maze. The layout of it is very different from the arcade version and playing with the graphics patch only further highlights the missed potential of this port.

For this reason, I'm considering expanding that graphics hack into a more extensive level hack, and although a couple hacks of this game exist that show it is possible, I've personally found no documentation on how this game's levels are built. I am expecting to do the levels in a hex editor, which I believe I can manage if I knew where the level data was and which values represented which tiles in the game.

If worst comes to worst and I can't manage it, I did briefly prototype a hack that "converts" Ms. Pac-Man (Namco) into a more faithful/less compromised port of the original Pac-Man maze using the Blinky level editor. Though for authenticity's sake, I'd rather just hack Pac-Man because at least then I don't have the Ms. Pac-Man sounds and intermissions clashing with the original's maze and graphics. For comparison, here's how the Namco Ms. Pac-Man "conversion" attempt looks versus the released Pac-Man "GFX Restoration" hack.

Cyneprepou4uk

  • Hero Member
  • *****
  • Posts: 533
  • I am the baldest romhacker
    • View Profile
Re: Notes for editing levels in Pac-Man? (NES)
« Reply #1 on: October 18, 2020, 03:51:44 am »
Use code/data logger tool in fceux emulator, level data should be easy to find. Manually edit bytes and reload a level to figure out what they mean
iromhacker.ru - NES ROM hacking tutorials for beginners. Please use Google Translate browser extension

Dr. Chill

  • Jr. Member
  • **
  • Posts: 18
    • View Profile
Re: Notes for editing levels in Pac-Man? (NES)
« Reply #2 on: October 20, 2020, 04:44:23 am »
Any tips for how to effectively use the code/data logger?

So far I can use it to get a rom with only fractions of the original data, saved from very brief sessions of just having the level loaded up for a few seconds, so the tool can (hopefully) log that data and not much else. In a hex editor, I tried poking at various isolated and large chunks of values that I believe could be the level layout data, though in most cases it just creates a weird corruption effect, like crashing the game as soon as a level starts.

Cyneprepou4uk

  • Hero Member
  • *****
  • Posts: 533
  • I am the baldest romhacker
    • View Profile
Re: Notes for editing levels in Pac-Man? (NES)
« Reply #3 on: October 20, 2020, 06:22:57 am »
You don't need to save a rom with that logger. You just launch it before entering a level, maybe create a savestate for convenience, and pause it after level is loaded. Then you search in rom file for blue chunks of bytes and edit them before loading a savestate and going into a level to see what has changed.
iromhacker.ru - NES ROM hacking tutorials for beginners. Please use Google Translate browser extension

Dr. Chill

  • Jr. Member
  • **
  • Posts: 18
    • View Profile
Re: Notes for editing levels in Pac-Man? (NES)
« Reply #4 on: October 24, 2020, 08:41:01 am »
Well, I followed your advice and I managed to make some progress, though not for long before hitting a road block. Turns out, certain sections of the maze are made out of what I call "tile groups." Basically a "tile group" is multiple consecutive copies of the same tile, assigned as a group to one single value in the level data, similarly to how singular tiles are. I can't seem to get around these "tile group" values to try adding values for singular non-grouped tiles in their place, or it'll corrupt my level; basically not being able to work around this makes the level far less customizable than I originally anticipated.


"Tile groups" for walls and dots in this image are highlighted in red. Though there appears to be less due to how they connect, there are actually twelve groups of four in this cropped portion of the level alone.

So with that in mind, how far did I make it with my custom level? ...Not very far.

By the time I made it to the lower half of the screen, I realized that there were even more variants of tile groups all scattered throughout the maze, including groups of three. My level looked nothing how I imagined it would, and I realized it wasn't going to for as long as there's no workaround for modifying all these tile groups.

Good news is, I was able to get a lot of notes down regarding how the levels in Pac-Man NES appear to be made. Including notes on the values of most of used level tiles, the location of the level data and some other things. I don't know if I'll continue to try level hacking, at this rate it all depends on those tile groups getting in the way, but for now I'm sure my notes may come in handy for someone in the future.

Here's all the notes I took throughout my attempts so far, Pastebin link. Even if I end up scrapping the whole "custom level" idea I had in mind for Pac-Man NES Improvement, this did prove to be a decent exercise for an aspect of hacking I've never even touched before. https://pastebin.com/zmyXDSgS