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

AC-130 Gunship Simulator: Special Ops Squadron [WIP]

Discussion in 'Works In Progress - Archive' started by Razorwings18, Nov 28, 2014.

  1. Razorwings18

    Razorwings18

    Joined:
    May 8, 2014
    Posts:
    69
    Hi!

    This is my first intended commercial project for Mobile platforms. I'm a solo developer, which means I don't get to discuss if the choices I make during development are the right ones, so I thought I'd publish it here to get some feedback from fellow developers. Do keep in mind this IS a work in progress.


    Description:
    Take control as the Fire Control Officer of an AC-130 Gunship following its story since its inception during the Vietnam war. Provide Close Air Support to your troops on the ground, fly Armed Reconnaissance and obliterate the enemy supply lines, give Landing Zone support for insertions and extractions under fire, protect US bases from enemy attacks and more while avoiding friendly and civilian casualties. Be always on the lookout for AAA and missile threats!

    Features (present and planned):
    - Watch the world through the AC-130’s Infrared sensors, with black-hot or white-hot modes and zoom. Use your radar systems to detect vehicles and large objects.
    - Hundreds of units on the battlefield, each one thinking and acting completely independently
    - It’s a living, breathing world down there. Each soldier has a mission. Desperate fights break out between foes. Friendlies call you for assistance. Civilians run for cover.
    - Artillery, tanks, trucks, APCs, attack ships, helicopters and bombers.
    - Large 1.5 square mile (4 square kilometer) sectors, with hills, jungles, rivers, bridges, buildings, bases and more.
    - Build your crew. Watch as they gain experience and become better at their job, making life easier for you.
    - Get rewarded for your performance with access to cutting-edge equipment and escort aircraft bomb runs, as well as medals and promotions.
    - Listen as your crew comment and react to the battle and keep you informed.
    - Be on your guard! Anti-aircraft guns and missiles are an ever-present danger. Aircraft systems may get damaged, crewmembers killed, or you may even get shot out of the sky.
    - Your weapons overheat, get jammed or destroyed. Use them properly.

    Latest development video:

    Previous videos:



    See more videos in the YouTube channel!

    Website: http://www.byteconveyor.com
    Facebook: https://www.facebook.com/ByteConveyor
    Google+: http://www.google.com/ Byteconveyor
    Twitter: https://twitter.com/ByteConveyor
    YouTube channel: https://www.youtube.com/ByteConveyor/
     
    Last edited: Jul 8, 2015
    cs747 and BigDaz like this.
  2. joni-giuro

    joni-giuro

    Joined:
    Nov 21, 2013
    Posts:
    435
    Woah! Liking it so far, good job
     
    Razorwings18 likes this.
  3. Razorwings18

    Razorwings18

    Joined:
    May 8, 2014
    Posts:
    69
    Since my last post there have been three developments:

    PERFORMANCE
    This was a huge win. With some creative thinking, I was able to more than double performance. That means now I can safely put 200 (and theoretically, a lot more; still testing) ACTIVE independently-thinking AI characters per sector.
    I have an Ainol Novo 10 Hero II tablet with a faulty outdated firmware, which benchmarks under a Samsung Galaxy SII. On it, the game was doing 30FPS average, spiking at 38FPS, but falling to 20FPS when there're lots of explosions (I still have lots of plans for optimization, so no worries for the time being).

    What fighting 200 characters looks like in the game:


    VEHICLE PATHFINDING

    I've implemented vehicle pathfinding. These are its main features:
    - Works on procedural terrain; just initialize and use
    - It a hybrid between the A* algorithm and a waypoint-generating bezier curve for roads. Each node has a cost depending on factors like surface material and steepness.
    - Can navigate from and to any point on the terrain. Since traverse costs are involved, vehicles will try to stick to roads when beneficial.
    - When vehicles DO use roads, they stick to the right lane, so oncoming traffic can move unobstructed.



    VEHICLE TRAFFIC AVOIDANCE
    This caused me a LOT of pain. I thought after pathfinding, this would be the easy part. Man, was I wrong!
    I worked for 2 days, for over 20 hours overall, and the code got so complicated and buggy, I decided to scrap it completely and start over.
    Then, I worked a full 17-hour day (yes, I went to bed at 7AM...). The code was better, but still some bugs, and still felt too complex. So the following day, I reorganized the whole thing into highly specific pinpoint actions, and FINALLY it worked and felt manageable. I'm still fine-tuning it, and probably will do even when I'm way past this task.

    Vehicles are now able to sort out complex traffic jams and safely and seamlessly form convoys.

    The following video is a demonstration, purposely set up to be somewhat chaotic. Trucks start facing random directions and try to form a convoy while following the road, while the tanks disregard road rules and try to blow through the group of trucks.


    If you like the game so far, I would appreciate it if you could vote for it for App of the Year on SlideDB. Do check the other projects as well before you do.
    http://www.slidedb.com/games/ac-130-gunship-simulator-special-ops-squadron
    Thanks!
     
  4. Pulov

    Pulov

    Joined:
    Feb 20, 2010
    Posts:
    824
    Videos look amazing. The thermal shader is perfect. Explosions are a bit too similar. The humans looks perfect. They should pierce with explosions. Pinned
     
    Razorwings18 likes this.
  5. Razorwings18

    Razorwings18

    Joined:
    May 8, 2014
    Posts:
    69
    Thanks for your comments Pulov!

    I spent SO much time with explosions, and at least so far I had to settle for these. They used to be more random, but I always ended up with either too much overdraw, or too much use of space in sprite atlases (thus increasing overall package size and memory usage). Since I'm hoping to have the whole thing work on mid to low range hardware, that is a concern. If I find the time, it's in my list to go back to them.

    Human injuries are something I'm still wondering whether I should or should not do. I was thinking of doing dismemberment and blood spatter (in real life you do see both in FLIRs), but the game's subject is already controversial. While my personal taste is gory fun, I understand that it may alienate some prospective players. It's an ages-old subject.
     
  6. Pulov

    Pulov

    Joined:
    Feb 20, 2010
    Posts:
    824
    Solve simply by adding an option in settings. By default in mild mode.

    The explosions are ok. Dont get me wrong. Will check real vids for more detail coments. Just that they look a bit too similar each other.

    I've a flir just in case you need testing anything. The bad news is that I dont have an airship :p

    Did the bodies that are ragdolled lose they temp value or is it that with the adaptation of the explosion temp the relative temp of the vodies lowers so much that they suddendly become gray... may ve you should keep that a temp avobe lets say, 30, is always bright.

    May be, have to check, there is too much heat transmision to the floor with regular bullets, they feel more like blood splats, do mot remember so mich heatprint on this flir vids, may be you could try fading these quicker and keep the blood and body parts longer.

    Batlefield had a mission similar to this, so dont worry too much on ethics, at least this is a game. People approaching this game will likely be well aware of the background of this.
     
  7. Pulov

    Pulov

    Joined:
    Feb 20, 2010
    Posts:
    824
    Also. In these attacks the drivers get pretty mad (I would too). You might consider adding a bit of chaos on the drivers side when firing them close.

    EDIT
    did not saw the chaos video. Well done.
     
  8. Razorwings18

    Razorwings18

    Joined:
    May 8, 2014
    Posts:
    69
    That's for the better I guess; you'd have me nagging you 24/7 if you did :)

    I reviewed the video and don't really notice any graying. There's actually no change in the gamma at all in the textures after death. They may look a tiny bit darker since their limbs are spread apart when dead; this is because the body has a bright halo around it to simulate the one you see on real FLIR videos. Spread limbs means less overlapping, so less brightness.

    I actually HAD considered having temperature drop after death, but a quick research showed me no such thing happens until after a couple of hours (as a very general rule, 1°C per hour, 2°C on the first).

    From the vids I've seen, this varies a lot. I figure it must have to do with the type of surface it hits. It's very easy to modify really. The option to reduce duration using a slider is already implemented, since these can cause a lot of overdraw.

    Absolutely. You'll also see drivers abandoning their vehicles in some cases.

    "Higher thinking" A.I. is not implemented anywhere yet. That goes for soldiers as well (see how they just keep running straight like cattle when an explosion hits nearby?).
    What you see now are very specific functions that the future "smart" AI will rely on. I.E., right now you've got orders to "GO TO...", "FIRE", "DUCK", etc; the "smart" AI will decide when and how to do these actions.
    I'm particularly eager to get to programming this, but there's still some work to do 'till I get there.

    EDIT: Oh, I think I know what you saw regarding body temperature. Some dead bodies are removed from the scene to save performance once there's a certain amount of corpses laying around. The most "graceful" effect to do so, is to fade them out to transparent. There's a slider where you can control the maximum amount of corpses you want before fade out occurs.
     
    Last edited: Dec 9, 2014
    NickHaldon likes this.
  9. Razorwings18

    Razorwings18

    Joined:
    May 8, 2014
    Posts:
    69
    All vehicles now need crewmembers to work (at least a driver to move, and a gunner to operate the weapon). They also can carry passengers. Each station inside the vehicle has its assigned entry point (door, hatch) that you can see open an close accordingly.
    This system is a "monolithic" component, so it can be added to any object and works by just configuring it. That means I'll be using the same system for ship and aircraft crews as well.

    Video demonstration. The first half is dedicated to boarding, while the second half shows dismounting.
     
  10. Pulov

    Pulov

    Joined:
    Feb 20, 2010
    Posts:
    824
    Looks awesome. Looks awesome even for pc and its a movile game.

    The trucks accel/ deceleration should be smoother.

    Will you release a christmas version with gingels etc while you pierce some badguys? :p
     
  11. Razorwings18

    Razorwings18

    Joined:
    May 8, 2014
    Posts:
    69
    Thanks again for your comments, Pulov!

    Yep, we agree on that. Fixing it is not as straightforward as you'd think, since both acceleration and deceleration are covering for some corners that had to be cut to maximize performance on Mobile. I'll probably get around to it eventually, but since it's non-essential, it's way down on the to-do list.

    I might actually do something along the lines of that goofy video I did for Halloween, but I'm so past due on the deadlines, I'm not sure I'll have the time.
     
  12. Pulov

    Pulov

    Joined:
    Feb 20, 2010
    Posts:
    824
    lol, you skared me the first time. OK, focus on teh product then!. Not a big issue the one of trucks, just keep it for the future!
     
  13. Razorwings18

    Razorwings18

    Joined:
    May 8, 2014
    Posts:
    69
    First of all, I'm happy to announce that the game has been voted as TOP 50 App of 2014 at SlideDB.com . Wheee!!

    With that out of the way...
    Vehicles now have working weapons. These weapons are actually comprised of two components:

    - turret component: This handles the "aiming" part of weapon operation. The component can be assigned separate mesh references for horizontal and vertical aiming. It will move them accordingly so they're facing the objective. It will also calculate the firing solution for moving objects, depending on the muzzle speed of the active weapon.
    Turrets use regular meshes and transform-based motion instead of skinned meshes. I've found even the simplest of skinned meshes are extremely taxing compared to regular meshes. The only downside would be that an extra Draw Call would be issued for complex turret or weapon meshes, which is completely acceptable.

    - weapon component: This is the weapon itself. It references a turret component (above) that will handle its aiming process. For example, a tank can have two weapons: the main cannon, and the coaxial machine gun. Both are mounted on the same turret, so in that case there would be two weapon components (cannon and coax) referencing the same turret component. When either of the weapons becomes activated, it will commandeer the turret.
    This component handles checking for line-of-sight (in case weapons are line-of-sight), firing, re-chambering, reloading, projectile motion towards the target and hit actions (explosion, force application on target, destruction, heath removal, etc).

    This independent two-component approach means that this is all I will need for any kind of weapon for anything. I can attach these to land vehicles, tanks, artillery, boats, helicopters, fixed-wing aircrafts and even human characters, and make any type of weapon or projectile just by modifying parameters.




    Happy new year to all devs!!!

     
  14. Pulov

    Pulov

    Joined:
    Feb 20, 2010
    Posts:
    824
    Looks Great! Dont forget to add some Shilka AA's firing at the plane so that you 've some priority targets because it seems otherwise a sit and masacre game. But I know reading at your description that it is not the plan... just comenting

    Duuuuude that 2015 :))))))))))))))
     
  15. Razorwings18

    Razorwings18

    Joined:
    May 8, 2014
    Posts:
    69
    Hmmm.... you mean like this? :D



    Actually, the Shilka will be one of the more advanced anti-aircraft systems you'll encounter later in the game -since they were only introduced in Vietnam by the end of the war and in limited quantities-.
    There are other, less advanced systems you'll see earlier. Enemy soldiers will also carry SA-7 MANPADS, so if you spot some guy carrying something bulky on his back, you'll want to get him as soon as possible.

    There are a lot of other things that will make the player think and prioritize.

    Troops will have levels of awareness. You will be able to catch them calmly walking until you fire those first shots. Just like in real life, when you do, everyone in the sector will be aware of your presence. Hitting an enemy running/jinking is much harder than hitting someone walking. Also, that's when most anti-aircraft systems will have a much higher chance of detecting you.

    Also, artillery, for example, can be pretty far from where the action is, in an unknown location. So at a certain point, you'll be wondering whether to keep eliminating those waves of enemies attacking a friendly base (attacking in waves combined by artillery / mortar was a real NVA tactic), or divert your attention to locate and disable the cannons.

    I'm also playing with the idea of being able to order friendly troops around, something AC-130 crews did in their role of Forward Air Controllers.
     
  16. Nitrohex

    Nitrohex

    Joined:
    Jan 16, 2013
    Posts:
    58
    All i can say is RESPECT !!!

    As a one man team, this is the best project/game i have seen so far.
    Keep it up.

    BTW did you wrote the shader, or is it an asset?
     
  17. Razorwings18

    Razorwings18

    Joined:
    May 8, 2014
    Posts:
    69
    Thanks Nitrohex!

    The shaders are mostly mine, but they're really extremely basic. They have to be, to keep performance as high as possible.

    You're basically seeing three types of shaders; two of those have two variations each (regular and inverted for BHOT and WHOT modes). All textures are made already in black and white:
    - Terrain: The standard Unity terrain shader. When inverting the colors, the terrain textures are swapped for other (preloaded) textures.
    - Textured shader: Used for houses, props, roads, trees, etc. Uses a texture atlas that is already in black and white.
    -- Inverted textured shader: Same as before, but inverts all colors (using the line "combine one - texture")
    - Vertex shader: Used for vehicles mostly. Vehicles have their "heat signature" vertex-painted in their source 3D model.
    -- Inverted vertex shader: The same, but inverts all colors.
     
  18. Nitrohex

    Nitrohex

    Joined:
    Jan 16, 2013
    Posts:
    58
    Very clever techniques, thank you for sharing.
     
  19. Razorwings18

    Razorwings18

    Joined:
    May 8, 2014
    Posts:
    69
    Today I've officially finished with soldier weapons and their effects (mostly soldier injuries).

    Here's a lengthy video of US soldiers ambushing a platoon of Viet Cong as reinforcements arrive. I couldn't get myself to cut it shorter, since it's got some cool things happening most of the time.


    Since soldier weapon uses the same self-contained component used for vehicle weapons, soldiers can have any type of weapon/s just by changing parameters on each component.


    For the time being, there are two main types of soldiers: the "rifleman" that carries a rifle, and the anti-tank unit, that also carries an anti-tank weapon.
    Different weapons have varying accuracy, damage types (i.e. some are great against vehicles but not so great against personnel, and vice versa), ranges, etc.

    As for injuries, damage received by soldiers varies based on several factors.
    Their stance has a huge impact on the amount of damage taken from a round. A soldier standing upright will receive full damage, while it is diminished for kneeling or prone characters.
    Some soldiers are also equipped with armor, which absorbs a percentage of the damage, but degrades with each hit.

    Injured soldiers walk slower as their health gets worse. You can see critically injured soldiers actually limping slowly.
    For each hit, there's also a chance of a bleeding open wound, that will drain the character's health until it dies.
     
  20. Razorwings18

    Razorwings18

    Joined:
    May 8, 2014
    Posts:
    69
    Finally finished with the Vehicle Destruction system today. It's quite complex: unlike most games, vehicles have many different systems, which have specific effects when they get destroyed.
    Crew is also vulnerable while inside the vehicle, and may get injured or killed even before it's severely damaged.

    The following video is a demonstration of the damage system, applied to the Type 63 tank.



    This is what happens internally during the video:

    - The hit @0:05 destroys the driver's station, killing the driver and forcing the vehicle to stop
    - Next hit destroys the vehicle's left track, immobilizing it
    - Crew starts bailing out @0:08 (you can see the top hatch open though the fire)
    - Hit @0:21 destroys the right track
    - Hit @0:22 is a critical impact on the vehicle's ammunition stores, igniting them and causing high-speed flames to erupt from the sides of the turret. Everyone left inside dies.
    - Extreme pressure inside the vehicle causes a secondary explosion @0:42, detaching the turret and hurling it through the air.

    As with all other scripts, the Vehicle Destruction System is a self-contained component, which can be added to any of the vehicles, and works just by modifying its parameters.
     
  21. Pulov

    Pulov

    Joined:
    Feb 20, 2010
    Posts:
    824
    Dude, awesome!

    That pressure pot effect is a todo list in my tank game!

    Its obvious you've documeted whell :).
     
  22. Bakkernils

    Bakkernils

    Joined:
    Nov 18, 2014
    Posts:
    30
    This looks really good! Can't wait to try it out myself :)
     
  23. Razorwings18

    Razorwings18

    Joined:
    May 8, 2014
    Posts:
    69
    Yeah, I've watched so many violent videos since I started this project, I'm not sure my neighbors are safe anymore. :D

    Thanks! I can't wait to hit pre-alpha so I can get it out there.
     
  24. Razorwings18

    Razorwings18

    Joined:
    May 8, 2014
    Posts:
    69
    I've released a new development video today, part of a series called "Meet & Kill". In these videos, you'll get to know the new units... and immediately see them obliterated.
    This episode shows the different types of Anti Aircraft Artillery (AAA) present in the game: the ZPU-4 4-barrelled 14.5mm, the huge KS-19 100mm, and the fearsome ZSU-23-4 "Shilka" 23mm 4-barrelled self-propelled anti-aircraft gun (SPAAG)
     
  25. unitarian411

    unitarian411

    Joined:
    May 30, 2012
    Posts:
    13
    This looks very good, and you are putting a lot of details in there like the progressive destruction / explosions.
    Also amazing you have this working on a tablet !

    This is not the right thread, but I am wondering whether you would consider writing up a bit about your experiences with shaders (like the FLIR you have) I am working on an automotive sensor simulator and one of the sensors I'd like to emulate is a CMOS infrared camera (not as sophisticated as a true cooled IR camera :)

    And I am thinking to use camera.RenderWithShader or SetReplacementShader (to render a IR image since the usual will be regular visuals) You probably never show regular, always FLIR so those are just your regular not replacement shaders. And how to get per-object or per-material specific parameters or textures for heat for example. Anyway, perhaps you have some comments / suggestions regarding this since you are obviously a very competent developer and the Unity docs on this topic are ... minimal.
     
  26. Razorwings18

    Razorwings18

    Joined:
    May 8, 2014
    Posts:
    69
    Hi unitarian, thank you for your comments!

    How I got the game to look like a FLIR is a question I get asked a lot, so I decided to make a tutorial for it:


    That said, I guess you're going to be disappointed to see there are no real novelty techniques involved; "heat" is mostly just painted black and white from the go.

    In your case, where you probably have an object that has "real" colors, I can think of a couple of simple ways you can switch to an infrared effect:
    1. Vertex paint the heat signature on meshes, and don't use vertex colors on any other shader but the "infrared" ones. Then just switch shaders on materials by code when you have to show IR.
    2. Make a "regular" and a "IR" texture for each material, and swap that when going to IR.

    RenderWithShader is cool, and is pretty much the first thing I tried when I started working on the project. But at least from my somehow limited knowledge of shaders, it's got two drawbacks:
    - Eats more performance than other methods (this is why I discarded it)
    - Unless you're pretty good with shaders, it makes things less flexible

    Hopes you find this helpful.
     
  27. unitarian411

    unitarian411

    Joined:
    May 30, 2012
    Posts:
    13
    Thanks Razor !

    Really appreciate you putting this up, I love learning from the Pro's !

    At first I thought my issue was different than yours. Because you already have all materials/textures/shaders in infrared / monochrome vs. what I would need.
    eg. regular visual RGB AND then a camera w RenderTexture that does IR.

    Manually switching shaders vs. RenderWithShader()

    But listening to your tutorial, I saw you actually do switch shaders, namely between your White Hot and Black Hot modes. Your post and the video suggest it is better to do that by iterating over all the materials and switching out shaders. In your case, you only have a few materials in your whole scene, plus you know the specific shaders you switch to, so that is efficient.

    In the general case, there may be quite a few materials, and different shaders (which have to be remembered somewhere in order to switch back to them), so this could be quite laborious at runtime. I thought that's why RenderWithShader existed (kind of a "temporary" replacement without having to write loops and remember original shaders) I wonder why you observed that it eats more performance...that would be bad wouldn't it :) I have seen the same suggestion (iterate and swap shaders vs RenderWithShader) elsewhere...

    Adding IR texture to an "Extended Standard Shader"

    You are right, I was thinking about having extension of the Standard shader that adds an additional "IR signature" scalar (-1...1 with -1 being full black hot and +1 being full white hot and in between just less contrast) and optional 2D texture (similar to Unity 5 Standard Shader Occlusion parameter which is a float and a 2D texture).

    Then perhaps I should just have a global boolean in that extended Standard shader that would be "RenderIR". I am not familiar enough with shaders yet to know whether such a global could be made available but assume yes it can. Then for the IR camera I just turn that global on before rendering.

    Adding IR texture to a separate script/component

    That assumes everything in the scene could use that shader. Otherwise I guess I have to squirrel away the IR temperature float & texture in some secondary object/script. And the Camera OnRenderImage would have to look for that and pass them somehow on to a special shader that gets swapped in as per above.

    So, clearly I still have some learning curve ahead of me but your tips & video really helps already, thank you for sharing !


    PS:

    - wow, thats a lot of wheelColliders in each Shilka :)
    - I recognize all the vehicle types from my favorite PC flight simulator DCS World ! Except your IR is better... (DCS Targeting Pod IR video)
     
  28. Razorwings18

    Razorwings18

    Joined:
    May 8, 2014
    Posts:
    69
    Thanks! Though I'm ->definitely<- not a pro; not at game development at least.

    I agree; the solution I used is very specific to my case.

    I really can't tell; in the low-end device I used to test it, it just did. May even have been something with the shaders I used to test it.
    I moved away from RenderWithShader fast enough when I found other solutions that worked great for my case, so I'm the first to claim ignorance on its use.
    Besides the performance problem, my other beef with it was its high dependency on shader code to properly tag items you want to influence, which hinders flexibility on both ends (scripting and shaders).

    That sounds like a cool solution. Maybe this'd help:
    http://docs.unity3d.com/ScriptReference/Shader.SetGlobalFloat.html

    In their defense, they surely wanted to avoid performance drops from rendering two cameras. They kind of dropped the ball with the explosion particles across the board, though.
     
  29. nathan91

    nathan91

    Joined:
    Mar 14, 2015
    Posts:
    3
    any oculus rift support?
     
  30. Razorwings18

    Razorwings18

    Joined:
    May 8, 2014
    Posts:
    69
    The game will not have support for Oculus Rift.
     
  31. unitarian411

    unitarian411

    Joined:
    May 30, 2012
    Posts:
    13
    Razor -
    don't want to hijack your thread, but hope a follow up question is ok with you:

    if I had a single "Infrared" or "Night vision" shader, but wanted to get a heat signature texture and/or scalar for each object, how would the shader fetch per-object textures ?

    I would attach a script with something like this to the main camera:

    transform.GetComponent<Camera>().SetReplacementShader( nightvisionShader , null );

    But shader properties like

    Shader"Test/NightVision" {
    Properties {
    _MainTex ("Base (RGB)", 2D) = "white" {}
    _Brightness ("BrightnessAmount", Float ) = 2.0


    mean the texture and brightness scalar are global to the shader not per object. Is there a way to query out from the shader to the object and get a "ShaderParameters" component from which to fetch the texture and brightness or am I not understanding how this works ?

    Again, sorry to have a such a specific question in your thread about your game. But after googling a long time for thermal, IR, nightvision shaders for Unity, your thread and videos contain by far the best quality IR in Unity and explanations, so perhaps others looking for something similar will find this tangent useful.


    EDIT: Upon further search the answer is no: a shader cannot fetch gameobject specific stuff. It runs on the GPU, scripts run on the CPU. So a replacement shader is only really useful if it does not have to do anything object specific. The only other way is to loop and switch materials/shaders on all objects as described earlier. Tedious.
     
    Last edited: Mar 16, 2015
  32. Razorwings18

    Razorwings18

    Joined:
    May 8, 2014
    Posts:
    69
    Ok, but not even Materials' Shaders can get GameObject-specific data, so that can't be a problem. That's just how things work.

    You can't get information into the Shader from a GameObject, but with SetReplacementShader you CAN get information from the original Material for that GameObject.
    You just have to define the same parameters in the Material's Shader and in your replacement Shader, and upon calling SetReplacementShader, the parameters from your Material's Shader will be preserved in the replacement Shader.

    With that, you just set different Materials for objects you want to have rendered differently, which is pretty much what you would always have to do anyways.
     
  33. Razorwings18

    Razorwings18

    Joined:
    May 8, 2014
    Posts:
    69
    I uploaded a new video today showcasing the engagement of a truck convoy escorted by a BTR-60 APC.

    This may be the coolest video I've released to date. Maybe I like it because it kind of puts a lot of the things I've been working on together in one same scene, and makes it seem "alive", rather than just a display of very specific things.
    A lot happens in just a few seconds, and what's even better, some of those things were kind of unexpected.

    The one thing you can see clearly in the video is a GAZ-67 (kind of a soviet-built jeep) rolling over backwards. I wondered why it did, since I could not spot a big explosion nearby.
    Upon closer inspection (and a frame-by-frame, since I thought I was dealing with some kind of weird bug) I discovered you can see the rear truck's fuel tank explode before its cargo does a few seconds later.
    The tank is on the left side of the vehicle, so you can't see it from the angle the camera is in. It's also located below the truck, so its blast would send things with a higher Center of Mass upwards. The GAZ-67 was located at just the right spot to have that explosion affect it like that.

    Also, while making the video I didn't even notice that soldiers escaping the vehicles to the left of the screen came under attack by a group of friendly soldiers that happened to pass the cliff above the convoy. You can see tracers flying at the bottom-left if you pay attention.

     
    NickHaldon likes this.
  34. Razorwings18

    Razorwings18

    Joined:
    May 8, 2014
    Posts:
    69
    I'm working on some functions of the high-level AI at the time.

    The backbone of the Soldier's AI are what I called Formations, that group soldiers into performing tasks to achieve set objectives.

    Each formation spawned into the scene has a set of missions, that range from patrolling a number of waypoints, to escorting other units or defending an area against enemy attacks.

    As in real life, these formations are physically arranged to best adjust to the current objective. For example, a group that is marching towards an objective along a road will use a column or staggered-column formation. A group that is expecting enemy contact ahead will use a wedge or line formation.

    In this video, you can see an enemy group switching from staggered column to wedge formation as they march towards their objective. When the AC-130 attacks, the formation disbands as soldiers start running for their lives, while trying to stay relatively close to each other.


    EDIT: SOME TECHNICAL INFO
    I forgot to mention something that is important regarding the decision to create formations from a technical standpoint (duh! it's a developers' forum!).
    Formations (as in "physically grouping characters") were not essential to gameplay. Some may even argue that soldiers moving independently are more visually appealing. But there's a very good reason for it: performance.

    First of all, moving in formation allows me to calculate a pathfinding solution just once (for the leader), then just calculate an offset from that path for each member.

    Secondly, knowing that all characters will be relatively close to each other, I can make just a couple of formation members detect and prioritize enemies, instead of the whole group.

    Causing "group reactions" to events is also way faster - I don't have to look for a lot of members in the vicinity of a spot; I just look for formations, then spread the proper reaction among its members.

    Considering some 200 characters would be on a scene, this approach lets me make each of these checks just some 20 to 30 times instead of 200, which is a huge performance saver considering pathfinding, enemy detection/prioritization and reaction to events are all processor-heavy algorithms.
     
    Last edited: Apr 8, 2015
  35. Razorwings18

    Razorwings18

    Joined:
    May 8, 2014
    Posts:
    69
    Still working on high-level AI; almost finished with human characters. I'll be posting a video once everything is polished.

    In the meantime, I took a small break yesterday to do the Missile launch/guidance script. The result looks pretty cool!


    (here's a link to the video; looks better than the GIF: https://vine.co/v/eZz1z3Ew239 )

    This is just a test; the "real" one will be used by the enemy from a shoulder-launched SA-7 MANPADS.

    The script is so self-contained, powerful and easy to use, I might release it as an Asset if there's some interest -and can work around the legalities of my indie-hostile country-. It's just drag the component and drop on the missile.
    It can target ground or air targets, do direct flight path or lead; acceleration / turn rate / speed are configurable; it can fly straight for a certain time after launch before guidance kicks in, and more.
     
  36. Pulov

    Pulov

    Joined:
    Feb 20, 2010
    Posts:
    824
    Missile feels great, I would just add some heat print in the back of the missille due to the fire jet. Also, the distance betwen the missile and the trail seems a bit too high
     
  37. Razorwings18

    Razorwings18

    Joined:
    May 8, 2014
    Posts:
    69
    Yeah, I fixed the distance between the missile and the trail shortly after I posted the video.

    EDIT: DISREGARD THE REST... SEE POST BELOW :oops:
    Now, as for the heat signature behind the missile, I tried a couple of options, like the following spark-like image (I've seen AC-130 FLIR videos where extremely hot spots look exactly like that):


    The thing is I couldn't find a decent FLIR video that shows missiles in flight. The closest I've seen is this one from an Apache Hellfire engagement -at the :45 second mark- but quality is so bad, you can't really tell how the missile really looks:
    http://www.asvab-practice-test.com/...kes/amazing-apache-flir-footage/665294791001/

    I've also seen a video of an Apache firing Hydras, and there seems to be no noticeable bright spot behind them. I guess it might be because the motors and hottest emissions are inside the structure of the rocket, or just because they're being masked by smoke.

    So until I get to see what a missile really looks like on the FLIR, it'll just be some imagination and coin-tossing.
     
    Last edited: May 4, 2015
  38. Razorwings18

    Razorwings18

    Joined:
    May 8, 2014
    Posts:
    69
    Pulov likes this.
  39. Pulov

    Pulov

    Joined:
    Feb 20, 2010
    Posts:
    824
  40. Razorwings18

    Razorwings18

    Joined:
    May 8, 2014
    Posts:
    69
    A little video showing how vehicles react when shot by a superior or undetected force. The script for this is generic, meaning vehicles will react this way to shots by anyone (be it the player or some other AI unit).

    Actually, the player unit (the AC-130) is considered a regular unit in the game world, and the aircraft where the player is sitting is actually a subclass of an "Actor" class used by all units, just replacing the AI component with a script that responds to player input. This is in line with the objective of having sequels to the game where you can man other units on the battlefield, and someday, maybe be able to hook other games using this framework in multiplayer, where each player can man different units in the same level.



    Last night I wrote a little article on IndieDB about how the development process was influenced by the game's focus on realism:
    http://www.indiedb.com/games/ac-130...al-ops-squadron/news/focus-on-realism-part-12

    It's a 2-part article, the second part will come in a week or so. This first part, though, is not as exciting actually... I wrote the whole article as one, but realized it ended up being way too long to release at once, so this is just the introduction really.
    The next part is actually pretty exciting, and the video that will accompany it should be as well.
     
  41. Razorwings18

    Razorwings18

    Joined:
    May 8, 2014
    Posts:
    69
    The second part of the article related to realism is out, that lists and explains many key features that make the game a realistic experience.

    The following is a link to the article:
    http://www.indiedb.com/games/ac-130...-squadron/news/video-focus-on-realism-part-22

    And this is the video attached to it, where you can see many things related to realism taking place. The most important one is probably the "awareness" thing, where the enemy is unaware of the Gunship's presence until it starts firing, and once they know that the aircraft is there, they counterattack.


    Note: Yes, I missed a letter in the second plaque. We'll all have to learn to live with it.
     
  42. nat42

    nat42

    Joined:
    Jun 10, 2017
    Posts:
    353
    This game just made global news!
     
  43. Razorwings18

    Razorwings18

    Joined:
    May 8, 2014
    Posts:
    69
    This game just made global news started WWIII!

    There, I fixed it for you.
     
  44. unitarian411

    unitarian411

    Joined:
    May 30, 2012
    Posts:
    13
  45. Zarkow

    Zarkow

    Joined:
    Jul 27, 2015
    Posts:
    92
    Did you ever end up finishing the game?