This is a video demo of a battlefield AI routine that I am developing in NWN2. The battle shown here is between a company of dwarves and a larger company of orcs. The features of the AI demonstrated in this video are the following:
Soldiers falling in formation at the start of the game
Units marching (somewhat sporadically) in formation
Each squad fighting as a (mostly) coordinated unit
Soldiers becoming frightened and running off the map when they fail their morale check
There is still quite a bit of work to be done with this AI routine. For example, I have not implemented any fancy maneuvers such as flanking. In addition, I haven't coded any routine for unit commanders to try to rally their troops. Also, the in-game frame rate when there are too many soldiers in the area is bad. I'll have to figure out what the maximum number of NPCs should be to maintain a minimum frame rate of, say, 15 per second. Nevertheless, the video demonstrates what is possible with the NWN2 engine.
Music Credits "Sarcophagus Unsealed" by Troy Sterling Nies
"Battle 2" by Steven Kelly
Disclaimer: The images shown in this page were not taken from the video. The images and the video were taken separately over several game sessions of the same module.
Posted by hspj8171 at 2008-05-31 22:12:48 Voted 10.00 on 05/31/08
Cool and a bit funny. :)
Posted by Skunkeen at 2008-05-30 08:06:43 Voted 10.00 on 05/30/08
wicked!
Posted by MammothTruk at 2008-05-22 10:38:12 Voted 7.00 on 05/22/08
I remember battle modules being played in NwN1 and I had a good time doing that. Kind of like what DoTa does for Warcraft3. Good vs Evil and the like. But in NwN2 it should be on a grand scale and your AI fits that. Purchasing 10 units in good vs evil wasnt really buying 10 trained soldiers but more like 10 fairly trained mercs. Your AI would make them a real infantry unit that would move and attack together making them much more effective.
I can see it now... purchasing 20 infantry units and 10 ranged archer units. Each map would have waypoints in different places and you can send your each soldier to any waypoint and would get in formation with units already there. Then you have a few units that you order to follow you. You get on a slope under your archers, order your infantry to stand their ground, and you go and get another set of units to raid with. Your archers back your infantry when the enemy advances and you run around and behind your enemy to trap them between infantry with archers raining arrows down onto them!
MammothTruk, as a matter of fact, I was thinking of eventually making a multiplayer module (not a PW) that's sort of like D&D miniatures but without the expensive figures. :P The video that I released is sort of a proof of concept. I know that there are players in the community who are into fantasy wargaming. Although NWN2 isn't an ideal platform for wargaming because of a number of performance issues, it can be done on a smaller scale.
I wish NWN2 had mounts so I could include cavalry units in the game. It would be great if some of those cavalry units could fly. (Dragonriders, anyone?) At least there's plenty of material for fantasy infantry units. It's a start. _________________________ Yay, I have a blog. Faithless: The Making of an NWN2 Module
Posted by MammothTruk at 2008-05-22 08:35:26 Voted 7.00 on 05/22/08
yes I was refering to the monster AI and not companions and the like. As it stands now monster AI is stupid and will not avoid dangers, use very few combat feats, and Ive never seen a monster taunt. In general mobs needs to be smarter and work to get the most out of what they have.
The unit(point buy)system is kind of what I was talking about. Giving players the option to purchase them to define their own army was more than I was expecting. I was talking about applying the battle system AI to different groups. When you said you could apply the AI to wandering groups and single monsters that answered my question. It would mean you can build any kind of army you want and the AI will sort them out into formation.
If you were to release a multiplayer version for PWs the unit buy system would be great. Adding units would be pretty simple with a levelup script and a conversation node for each unit you wanted to make available to the player. _________________________ Baldur's Gate: The Sword Coast Chronicles
Okay, I think I understand what you mean regarding changing one side for another. If I understand correctly, you're thinking along the lines of a multiplayer battle system where each player can "buy" units (using, say, a point system) and have them fight on their side. For example, two opposing player might each acquire an elven squad to battle each other. If this is what you mean, then yes, the same AI can be used to get units to fight in any side desired.
Regarding your question on other aspects of AI combat, I'm not sure what you mean. If you're asking about things like targeting, using combat feats and skills, or spellcasting, I'm planning to integrate that in the battlefield AI or army system as you call it. As Qkrch observed, there's still a lot of work to be done. If you're asking if I'm planning to make something like Tony K's AI for party companions and monsters, I don't really have any plans for that at the moment. Tony K has already done a wonderful job of creating his AI. It would take a lot of man-hours to try to accomplish anything like what he has done. _________________________ Yay, I have a blog. Faithless: The Making of an NWN2 Module
Posted by MammothTruk at 2008-05-22 06:44:34 Voted 7.00 on 05/22/08
going to call it a 7 right now. I think its a 9-10 when finished. the AI needs a lot of help and I think this is a move in the right direction. Being able to put the AI on any monster means you can switch out armies IE making a different set of units fight together under the same faction against another faction with different units.
Also after your done with the "army system" as I shall now refer to it as is there a chance you will also create new AI system for other aspects of AI combat? _________________________ Baldur's Gate: The Sword Coast Chronicles
Posted by Qkrch at 2008-05-22 04:17:34 Voted 6.75 on 05/22/08
(ah I forgot, my vote is for the video... not for the idea and work in the project, this is the movie section :)) _________________________ The Ancient NWN Spanish Community Link
Academy for Modding Excellence Link
The Everfire Forge, a weapon for your hero Link
Posted by Qkrch at 2008-05-22 04:15:47 Voted 6.75 on 05/22/08
I think you'll have to create still a lot of scripting routines to get a wonderful result. I really hate when in nwn2 the characters get stucked in middle of the battle, you need to develop a new AI and see what happens...
Good luck with it and my best desires! _________________________ The Ancient NWN Spanish Community Link
Academy for Modding Excellence Link
The Everfire Forge, a weapon for your hero Link
Posted by seeker_of_rain at 2008-05-22 02:48:36 Voted 10.00 on 05/22/08
Posted by MammothTruk at 2008-05-21 19:04:53 Voted 7.00 on 05/22/08
Will it be compatible with Nytir Battle System or will it be fully self supporting? How hard will it be to change out one side for another? Can the AI be used outside the battles for patrolling monster groups? Can the fleeing by moral checks be used with just a single monster vs players? Any plans to expand on other AI routines? _________________________ Baldur's Gate: The Sword Coast Chronicles
Posted by jlf2n at 2008-05-21 18:59:01 Voted 10.00 on 05/21/08
Really cool man. Lots of potential.
Posted by jlf2n at 2008-05-21 18:58:59 Voted 10.00 on 05/21/08
Interesting. I especially look foward to see how you deal with moving in formation. The flee routine sounds good too (but it might be more realistic if both sides didn't exit at the exact same point). Good luck with the project! I'll be looking out for it.
Oh, and you produced a fun little movie there for an ai demo. The music and editing are spot on. (I would have removed the ui though.) Thanks for sharing it. _________________________ E.C.Patterson Gaming Parents Studios
Hey, Indira, thanks for your quick feedback. I agree that we need more, especially playable modules where the players command their own squads. I wonder if its doable in multiplayer. :) _________________________ Yay, I have a blog. Faithless: The Making of an NWN2 Module
Posted by Indira Lightfoot at 2008-05-21 11:44:04 Voted 10.00 on 05/21/08
What can I say! Hehe, a sheer pleasure all the way thru! :D
It was very exciting to see how the engine behaved (pretty ok, is my verdict, one orc seem to have got stuck far off in the rough tho, heh) and that it did look quite impressive (plus a great choice of soundtrack)! Mmmm, M as in More, Multiple Opponents, Massive fun! _________________________ From someone who is starting to feel like an Ent among saplings when playing computer-based D&D games...
You must be Logged In to post comments in this section.
10 - A Masterpiece, Genuinely Groundbreaking 9 - Outstanding, a Must Have 8 - Excellent, Recommended to Anyone 7 - Very Good, Deserves a Look 6 - Good, Qualified Recommendation 5 - Fair, Solid yet Unremarkable 4 - Some Merit, Requires Improvements 3 - Poor Execution, Potential Unrealized 2 - Very Little Appeal 1 - Not Recommended to Anyone