Picross 3D puzzle generating algorithm

ganondev

New Member
OP
Newbie
Joined
Dec 29, 2022
Messages
1
Trophies
0
Age
33
XP
18
Country
Saudi Arabia
Hello,

I was redirected here from the DeSmuMe forums.
I am trying to figure out how the puzzle generator that HAL built for Picross 3D on the NDS works.

Some background:
Picross 3D has an editor that allows you to build an object, and then process that object into a puzzle that you used to be able to share on Nintendo WFC. When you have assembled the puzzle shape, you click complete, and then the game goes into this processing state where it figures out an initial state for the puzzle. This is interesting because it seems to optimize the puzzle towards providing a minimum amount of information as possible on the surface of the puzzle such that the player can then solve the puzzle without having to make guesses during play. Based on the way it works, I would guess that it does some kind of brute force optimization because sometimes it can take a few minutes for the generator to wrap up a 10x10x10 puzzle (which feels like a long time if it was a linear growth generator). However it works pretty well, and I would like to know exactly what the algorithm HAL developed for this puzzle creator was.

Screenshot 2022-12-27 192932.jpg


I am no real ROM hacker. I was able to load the ROM in Ghidra using the NTRGhidra extension (can't post github link because new), but once I see the decompiled C for the ARM9, the impostor syndrome kicks in and I get overwhelmed, as I have no reverse engineering experience :P .

I come seeking advice on what you guys might do to figure out this algorithm, and perhaps some guidance on how to navigate the disassembled rom in ghidra, or another tool if possible. Again I have never tried reverse-engineering something like this before, so if there are some basic techniques that would serve me I would be glad to get some pointers there too, or a journeyman's handbook if possible.

Thanks.
 

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
36,798
Trophies
3
XP
28,346
Country
United Kingdom
Not many would use ghidra for this but I guess it would work.

https://gbatemp.net/threads/questio...ld-i-adquire-for-general-game-modding.622879/ contains links at least to a variety of things people usually use to learn on.

Reverse engineering a potentially complicated algorithm* from assembly code (much less ARM code) is not what most spend their time pondering (at best there is save hashing or some video decoding) but it can be done.

*10 minutes is a fairly long compute time for anything on the DS. It might be a simple iteration run thousands of times (the DS ARM is not a complete slouch but it is nothing special) but could also be something involved.
What I will say is you also have the code all ready to execute so you can input your data and watch it get transformed.
Beyond that how do you eat an elephant? One bite at a time (you have no idea how hard it was not to put byte or nibble in there).
 
  • Like
Reactions: SylverReZ

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    Metoroid0 @ Metoroid0: im more interested in metroid prime 4