Dystopian Lights: Dev Blog #2

Published November 08, 2017
Advertisement

I am excited to say that I have gotten a bit of work done on Dystopian Lights recently and also excited to see that people are downloading it and trying it out on their android devices. I haven't received any feedback yet, and please don't hesitate to give any critique or suggestions. I am really open to everything as this is my first serious project that I think has any validity of professionalism in it, and I really would like to see it succeed. I do have a few updates for you guys and will have a new version ready for download by this weekend, but here is the new stuff I've been working on.

1. Capacitor

I have enjoyed playing shooter games on mobile devices but many of the free to play or inexpensive ones all do something similar with their weapons schemes. Generally you select a ship and it has specific weapons with it, or you toggle on and off the different weapons you have while only being able to shoot one weapon at a time. Since I am such a fan of the chaos and destruction in these games I was trying to come up with a good way to enable the player to have all weapons active at the same time without it being too overpowered. My solution is a capacitor. Your regenerate energy every second and certain weapons use more energy than others. When your energy is depleted, you can only use your basic shot. With this enhancement to the game, it has given it a new level of customizability and even greater balance. It has also given rise to new ideas that will be implemented before I release the next version which should be before the end of the month. You can still toggle off and on your weapons in order to control your capacitor usage, or you can just watch it drain and toggle off automatically and wait for it to regenerate.

Small disclaimer: The grid is not as detailed in the android version as it appears in this image

blog2picture.thumb.png.9a3d15c4fc31d8dddf531c6ca1ed885e.png

2. Health Packs

One thing that was missing from the game was the ability to heal after you have taken damage. Since there should be ample amounts of chaos, then you should really be able to heal after all the damage that you have taken. Each enemy now has a 10% chance to drop a health pack on death. Another way to heal right now is to level up. When you level up you heal fully. This may change in the future as it does seem a bit overpowered and throws the balance of the game off quite a bit.

3. Balance

I am working on balancing things in the game to make it feel like you get a good amount of time of play before you die and where your skill can extend that time substantially if you are good at dodging and killing things. This is no easy task and I imagine balancing changes will continue from here on out until the full game is released. Some of the changes are the required points you need to level up each time. It's a simple algorithm and can be easily extended to add more balance later if needed. Besides just the points required for leveling be updated, I have also changed around some of the spawning algorithm. Spawning happens in two forms in this game. There are random spawns, and pattern spawns. With the random spawning, a random enemy that falls within the level range of the current players level will spawn at a random location within the bounds of the game and outside of the hit radius of the player. The other form is the patterns. A pattern is randomly selected based on a few conditions and will spawn around the player. Usually it will appear as a circle or triangle. The pattern spawn will be forced every 15 seconds or so, sometimes exceeding the max enemies a player would see at the given level of random enemies, but is still limited. This form still uses the same algorithm for enemy selection, which is something that I need to revisit as the enemy selection favors higher level enemies the higher level the player is and scales at a very unbalanced rate.

Future Updates to Come

Some of the changes I hope to have finished for my update this month will be more upgrades. For one, I will probably make the shot weapon the default weapon, and then the missile and laser will have to be unlocked with points which can be further upgraded. The missiles will have an option to increase amount fired at a time. The laser will have options for increasing damage, length, and capacitor efficiency. The player will have a new upgrade for max capacitor and I will also be making a lot more balancing changes. I would like to start adding sound effects in the game soon and already have a system designed and implemented for sound effects and music. It will add a nice touch and probably make the ambiance of the game a lot better. Another thing I would like to add is some different sprites for certain tiers of weapon upgrades. It looks very static at this moment and if your weapon projectile changes every 3 to 4 points spent, it could add a nice touch. The player ship will also change here in the very near future. One thing that I have been meaning to work on is a turret sprite for each weapon. Right now it only exists for the laser as you can see in the picture above but even then it is not as dynamic as I would like. For instance, with the shot weapon, you might have 5 waves coming and having a single static image might not be the pleasing to look at as it will not match up properly as one would expect. This might mean creating a lot of different images for each different combination of weapon and the count of the projectile that each weapon has but this would add an exponential amount of work to do. In order to minimize this work, I might procedurally generate a turret sprite based on what weapon is active. The system might take some time, but then I would only have to make a few images that are spliced together based on the procedural system rather than creating 500 images for different combinations of weapons and weapon levels.

Some Code:

Something I wanted to share with everyone was the code that I use for my health bar and the capacitor energy bar. With this code you will notice that there are 2 draw methods that are being utilized. That is due to the nature of the game and it's post processing to achieve the glow effect. The PercentBar.Draw() method will draw the darker lines that you see inside of the health and capacitor bars, whereas the background is the DrawPostProcessed. This is probably a poor name for the method as it's not post processing anything, it could be renamed to DrawLines and DrawBackround for a better naming convention but this works for me since I am just trying to distinguish between what is post processed for the glow effects and what is not. The parameters foregroundColor and backgroundColor are optional and will default to green and red, which is what the health bar uses, but you can also make the foreground color anything that you choose as well as the background color. If you give the backgroundColor a 0 alpha value then it will just look like the bar is shrinking if it decreases in size or will look like it is growing if it is increased. This PercentBar class can be used to represent any kind of percentage that you want to display such as health, energy, or even a loading bar.


    public class PercentBar
    {
        private float width;
        private float height;
        private Color backgroundColor;
        private Color foregroundColor;
        private Vector2 location;
        private float percentShown;

        public PercentBar(float width, float height, Vector2 location, Color? foregroundColor = null, Color? backgroundColor = null)
        {
            this.width = width;
            this.height = height;
            this.location = location;
            this.backgroundColor = backgroundColor ?? Color.Red * 0.6f;
            this.foregroundColor = foregroundColor ?? Color.Green * 0.6f;
            percentShown = 1;
        }

        public void updatPercent(float current, float max)
        {
            percentShown = (current / max);
        }

        public void Draw(SpriteBatch spriteBatch)
        {
            float segmentSpacing = 4;
            float segmentWidth = 2;
            float segments = width * (percentShown) / segmentSpacing;

            for (int i = 0; i < segments - 2; i++)
            {
                spriteBatch.Draw(Primitives.line, new Vector2(location.X + (i * segmentSpacing), location.Y), scale: new Vector2(segmentWidth, height), color: foregroundColor);
            }
        }

        public void DrawPostProcessed(SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(Primitives.line, new Vector2(location.X - 5, location.Y - height * 0.25f), color: foregroundColor, scale: new Vector2(width * percentShown, height * 1.45f));
            spriteBatch.Draw(Primitives.line, new Vector2(width * percentShown + (location.X - 5), location.Y - height * 0.25f), color: backgroundColor, scale: new Vector2(Math.Abs(width * percentShown - width), height * 1.45f));
        }

        public float PercentShown
        {
            get { return percentShown; }
            set { percentShown = value; }
        }

        public float Width
        { get {return width; } }

        public Vector2 Location
        { get { return location; } }
    }

 

0 likes 2 comments

Comments

JEJoll

Hey. Just tried the game briefly. Unfortunately, I have a pretty low end device (it's an LG4K), so the game was pretty much unplayable. 

I was seeing framerates under 10 fps consistently. 

Given what I did see, the game looks really cool visually. 

I'd love to hear about how you accomplished the warping of the grid. I really liked that. 

I might give the game another shot on an emulator on my pc or something later. 

Best of luck! 

December 21, 2017 03:37 AM
kostile

Hey sorry for the delayed response. The game does use graphics shaders so it will require a GPU or else I'm not sure if it will run properly. I am optimizing it currently so that lower end devices with a low end GPU can still run it well. I had hoped to have this project finished a while ago, but it seems it just keeps dragging on.

https://gamedevelopment.tutsplus.com/tutorials/make-a-neon-vector-shooter-in-xna-the-warping-grid--gamedev-9904
I use something akin to this for the warp grid. 

May 12, 2018 02:33 AM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement