B Other [WB] Competitive-style combat AI - Playable version (0.2) out!

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Oliveran

Master Knight
WB
Best answers
0
Slytacular said:
How do you edit the AI bot to behave differently? Is there a tutorial somewhere?
No tutorial. I might write one once I'm done with most of the basic stuff for the AI.

You work, like Efe Karacar (aka Belendor) said, with the module system triggers (in items or in mission templates). However, I'm writing it in Lua so it's quite different.
 
Best answers
0
Bone 9 is the neck not the face

Oliveran said:
(as it required quite some complex 3D projectile motion)
The improvement will be that it can aim "in front of" targets, predicting it's motion.
basic 1st year physics wouldn't really call that complex mate.
 

Oliveran

Master Knight
WB
Best answers
0
While I've realised writing some of the AI (especially the cavalry, having some issues with making it bumpstab) takes time, I've decided to make sure to give something that you guys can really use, rather than just some videos and me explaining what I've done.

Therefor, in a day or two do I'll upload a Native mod. It will contain the melee-part of the AI only, that will only be used in open field battles. Other than that, it will be vanilla Native. That way, you guys can test it out in larger scales, report back problems and also have fun testing it out (and getting your ass kicked by it)!
 

NPC99

Baron
M&BWBWF&SVC
Best answers
13
Oliveran said:
... have fun testing it out (and getting your ass kicked by it)!
Sounds great. Presumably your AI is immune to my selecting the easy option of poor enemy AI.  :fruity:
 

Oliveran

Master Knight
WB
Best answers
0
NPC99 said:
Oliveran said:
... have fun testing it out (and getting your ass kicked by it)!
Sounds great. Presumably your AI is immune to my selecting the easy option of poor enemy AI.  :fruity:
Quite correct! :party: Apart from the lower HP and damage!
 

NPC99

Baron
M&BWBWF&SVC
Best answers
13
Oliveran said:
NPC99 said:
Oliveran said:
... have fun testing it out (and getting your ass kicked by it)!
Sounds great. Presumably your AI is immune to my selecting the easy option of poor enemy AI.  :fruity:
Quite correct! :party: Apart from the lower HP and damage!
Time to take up the bow or crossbow and lead my troops valiantly from the rear. :grin:
 

Oliveran

Master Knight
WB
Best answers
0
Combat AI 0.1 - Introduction - Showcasing & Singleplayer gameplay, Download

Download link to the module + WSE Lua version

Note that it only works in open battles, for now.

Code:
To use this AI, you must use the Warband Script Enhancer - Lua Edition (WSE Lua) included in the download of this file.
It uses a library not included in the one currently uploaded on the forum. Therefor, you must use the included version instead.

Copy all the files into the MAIN folder of your Warband directory, i.e. /Program Files (x86)/Mount&Blade - Warband/

Then run the game via /Program Files (x86)/Mount&Blade - Warband/WSE Lua/WSELoader.exe

Running the module included without WSE Lua will cause errors, crashes and glitches.
Please do not forget to give feedback on glitches or problems you may have while testing it; suggestions are also very welcome and I'll make sure to at the very least read every post and make decisions based on whatever feedback and suggestions I get.
 

Gasset

Sergeant at Arms
Best answers
0
Looks very nice. A real upgrade to the AI and a boost of difficulty in the otherwise easy singleplayer combat. Battles are surely more thrilling and players won't be able to kill dozens of dumb AI soldiers. Good work and keep it up.
 

Oliveran

Master Knight
WB
Best answers
0
fladin said:
Downloading now, congrats  :grin:
Gasset said:
Looks very nice. A real upgrade to the AI and a boost of difficulty in the otherwise easy singleplayer combat. Battles are surely more thrilling and players won't be able to kill dozens of dumb AI soldiers. Good work and keep it up.
Thanks! Please report back any feedback you have, if you do testplay it or similiar. Both constructive criticism and bug reports are very welcome! :iamamoron:
 

Khamukkamu

Master Knight
M&BWBWF&SVC
Best answers
0
AI too good for me :sad: I get destroyed

Do you have plans of allowing the tweaking of AI difficulty? Maybe scale it with troop level / type?

For example, we shouldn't expect this level of AI against a farmer, right (unless he was some sort of veteran warrior that has given up soldiering, and taken up farming :razz:)

...or should I just git gud...
 

Gasset

Sergeant at Arms
Best answers
0
Perhaps the lower tier units can have lower combat skill. As in the higher the unit tier you are facing, the higher the AI's combat performance. That would be more realistic, but would dump the difficulty a lot, and the increase of difficulty this mod presents is the reason I opened SP in a long time  :grin:.
 

Oliveran

Master Knight
WB
Best answers
0
Khamukkamu said:
AI too good for me :sad: I get destroyed

Do you have plans of allowing the tweaking of AI difficulty? Maybe scale it with troop level / type?

For example, we shouldn't expect this level of AI against a farmer, right (unless he was some sort of veteran warrior that has given up soldiering, and taken up farming :razz:)

...or should I just git gud...
It has a hardset tweak, currently. The formula goes as follows:
1 * 0.9^troop_level

For a farmer level 1, he has a 10% chance to block
A level 5 troop has a 40% chance to block
A level 10 troop has a 65% chance to block
A level 20 troop has a 88% chance to block
A level 40 troop has a 98.5% chance to block

There's a few conditions to it, but these percentages are currently hardcoded. I suggest to git gud; but I will consider how to change it to be more fun!
 

Oliveran

Master Knight
WB
Best answers
0
Version 0.2 out! Added melee pathing (infantries only!) + updated targeting script (splits units up more in fights)

A short few words about what the update does:
Pathing: It allows the AI to move around it's target when close enough to fight it. Vanilla only allows forward or backwards, but here it can walk sideways and around too
Targeting script: If there's more targets than 1 around the AI, it choses the closest one. It must however choose an AI that has less than 3 targets on it, as to avoid clumping and inefficent combat


Watch the video if you want to see it in action, and get a more detailed explanation of how it works.
I do run the game and play it while talking 'in real-time', so the examples in the videos are not 'best-case' scenarios I have recorded, but how it will actually look when you play!

Download Link

Note: The AI only works in open-map combat, so as of now to test it you must engage parties out in the world map for the AI to work. I will ofcourse fix this later, but this is a testing process so it'll take a bit of time.

Code:
To use this AI, you must use the Warband Script Enhancer - Lua Edition (WSE Lua) included in the download of this file. It uses a library not included in the one currently uploaded on the forum. Therefor, you must use the included version instead.

Before you install, backup your main executables in your Warband's main directory i.e. '/Program Files (x86)/Mount&Blade - Warband/mb_warband.exe'. Copy it and save it if you want to go back to normal vanilla at any point (thought it should work just fine using that .exe instead of the normal one from TW), as it is used to run WSE as well.

Copy all the files into the MAIN folder of your Warband directory, i.e. /Program Files (x86)/Mount&Blade - Warband/
Then run the game via /Program Files (x86)/Mount&Blade - Warband/WSE Lua/WSELoader.exe

Running the module included without WSE Lua will cause errors, crashes and glitches.
 

NPC99

Baron
M&BWBWF&SVC
Best answers
13
If I followed your version 0.2 installation instructions, I'd overwrite my mb_warband.exe with yours - shouldn't there be a warning to backup the existing file? Why does your download need a different mb_warband.exe? I thought only Taleworlds could alter that.
 

Oliveran

Master Knight
WB
Best answers
0
NPC99 said:
If I followed your version 0.2 installation instructions, I'd overwrite my mb_warband.exe with yours - shouldn't there be a warning to backup the existing file? Why does your download need a different mb_warband.exe? I thought only Taleworlds could alter that.
There should be. It's just the normal replacement .exe's that is used by WSE. Just wanted to make the installation more simple, but forgot to add that in the instructions - thanks!
 

NPC99

Baron
M&BWBWF&SVC
Best answers
13
Oliveran said:
NPC99 said:
If I followed your version 0.2 installation instructions, I'd overwrite my mb_warband.exe with yours - shouldn't there be a warning to backup the existing file? Why does your download need a different mb_warband.exe? I thought only Taleworlds could alter that.
There should be. It's just the normal replacement .exe's that is used by WSE. Just wanted to make the installation more simple, but forgot to add that in the instructions - thanks!
Thanks for the reply. Clearly, WSE has moved on since I last used it with CWE.  :grin:
 

Oliveran

Master Knight
WB
Best answers
0
NPC99 said:
Oliveran said:
NPC99 said:
If I followed your version 0.2 installation instructions, I'd overwrite my mb_warband.exe with yours - shouldn't there be a warning to backup the existing file? Why does your download need a different mb_warband.exe? I thought only Taleworlds could alter that.
There should be. It's just the normal replacement .exe's that is used by WSE. Just wanted to make the installation more simple, but forgot to add that in the instructions - thanks!
Thanks for the reply. Clearly, WSE has moved on since I last used it with CWE.  :grin:
Yeah, it has. Though, afaik, my version has a unique library included for multithreading and such. Which is why I can't just simply link the latest version of WSE (even though it has Lua included), sadly :cry: But it does offer immense performance support, such as that my scripts currently, done in the ModSys, would cause constant freezes and lag due to the code having to run 'every frame'.

However, my code runs 'faster than every frame' Warband runs the game's base FPS at, so I also can safely alter the code's tempo with conditions to ensure it is optimal for weaker systems - I had a few people with potato computers test it, and it seemed they lost no FPS upon running my code. Running more AI's also caused no FPS difference, when testing the exact same battles with the same amount of AI's with vanilla and with my scripts.

I'm also almost done with a 1.0 version, I think. I revised my options and decided to just fix an archer target changer, anti-cavalry infantries and making siege better. I'll hit the mod up on the actual mod section soon, and release this as an OSP. Rather get time to make things better after a release that works, so it's playable earlier on than having small changes get piled up with time but having nothing concrete to play! :party:

Learning how to edit AI meshes for siege, takes some time it seems....
 

NPC99

Baron
M&BWBWF&SVC
Best answers
13
Good luck with the AI meshes, they can be quite fiddly.

For your archer targeting, how differently have you treated bows and crossbows? Presumably the crossbow code will also work for mods with firearms once you've released an OSP version.