Jump to content
  • Advertisement

Battletech Developer Journal - 07

Eck

1173 views

I'm Chris Eck, and I'm the tools developer at HBS for the Battletech project. I've recently been given permission to write up articles about some of the things I work on which I hope to post on a semi regular basis. Feel free to ask questions about these posts or give me suggestions for future topics. However, please note I am unable to answer any questions about new/unconfirmed features.

The last few weeks I've been in an unofficial bug fixing contest. A bug fixing contest is a lot like a pie eating contest. The reward for fixing a bug is you get more bugs to fix. >.< I cleaned up some performance fallout, worked on updating region labels, and put some finishing touches on drop pods. Of those, drop pods are the coolest so let's talk about that.

Drop Pods

The Urban environment is a lot more cramped than the open terrain maps of old. Tall skyscrapers sometimes prevent a dropship from coming in to drop off mechs. The dropships are so large that the wings will clip right through the buildings in the flyby animations and that just won't do.

Someone modeled a bomb like drop pod. Someone else modeled the open drop pod. Will worked up a VFX and designed a ParticleSystem that had the flaming Drop Pod slamming into the ground and then kicking up a huge cloud of debris (and built a separate one for each biome). Rob worked on new sound effects. And I wired it all up for the designers and spawn it during the game. 

SpawnMethod.jpg.e0597061a74536ce6dc7b6c4a62946fd.jpg

First, I had to add a new SpawnMethodType so that designers could specify when a lance should spawn with this new animation. When Drop Pods is selected, they need to plummet from the sky during spawn. I instantiate the prefab at the UnitSpawnPoint location and the VFX plays out. Here is the particle system in action.

DropPodVFX.gif.0e8dfac3dd1654be9f6c49652baf05d6.gif

ParticleSystems don't have a method for communicating events so I had to watch the VFX and write down when different things happened (when the pod hits the ground, when a cloud is big enough to hide the mech teleporting in, when the effect was over). After I had numbers in constants for different events, I wrote a Coroutine to wait the appropriate amount of time. A coroutine is like a function that has the ability to pause execution and return control to Unity but then to continue where it left off on the following frame. 

My first test had all the pods landing at the exact same time. I didn't like that so I introduced another constant that would put a delay between each one. I still wasn't satisfied so I added a random delay on top of that. Now there won't be a regular pattern and if two lances spawn drop pods at the same time there will be some variance instead of their units landing in the exact same pattern in the exact same timing. It's very jarring when it happens.

private const float dropPodImpact = 1f;
private const float dropPodSpawnDelay = dropPodImpact + 2f;
public IEnumerator StartDropPodAnimation(float initialDelay, ParticleSystem dropPodVfxPrefab, GameObject dropPodLandedPrefab, Action unitDropPodAnimationComplete, int sequenceGUID)
{
    // Only do work if we actually have a unit to spawn.
    if (HasUnitToSpawn)
    {
        // Wait a random amount of time before starting
        float delay = Random.Range(.5f, 1.75f) + initialDelay;
        yield return new WaitForSeconds(delay);

        // Play the sound effect
        WwiseManager.PostEvent(AudioEventList_play.play_dropPod_projectile, WwiseManager.GlobalAudioObject);

        // And start the VFX
        if (dropPodVfxPrefab != null)
        {
            ParticleSystem instance = Instantiate(dropPodVfxPrefab, transform);
            instance.transform.position = hexPosition;
            instance.Play();
        }
        else
        {
            LogError("Null drop pod animation for this biome.");
        }

        // Wait until the drop pod hits, play the sounds, and kill whoever is standing in the spot
        yield return new WaitForSeconds(dropPodImpact);
        WwiseManager.PostEvent(AudioEventList_play.play_dropPod_impact, WwiseManager.GlobalAudioObject);
        yield return ApplyDropPodDamageToSquashedUnits(sequenceGUID);

        // Wait a bit more and teleport the units in and spawn the landed drop pod.
        yield return new WaitForSeconds(dropPodSpawnDelay);
        TeleportUnitToSpawnPoint(dropPodLandedPrefab);

        // Wait a couple more seconds for the drop pod vfx to finish playing then we can say we're done.
        yield return new WaitForSeconds(2f);
    }

    unitDropPodAnimationComplete();
}

If you aren't familiar with how Coroutines work this might look a little weird with all these yield returns. Basically you're yielding control back to the caller and will continue doing work on future frames. Here's the Coroutine documentation if you're interested in learning more:   https://docs.unity3d.com/Manual/Coroutines.html

While testing, another thing that I noticed is that we bunch our spawn points up but the physical drop pods are pretty big and they overlap each other like so.

TestLevel_DropPods.png.ef3802c55d0f369bf4e8e7b864f6e556.png

To give the designers some in editor indication I added some code to the UnitSpawnPoint "Gizmo" (or in editor widget). Lookup Unity's OnDrawGizmos for more information. It gives you ways to draw things in the editor's scene view.

DropPodGizmo.png.2d6f44ac60c0fa98b5723c466c58233b.png

After stringing everything together, here's what it looks like. (in my super ugly all-flat test level). Also I'm in the editor so pay no attention to the lag spike. *jedi hand wave*

There are definitely some Rule of Cool physics going on here. Any person inside the cockpit of that drop pod animation would be turned into strawberry jam, and the mech would be a mass of twisted metal and myomer. Drop Pods are supposed to split up in the atmosphere and then jump jets and parachutes are supposed to let the mech drift safely down. I brought this up as a concern, but I also said I wouldn't change anything after seeing the drop pod animations in the game. B)

 

New Hatchetman Variant

It was announced that we were releasing a few variants and one of those is a brand new Hatchetman variant. I was tasked with stating it out so I did some research but most of the variants are all way past the 3025 era. I saw the HCT-5K and that sounded pretty interesting so I designed an earlier prototype version the HCT-3K. There was some lore debate on whether or not a Kurita variant would be this far "south" in the periphery so after the forum goers read about the 3X consideration they demanded that we change it. :D In lore the X stands for experimental. But for me it stands for 3 Ecks (Me, my wife, and my daughter). I can't wait for this to ship because I can finally point at something concrete in the game and said I MADE THAT! :D Also, there's a small chance it will get added to Battletech cannon so it's yet another cool thing about #livingthedream.

 

Blood Bowl Update

In more casual news, I've been streaming my Wood Elves and finally won a couple of games. It's vastly different from my typical bashy-ork play style but I feel like I'm learning. The league that I joined TRBBL (Totally Relaxed Blood Bowl League) has a cool bunch of laid back coaches in it. Season 3 will be starting soon and I plan to stream those matches when I play them (roughly every other week). Lately I've been streaming sporadically about once a week. Feel free to come hang out when I do: https://www.twitch.tv/eck314 or you can check out the matches that I upload on Youtube: https://www.youtube.com/watch?v=VQaN12XU5Wg&list=PL2M43bS2cfSMNvtzWDR0DxuQgh0Ky7yrA

If you're interested in playing Blood Bowl 2, there's a big steam sale for all Games Workshop related products. I think Standard Edition costs like $5 and Legendary Edition is around $15 which comes with all the teams. It's a good time to pick it up. https://store.steampowered.com/sub/192166/ 

Links



2 Comments


Recommended Comments

Very glad you put in that randomization code for the drop timing, being able to vary an animation like that to provide a degree of randomness is another excellent touch on an already superb game.

I can see where some might not like the more 40k style drop pods over jet packs and chutes, but these definitely look amazing!!  Maybe down the road for BT 2 they'll let you introduce variable drop types ;)

Congrats on the HCT-3X!!!!  I suppose you better warn your wife that once the BT universe moves up to 3050 and the Clans you will need to have 2 more kids for the HCT-5X :D

Share this comment


Link to comment

Hmmm, maybe we'll get a couple of pets instead. We got it right the first time so no sense in rolling the dice a second and third time. :)

Share this comment


Link to comment

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 horror_man
      Hello, I'm currently searching for additional talented and passionate members for our team that's creating a small horror game.
       
      About the game: The game would be a small 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 more than 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. Also I'm currently learning how to use Unity and learning how to program in C#.
       
      Our team right now consists of: Me (Game Designer, Creator, Music Composer, Writer), 2 3D Modelers, 5 Game Programmers, 1 Sound Effect Designer, 1 3D Animator and 2 2D Artists.
       
      Who am I looking for: We are looking for a talented and passionated 3D Environment Artist that's experienced in the modeling of closed environments and is familiar with the horror and sci-fi genre.
      Right now the game is in mid development and you can see more information about it and follow our progress in our game jolt page here: https://gamejolt.com/games/devilspunishment/391190 . We expect to finish some sort of prototype in 3 months from now.
       
      This is a contract rev-share position
       
      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
    • By INTwindwolf
      THE PROJECT

      INT is a 3D Sci-fi RPG with a strong emphasis on story, role playing, and innovative RPG features such as randomized companions. The focus is on the journey through a war-torn world with fast-paced combat against hordes of enemies. The player must accomplish quests like a traditional RPG, complete objectives, and meet lively crew members who will aid in the player's survival. Throughout the game you can side and complete missions through criminal cartels, and the two major combatants, the UCE and ACP, of the Interstellar Civil War.
      Please note that all of our current positions are remote work. You will not be required to travel.
      For more information about us, follow the links listed below.
      INT Official website
      IndieDB page
      Also follow social media platforms for the latest news regarding our projects.
      Facebook
      Twitter
      CURRENT OPEN POSITIONS
      Website Manager
      3D Character Modeller
      3D Environment Modeller
      3D Animator
      Unity Engine Programmer
      REVENUE-SHARE
      The project is marching increasingly closer to be ready for our crowd-funding campaign. Being an Indie team we do not have the creative restrictions often imposed by publishers or other third parties. We are extremely conscientious of our work and continuously uphold a high level of quality throughout our project.
      We are unable to offer wages or per-item payments at this time. However revenue-sharing from crowd-funding is offered to team members who contribute 15-20 hours per week to company projects, as well as maintain constant communication and adhere to deadlines. Your understanding is dearly appreciated.
      TO APPLY
      Please send your Cover Letter, CV, Portfolio (if applicable), and other relevant documents/information to this email: JohnHR@int-game.net
      Thank you for your time! Please feel free to contact me via the email provided should you have any questions or are interested to apply for this position. We look forward to hearing from you!
      John Shen
      HR Lead
      Starboard Games LLC
    • By DreamcityClass
      Dream City: Classified – "Survival Code" (Proof of Concept Framework)
      Episodic, 3D 3rd Person Co-op, Action Adventure Puzzle Plat-former
      Hey everyone I'm looking for a PART TIME/ HOBBYIST PROGRAMMER with an interest in the "Afropunk" style and culture. He would need a understanding of Unity python and marching cubes, or a willingness to learn it. I'm a character artist/ animator dabbling in coding and while starting to develop this game myself I just realized I don't have the time. I need help. I need a team. Hopefully some what passionate, but any little bit will help. You covering the coding would free me up to do more art, animation and character design, (and find more guys).
       
      The game is a procedural puzzle game, which aims to make all of the 5 (or more) characters on screen use different methods of traversal and fighting styles. The more characters in the party the more complicated the puzzles get. The players need to work together to survive (Dark Souls combat difficulty). There are charts, diagrams, and examples of each with assets I've already created, and a frame work you just need to stitch together. 
       
      But don't fear, this is a "BY THE EPISODE PROJECT", each of which will be individually Kickstarter'd. Once you sign on we will begin to understand one another's work habits, schedules, etc. while we make this FRAMEWORK. The framework is what we CROWD FUND for support to make the first episode.  
       
      If there is anyone out there interested in...
      Bringing more diversity to Indie games Working with an unique horror adventure world (World Anvil WIP) Working with an committed artist (who understands coding) and a remote growing team Developing a tight development plan, with passive income contracts: Patreon, product sales, (micros) and of course Revenue sharing Interested in working on a co-op TRINE ~like game mixed with DARK SOULS Willing to grow with this me/(us) as this company takes off.  
      Lets make a dream worth dreaming. 
       
      (Contact with questions)


    • By RoKabium Games
      Metis enemies – "Creeble" is the only creature on Metis that can crawl on the walls and it spins sticky webs that the Alien can get stuck in.
  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!