Giter Site home page Giter Site logo

Comments (9)

00-Evan avatar 00-Evan commented on May 9, 2024

I do plan to port Shattered PD to various platforms using the code in pixel-dungeon-gdx, but am working on other updates I want to implement first. Once I am done merging 1.7.2 to my own code (manually merging sucks, but I want to better understand what's changed) and making a few more improvements I may look to port to desktop.

I haven't looked at the GDX wrapper yet but I suspect adding in proper desktop functionality (key bindings, scroll with mousewheel, compatibility bugfixes, save encryption, etc.) might make porting Shattered a bit more tricky than just putting the java code in the wrapper. Still, I'm sure I can reference the work that's already been done for much of that.

Thanks

from shattered-pixel-dungeon.

prurigro avatar prurigro commented on May 9, 2024

The GDX wrapper is actually extremely well done in that respect. An extremely small amount of the original code base had to be changed; a few input classes that I don't believe you've touched except to rename watabou to shatteredpixel were removed and replaced with the GDX ones, which implement all the input junk including key bindings and mousewheel, and I was able to merge the modifications to the main menu, including those to the menu items, without bumping into issues with the key bindings and fullscreen menu items. There are a few areas that have additional code in them and therefore can't be automerged, aside from axing immersive mode, I didn't need to make any "judgement calls".

I personally don't build with save encryption as it's not compatible with old saves (unless I missed something), and it's removed pretty easily with this patch I created from the reverse diff of the commit that added it.

Again, no pressure, and I agree that merging the 1.7.2a code makes sense as a priority over anything like this- thanks for all the continued work you've been doing on this fork!

from shattered-pixel-dungeon.

00-Evan avatar 00-Evan commented on May 9, 2024

I'm very new to working in other people's codebases, merging working with mine, and git/open source in general, so I assumed it would be tricky, thanks for letting me know it might be simpler than I thought.

I still have other stuff I want to get done first, as I said, mainly getting an update with 1.7.2 out on android, but I'll bump up the desktop version on my list of priorities.

Thanks

from shattered-pixel-dungeon.

prurigro avatar prurigro commented on May 9, 2024

@00-Evan: kk, so to make things easier on myself, I renamed all the shatteredpixel stuff back to watabou.pixeldungeon, then merged the diffs between shattered pixeldungeon 1.7.2 (with your objects-thrown-between-floors update) and pixel-dungeon 1.7.2 against pixel-dungeon-gdx 1.7.2, aside from stuff relating to the immersive mode which I'm not sure if libGDX supports, but will likely need to be reimplemented if it does. After all that, there were 4 files that I could have made judgement calls on, but I figured you'd be better being as you're the one who wrote the differences :).

So your 99% of the way port of shattered-pixel-dungeon-gdx is here: https://github.com/prurigro/pixel-dungeon-gdx/commits/shattered-pixel
and the patch containing the changes I didn't merge yet (which are also saved as .rej files in the sources) is here: https://gist.github.com/prurigro/e38ec48236ac43ef2700

If you're curious, the first commit was all the completely clean merging differences: prurigro/pixel-dungeon-gdx@e9e32fc
and all the unclean items in .rej files, which joined the repo

and the second commit is all the .rej items I merged, many of which turned out to be mostly whites-space or formatting differences, though I replaced them either way if there was any question just to be safe: prurigro/pixel-dungeon-gdx@95c6843

If you're able to merge those final 4 files (and I feel like I remember removing the logging stuff from the 1.7.2a stuff after looking and seeing that it was there for the original port to gdx, and thus removed by Arcnor, but you might want to double check)

from shattered-pixel-dungeon.

prurigro avatar prurigro commented on May 9, 2024

@00-Evan: Ahoy there! I ended up finishing the port for you, including renaming everything back to shatteredpixel/shatteredpixeldungeon and ShatteredPixelDungeon, and updating all the GDX stuff to use that naming convention as well (the save folder, for example, is: ~/.shatteredpixel/shattered-pixel-dungeon). Feel free to create shattered-pixel-dungeon-gdx and pull in these two branches:

I uploaded builds of each branch if you want to try them without needing to configure your build environment:
(EDIT by Evan: JARs removed, see my post below)

Things to note are:

  • Like the 1.7.2 GDX update, immersive mode did not come along.
  • The versionCode variable you use to decide whether to display the welcome screen pulls its information from an Android class that isn't available when using GDX, so I've commented out the related code in this commit, and you'll have to decide how to handle this. Also note that the function relating to versionCode was the only part of your PD-classes changes I didn't merge in this commit.
  • To make it easier to synchronize your efforts, hopefully your system has access to bash and sed so you can run this script on patches you create of commits to the shattered-pixel-dungeon project, and it will create a backup of the patch before updating the paths to reflect their locations in GDX (you know that if you add .patch to the end of the URL when viewing a commit on github, it will create a patch from it right? ie: https://github.com/00-Evan/shattered-pixel-dungeon/commit/fa53d788098701593fd72f72c8336be7f52f1e26.patch - also, if you're not aware, the patch feature in *nix and cygwin can't handle patches with binary assets, while git apply file.patch can apply all patches).
  • A few files create issues with patches, but the reasons are often small things, like a gdx library imported somewhere; items/Item.java is a good example of this. The few times I ran into this, it turned out to be fairly easy to just open up the patch and apply that section manually, then strip it out, though I tried comparing the shattered-pixel-dungeon file against the equivalent file in pixel-dungeon-gdx 1.7.2a then applying those differences to the patch once, and that worked pretty nicely too.
  • The save encryption doesn't seem to update old save data, so if you're like me and want to swap your saves between your phone and desktop, you can remove that particular feature with this patch.

EDIT: BTW, I don't know if you use ArchLinux by random chance, but if you do, I have a package for shattered-pixel-dungeon up in the AUR: https://aur.archlinux.org/packages/shattered-pixel-dungeon-git/ (I'll update the location it grabs the source to yours once you've created your own repo)

from shattered-pixel-dungeon.

00-Evan avatar 00-Evan commented on May 9, 2024

Wow, that is absolutely incredible. Sorry for not replying sooner, I was waiting until i could find the time to thank you properly for doing most of the job for me, and now you've gone and done it all!

Thank you so much, honestly I am very new to open source software development and Github, you have done days worth of work for me. The only way I can think to thank you is to give you a credit in the about page and a shoutout when I announce the desktop version on reddit.

With your work expediting the desktop release, I now plan to release the next update (0.2.2) on both desktop and android when it is finished (aiming for early next week), I still have some more content to add and bugs to test for. With that in mind I've edited your post to remove the jar files, I wouldn't want people distributing a pre-release dev build which is likely to be buggy(e.g. right now it saves to the same place as vanilla PD in windows).

However, if you would like, I would have no problem sending you a pre-release version of desktop v0.2.2 this weekend once I've gotten most of the content/polish done =). Thank you so much once again.

Also, as an aside, I agree with you on removing the save encryption, it makes more sense to me to let the user do what they like with the files, but hide them away a bit.

from shattered-pixel-dungeon.

prurigro avatar prurigro commented on May 9, 2024

Hey man, no worries! A shout-out in your announcement would be sweet, but I've been getting tons of entertainment from your hard work for over two months now, and I'm happy I can finally give something back :)

I didn't think porting to GDX would be much work when I suggested it, but I started to remember some of the roadblocks you'd be running into after I read your response, and since I was already familiar with them, I decided to get things started and cover those bases for you. I kept thinking of new roadblocks that were coming up as I'd reach the end of each step though, and eventually I decided I'd just finish the job and get it synced up with master. Learning the code base as you keep it up to date by patching in your commits from upstream should hopefully be pretty easy now, though there are a few things I can think of that might be worth mentioning:

  • Like the convert-upstream-patch.sh script would imply;
    • src/ -> core/src/
    • res/ -> android/res
    • assets -> android/assets
  • PD-classes is included in the project in a folder with that name
  • The version code should be edited in build.gradle and ios/robovm.properties

The jar files were for you to test anyway, and I'll eventually be moving/removing the files, so thanks for removing the links. In respect to the Windows save location, I'd actually noticed that the path was set to Saved Games/ earlier and thought it was a bit strange, but not being a Windows user and since the paths were specified for OSX and Linux, I figured it might be some kind of wizardry that Windows uses where respective programs have their saves differentiated by some other means or something, but I guess it simply means Arcnor probably isn't a Windows user either :) In any case, I just updated Windows save location to to Shattered Pixel Dungeon/ on both branches. You caught the one thing I'd noticed that I wasn't sure about, so hopefully it's the only major issue! I'd definitely help test a pre-release for bugs or anything else you think I should be looking for on that note, though give me a heads up so I don't miss the boat :) you can reach me by email @ [email protected].

BTW, I'm not familiar with the subject at all, but something to wrap the java .jar in a .exe for Windows users seems like it might be a good idea. Launch4j seemed like the least sketchy of the few options I looked at with some brief Googling, and it's open source, which is important when you're creating executables for others to use.

Since you agreed with me on the save encryption issue, I made a (potentially final?) commit to both branches that applies the patch that reverts the commits that implement it (the same as I'd linked before).

[EDIT] (clarified some things and added detail)
Just to make sure you're aware, since you mentioned being new to Github and might not be, if you fork a repo on Github (as opposed to creating a fresh one and merging the contents, which is essentially forking as well, only without using their system), it hides you from the project search results by default and makes it so people need to find you through the forks section of the original repo you forked from for them to even know you exist. This is a good thing for situations like mine, where I've done work with the intention of eventually having it pulled into a different repo, but in cases like your shattered-pixel-dungeon fork, where you're creating an alternative to the original project that exists as a separate entity that happens to share some common elements, it's making one of two equally valuable projects the gateway to the other (and not in an obvious way), simply because it happened to come first (try searching for shattered-pixel-dungeon in Github's project searchbar (on the same page as your news feed) and you'll notice that the only result is this project: https://github.com/MartinMassie/Shattered-Pixel-Dungeon-by-Shattered-Pixel, which is definitely not yours :). To avoid this, I'd recommend creating new github projects, merging your forks into them, and renaming everything (if necessary) so the non-fork repos are what https://github.com/00-Evan/shattered-pixel-dungeon and https://github.com/00-Evan/shattered-pixel-dungeon-gdx point to.

from shattered-pixel-dungeon.

00-Evan avatar 00-Evan commented on May 9, 2024

Thanks to your hard work Shattered PD Desktop v0.2.2 has just released! You can find the reddit thread here: http://www.reddit.com/r/PixelDungeon/comments/2l8cwm/shattered_pixel_dungeon_v022_source_update/

from shattered-pixel-dungeon.

prurigro avatar prurigro commented on May 9, 2024

Thanks for the mention and congrats on the sweet release!

from shattered-pixel-dungeon.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.