• Content count

  • Joined

  • Last visited

Community Reputation

102 Neutral

About kostile

  • Rank

Personal Information

  • Interests
  1. How to stay motivated?

    I am in the same boat, I can't stay motivated for long periods to keep working on my game projects. It comes in waves for me. I end up developing my game every day for one or 2 weeks on all of my free time, and then stop for about a month. I drink the whole time, its a wonder my game works at all. I really need to stop writing code under the influence. Someone is going to end up in an accident
  2. NeonAndroid: This is a new game that has been in development for quite some time and is still a WIP. It's initialrelease will be for Android followed by a release for Windows and Linux. It is very similar to GeoWars which I'm sure many are familiar with. To download, head to http://solumgames.com This is currently a demo that I am releasing for testing. It should work on most mid range to high end android devices. Some of the things you can expect when playing is infinite play with dynamically scaling difficulty. Enemies will spawn with increasing difficulty and at an increased rate varying upon your score. There are a few enemies with very different behaviors so that it doesn't feel like you are killing The same things that just look different. The shaders in the game add for a very nice and pleasing to look at neon effect. The game is written in C# and uses monogame. It runs pretty well on two devices that I have tested it on, the LG G6 and the LG Nexus 5. There are multiple weapons to choose from. Right now there is no indicator for which weapon you have activated. Tapping the buttons to the left will activate and deactivate each weapon. You can have all weapons running at the same time right now but with future versions, that will likely change. Each weapon type is upgradeable and more upgrades are coming as well. Currently the laser does not have any upgrades. Your are given two points per level. Some upgrades do cost more than one point. If you upgrade your health you will notice that it does not replenish. The GUI is going have a very different theme to it once I release the full version, the buttons are small and the menu tabs are as well. To upgrade your weapons you will select the tab with the corresponding weapon name, tap the + button distribute points and click apply to confirm. You can select the minus to remove points only if you haven't applied them before. There are quite a few known issues that I am working on, but it is in a very playable state. Some things you should be aware of if you decide to test out the game. The controls work by pressing and holding either side of the screen and using the virtual joysticks that appear where you press. The left side will control movement and the right side will control the crosshair. There are sound effects and music but they are disabled as of right now. You can leave the battlefield, You may encounter lag spikes, The difficulty scales very quickly, The Tutorial button on the main menu will not do anything, there may be other minor or major bugs and if you notice one please don't hesitate to inform me.
  3. Just wanted to update you guys that I was able to get an understanding of using a generic set of parameters as an object. I ended up with this. public struct GenerericShapeAttributes { public int Amount; public float Delay; public float Radius; public Vector2 P1; public Vector2 P2; public bool IsCircle; public bool IsLine; public bool IsRandom; public bool IsSpiral; public int MaxIteration { get { return Amount - 1; } } } I moved the SpawnPolyGroup and SpawnGroup to the static class. They both now return arrays of Vector2 and are called GeneratePolygonVectors and GenerateBasicShapeVectors. The static class is now called ShapeBuilder. Only the GenerateBasicShapeVectors function takes the struct as a parameter and depending on which bool is flagged, it will determine which parameters to pass to which function. This will make it much easier to extend in the future with more patterns and logic. Thanks for the help guys and though I know it may not be perfect or pleasing to everyone, I would agree this structure is better and more pleasing to most people than my previous code. I did fix this issue and it took some thinking to get it done. The Line function wasn't the issue, but it was the parameters being passed to it. It did not return the end point but it will now that I have fixed my other functions that call Line. I also realized that I did not have the SpawnPolyGroup functioning correctly either. It "looked" like it was working as I was testing, but I had to change up the loop and the math to get it to account for the extra points that weren't being assigned in the array which would cause an exception if the array was only large enough to hold the amount of points that were actually supposed to be there. Thanks a lot guys
  4. I am reading what you guys are saying, but I don't see how this makes the code any less complex and more readable. The DirectX example I looked at doesn't really shed any light on this either. As I am searching through it seems like this is going to increase the complexity of my code and make it that much more harder to manage. I might not be fully understanding the concept behind what you guys are talking about. I need a way to pick a function to launch at "random" even when the parameters of each function are not identical, otherwise I will end up with extra params in functions that I don't need as placeholders to fit the Func or Delegate. The lines public static Func<int, int, Vector2, Vector2, Vector2> currentPattern = SpawnPatterns.Line SpawnPolyGroup(gameTime, new Vector2(800, 0), 5, 6); are hard coded, but this is not the way it will remain. I guess I should have said that this code was unfinished but I am looking at a way to randomize the information provided where SpawnPatterns.Line might be SpawnPatterns.Circle at one point, and each int and Vector2 will vary in SpawnPolyGroup to some degree once I have finished it, but I can hardly make out how putting the information to these into a struct will add any cleanliness to the code. Instead of using the Func should I just make a switch/case? EDIT: So I did some more thinking and is this what you guys were explaining to me? I have kept the Circle function in another class for now, just posting it like this right now to make it easier to view. public struct Pattern { public int MaxIterations; public float Radius; public Vector2 P1; public Vector2 P2; } public static Vector2 Circle(Pattern pattern, int currentIteration) { float radians = AOneMath.AngleToRadian(360/ pattern.MaxIterations); float x = (float)Math.Cos(radians * currentIteration); float y = (float)Math.Sin(radians * currentIteration); return new Vector2(pattern.P1.X + (x * pattern.Radius), pattern.P1.Y + (y * pattern.Radius)); }
  5. I will have to look into that. I have never tried to use structs for filling parameters. You wouldnt have an example or be able to elaborate a little? This is a totally new idea to me, and i have never thought about using structs for anything really.
  6. Your explanation of good code outlines it really well for me. I will have to revisit a lot of code with these ideas in mind. I'm well on my way of practicing good habits and i appreciate the feedback
  7. I see what you are saying about having params that aren't used but what would be a clean solution to that? The idea was to have the generic Func that i just call through the SpawnGroup function and i can easily change which function is called, either random, line, or circle, but this does end up having functions that use the paremeters differently as well as not using some at all.
  8. Thanks for the critique, I wasn't aware of the PascalCase for public variables convention but I am trying to follow the "standard" convention so that is good to know. I like the recommendations and will do this and continue to do this in the future. I'm am really glad to hear that this isn't terrible because like I said, it is more recent code that I think looks much better than most of my previous.
  9. I really don't know what is considered better or even good for the most part. My code varies and has evolved over the years as a developer and sometimes I think it looks cleaner, but it is never easy to edit or add something. I fight with myself when writing things like particle engines because I know the purpose of a particle engine is to be quick and efficient, but how much overhead is there really just by giving a reference of an emitter to a particle that is contained within it? Why should I write behaviors for particles as functions that return a value vs just writing a function that returns nothing but handles all of the behavior? I feel like with the latter I end up with code that is easier to modify, but it looks terrible. With the previous I end up with very clean code but is god awful to edit as I have one iteration loop that basically controls everything based on the function it is given. Here is some more recent code I have written that I think would be considered "good" but I am really not sure. The gist of this code is that it will spawn an enemy in a pattern that right now is determined by the writer. I will eventually write functions that determine which shape should be spawned when and where, but right now it just will spawn a shape from the SpawnPolyGroup function with 5 enemies per line and 6 lines in the shape. So it makes a hexagon with 5 enemies per line. My question is, is it better to have the SpawnGroup function control the for loop and return values from each SpawnPatterns (being Vector2 as locations), or would it be better to have each function in the SpawnPatterns class have it's own iterative loop? Also, any other tips on my code for cleanliness and professionalism would be great. I am self taught and never had a tutor, but have read a lot about people being self taught writing code that is unprofessional, but I have never reached out for someone to look at my code aside from a few people so I am hoping that I can learn something to be more professional in the future in hopes to find a paying job as a programmer. public static class Spawner { public static bool isSpawning = false; public static float spawnTimer = 0; public static bool groupSpawning = false; public static Dictionary<Enemy, float> delayedSpawnDict = new Dictionary<Enemy, float>(); public static float timeDelta = 0; //Arguments for currentPattern should be (int maxEnemies, int currentIteration, int radius, Vector2 PatternLocation) public static Func<int, int, Vector2, Vector2, Vector2> currentPattern = SpawnPatterns.Line; public static void Update(GameTime gameTime) { if (!isSpawning) { return; } if (timeDelta > 0) { timeDelta -= gameTime.ElapsedGameTime.Milliseconds; } if (timeDelta <= 0 && delayedSpawnDict.Count() > 0) { KeyValuePair<Enemy, float> pair = delayedSpawnDict.ElementAt(0); Enemies.enemies.Add(pair.Key); pair.Key.Spawn(); timeDelta = pair.Value; delayedSpawnDict.Remove(pair.Key); } //If enemies alive is greater than max enemies then do not spawn if (Enemies.enemies.Count + delayedSpawnDict.Count() >= 1) { return; } //Spawn Individual if (spawnTimer >= 500) { SpawnPolyGroup(gameTime, new Vector2(800, 0), 5, 6); spawnTimer = 0; } spawnTimer += gameTime.ElapsedGameTime.Milliseconds; } public static void SpawnGroup(GameTime gameTime, Vector2 location, Vector2 mod1, int amount = 5, float delay = 100) { for (int i = 0; i < amount; i++) { Vector2 enemyLocation = currentPattern(amount, i, mod1, location); if (enemyLocation == default(Vector2)) { return; } Enemy enemy = new Enemy(15, Assets.hollowCircle, enemyLocation, EnemyUtilities.Follow, 500); if (delay > 0) { delayedSpawnDict.Add(enemy, delay); } else { Enemies.enemies.Add(enemy); } } } public static void SpawnPolyGroup(GameTime gameTime, Vector2 location, int amount = 5, int sides = 5) { float radians = AOneMath.AngleToRadian(360 / sides); float rotation = AOneMath.AngleToRadian(90 * (sides % 2)); for (int i = 0; i < sides; i ++) { int distanceFromCenter = 200; float x1 = location.X + (float)Math.Cos(radians * i + rotation) * distanceFromCenter; float y1 = location.Y + (float)Math.Sin(radians * i + rotation) * distanceFromCenter; Vector2 p1 = new Vector2(x1, y1); float x2 = location.X + (float)Math.Cos(radians * (i + 1) + rotation) * distanceFromCenter; float y2 = location.Y + (float)Math.Sin(radians * (i + 1) + rotation) * distanceFromCenter; Vector2 p2 = new Vector2(x2, y2); SpawnGroup(gameTime, p2, p1, amount); } } } public static class SpawnPatterns { /// <param name="radius">Radius, Best to have X and Y the same</param> /// <param name="patternLocation">Center location of circle</param> /// <returns>Enemy location based on current iteration of max from radius to the patternLocation as the center</returns> public static Vector2 Circle(int max, int current, Vector2 radius, Vector2 patternLocation) { float radians = AOneMath.AngleToRadian(360/max); float x = (float)Math.Cos(radians * current); float y = (float)Math.Sin(radians * current); return new Vector2(patternLocation.X + (x * radius.X), patternLocation.Y + (y * radius.Y)); } /// <param name="pointB">The end point where the last enemy should be in the line</param> /// <param name="pointA">The start point where the first enemy should be in the line</param> /// <returns>Enemy location based on current iteration of max from pointA to pointB</returns> public static Vector2 Line(int max, int current, Vector2 pointA, Vector2 pointB) { float x = MathHelper.Lerp(pointA.X, pointB.X, (float)current / (float)max); float y = MathHelper.Lerp(pointA.Y, pointB.Y, (float)current / (float)max); return new Vector2(x, y); } /// <param name="p1">Top left point of area to spawn randomly</param> /// <param name="p2">Bottom right point of area to spawn randomly</param> public static Vector2 Random(int max, int current, Vector2 p1, Vector2 p2) { float x = AOneMath.random.Next((int)p1.X, (int)p2.X); float y = AOneMath.random.Next((int)p1.Y, (int)p2.Y); return new Vector2(x, y); } }
  10. What engines do you use, and why

    I have been using the xna and more recently the monogame frameworks. These options provide a high level of code for tasks that i just prefer not to deal with such as image loading, sounds and so forth. With these tools it makes it quick to produce your item engine with as much flexibility that you need. Running in dot net gives out the added bonus of being pretty efficient. I'm not a huge fan of all in one editors such as unity. I feel to separated from the code at times and i feel it takes a much larger learning curve to pick up on a full engine rather than brewing something in house where you only have to focus on the pieces you need. That being dai said i do feel that monogame and mono have some draw backs. I would prefer to do all of my development in Linux and release and compile for Android, linux and Windows but I just came get xamarin.android to compile and work with Linux. Other than that i am very happy with it. I'm surprised i dont see more people using monogame. It's probably the easiest and cleanest framework to use when developing 2D games.
  11. I have been using xna and monogame for a few years now and i am curious about this. Are you able to boast any improvements or anything? Monogame is open source and it seems like this is redundant unless there is some major overhead difference that I'm not aware of.