Making Sil 1.3 for Android

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Shaosil
    Rookie
    • Jun 2018
    • 12

    Making Sil 1.3 for Android

    Hi folks,

    Just FYI, I'm not exactly "new" per se to roguelikes (I've spent some time in this, Nethack, FTL, etc), but I'm by no means good at them. For example, I haven't really got past the 5th depth of any dungeon roguelike that I know of

    However, I do like access to them, namely on my android phone so I can pull it up and play anytime. As some of you may know, Sil 1.1.1 can be currently played on Android via the app "Angband Variants" and setting the plugin to Sil. But of course, it bugs me to play on a version other than the latest and greatest, so, being a software developer myself, I started looking into ways to get Sil 1.3 compiled.

    The BAD news is that I've never even looked at Android development before, and right off the bat I can see the development process is much different than what I'm used to, and I know for sure I'm going to overlook something.

    The GOOD news is that I already have a compiled and mostly working version of Sil 1.3 on my phone. There are some bugs, like savefiles don't seem to be loading properly, and other minor things I want to fix before I "release" it. I downloaded the source code for Angdroid from the Google code repository and just plugged Sil's latest source into it when I figured out how the build worked. If you're interested in the extra nerdy info, I'm using Visual Studio (I know I know, not the usual IDE) and an android Native Activity project since the source is in C, but I also need the Java files from the repository.

    I have no idea how to release anything on Google Play, though I imagine it can't be too difficult, and I imagine there must be some type of licensing info I have to include. Obviously I would release it for free as well, according to the license.

    I don't really have a point to this post other than bringing awareness to my little project, and welcoming any tips or suggestions given my situation. I usually never finish personal projects, but this is something I've been wanting to do for a long time, and since I'm this close already, I can't imagine that I will completely abandon it.

    Thoughts? Does anyone other than me actually want this?

    Edit: It's live, download it from the Play Store here!
    Last edited by Shaosil; July 14, 2018, 03:25.
  • Squid
    Rookie
    • Jul 2018
    • 1

    #2
    I'd love Sil on Android!!

    Comment

    • Shaosil
      Rookie
      • Jun 2018
      • 12

      #3
      Status Update

      I've made progress since my initial post. At first I thought Angband Variants had been removed from the play store, but it appears some people still see it, so perhaps my Android version was upgraded to a version past what it allowed? For now I'll keep going and plan on releasing it when it's stable enough.

      Now for the progress update. Here is a list of the changes I've made from the other app:
      • Upgraded Sil to version 1.3
      • APP BUGFIX: Save games are no longer being corrupted! This was the highest thing to fix on my list. We can't be having saves be corrupted for a game like this. The other app was calling a save function any time the app lost focus, and didn't always detect whether the game was in progress. Sometimes, it would save during the main menu and overwrite the game data. I just improved the in progress logic.
      • APP BUGFIX: The quit button now functions from the main menu.
      • SIL BUGFIX: Playing a game after the tutorial no longer displays a blank message at the top.
      • SIL BUGFIX: Trying to save during the tutorial no longer displays a warning message with -more- cutting out the middle.
      • Added a tab key to the symbols keyboard.
      • Added an options key to the symbols keyboard.
      • The orientation preference now has four options: Sensor (System), Sensor (Forced), Portrait, and Landscape. Sensor (System) will rotate based on the current user rotate system preference, and System (Forced) will rotate based on the sensor, regardless of user preference. The latter was the only sensor setting previously, and it bugged me.
      • The keyboard no longer displays annoying little popup key animations between certain keypresses. I had to hack my way around this one because that animation code is part of Android's functionality for that class.
      • Raised the minimum and target APIs a bit (19 and 26 - KitKat and Oreo). As a result, I had to make sure the newer Android permission system worked and asked the user about permissions when needed.


      Basically, it's probably good enough to go ahead and release on the Play store, and I can if the public demands it. However, I do have a Todo list, and I would like to get another 2-3 things done before committing.

      Todo List:
      • Use the same font as the one on PC. Android is showing '#' for walls, which I think is ugly compared to the solid block that I see on Windows. This one is a little difficult to track down but I'm close.
      • Add a transparency setting for the keyboard, at least in landscape mode.
      • Fix the slain monsters list - currently doesn't open
      • Thinking about adding a single row sliding keyboard, similar to DCSS.
      • Add a way to open the manual from the app - could be embedded, or a link to the website...
      • Fill entire screen with game view so there is no wasted space in portrait mode.
      • Add way to reuse the exact stats from the last character upon a new play. Everything but the skills save currently, so it's probably not difficult.
      • Add a way to pan the view by dragging. This might be harder than it sounds, since Sil isn't structured to let the view be changed if the player isn't in a look-around mode already. I may not actually get to this.
      Last edited by Shaosil; July 1, 2018, 21:55.

      Comment

      • Pete Mack
        Prophet
        • Apr 2007
        • 6883

        #4
        It's still there, from angdroid.org whoever that is.

        Comment

        • Pete Mack
          Prophet
          • Apr 2007
          • 6883

          #5
          Ooh, one more: fit screen correctly in portrait mode. (I am playing Angband, not Sil, but the waste of vertical space is my biggest peeve. )

          Comment

          • Shaosil
            Rookie
            • Jun 2018
            • 12

            #6
            Originally posted by Pete Mack
            It's still there, from angdroid.org whoever that is.
            Oh really? Maybe they have a max SDK version set. I could have had an Android upgrade that went past it. Good to know though!

            Comment

            • Shaosil
              Rookie
              • Jun 2018
              • 12

              #7
              Originally posted by Pete Mack
              Ooh, one more: fit screen correctly in portrait mode. (I am playing Angband, not Sil, but the waste of vertical space is my biggest peeve. )
              I see what you mean. I'll add it to my list

              Comment

              • Nick
                Vanilla maintainer
                • Apr 2007
                • 9634

                #8
                If you could update Angband as a side-effect, that would be awesome
                One for the Dark Lord on his dark throne
                In the Land of Mordor where the Shadows lie.

                Comment

                • Shaosil
                  Rookie
                  • Jun 2018
                  • 12

                  #9
                  Originally posted by Nick
                  If you could update Angband as a side-effect, that would be awesome
                  Not sure what you mean exactly. The Angdroid app?

                  Comment

                  • Nick
                    Vanilla maintainer
                    • Apr 2007
                    • 9634

                    #10
                    Originally posted by Shaosil
                    Not sure what you mean exactly. The Angdroid app?
                    Yep. I'm appointing you the new maintainer of it
                    One for the Dark Lord on his dark throne
                    In the Land of Mordor where the Shadows lie.

                    Comment

                    • Pete Mack
                      Prophet
                      • Apr 2007
                      • 6883

                      #11
                      I made a list a couple days ago, in no particular order, of things I noticed playing on an android phone.


                      It'd be nice to use keys with gaps around them: miskeys in roguelikes can be very bad. Most of the other issues are minor.

                      Comment

                      • Shaosil
                        Rookie
                        • Jun 2018
                        • 12

                        #12
                        Alright, I think Sil is finally in a place good enough to release on the Play Store! It 'seems' stable enough for now. I still may need to update the package name (rather than com.Sil...) but I already registered a Google Developer account or whatever, so I just need to learn how to get stuff on there next.

                        Here is what I've accomplished since my last post:
                        • Added original font. I left the new font alone, because after I painstakingly traced each bitmap character in the original 8x13 font to convert it to vector (android only likes vector fonts), I realized how truly awful it looks on phone screens. However, I did add a font option to preferences if you must have the classic look.
                        • Fixed background colors. This means walls draw as solid blocks (assuming you have the option enabled), highlights work, etc.
                        • Added transparency option for keyboard, along with the option to overlay it on top of the game view. Great for playing in landscape mode, similar to what you can do with DC:SS.
                        • Introduced and then fixed a rather large bug related to the graphics being drawn. Still not sure what causes it, and why it doesn't happen with Angband Variants and DC:SS, since they use nearly identical code. If you pressed keys too fast, the game bitmap could be updated during a draw, causing minor glitches like overlapping or half-blanked-out text. I fixed it by rewriting the draw method to use a queue of characters that were set instead of external draw calls.
                        • Other minor code improvements that shouldn't affect much.


                        Eventually, I would still like to get to most of what I had on my todo list before.
                        • With the introduction of an overlaying keyboard, the 9 "squares" on the screen that are used for finger tap movement don't work when the transparent keyboard is overtop of them. Currently the only way around it is not to use an overlapping keyboard, sorry.
                        • Slain monsters list doesn't appear
                        • Add way to view manual from app, or at least link to it.
                        • Having second thoughts about a single row sliding keyboard. I think the transparent option helps a lot, so it may be more effort than it's worth.
                        • Want a way to copy over ALL settings from last character on a new one
                        • Also having second thoughts about filling the whole screen with the game view. Not even sure if Sil would allow that type of aspect ration, to be honest. Let's hear your thoughts on this!
                        • Probably won't make a way to drag the screen around. I dunno. I'll keep it in my list.


                        Anyway, I'll post another update when I actually have this thing on the Play Store.

                        Comment

                        • Pete Mack
                          Prophet
                          • Apr 2007
                          • 6883

                          #13
                          Does it work fully in portrait mode? And can it change font size in landscape? The main problem with the game is that in each mode it is wasting screen space. In one, because a third of the screen is empty. In the other, because the font is too large.

                          Comment

                          • Shaosil
                            Rookie
                            • Jun 2018
                            • 12

                            #14
                            Originally posted by Pete Mack
                            Does it work fully in portrait mode? And can it change font size in landscape? The main problem with the game is that in each mode it is wasting screen space. In one, because a third of the screen is empty. In the other, because the font is too large.
                            It does work pretty well in portait mode, but you're absolutely right. Sil is by default like 80x25 or something like that. I could mess around with those values and see how it goes, which I may get to eventually. But I did improve the font code a bit - by default you can scale it up and down using the volume buttons, or autosize it to the width or height of your orientation using the pop-up menu. I think that, combined with a translucent keyboard, makes the game more manageable on mobile

                            Comment

                            • fph
                              Veteran
                              • Apr 2009
                              • 1030

                              #15
                              Thanks, great job! I will try it [EDIT: as soon as it's on the Play store --- didn't read that it's not there yet].

                              If you want to make it fit better on a portrait screen without changing the gameplay at all, one possibility could be rotating the map view by 90 degrees, so that the long side of the dungeon matches the long side of the screen.
                              Not sure if it looks good, though, because fonts usually are taller than larger. Just brainstorming...
                              Last edited by fph; July 13, 2018, 08:40.
                              --
                              Dive fast, die young, leave a high-CHA corpse.

                              Comment

                              Working...
                              😀
                              😂
                              🥰
                              😘
                              🤢
                              😎
                              😞
                              😡
                              👍
                              👎