Search Unity

Medieval Battle Simulation: Soldier AI (How hard is it?)

Discussion in 'Navigation' started by Necropolitan13, Apr 21, 2022.

  1. Necropolitan13

    Necropolitan13

    Joined:
    Feb 27, 2020
    Posts:
    8
    I'm an intermediate programmer, at best, right now. I have an idea for a battle simulation game involving heavy delegation to the AI (the player is the commander and is mostly involved at the start of the battle, after which the AI largely does its own thing). I'm wondering how hard this is going to be and how much more I need to learn or how much more experience I should have before attempting it.

    I have not really worked with AI much in the past; and I don't think I've worked with it at all in Unity yet. I'm trying to get back into game development (again) and had this idea for a medieval battle simulation game, where the player takes on the role of the commander/general, setting up the initial battle strategy and then delegating the moment-to-moment decisions to AI captains which are in charge of units of many AI soldiers. This would be a 2D, top-down style game, with simple graphics (I'm not much of an artist), mostly focused on realism and complex systems.

    I'm mostly wanting to do it because I think it would be fun and I'd surely learn quite a lot from such a project, and it might actually turn out to be pretty cool/fun to play. But I'm concerned it might be too much for someone with my current programming experience to even begin (and risk burning out before I get very far, as I have a tendency of doing). There would be a lot of things I'd be keeping track of that would affect the AI behavior on various levels. I would need Unit AI (what the unit as a whole is trying to do, and how it might be interacting with other units, both friendly and enemy) and soldier AI (what each soldier in a unit is doing and what their stats are, including health, morale, skill level/experience, etc.). I would also want the player to be able to have some ability to give commands during battle, but limited in realistic way (I've considered having AI messengers that actually have to traverse the field to carry orders to the units).

    (Edit: To tie this more directly into the specific 'navigation' heading of this forum, I should point out that it would also, of course, be heavily navigation focused, as well, as units of AI would have to be able to form up on the field and keep formation even through losses and as the unit moves. So it would require the soldier AI to be able to see their fellow soldiers and understand their unit's formation and movements and act accordingly on an individual level, as well as on a unit level.)

    Anyway, all that aside, my main question is this:

    Should I try to make a complex, AI-driven game as an intermediate-level programmer?

    Or should I do something simpler and learn more about AI before dedicating myself to such a project?
    Essentially, would it be a good learning experience or a frustrating and overwhelming mess?
    I guess it depends on a lot of variables, but I just wonder if anyone has any insight for me. I'd appreciate any advice.
     
    Last edited: Apr 21, 2022
  2. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    2,074
    Many soldiers is your main problem here. Optimizing it will be a hell.

    Do something simpler. The simpler will be still very hard and you will not dedicate yourself to more advanced project ever.
     
  3. DwinTeimlon

    DwinTeimlon

    Joined:
    Feb 25, 2016
    Posts:
    300
    Hey, I am working on a game like this for quite a while now (4 years roughly). I might not be the most capable programmer in regards to AI and navigation, but what I can tell you is that it is a lot of work but it's also a lot of fun to make such a project.

    So my recommendation would be to start small and go from there and you should probably not use unity navigation but instead something more sophisticated to save you time and energy. Probably A* Pathfinding or some other well tested navigation/pathfinding solution.

    Though unity navigation can do all the stuff, it's hell to work around all the problems. If you want to check out what I have put together have a look here. The demo is a few months old, but you get the idea. It's basically an RTS with limited player controls.

    https://store.steampowered.com/app/1368160/Heart_Of_Muriet/
     
    ElevenGame likes this.
  4. Necropolitan13

    Necropolitan13

    Joined:
    Feb 27, 2020
    Posts:
    8
    Wow, that looks pretty awesome! Congrats on getting so far with it! I will try the demo some time.

    Thanks for the advice, guys. I figured it was probably going to be too much to jump right into. I've already started a test project just for learning and proving the concept I'm after, and already hit some road blocks. I didn't realize Unity had no built-in pathfinding solutions for 2D games, for starters.

    I did see reference to A* in the light searching I've done so far, and I have found another pathfinding solution that I haven't tried yet. I guess I'll just start picking away at the basic problems first and just see how it goes.
     
    DwinTeimlon likes this.