Captain PlaneEd

Discussion in 'Utilities' started by Clownacy, Apr 1, 2016.

  1. Clownacy

    Clownacy Retired Staff lolololo Member

    Joined:
    Aug 15, 2014
    Messages:
    1,020
    Old April Fools' post:
    Greetings. I am here today to address a matter of utmost importance.

    For decades, the Ed family has enjoyed a glorious reign, ushered into being by our founder, SonED, whose brilliance radiated down onto the groveling masses, bringing us into our golden age. SonED's magnificence remained unsullied, as its great legacy was honoured by its successor, SonED2. When the time came for SonED2 to entrust the crown to SonMapEd, the legatee pursued its dreams of travelling to exotic lands, extending the Ed family's reach. In time, no name would be more known, and more feared, than SonMapEd's. Indeed, it was as if SonED's majesty was lost to the world.

    Alas, SonMapEd met an unfortunate end before its time, and corners of the world remained unenlightened by the Ed family's righteous glow. It was then that PlaneEd headed the Ed name, at a pitifully young age. PlaneEd looked up to its successor, and its heart was set on fully-realising the late master's dream.

    Fate, however, would not be so kind: the tragic death of the heir's sibling, SpecialEd, who was closer to the young heir than anyone else, devastated it, and sent its life in a downwards spiral.

    Deaf to the divine will of SonED, and driven by sorrow, PlaneEd forever tarnished the Ed family name, allowing the unclean to crawl from the filthy corners of the world, and clamber to positions of power. Vermin like SonLVL, Flex, SoniPlane, these lowest of the low took what was rightfully ours, and PlaneEd turned a blind eye to it all.

    But no longer.

    Today, the glorious Ed family makes its grand ret-
    *cough* ...okay, I'll stop.

    [​IMG]

    What is this?
    This is a fancy-pantsy improved version of the original PlaneEd, featuring a port to SDL2, a bugfix here and there, and a disgusting amount of Windows-ification. Hey, the original PlaneEd only seemed to work on Windows, anyway, so nothing of value was really lost.

    Well, what does any of that mean?
    First up, the port from SDL1 to SDL2, along with opening the project up to SDL2's feature pool, also allows the resizing of the window, without me having to implement some kind of software upscaler. This means you can actually see what you're doing. This also lets me use SDL_ShowSimpleMessageBox, which I use to display error messages, instead of immediately quitting and hoping people read the stdout/stderr files.

    The bugfixes I've made are rather minor. First up, using the original PlaneEd, open the Sonic and Miles animated background.txt file in the PlaneEd Projects folder of the S2 Git disasm. You'll notice the gaps in between the repeating 'SONIC's are an odd shade of blue/purple, while, in Captain PlaneEd, it's the same colour as what you'd see in the actual game. This is because PlaneEd stores the palette data in memory as BGR, but one section of code reads it as RGB. I accidentally fixed this when I converted the palette data to RGB while it's being loaded to memory, rather than during tile generation (which, might I add, SDL2 is very picky about). An odd bugfix in the original PlaneEd caused a crash if you tried to copy and paste anything while editing the S1 Git disasm's Title Screen.txt project. Removing this hackish bugfix eliminated that problem, but because the bug it was meant to prevent wasn't documented, I have no idea what side-effects that might have.

    Finally, there's the mess that is the Windows-ification. No longer do you have to drag-and-drop files onto the EXE, or start it with the command prompt, to get it to work. Now, you can simply double click on the program, and be presented with a blank window with a Windows-style menu bar, from which you can select File, Open, and navigate to your projects in a much more natural way. Be aware, not everything has a Windows button for it yet. Heck, the only things the menu bar does at the moment is Open, Save, Close, and Exit. You still have to get used to the Function Keys to do anything practical. There's also a View option, which allows you to select a background colour for the window, so you can see your tiles better, in the event that they happen to blend in with the default background.

    I also replaced the stripped down KENS library with the full-fledged KENSC library, allowing access to Comper(?), Moduled Kosinski(??), and Saxman(???), for all your oddball needs. The mappings can also be in whatever compression you want (except Kid Chameleon), and not just uncompressed and Enigma. Because, you know, people do that.

    This thing should be completely backwards-compatible with regular PlaneEd projects, as much as I would love to introduce a required header, so any old file cannot be accidentally loaded...

    PlaneEd sucks, why would you do this?
    I wanted to learn C++. I've also had a pretty rough time with the SoniPlane editor in the past, so I figured, why not make my own ('own' being in huge quotation marks). I needed something to do for April Fools' anyway.

    Links
    Download
    GitHub source repo
    (This thing should be LGPLv2.1, but PlaneEd's original source never made it too clear)

    Credits
    From the original PlaneEd:
    • qiuu: for writing the original program
    • The KENS library authors: for making KENS available
    • Damian Grove: for the documentation and code of the Kid Chameleon compression format
    • Puto: for consulting on license issues and trying to run it under Mac OS (which sadly failed)
    • the #boom crew: for beta-testing - any bug you encounter is their fault :p
    Captain PlaneEd:
    • flamewing: KENSC library
    • Clownacy: working on the code, when people would rather just complain about it =P

    [​IMG]

    Captain PlaneEd is a modified version of PlaneEd, sporting a basic menu bar on Window, as well as bugfixes and under-the-hood changes such as a rebase from SDL1 to SDL2.

    Download
     
    Last edited: May 11, 2021
  2. โบวี่

    โบวี่ Tsingtao Enjoyer Member

    Joined:
    Dec 27, 2011
    Messages:
    215
    I've been waiting for a thing like this to come out, as PlaneEd was really buggy and froze a lot.
    Good work Clownacy. I can't wait to try it out, and I will soon.
     
  3. Soldaten

    Soldaten The Coilgun Root Admin

    Joined:
    Mar 10, 2016
    Messages:
    268
    Thanks for this man. Toyed around with it yesterday and didn't come across anything unusual. Going to be using this for a current project.
     
  4. TheStoneBanana

    TheStoneBanana banana Member

    Joined:
    Nov 27, 2013
    Messages:
    602
    Location:
    The Milky Way Galaxy
    Maybe I just have a poor taste in tools, but I actually don't mind PlaneEd. It's a tool that gets the job done, and that's really all that matters for me.
     
  5. Clownacy

    Clownacy Retired Staff lolololo Member

    Joined:
    Aug 15, 2014
    Messages:
    1,020
    Call me two-faced, but I prefer PlaneEd, too. I just worded the post the way I did because, A, April Fools' (I did put myself down, too), and, B, it's the majority opinion, it seems. Putting it on a pedestal might have had some odd backlash, if what I've heard from babbling on the IRC is anything to go by.
     
  6. Ayla

    Ayla Sonic Hacking Contest Founder & Commentator Member

    Joined:
    Mar 3, 2008
    Messages:
    256
    Location:
    Portland, OR
    SonED really shows its age. I remember when I bought it from Stealth way back in the day. He said he'd frame the money I sent him as it was the first time he had sold one of his applications. That was over ten years ago and the last release of SonED2 is only a little younger.

    New utilities for this community are badly needed in general, imo. It's good to see people still working on them. =)

    EDIT: Before sounding like an idiot, I'm assuming that the last release of SonED2 is that old. Truthfully, I haven't checked for updates in years as Stealth had said he would email me any new updates and ONE of those updates was actually said (in his own email) to be the final. If there are newer ones, I don't know of them.
     
  7. Clownacy

    Clownacy Retired Staff lolololo Member

    Joined:
    Aug 15, 2014
    Messages:
    1,020
    v1.0.1 is out, to address some working directory and performance issues. The version of the program is now displayed in the window's name, too.
     
  8. Clownacy

    Clownacy Retired Staff lolololo Member

    Joined:
    Aug 15, 2014
    Messages:
    1,020
    v1.1 is out: it mainly fixes bugs, but it also features some rather extensive modifications under the hood:
    • Fixed garbage data that would appear at the sides of the screen after resizing the window
    • Fixed compiling on Linux
    • Ditched the old dirty-rendering system, fixing the bug where 'ghost' tiles would appear after moving the mouse around
    • Converted to hardware-accelerated rendering, replacing the previous software renderer
    • The smoothing filter that is applied to the window when it is resized has been redone entirely, which should make it look better while also using fewer system resources
    • Fixed crash that would occur when doing CTRL+A after previously selecting a region
    In particular, Captain PlaneEd is fully hardware-accelerated now: previously it was software-rendered, and only used the GPU to upscale the final image to fit the resizeable window.

    The reason for the switch to hardware acceleration was so I could ditch the old dirty-rendering system: instead of redrawing the whole screen multiple times a second like a video game, the original PlaneEd would only redraw bits of the screen when you did things like select or draw a tile. Unfortunately, this system had a few holes in it that don't seem possible to fix (namely, moving your mouse out of the window causes a 'ghost' tile to be left on the screen), so I decided to just get rid of it entirely, and hope that an optimised hardware-accelerated renderer would be fast enough that no one would notice any difference. Technically, earlier versions of Captain PlaneEd already drew multiple times a second, which is why it performed so sluggishly compared to vanilla PlaneEd, but now that problem should be gone.
     
    Last edited: May 13, 2021
  9. Clownacy

    Clownacy Retired Staff lolololo Member

    Joined:
    Aug 15, 2014
    Messages:
    1,020
    [​IMG]

    Captain PlaneEd v1.2
    I found myself itching for a fun project to work on, and my mind settled on updating Captain PlaneEd to use Dear ImGui instead of WinAPI. This allows the previously-Windows-only menu bar to work on Linux, macOS, and the BSDs too. Additionally, Linux and BSD users get to enjoy file dialogs.

    This update can be downloaded here.
     
    vladikcomper likes this.