Daily Dev Blog – Update on Battle Bases

It’s been a long while since I updated this so I figure I’ll do just that.  The Multiplayer has been implemented for the most part and I have moved onto working on the Single Player/Campaign mode.  So what are some features I’ve worked on since last time?

  • I’ve refined the Predictive aiming.  AA-Missile Turrets now turn in the direction of the incoming missiles and fire.
  • Added Rotational movement for Gun Turrets as well for firing mechs when they land.
  • Mech Soldiers can now defend the base from enemy Mechs.
  • With the addition of the Campaign Mode, there is also currently 5 missions.  My plan is to have around 25.  Every 5th mission being a harder boss stage.
  • A Save/Load Progress mechanic has been added.  Auto saves if latest mission is completed.
  • Have a workable Computer AI Logic on how they launch missiles and mechs. I will probably altar the logic a bit for each enemy commander you fight against from easiest to hardest to create more nuances.
  • Player and Computer can now rebuild back Mechs.  player can also rebuild back from tagged buildings via shortcuts.
  • Added a way to add pre-built buildings.  This is mainly for the campaign mode where the player/computer starts off with buildings.
  • Computer AI can build buildings based on its current warfunds and on an initial preview I setup in the Unity Editor.  So basically, it won’t randomly build anywhere where it doesn’t make sense.
  • Fiddled around with the Menu/UI for better navigation.
  • Can now bulldoze and clean destroyed areas for a small warfund cost.  Also cannot build on destroyed areas from missiles.
  • Computer also follows the same logic of clearing destroyed areas before building.
  • Further updated Fog of War and how it displays revealed things like destroyed territories/buildings..etc.
  • Lots of bug fixes and probably other features I’m forgetting to add here.

So I would say the majority of major implementations have been added to the game so far.  The only other feature that is missing at the moment is an upgrade system.  I’m still thinking about how to go about this but I do have some ideas.  At the moment, missiles shot at a destinations will destroy a patch in a 3×3 Area.  But I do plan to change this.  Perhaps start where the missile only destroys 1 tile until upgraded.  Choose an upgrade where it destroys in a + or x shape maybe?  the final upgrade will be the 3×3 I think.  it will be similar to an old NES battleship game I played before where you can shoot special missiles.  I also need to think about a mech upgrade system.

So Game Development isn’t all about coding.  There’s so much time that also goes into thinking about mechanics and stuff.  Also, researching and reading up on reviews that this game is based off of takes time.  Like reading Metal Marines reviews and what people have been critical of and their thoughts.  I want to build a better and more improved version of it so I want to cover the downsides of the predecessor.  Also, another reason I started this project was because the PC version I remember so fondly is nearly unplayable currently.  Either I need a virtual machine or I have to play on the browser from this abandonware website where the controls are simply too clunky to enjoy.  And that’s where my initial motivation came from.  This isn’t supposed to be a huge game/project was my initial thought as the mechanics looked simple enough, but as I started building… Game Development is just a grueling process as a Solo Developer due to all the intricacies.

And then I have the art assets which I need to improve on.  I have to work on animations soon for missile trails and explosions.  Mech Soldier turning directions/shooting etc.  Buildings in progress of building and when destroyed.

Well… time to go back to the grind and hope to have major advancements soon! 

Posted in Entries | Leave a comment

Daily Dev Blog – Predictive Aim for my Interceptors!

So I spent today tackling again what I couldn’t do a month or two ago.  Predictive Aiming!  It was time I solved this problem if I wanted to move forward even more with my progress on the game.  And I FINALLY figured it out!  It’s actually not that complicated.  I’ve seen like 1 or 2 tutorials on this subject but they were either not exactly what I was looking for or it was made overly complicated to the point where I couldn’t understand what was going on.

So normally, when the turret shoots a “moving” target, if that target is far away.. chances are that the bullets will miss unless it’s going at lightspeed.  That’s where I had to figure out a way to predict where this moving target was going to move next and for the turret to aim at that position.

To solve this problem, I made some variables that tracked where I believe the target will move to in the next second.  Since the target has a move speed of 2 via the Rigidbody, it’s moving 2 tiles in 1 second.  So say the angle of this Target was 45 degrees.  So the sides would be 1.414 in length while the hypothenuse is 2 since that is 2 tiles diagonally.

What I want from the turret is to not shoot where the Target currently is, but where the target will be that next second where it has moved 2 tiles.  So I draw a triangle from the current turret location and the future position of where the target will be at.  Use the Pythagorean theorem and we’ll get the hypothenuse from the turret to the Target’s future position.

Now I want to know the angle in which my turret will shoot at to hit the target’s future position.  Since I know the opposite and adjacent sides length, I can now get the angle of the turret and the bullet that comes out of it.  Still, even if I know the angle of where to shoot… this angle is basically saying that in 1 second time, it will collide with the target’s future position.  But the Hypothenuse is say… 7.  So if the Bullet is moving at 10 tiles per sec, the Turret doesn’t need that full 1 second to collide.  it will actually shoot too soon, so I will need to adjust the angle some more.

I take the distance which is the hypothenuse and divide that by the speed of the bullet and multiply that with the difference between the current angle and the angle that will hit the target’s future position so that I get the angle of where it would be after .7 seconds.  So the new angle will be more then the current position and less than where angle would be at if it shot too soon.

And that’s basically it!  It works out as you can see from the Clip.  So, I’ll just need to use this same concept for my Interceptors when hitting incoming Missiles.  Cheers!

Posted in Entries | Leave a comment

Daily Dev Blog – Player Chat, Fog of War, etc.

I missed a month of Daily Blogging.  To be honest, I’ve been a bit down on luck with the Job Market.  It’s definitely makes me a bit sad… 

Anyway, I’ve been coding in Unity for awhile and I enjoy it and there’s still so much to learn.  The Software Engineering field is just so vast that I’m a bit overwhelmed with everything out there.  Sure, I can code decently in Unity for 2D games and other projects that I’ve built, but if I were to code in something else outside of Unity, it just feels a bit foreign.  Bootcamp in General Assembly wasn’t hard to pass and get my Certificate, but that’s mostly Web Development which I’m pretty sure I can pick up again if I spend more time with it.  But that’s the thing, there’s never really enough time to learn everything and I really have a strong urge to specialize in Unity 2D games.  Seems like Employers expect one to know everything or maybe I’m just not searching hard enough.

Aside from another project that I have to do some maintenance on from time to time, I’ve been spending the other portion of my free time continuing on Building Battle of Bases (Metal Marines Inspired).  I got some Menus built to get to the gameplay portion which includes the Lobby where players connect through LAN and can chat.  There’s also a grid like preview of the map where the player can choose where to plant their base.  It’s a bit like Battleship where you plant your ships.  So aside from the Test Map, usually a player can place up to 3 Bases.

The next major thing I worked on aside from some UI adjustments have been the Fog of War.  This thing was a major pain to implement and I couldn’t find any perfect tutorial for it.  Although, implementing the Minimap’s Fog of War was a Breeze thanks to James Doyle covering that aspect in his Udemy Roguelike course.  I initially did the method of Spawning a grid of Fog Tiles per grid position.  So with a map size of 65 x 65, the screen ended up having over 4000 Objects.  Did it work?  Sure, but the framerate was horrendous.  Dropped to 20-30 Frames per second.  After a few days of fiddling with that along with trying other methods or solutions to increase the Framerate, I completely scrapped that way of doing it.  

So, I had to make use of the Tilemap somehow but I’m still pretty new to Tilemapping.  I used to actually just drag prefab objects and snap them into the scene but Tilemaps are just so much better for performance.  And it’s supposed to speedup things map/dungeon designing.  But Tilemaps does make Visualizing each tile more difficult as it seems like one Merged Object.  So I can’t click each object individually to check.  And I never understood how one can get properties of each Tile in the Tilemap.  During this road block, I learned much more about how Scriptable Objects work now in Unity.  I also got more familiar with custom classes, structs, a bit on Dictionaries and ways to reference those Tiles which helps with the Visualizing.  I haven’t really had the need to use them much in the past.  It’s still a major pain as opposed to just adding a trigger collider onto an Tile.  But since I can’t find a way to give each tile a unique collider that triggers separately, I had to go back to studying Trigonometry again and make each Fog Tile show (or not) based on the Distance from a structure for instance.  All in all, after much effort, I’m happy with the results as now it performs over 100 Frames faster than the previous method of spawning a few thousand GameObjects.  Also, shooting missiles blackens the terrain.  I just have to draw some Animations now for the Explosion!

Posted in Entries | Leave a comment

Learning Multiplayer and creating Sprite Assets

Been awhile since I updated this Blog. Figured I’ll check in with what I’ve been up to. After the last Blog, I spent about a week learning and getting used to how to use Mirror Networking for Unity. Then I spent some time creating Sprite Assets so that the game actually looks like something lol. 

However, I’ve had a lot of distractions along the way like updating and fixing some bugs on another project I had.  I also created a community of sorts there so it’s something I’d like to keep up to date on.  Furthermore, I simply enjoy Unity C# coding for the most part other then bashing my head against the wall initially learning the Networking part.  But I think I’m fine with that now.

Other distractions involved me working in FedEx for like 2 days until I quit due to the 3 Hour commute and actually being written up for working too slow.  Well, that’s what happens when after I left the Army in 2010 and just focused on drawing and coding all day sitting in a chair.  Obviously, I’m going to be way out of shape. I’m not going to break my body for this job. I’ll pay more in Hospital Bills then what I’ll get in return from FedEx. But props to those who are able to.  It just gives me a new perspective on how I need to try harder with something where I can be utilized for my mind instead of my body.

Another distraction was spending a few days enlightening myself on frauds and scams. There’s just a lot of it nowadays in the Job Market that it’s disgusting.  Fake interviews ate up my time and I’m just annoyed that I could’ve spent that time working more on ‘Battle of Bases’ which will be my temporary name for the game for now I guess.  Maybe I’ll come up with a better one in the future.

I can run on typing a bunch more things but this blog is getting long enough so I’ll just attach a screenshot to show my progress so far.  All the basic Metal Marines mechanics are there, just have to fix some bugs, some syncing, and polishing basically.

Posted in Entries | Leave a comment

Pivoting to a Metal Marine Inspired Game

Yeah…, drawing all my own cards is way too tedious a task.  From one of the most important lessons I learned from General Assembly, MVP (Minimum Viable Product) was one of those lessons.  So I’ve always had another idea in the back of my mind to tinker around with as a second option and a much more reachable goal in the meantime.  And that idea is an updated version of Metal Marines!  I rather enjoyed this game as a kid and in the 90s and it was one of those memorable games back during Windows 95 even though this game was made for Windows 3.1!  I’ll attach a screenshot and this can be played at https://classicreload.com/win3x-metal-marines.html

The idea came when Battleship was one of the options to select from for my 1st GA project even though I selected Minesweeper instead.  A few of my peers did select Battleship to code and at the time, I’ve always heard of the popular board game but never understood how it was played.  Then I watched a few online videos and it really reminded me of a simplified Metal Marines game.  Metal Marines came after and it maybe was inspired by Battleship but anyway, that’s what I’ve been working on quite recently after scrapping the card game idea.

I understand that it doesn’t look very pretty so far but those are just placeholders that will all get replaced by Pixel Sprites that I’ll draw eventually.  For now, I’m more so focused on the functionality.  You will notice in the video that:

  • When placing a Structure, it snaps and each sprite will be 32 Pixels.
  • After placing a Structure, there will be A Bar that represents the Health.  This will not be visible unless the building is damaged.
  • Building Factories increase the rate at which the structures build and eventually, I’ll probably add a repair function.  Building Energy Plants and Finance Buildings work much the same way as Metal Marines.
  • You will also notice that when placing a Structure, particularly the Mech Building (Light Blue) and Missile Building (Green) that it pops up on the right hand side of the screen too.  That’s basically a shortcut button to Launch the Missile or Mech Soldier.
  • Scrolling has always been kinda janky in the original PC game imo as well as the SNES version which is quite different altogether.  My goal is giving the players many means to Scroll around whether that be using the minimap on the bottom right to target or the shortcut UI buttons on the right.
  • AntiAir Missiles (Orange) you will notice have a Field of Vision in front of it.  This basically detects when a Missile enters it and it will have a % to shoot down that Missile.  AA Missiles also have a cooldown and Normal Missiles will as well when I’m done testing it enough.
  • Mech Soldiers will work similarly but also different in that it will land and do it’s thing which I’ll work on very soon.

And that’s the very basic framework of what I have got so far.  I have plans to make this multiplayer as well and it’ll be good practice I think.  So Stay Tuned!

Posted in Entries | Leave a comment

AI References and Speed Paintings

Had a lot of trial and error basically in the last few days testing out a style of art that would be applicable for a card game.  First off, I can’t have a style that’s too detailed or it would take me too long to create each image and the game would never come out.  It’s important that the art I create looks appealing while also taking me under 2 hours to make.  Well… give or take but I want it roughly to be around that time.  The first day or 2, I had that awful habit of trying to make things way too detailed for me to want to continue any further.  Today, I think I found a good middle ground…

Anyway, here’s a comparison between Stable Diffusion References I used and the Speed painting I did.  I’ll refine it a bit more as well as add some sort of background.  Let me know what you think!

Posted in Entries | Leave a comment

My decision on AI Art for Game Development…

I finished reviewing the updated Unity C# 2D course by Gamedev.tv about a day or 2 ago and have moved onto some segments of the Multiplayer course by them as well.  Things were looking up until I had a meetup.  The meetup was great but I guess I can blame my naivety. I had a Game Dev (Not related to Gamedev.tv) meetup tonight hoping to learn more about the industry.  That meetup had me thinking as I brought up the topic about AI Art.  While we didn’t talk about it too much during that meetup, it did touch upon some topics that got me thinking about the ethical aspects of using AI Art for Commercial Usage.  About how the community in general feel about it.  I started googling the topic afterwards and I can sorta relate as the first time I heard about AI softwares like Midjourney and Stable Diffusion generating Art in minutes, that I was definitely afraid of Job Opportunities being lost.  Since I was in that industry prior to getting into Game Development.

After much thinking about it afterwards, I think I can still utilize AI Art to some degree but more of as a Reference in order to create art images myself and not just have the AI scrap around the Internet for what is essentially a culmination of other artist’s work.  I can see why there is currently a huge debate over copyright issues regarding the usage of it.  I will give myself a few days to dust off my wacom pen and digital paint some card pieces.  See what I can conjure up during that time window.

Also, regarding my past project in Unity where I made the rookie mistake of creating something too large for me to finish, I may continue that in the near future as the meetup group did like the demo version I presented.  A lot has changed in Unity over the past few years and I would have to convert all my sprites to use the Tileset system.  It would probably increase the framerate and tidy up my Hierachy.  Then there’s the new input system and cinemachine camera.  I spent loads of time coding my camera to move how I wanted to as well and now they have something that makes it so much easier!  Yeah… that and tweaking a extremely large portion of code which I’m kinda dreading.  I did put huge amounts of work into it in the past so updating it is gonna take a huge amount of time I feel.

I will post screenshots of that project sometime soon as I feel it’s something that defines me much more than my current Resume or Portfolio from GA can… a lot of ideas, so little time.

Posted in Entries | Leave a comment

AI Art with Stable Diffusion

Outside of fixing my Portfolio and Resume again after General Assembly, I’ve been meaning to get to know what the craze is with AI Art after seeing all these recommended videos on Youtube for the past few months. While I was busy during the bootcamp course, I figured now that I’ve graduated and out, that this would be the best time to uncover the mystery of how these amazing Artworks appear to be generated so effortlessly.

Here are three images generated through some prompts I entered into Stable Diffusion.  I also learned how one can train the AI in particular poses, styles, etc to get it closer to the things we are looking to create.  All around, I’m really impressed with the software and it feels like the ChatGPT of Art.  With how quickly it can generate images, I am getting many ideas about the possibility of creating a card game for example in the future.

Having made the mistake of working on something too big in Unity in the past, I’ll definitely start off with something simple first.  And speaking of Unity, I’m glad the course I purchased years ago has been updated so I’ve been reviewing the lectures these past few days to stay up to date.  My goal is that after I’m done with that which shouldn’t take too much time, I’ll start learning the Multiplayer aspect of Unity.  Multiplayer is something I really wanted to learn for awhile now and I definitely can’t wait to get to that point soon!  I’m planning to have at least some sort of Account Creation System in a few weeks if not sooner.  Once I can understand that aspect, I’ll be able to move onto bigger and better things!

Posted in Entries | Leave a comment

Graduation from GA and onwards…

Feels a little different now having graduated from General Assembly, a Coding Bootcamp. Aside from the daily routine of 9 to 5 classroom days, I feel the world is a lot more different as well compared to how it was just 3-4 months ago before I started the bootcamp. Tech is moving so fast nowadays and I realize how important and critical it is for me to catch up and learn new tools or get left behind.

I’ve been kind of overloaded with information while in GA and I can’t say that I’m completely fluent at everything. Some materials I grasped quicker than others while some still gives me headaches. Still, I feel like I got a great starting point or exposure to everything… at least the Web based part of Programming and Software Development. Is it bad to say that while I had fun in GA learning mostly Web Development, mostly due to the problem solving aspect of coding, that it’s still not exactly what I’m looking for? Probably bad for any Recruiters reading this, but it’s also why I chose to call myself a Game Developer or Software Developer over a Web Developer.

However, it wasn’t all for nothing. Aside from all the Web based tools I got exposed to, I’m particularly happy to have got more fluency in GitHub and popular languages like Python & JavaScript. It’s always great to dabble in other languages outside of my initial language of C# when I first started learning the Unity Game Engine years ago. I don’t think one can go wrong with that. I also even learned what it was like to collaborate with others on projects. Heck, this WordPress Blog was customized with CSS, something I definitely wouldn’t have been able to do prior to my experience in GA.

So why a Blog? Well… I’m very certain I’m a high tier introvert and I felt this would be a nice way to express myself for those who care to read as I’m not the most articulate in person. It’ll also allow readers to get to know a bit more about me and my journey towards my dream and passions.

Posted in Entries | 3 Comments