Jump to content
  • Advertisement
Sign in to follow this  
  • entries
    2
  • comments
    2
  • views
    936

Dystopian Lights: Dev Blog #1

kostile

1405 views

So to start the day I am going to share with you guys how I use touch controls and touch "joysticks" in Dystopian Lights (previously Neon Android) to control movement and crosshair aim. Initially I had a floating joystick system where you would tap and hold in a certain area but the response to that system has been heavily negative, so I have redone the code running the joysticks and with refactoring I have made them static as well as extremely reusable. This code is tested in monogame for android and should work for iOS as well if you are using the mono and the monogame framework. What I wasn't aware of when I wrote my first joysticks, is that monogame has a cool feature for touchlocation IDs that allows for greater control without having to worry about which touch is which, we already know if we assign it an ID on touch. You can view the code and use however you want if you decide you like it.

If you have ever used monogame and you look at the scaling in the draw method, you will notice that I multiply the scale by 0.001f. This is because the Primitives.circle texture has a radius of 500. There may be some other oddities in the code, if you do use it and have any questions, don't hesitate to ask. The code is at the end of the blog.

So this is one of the updates for the game, as well as a proper title. I have been developing the game under a working title "Neon Android" for quite some time but I have always known that this isn't going to fly as the actual title of the game. Dystopian Lights rang a good bell for me when thinking about how I want the game portrayed. For now it sits as a very similar, almost clone of, Geometry Wars. This is intended for art and play style to some degree, but with many varying factors I think the two games will stand far apart from one another once Dystopian Lights is a finished product.

One of the other upcoming changes for the game is the change in the GUI. It has been heavily improved on mobile platforms. Previously the GUI was tiny and fit for a computer, but now it looks okay on Android and you can actually navigate the menus when upgrading your weapons. Also I have changed the buttons for weapon selection to be highlighted when selected so you actually know what's firing without having to pay attention to your projectile.

59f00514f3a89_Capture_2017-10-24-22-24-06.thumb.png.d1ee9c3b7f99641d40cf6210fdc1ba81.png

 

So from here, the plan is to release an update on my website by this Friday, which will include the changes I have showcased here as well as a few other minor changes. Right now the game is only available on Android and is available for download from my website, https://solumgames.com so please head there if you want to check it out. I will have more Dev Blogs in the future and hope to do a minimum of one a week until the end of the year, when I will release it on the Android app market and then see about working for a PC release. The largest problem I have encountered so far while developing this game is the spawning pattern. If anyone has any recommendations for setting up a spawner that gets infinitely more difficult, please feel free to give your input. I have a system right now that works, but its scaling is terrible and it feels like end game within about 5 minutes. There is some obvious tweaking and balancing that I still need to work out as well, so if anyone trys the game and would enjoy something being different, feel free to let me know what I should change.

Some of the ideas I have for the future of the game will be to include a story mode. My thoughts keep going around to scripted spawns, and then some animations with full screen-width chat boxes that show an avatar of the character speaking. There will be at least a few boss fights and some over the top story that would make this game seem like a space opera straight out of the cheesiest movie you have ever seen on the Sci-Fi network. I have also been working out this idea where your player has a capacitor that can only sustain so many weapons for so long. If I do add it, the shot weapon will probably always be available, when you use your missile and laser in tandem with something else, depending on your capacitor recharge rate and max capacitor, you will run out of energy which will cause your capacitor to short and then the only weapon available until it fully recharges will be the shot weapon. Health packs are coming as well. They will be random drops from enemies and they will heal different amounts based on the enemy killed. 

So far I am happy to see that I have about 40 downloads of the game just from my website alone. I have not received any feedback from any users of the software that I don't know, so please if you are downloading it, speak up with any critique or recommendations. I would love to hear, the good, the bad, and the ugly.

 

    public class Joystick
    {
        private Vector2 outerLocation;
        private Vector2 innerLocation;
        private Vector2 direction;
        private Color innerColor = new Color(0.2f, 0.2f, 0.2f, .5f);
        private Color outerColor = new Color(.5f, .5f, .5f, .5f);
        private float innerRadiusRatio;
        private float outerRadius;
        private int touchId;

        public Joystick(Vector2 location, int radius)
        {
            outerLocation = location;
            innerLocation = location;
            outerRadius = radius;
            innerRadiusRatio = 0.3f;
        }

        public Vector2 Direction
        {
            get { return direction; }
        }

        public void Update(TouchCollection touchCollection)
        {
            foreach (TouchLocation tl in touchCollection)
            {
                if (tl.State == TouchLocationState.Pressed)
                {
                    if (AOneMath.Distance(outerLocation.X, tl.Position.X, outerLocation.Y, tl.Position.Y) <= outerRadius)
                    {
                        touchId = tl.Id;
                    }
                }

                if (touchId != tl.Id)
                {
                    continue;
                }

                if (tl.State == TouchLocationState.Moved)
                {
                    float dirX = tl.Position.X - outerLocation.X;
                    float dirY = tl.Position.Y - outerLocation.Y;

                    direction.X = dirX;
                    direction.Y = dirY;
                    direction.Normalize();

                    float length = AOneMath.Distance(tl.Position.X, outerLocation.X, tl.Position.Y, outerLocation.Y);

                    if (length > outerRadius - outerRadius * 0.5f)
                    {
                        length = outerRadius - outerRadius * 0.5f;
                    }

                    innerLocation.X = outerLocation.X + direction.X * length;
                    innerLocation.Y = outerLocation.Y + direction.Y * length;
                }

                if (tl.State == TouchLocationState.Released)
                {
                    innerLocation = outerLocation;
                    direction.X = 0;
                    direction.Y = 0;
                }
            }
        }

        public void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(Primitives.circle, position: Vector2.Subtract(outerLocation, new Vector2(outerRadius / 2, outerRadius / 2)), 
                             scale: new Vector2(outerRadius * 0.001f, outerRadius * 0.001f), 
                             color: innerColor);
            spriteBatch.Draw(Primitives.circle, 
                             position: Vector2.Subtract(innerLocation, new Vector2(outerRadius * innerRadiusRatio / 2, outerRadius * innerRadiusRatio / 2)), 
                             scale: new Vector2(outerRadius * innerRadiusRatio * 0.001f, outerRadius * innerRadiusRatio * 0.001f), 
                             color: outerColor);
        }
    }
 


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Advertisement
  • Blog Entries

  • Similar Content

    • By Nick Griffith
      I'm making a 2d platformer game as a learning experience, and I need a character and some backgrounds.
      The idea is a person on the brink of death "running" through his memories. The background is his memories.
      This game will make minimal revenue, because it'll be a free mobile game.
      I'll give you more details if you respond.
      Thanks.
    • By Vivid3DDev
      FusionCL.Net is a new wrapper around OpenCL for C#(4.7.2) -
      The git is online, and it is working. It's not 100% complete but you can create programs, run kernels, create membuffers and read/write them. It works fine for me on a Nvidia 1060.
      There are two projects on the git repo.
      FusionCLNative.dll - this is a C++ wrapper around opencl, you do not need to use this.
      FusionCL.Net - This is a C# set of classes(Namespace:FusionCL) that internally uses the native dll to create and use the OpenCL library.
      Like i said, not 100% complete, but it is working and usable. Only a small amount of code really, but it works well and I think is very easy to use.
      - So, yeah just a head's up. Free for anyone, please let me know if you run into any issues or have any requests for future commits. Cheers!
      https://github.com/AntDevUnity/FusionCL.NET
       
       
       
    • By LonelyStep
      PROGRESS
      Thought I'd reach out for some feedback on my little project. This is an android two-player game for top-down boxing matches. The core mechanics are all that I have accomplished thus far, later I want to add different configurations for your boxer (special effects, increased health or damage, etc) and maybe even a single player AI to practice against.

      SCREENSHOTS
      #1

      *****************************************************************

      #2
       
      FEEDBACK
      Right now the gameplay feedback I'm looking for is on the fundamental mechanics of the game.

      One area of particular concern is the window of opportunity for a player to block after their opponent has begun a punch. Currently that window is one-tenth of a second, otherwise you will be to late to counter their blow. I want it to be difficult to successfully pull off a block and have it be something that requires real attention to accomplish. I'm wondering though if it isn't too difficult right now, which may encourage mindless button mashing, which is certainly not what I want to condone.

      Another consideration is whether having three main actions (block, attack, charge) provides a good balance. My idea with having three main areas is that your two thumbs will have to leave one section uncovered at all times. This should result in hand movements that telegraph actions to the opponent.

      Aside from these, any other constructive criticism is very welcome.

      LINK
      My game can be found at the Google Play Store here:
      https://play.google.com/apps/testing/com.meatandgrain.PunchABunch

      NOTE There is a known graphics error when performing a special punch. There are no doubt other unknown errors as well.

        Thank you for your time, I hope you'll be able to find some fun in this little game!
    • By ERASERHEAD STUDIO
      A new entry in the devlog for 13 Ronin, a retro 2d samurai fighting game, this time it's about implementing the logic for the computer player.
      Happy coding!
      https://www.eraserheadstudio.com
       
       
    • By horror_man
      Hello, I'm currently searching for a talented and passionate programmer to create a small but great horror game that would take around 3 months to be done.
       
      About the game: The game would be a sci-fi/post-apocalyptic survival horror 3D game with FPS (First person shooter) mechanics and an original setting and story based in a book (which I'm writing) scene, where a group of prisoners are left behind in an abandoned underground facility. It would play similar to Dead Space combined with Penumbra and SCP: Secret Laboratory, with the option of playing solo or multiplayer.
       
      Engine that'd be used to create the game: Unity
       
      About me: I'm a music composer with 4 years of experience and I'm fairly new in this game development world, and I'm currently leading the team that'd be creating this beautiful and horrifying game. I decided that making the book which I'm writing into a game would be really cool, and I got more motivated about doing so some time ago when I got a bunch of expensive Unity assets for a very low price. However, I researched about how to do things right in game development so I reduced the scope of it as much as I could so that's why this game is really based in a scene of the book and not the entire thing (and also that's why it would take 3 months). Also I'm currently learning how to use Unity and how to model things with Blender.
       
      Our team right now consists of: Me (Game Designer, Creator, Music Composer, Writer), 3 3D Modelers, 1 Sound Effect Designer, 1 Concept Artist and 1 Programmer.
       
      Who am I looking for:
      - A programmer that's experienced in C# and with Unity.
       
      Right now the game is very early in its development (GDD is completed and all 3D Items, Music and Sound Effects are completed).
       
      If you are interested in joining, contributing or have questions about the project then let's talk. You can message me in Discord: world_creator#9524
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!