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,404
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.
  • BakerMan @ BakerMan:
    you go bro
    +1
  • BakerMan @ BakerMan:
    i know, i know, i'm late
  • Sicklyboy @ Sicklyboy:
    @BigOnYa, I'll rip a bag off my Volcano to that, brother
    +2
  • a_username_that_is_cool @ a_username_that_is_cool:
    DDDS . Dual Developer Dedede System :)
    +1
  • BakerMan @ BakerMan:
    also happy birthday @Xdqwerty
    +1
  • BigOnYa @ BigOnYa:
    Is it me you're looking for?
  • MysticStarlight @ MysticStarlight:
    'Cause I wonder where you are
  • MysticStarlight @ MysticStarlight:
    wait I got the lyrics mixed up
    +1
  • BigOnYa @ BigOnYa:
    And I wonder what you do...Lol
  • BigOnYa @ BigOnYa:
    Its all good, I'm here to talk to you.
  • BigOnYa @ BigOnYa:
    Hello
  • BigOnYa @ BigOnYa:
    I've been playing fallout4 all day, I went into a elevator and it kept going, never stopped, waited 5 minutes, must of been a bug. How bout you, whatcha do today?
    +1
  • MysticStarlight @ MysticStarlight:
    I'm wondering why a stray tuxedo cat has a cloudy eye
  • MysticStarlight @ MysticStarlight:
    I've been playing TOTK all day also
    +1
  • MysticStarlight @ MysticStarlight:
    Oh you reminded me of those elevator nightmares
  • BigOnYa @ BigOnYa:
    Awesome game, fun how they force you to build, but you can build as you want
  • MysticStarlight @ MysticStarlight:
    It is super fun, I actually prefer it over BoTW
    +1
  • BigOnYa @ BigOnYa:
    The guy holding the sign always cracked me up, esp when you fail, and it falls
  • MysticStarlight @ MysticStarlight:
    Ah yes, that guy lol. I still need to find all his signs. The game has a lot to do though so I don't know what to finish first
  • MysticStarlight @ MysticStarlight:
    I'm 120 hours in and am still like 44.4% done
    +1
  • BigOnYa @ BigOnYa:
    Good times. Building is starting to get good around now for you. You making me want to make run thru again.
  • BigOnYa @ BigOnYa:
    Ok good chatting, enjoy your gaming, and avoid the lightning, or put your sword away. Good night.
    Veho @ Veho: https://i.imgur.com/E1U7Nlt.mp4 +1