[TOOL] Trajectory - A Trajectile/Reflect Missile Level Viewer (WIP)

Discussion in 'NDS - ROM Hacking and Translations' started by loco365, Jul 27, 2015.

  1. loco365
    OP

    loco365 GBAtemp Guru

    Member
    5,458
    2,674
    Sep 1, 2010
    [​IMG]
    Trajectory - A Trajectile/Reflect Missile Level Viewer
    WIP Source Code (Without documentation)

    So I finally managed to dump a copy of the game for some research late last week, with the help of @einstein95, and I've been delving into the various files that the game has. What got my attention, though, is that there's 230 levels in the game, but there's approximately 310 level files! While I did want to document this game for TCRF, it'd take me forever to go through all the level files and try deciphering them by hand or doing file replaces to view them in-game. I took a few minutes to peek at a level file, and it didn't take me long to figure out how the level files worked. However, I didn't want to compare everything at a hex level, it'd take far too long!

    So I cracked open Visual Studio Community and started writing some quick code. I quickly ran into a problem: The vshost file didn't like debugging properly and randomly crashed, rendering debugging next to impossible. So a quick port to C# 2010 (Which took about 15 minutes), and we were back in business. Within a day, this was the first sizeable prototype:

    Warning: Spoilers inside!

    It was really plain. I mean, it was just a simple datagridview and it wasn't particularly helpful. It did display the data, but it wasn't really, uh, user friendly. What it needed was some graphics. The next morning, I deleted the datagridview and started playing around with the code, as well as some ripped tiles from the ROM (thanks again @einstein95). I ran it, and it failed. But after looking at my code, whoopsies it was inside the wrong set of curly braces. After moving it out to where it needed to be...

    Warning: Spoilers inside!

    We had a visual version! Granted it was missing a lot of tiles, but that was easily rectified. Fast forward a day, and we were on a roll:

    Warning: Spoilers inside!

    Then, fast forward again to this morning, and after doing some further analysis, I discovered this:

    Warning: Spoilers inside!

    So, what exactly is this program? Well, it's a first of its kind. No other DSiWare applications have any kind of viewers or editors for their levels/maps. Right now, this is purely a viewer as for my research purposes, but I do plan to, in the beginning of August sometime when I finish developing this application, make this open-sourced so anyone can look at the code, and perhaps even turn my viewer and notes into a level editor. Along with the source being released I will also release my documentation on the level format that I've mustered up so far.

    With the recent advents in the DSi and 3DS hacking communities, it shouldn't be difficult to allow users to make custom levels for this game. My wishes are that people buy the game (It's 500 DSi points, or $4.99 + tax, it's really cheap but a lot of fun), dump it, edit it with a revised version of my application by someone else, and they can share their levels with the world, and perhaps come up with some fiendish levels of their own for people to try and solve. It seems that this is generating some positive acclaim, so I thought I'd move this to its own thread to allow people to discuss this game, and what could be possible for custom levels in Trajectile/Reflect Missile.

    As well, I'd like to point out that as of today, development is on hold until I update to Windows 10 on Wednesday. I have made a 1:1 backup of my hard drive as I intend to wipe the data after I install WinX, so I don't want to start coding more features in, only to lose it when I update and have to revert back to an earlier version that's in my backup.

    I'd also like to provide some credits:
    -einstein95 for helping with getting the graphics to rip. Tinke doesn't handle them natively, so you have to work a little magic with the application to view the graphics.
    -Martin Koth for No$GBA and the recent advent into DSi emulation. That made it really helpful with getting this project started.
    -The supportive members of GBAtemp that liked my posts regarding this program as I started developing it

    If you have any questions on Trajectory, feel free to ask. I could provide a beta today, but I'm still missing a few tile bytes (4 to be exact), and I need to rip six missing tiles still and edit them accordingly. It currently supports all levels that are in the ROM (Including the early level formats still present in the ROM), and it also supports saving the level image to your computer, as well as copying the image directly to your clipboard in case you want to upload it to a photo host, such as Imgur.
     
    Last edited by loco365, Jul 27, 2015
  2. loco365
    OP

    loco365 GBAtemp Guru

    Member
    5,458
    2,674
    Sep 1, 2010
    I decided to create a new repo on Github today for the application, so if you'd like to preview the latest version, feel free:

    https://github.com/TeamFail/Trajectory/tree/master

    DO NOTE that it is currently in a beta phase and is unfinished. I still have other things to do with this, but I wanted to put it on Github so I can continue working on this while waiting for the Windows 10 update and just push changes as things happen. Most of these are mentioned either in the comments of the application's source, or in the readme.

    TODO LIST:
    1. Finish gathering the remaining tiles that are needed
    2. Get the remaining hex equivalents for four tiles
    3. Implement a way to read the missile data
    4. Convert the external resources to internal resources
    5. Code cleanup (I may need an old priest and a young priest)
     
    Last edited by loco365, Jul 28, 2015
    I pwned U! likes this.
  3. Flame

    Flame Me > You

    Member
    3,866
    5,024
    Jul 15, 2008
    So is this like some sort of emulator?
     
  4. loco365
    OP

    loco365 GBAtemp Guru

    Member
    5,458
    2,674
    Sep 1, 2010
    Nah, it's just a viewer to view the layout of a level file ripped from the ROM.
     
    Flame likes this.
  5. I pwned U!

    I pwned U! GBAtemp Advanced Fan

    Member
    833
    1,117
    Jun 14, 2013
    United States
    Sorry for the bump, but now that unsigned DSiWare can be run on a 3DS, are there any plans to continue this project and eventually have level editing implemented?
     
    Pablitox likes this.
  6. loco365
    OP

    loco365 GBAtemp Guru

    Member
    5,458
    2,674
    Sep 1, 2010
    The reason I don't have level editing implemented is because I'm not sure how to go about making an interface to allow for such. The hex format behind it is dead simple though. I should perhaps release my study notes, it doesn't take long before you can very easily hex edit the level files.
     
    I pwned U! likes this.