Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Games [WIP] Astralojia 2.5D Turn Based Battle System Development Log

Discussion in 'Works In Progress - Archive' started by astracat111, Jun 27, 2018.

  1. astracat111

    astracat111

    Joined:
    Sep 21, 2016
    Posts:
    725
    Astralojia: Turn Based Battle System Development Log

    http://www.astralojiagame.com

    Battle Module Current Todo List

    1) First Character Turn - COMPLETED
    2) Far Attacks/Projectiles - COMPLETED
    3) Status Effects - COMPLETED
    4) AI - COMPLETED
    5) Win Conditions - COMPLETED
    6) Implement Scripts SKIPPED FOR NOW
    7) Hook Up To Rest Of Game COMPLETED

    Current Estimate: 0 Hours Left
    Estimated Date of Completion: August 1st, 2018
    Actual Date of Completion: August 5th, 2018

    Updated: 7/27/2018 9:00PM
    6577 Lines, 7 Scripts, 40 Days, 206 out of projected 200 Hours COMPLETED

     
    Last edited: Aug 6, 2018
    CharisVik and Neviah like this.
  2. deneme09

    deneme09

    Joined:
    Feb 26, 2016
    Posts:
    19
    Interesting. Graphics are very nice, but you can remove the carpet in the library. I watched your video.. Game is very good for VR.

    I have 2 questions :)

    Do you release any mobile build?
    Do you add any other languages like Russian, German, Turkish, Spanish..?

    BTW, can you comment about my project, https://forum.unity.com/threads/hit...mi-dynamic-cover-clothing-minimap-etc.537878/
    English isn't my native language, so I can make wrongs. I'm sorry.
     
    astracat111 likes this.
  3. astracat111

    astracat111

    Joined:
    Sep 21, 2016
    Posts:
    725
    @deneme09

    Yeah, no problem will do we can do a comment trade.

    I've built the game to be compatible with android, which mostly just requires that you keep your draw calls low, you don't use dynamic lighting or use unlit textures, and you make sure that your save files are located in 'Application.persistentDataPath'. I think it's destined eventually for mobile platforms given the look of the visuals.

    By early next year I would really like to release the game for PC only and in english to start. If it bodes well with people, gets a positive reception and if it over the next 6 months can gain a following enough to merit it, I would move on to what platforms it would be easily port-able too.

    Every decision I make is based around tiptoe-ing around the fact that I am one person right now and I'm not superman or anything. I can't release in another language or on other systems unless it brings in enough income to actually pay out to have it ported, so there's no telling right now whether it will be at all. I guess it all depends on it being a really good game and having good marketing.

    Other than the North American markets, I would actually be aiming for the Asia markets as I believe it would do best there, being modeled after traditional JRPGs.

    I've left both a comment on your game's thread and a comment on your Youtube about the Hitman-style stealth project.
     
    deneme09 likes this.
  4. deneme09

    deneme09

    Joined:
    Feb 26, 2016
    Posts:
    19
    Thank you very much for detailed answers and comment. You're absolutely right, I hope you can release the game without any problem. I want to see the game on the Steam. I'll buy, probably.

    I also listen your soundtrack on Youtube. They are really awesome musics.
     
  5. astracat111

    astracat111

    Joined:
    Sep 21, 2016
    Posts:
    725
    @deneme09 Thanks, we'll see where it goes. The core of the game is the battle system, and I'm gonna be uploading progress soon.
     
    CharisVik and deneme09 like this.
  6. astracat111

    astracat111

    Joined:
    Sep 21, 2016
    Posts:
    725
    Today I worked on laying out the menus and just generally hooking up all of the data. I've recorded a Youtube video of my current progress. There's a lot more to this kind of thing than meets the eye:

     
    CharisVik likes this.
  7. astracat111

    astracat111

    Joined:
    Sep 21, 2016
    Posts:
    725
    I've added stretch goals above, my current todo list for the month of July is set up. Here is day 2's progress of creating the battle system. I've added in ATB time and have the party member's ATB bars charging accordingly. The Opponents also have ATB time as well and theres charges off screen.

     
    CharisVik likes this.
  8. CharisVik

    CharisVik

    Joined:
    Feb 18, 2018
    Posts:
    77
    2D with a 3D is really cool idea, it reminds me of paper mario (i dont know if u know that game).

    Hope your best m8,it seems you know what you are doing and are well prepared. Having a todo list is very important and shows how serious you are to finish the project.

    Rpg are what i play mostly so if all goes well you have your first buyer here :D
     
    astracat111 likes this.
  9. astracat111

    astracat111

    Joined:
    Sep 21, 2016
    Posts:
    725
    @CharisVik Nice, thanks. I want to go for something kind of like Project Octopath Traveler.

    I hope it inspires people to keep on going on their dream projects. I've been programming for 10 years off and on but for 2 1/2 years full time and I'm juuuust about starting I think to get maybe to that intermediate level of C#.

    I know that a lot of people would encourage to start with a battle system prototype first and foremost, but I will tell you that if I hadn't gone and worked on the rpg database module first I wouldn't have been able to encapsulate classes in a way which makes it easier for the system to scale. I'm noticing my older mistakes now and understanding how C# works a lot more intuitively.

    Here's my update for day 3:
     
    Last edited: Jun 29, 2018
    CharisVik likes this.
  10. astracat111

    astracat111

    Joined:
    Sep 21, 2016
    Posts:
    725
    For day 4 I've been focusing on getting selectors working. Selectors will activate and deactivate above the character's heads based on what type of ability you're using. There's selecting one, a handful or a random selection (where it blinks on and off randomly like in FF7) before you go ahead and use your ability.

    You also can through this video get a look at the rpg database module and how the data that the battle module is drawing from comes from what it edits and saves:



    P.S - I've re-worked the thread to look more organized. I've recently created a todo list to finish what I hope will be the first beta test of the system. I project it to take 3 months if I can keep getting 120+ hours of work in each month.
     
    Last edited: Jun 30, 2018
  11. astracat111

    astracat111

    Joined:
    Sep 21, 2016
    Posts:
    725
    Today it was all about completing the loop between the first action window, the second action window, then the select target state, going back and forth without any hiccups. Here's a test:

     
  12. astracat111

    astracat111

    Joined:
    Sep 21, 2016
    Posts:
    725
    For today, day 7, I've now made it so that the character will move in front of their target.

    What I need to do next is to have the dash battle animation state activate instead of the weaker field run animation state. I don't use Unity's animation system at all, but rather have programmed a custom state machine for 2D animations.

     
  13. astracat111

    astracat111

    Joined:
    Sep 21, 2016
    Posts:
    725
    For day 7 I've got the selected party member running up to it's target for a close range attack ready to strike, then playing it's appropriate animation move state found within it's ability:

     
  14. astracat111

    astracat111

    Joined:
    Sep 21, 2016
    Posts:
    725
    Today I realized that I needed to have my particle fx set up. I've got the character running up to his/her opponent and punching, but since there's limited animation the particle fx will be a deal breaker. Most of the animation in the game will be within the particle fx.

    I'm using three different asset store libraries for the vfx. I'm using Pixel Arsenal, Stylized Melee Pack 1 and Pixel Weather FX:

     
  15. astracat111

    astracat111

    Joined:
    Sep 21, 2016
    Posts:
    725
    It might not look like much, but I've gotten instantiation working at ....KIND of the correct place for the party member. This allows me to just choose a file from the rpg database for the ability within the resources folder in order to instantiate whatever prefab is needed for that ability. In other words, quickly switching between graphics by just a selection of a file:

     
  16. astracat111

    astracat111

    Joined:
    Sep 21, 2016
    Posts:
    725
    For day 10 I worked on developing a skill bar system. This will hopefully work to take away all of that boredom associated with just hitting the 'attack attack attack' button.

    There will be three kinds of skill bars in the game. The first is the power bar, usually for hand to hand combat. You need to score at least an 80/100 to successful land a hit on your opponent with this one.

    The next is the aiming bar or agility bar, which will pertain to throwing projectiles like fireballs, windballs etc... You need to hit the needle in the center for this bar to be a success.

    And the next will be the defense or dodge bar. If you can successfully pull this one off, your character will dodge your opponents attack completely. The only problem is that this bar will be the hardest by far, with a 5% chance of success.

    The tougher an opponent you're against, the tougher the bars turn out to be. If you are low lvled and trying to dodge a high lvl opponent, you're not gonna have an easy time with it. If your character is lvled and adept at hand to hand combat, your skill bars will be easier when using hand to hand combat.

    Here's an early prototype of the skill bar in use. I need to add another mode or two before I can proceed to add it into the game:



    After this it's on to damage calculations.
     
  17. astracat111

    astracat111

    Joined:
    Sep 21, 2016
    Posts:
    725
    For day 11 I've been working on the mechanics of skill bars. I'm adding skill bars as I believe that these days something more has to be added to the traditional turn based jrpg system.

    There are different settings for what kind of ability you use, and offense vs defense stats effect how difficult it is to get through a bar. If you don't get a success on an ability bar, you never hit. I want it to feel almost like a baseball simulation, so I have different kinds of 'pitches' so to speak, from just a regular fastball to what I call a slider, which is where the bar is given a liiiiil push and then somewhere randomly gives you a big push.

    The goal is to press the fire button before the arrow stops. Here's an example:

     
  18. astracat111

    astracat111

    Joined:
    Sep 21, 2016
    Posts:
    725
    For day 15 I've been implementing skill bars.

    There are a few aspects to them which make them a little more challenging than simply instantiating a bar. Skill bars have a difficulty level, different modes that throw you off from getting a passing score, and a passing score. Every one of these changes based on the attackers stats vs the defenders stats. There are 5 stats in all, so I'm using 1 less stat that DnD or Final Fantasy.

    Here's the early version of heading up to attack someone and having a skill bar show up:

     
  19. astracat111

    astracat111

    Joined:
    Sep 21, 2016
    Posts:
    725
    I could only really get to work on the project today as I'm currently moving out, but today I could get a few hours in.

    Everything is set up and ready to go as far as attack impact and instantiating the damage numbers. There's a lot more that needed to be thought out than just 'punch takes 25 damage'. There are the factors such as:

    - Did this attack cause a hit, block or miss?
    - Is this ability used on 1 opponent, all opponents, 1 ally, all allies or everybody?
    - Is this ability close or far range?

    I tried to keep the factors to the absolute minimum here, but since it's an RPG they are boldly there.

    So for a turn based RPG you have first the roll for whether you hit or not, then the roll for damage. I tried to simplify everything by just having a modifier for both determining hits and damage. Say you have STR, DEX, INT right? The modifier will work like this:

    (offSTR * 7f) * 0.01f - (defDEX * 4f) * 0.01f

    Then take that modifier and add 1.00f to it.

    If it hits. You run through all these checks and you end up with some number like '2.35' for example. This is your multiplier. You just multiply base damage of the ability by that number.

    If your opponent is much higher lvl than you, your modifier might be something like 0.30 or something, which would decrease your damage. Of course, you need to actually hit with the technique first.

    For today I worked on determining a hit percentage based on how badly you fail the skill bars to determine if your opponent either ends up dodging or blocking your attack. If your opponent dodges your attack it's way worse than blocking your attack, as most abilities take up both white magic and mana, and once your mana is depleted it's game over, so attacking in and of itself is risky business, which is why I'm implementing a [very difficult to make sure it's not OP] defend feature.

    This is what I've been working on for the last three days, so this concludes day 18. I've wanted to get this battle system done in it's simplest form by day 60, but of course as life is it looks like weekends are the time I'm mostly gonna be working on it as since I had to come up with a down payment for my new apartment I'm gonna have to work much harder for a few weeks to make up the money.

    So, what am I saying for today? Everything is set up and ready for that final process that should close the performance loop. Once it's closed, the whole process will go a ton faster. To create a turn based jrpg system, the first biggest goal is to get that first turn phase completed. After that you've got that basic backbone down.

    I'm now at 120 hours of the 150 that I first projected, and my new projection of 200. Might it be possible to finish this thing up in 80 hours in it's first draft form? Yes, it's possible I think, due to just finishing up some of the roughest parts like creating a script for menus, damage and hit calculations, fixing the rpg data that wasn't working, and getting the battle states to work on command.

    There's quite a lot to it.

     
    Last edited: Jul 15, 2018
  20. astracat111

    astracat111

    Joined:
    Sep 21, 2016
    Posts:
    725
    Finally, today, I've gotten a character to run up to their opponent(s) and attack. The damage numbers now instantiate only for those who are hit in the attackers performance.

    Next up will be handling blocked shots and dodged shots, then character placement (far or near), then projectiles. Most of the main hurdles at this point in this battle system have now been crossed like animation states:

     
  21. astracat111

    astracat111

    Joined:
    Sep 21, 2016
    Posts:
    725
    For Day 21, I've finally finished the first turn cycle. Next up is to add the 'move' feature, which tactically moves the character from the near to far position, or from the far to near position. Then it's off to projectiles/far range attacks.

     
  22. astracat111

    astracat111

    Joined:
    Sep 21, 2016
    Posts:
    725
    Day 22, and I've just tinkered with all of the battle states. The opponents now dodge, block or take a hit and show it in an animated way.

     
  23. astracat111

    astracat111

    Joined:
    Sep 21, 2016
    Posts:
    725
    So I've updated the todo list with the final stuff to do. I honestly never thought I'd get this far with this game. Maybe it's not optimized code wise, but I just kept grinding at it every day consistently for 2 years in October...I'm hoping I can have a first draft of the first episode of the game by October if I can keep up these on average 30 hour weeks.

    I've just got far/projectile attacks to do, status effects, ai, win conditions and then hooking it up to the rest of the game. It's been an extremely exciting journey to get this far, but there's still a lot of hours to put in.

    I've gotten a lot better over the years of developing at creating time estimations. I work a 35-40 hour a week job in bus driving by day and when I drop the kids off I get to crack out my laptop on the bus for 2 hours and work, as well as having an in between break of 1 hour...It's tough because I get tired...but this is my dream and I'm gonna do my best to make it work out!

    Almost there...but have to stay vigilant and get those hours in. Above I've put in an estimate of 40 hours to go. This is for a first draft of the battle system. I've decided to finish up a first draft of the entire game at this point and then improve from there. Keep in mind that episode 1 is only meant to be 2 hours in length. With the battle system I'm hoping I can get in a 4 hour average playtime, as if I add in a LITTLE bit of grinding/lvling up that you can do it should put me in at a decent time to sell the game at the $9.99 asking price I want.

    Marketing and advertising.....................that's a tough one. I know what everyone says, market/advertise asap, but I'm thinking of finishing the first draft of the game first so I have a legitimate amount to show first. The rest will just be improvement of what's there.

    In short: 40 hours to go and I'm averaging 30 hour work weeks, hope I can complete this draft of the battle system by August 1st!!
     
  24. astracat111

    astracat111

    Joined:
    Sep 21, 2016
    Posts:
    725
    I'm starting to see the finish line more and more as thrown attacks are now done and status effects are implemented.

    I've never programmed AI, but my plan for it is to set up a class like so:

    Code (CSharp):
    1. public class Battle_AI {
    2.      public enum Intention { Move, UseAbility, Defend }
    3.      public Intention intention;
    4.  
    5. }
    6. public Battle_AI battle_AI = new Battle_AI();
    My guess is that this method will work okay to start. I'm not sure, though.
     
  25. astracat111

    astracat111

    Joined:
    Sep 21, 2016
    Posts:
    725
    All of the features that I thought would take up to 20 hours to implement in their first draft took much less time, and after marathoning the weekend away I've come up with this:



    It uses basic AI. I've gotten projectiles to work as well, implementing the move feature and the defend feature.
     
  26. astracat111

    astracat111

    Joined:
    Sep 21, 2016
    Posts:
    725
    So the final touches are being added to the first draft of the battle system.

    I've been working this weekend on getting lighting to all be on a single panel within a scene, and all within a single class, so that lighting settings can be transferred over from scene to scene fairly easily.



    I'm going to finish this log, marking as completed now. Thanks to anyone who wants to sift through and see the progress.
     
    Last edited: Aug 6, 2018