Ambush And Camp Mechanic ( with demo )

Users who are viewing this thread

Bloc

Archduke
WB
I'm 99% sure that TW will choose to ignore this idea. But I want to say my bit about this since I had quite a lot of fun while experimenting with it. Let me know what you also think. Also I know some modders might want to add something like this, so perhaps it can be a proof-of-concept.


Two days ago I had some spare time and I implemented a simple ambush mechanic demonstration for Bannerlord. I made the entire thing in ~4 hours so it's not perfect but the overall idea is very fun to explore. I'm not planning to release it as a mod but would be nice to see it in-game. It's also NOT complex. See the video, below I'm explaining the things.


Camp:
Allows the player to camp on the campaign map. This shows a camping tent on the campaign map as well. Camping will allow you to access certain features that you weren't able to access (the camp section wasn't implemented yet in demo videos )
- Train your troops: This will allow you to train your troops, either with training with them in the training-ground area or simply by allowing them to train themselves ( top tiers can train lower tiers only. If everyone is on the same tier, this won't be too effective )
- Rest: This will simply increase party morale since they are resting. If you are in an army, this should also increase cohesion so that you will feel the need of stopping if you are aiming to go through long-distance sieges/battles.
- Prepare for Ambush: This will start ambush preparation. I will come to this later on.
Downside: You will be stationary, exposed to other parties. Adding "assembling/disassembling camp" time ( 2-3 game hours ) can also help to discourage camp-spamming.
Can AI also camp? In the demo videos, they are not able to do that. But I think it would be logical for assembled armies to do that based on the cohesion they have. This also puts a limit to snowballing since armies can't go long distances without actually spending time on the road.

Ambush:
This is the main content in the videos. Although the idea of ambush I had in mind had two sides - videos are only showing one side - ambushing enemy party while they are camping and unprepared. Once you set an ambush plan, there is a range where you can see that Attack is gets enabled if any hostile party is close by. If you feel like you want to attack one of them, all you have to do is clicking attack and selecting the party. The success of this ambush relies on traits and skills. While in an ambush position, you are invisible to hostile parties ONLY if your certain skills are better than their party leader. This means, character X can see you and attack you directly if their skills are better than yours even though you are ambushed. The bad part of this for you is that, you can't simply disassemble your setup instantly because it takes time, so if AI sees you and runs towards you, a hunter might become hunted. However, upon successful ambush, you can attack the enemy army's camp and win even while outnumbered. It opens a normal battleground map. But in this map, unlike normal battle, they will be unaware of your location and intentions. Depending on certain conditions ( crouching, night-time, distance, and visibility ) they can spot you easily on the battlefield or they can see your troops when it's too late. While you are undetected, they won't realize that your troops are in the battlefield and they will continue their disorganized position ( sleeping, playing games, drunk, laying on the ground and scouting etc )
All "camps" are automatically generated hence the content is random and dynamic to troop culture and count (for example, looters won't have outer palisades) and can be generated in all terrains - snow, desert, forest. They are also culture-specific in terms of items they are using and this idea can be extended with more culture-specific things ( how they set up camps, structure shapes, etc )
- Pros:
A new mechanic where you can feel the stealthy side of the game.
Ambushed enemies will have lower morale - keener to flee.
Ambushed enemies will be in a disorganized state and will not have unit cohesion.
The horseman will be on foot at the start ( this isn't implemented properly in the demo video )
- Cons:
You can fail to ambush, which will make you fight with an overpowered enemy. And your soldiers will be the one who starts with lower morale.
Building and disassembling take time. If your skills are bad, they can spot you and hunt you down.
Might add extra food consumption to avoid lurking in ambush state

Can AI also ambush? Yes. Well in the demo version it wasn't fully implemented because it's a POC but in theory, AI can do the same. Shouldn't be possible to do this while in Army. Ambushing can add extra traits/skills to AI and/or can be decided by them.

Variations: In the demo, I only added camp ambush but it could be that we can also have a scene/scenario where the enemy party moves from point A to B, unaware of our presence until they spot our soldiers on the battlefield or until we attack. This would be better if we do it at noon, and the camp scenario can be used at night/early morning/late daytime.

All demo videos:
Because it's a night attack, seeing distance is short and this grants chance for our troops to sneak in closer. If we were not crouching, however, they would notice our troops from a longer distance. Some tents are causing issues for AI when they need to pathfind, but this can be easily avoided if I had time to create new prefabs.
I used RTSMod and MBSuperspeed for view and speeding up. Reason why soldiers are crouching is to decrease detection chance. At 02:47 , enemy detects our soldiers and we get the notification. After that moment, they are trying to defend their ground FPS drops are happening because I have an old pc with bunch of development related stuff running on the background.
The reason why you are seeing some soldiers are moving while some of them are sleeping/sitting is that ones that are awake and moving are actually camp guards. Once they spot your soldiers from a distance, your position is revealed to the enemy and they immediately try to notify all other soldiers to get into battle formation. Some tents are causing issues for AI when they need to pathfind, but this can be easily avoided if I had time to create new prefabs.
This is another trial for the on-transit ambush. I fixed a bunch of column order and decisions making things. Extreme FPS drop is happening because I overestimated my GPU power and added too many troops and used torch/banner mod. I also noticed that while soldiers are outside of the boundary, pathfinding is sucking CPU( you will realize that FPS drop is more tolerable after a few seconds when soldiers march into the scene)
I attacked this party by knowing that I was going to get crashed. So don't say anything about that :razz:
This is another trial for the on-transit ambush. I fixed a bunch of column order and decisions making things. Now each cavalry chaperoning certain units, in big armies looks better because it gives a feeling of chaos caused by marching and order enforced by sergeants.
I created a really sloppy implementation of "ambush while marching" logic
I had to rewrite some of the spawning logic and area calculations, for some reason soldier management, moving people from point X to Y isn't that easy - still idea is very fun to explore. Although it's not clear in the video, I actually implemented a message-delay system, meaning that when marching line becomes too long for big armies, head and tail will not immediately know that they had been attacked and will continue to move forward. After 16 seconds ( 8 seconds each ) entire line will be hostile and trying to organize and take their battle formations.
Reason why they are piling up in the spawn is that I'm ordering them to form a line while marching to keep the cohesion but they designed this formation in a way that everyone gets a magic number and waits for the person in-front of him, which creates a "collider" traffic jam. And if I command them not to form a line, then it looks a like scene from GoT where everyone walks like whitewalkers. ( could be useful for those mods though )

 
Last edited by a moderator:

Nodice83

Knight
WBWF&SNWVC
Great idea. Find it a very immersive feature that fits in the Rogue gameplay.
Variations: In the demo, I only added camp ambush but it could be that we can also have a scene/scenario where the enemy party moves from point A to B, unaware of our presence until they spot our soldiers on the battlefield or until we attack. This would be better if we do it at noon, and the camp scenario can be used at night/early morning/late daytime.
I wish I could see the ambush 'on transit scene' version. I think that the player could have a little cinematics (EDIT: where there is no control over your troops) until the enemy is really close so the chance to react positively is really slim. Same way with the AI being attacked.

You thought through the perk system - that is a great idea as well. I believe we should be able to make ambushes only if our skill is better than the attacked party, and also lead to disastrous effects when performed badly (lower ambusher skill vs higher counter-ambush skill).

Nice and exceptional idea... and those camps similarily to VC. That would be grand if they decide to use it in-game. If...
 

Piconi

Fashionista
Section Moderator
M&BWBWF&SNWVC
This looks like a road to so much fun if polished a bit with what you mentioned, amazing work once again!
I wonder how that ambush mechanic TW was about to implement looked before they scrapped it.
 
Great demo.I've always wanted to see ambushes in the game. It was a shame TW discarded their ideas for it. When AI parties can also set ambushes it might be wise to limit it as a tactic for smaller warbands. I'd hate to be ambushed by overwhelming numbers. :grin:
 
Camp:
Allows the player to camp on the campaign map. This shows a camping tent on the campaign map as well. Camping will allow you to access certain features that you weren't able to access (the camp section wasn't implemented yet in demo videos )
- Train your troops: This will allow you to train your troops, either with training with them in the training-ground area or simply by allowing them to train themselves ( top tiers can train lower tiers only. If everyone is on the same tier, this won't be too effective )
- Rest: This will simply increase party morale since they are resting. If you are in an army, this should also increase cohesion so that you will feel the need of stopping if you are aiming to go through long-distance sieges/battles.
- Prepare for Ambush: This will start ambush preparation. I will come to this later on.
Downside: You will be stationary, exposed to other parties. Adding "assembling/disassembling camp" time ( 2-3 game hours ) can also help to discourage camp-spamming.
Can AI also camp? In the demo videos, they are not able to do that. But I think it would be logical for assembled armies to do that based on the cohesion they have. This also puts a limit to snowballing since armies can't go long distances without actually spending time on the road.
A BIG YES, for camps.
This looks like a road to so much fun if polished a bit with what you mentioned, amazing work once again!
I wonder how that ambush mechanic TW was about to implement looked before they scrapped it.
Great demo.I've always wanted to see ambushes in the game. It was a shame TW discarded their ideas for it. When AI parties can also set ambushes it might be wise to limit it as a tactic for smaller warbands. I'd hate to be ambushed by overwhelming numbers

I would have a counter-proposal (which can be integrated) which takes into consideration the mechanics of ambushes but which not only binds it to numerical parameters, but also to other factors, such as the march formation of the enemy army and the way in which our ambush formation is positioned or directed.
GEOGRAPHICAL COVERAGE: marching formations, ambush, interception of armies,resting
 
I think we need an Ambush Map, where the ambusher is setup on high ground surrounding a sunken road, and the Ambushee is marching in column along that road.

That would be an ideal ambush, imagine getting pelted by a million rocks from Looters higher up.

.
 

vonbalt

Sergeant Knight
WBNWVCM&B
I think we need an Ambush Map, where the ambusher is setup on high ground surrounding a sunken road, and the Ambushee is marching in column along that road.

That would be an ideal ambush, imagine getting pelted by a million rocks from Looters higher up.

.
With the new terrain system they could make some places have obvious vantage points for ambushes and you would learn over time where they are and then prepare ambushes there since battle starting position will be based on world map position, it would combine perfectly if TW wanted to put the work to implement a feature like ambushes.
 

KSHMR

Sergeant at Arms
I'm 99% sure that TW will choose to ignore this idea. But I want to say my bit about this since I had quite a lot of fun while experimenting with it. Let me know what you also think. Also I know some modders might want to add something like this, so perhaps it can be a proof-of-concept.


Two days ago I had some spare time and I implemented a simple ambush mechanic demonstration for Bannerlord. I made the entire thing in ~4 hours so it's not perfect but the overall idea is very fun to explore. I'm not planning to release it as a mod but would be nice to see it in-game. It's also NOT complex. See the video, below I'm explaining the things.


Camp:
Allows the player to camp on the campaign map. This shows a camping tent on the campaign map as well. Camping will allow you to access certain features that you weren't able to access (the camp section wasn't implemented yet in demo videos )
- Train your troops: This will allow you to train your troops, either with training with them in the training-ground area or simply by allowing them to train themselves ( top tiers can train lower tiers only. If everyone is on the same tier, this won't be too effective )
- Rest: This will simply increase party morale since they are resting. If you are in an army, this should also increase cohesion so that you will feel the need of stopping if you are aiming to go through long-distance sieges/battles.
- Prepare for Ambush: This will start ambush preparation. I will come to this later on.
Downside: You will be stationary, exposed to other parties. Adding "assembling/disassembling camp" time ( 2-3 game hours ) can also help to discourage camp-spamming.
Can AI also camp? In the demo videos, they are not able to do that. But I think it would be logical for assembled armies to do that based on the cohesion they have. This also puts a limit to snowballing since armies can't go long distances without actually spending time on the road.

Ambush:
This is the main content in the videos. Although the idea of ambush I had in mind had two sides - videos are only showing one side - ambushing enemy party while they are camping and unprepared. Once you set an ambush plan, there is a range where you can see that Attack is gets enabled if any hostile party is close by. If you feel like you want to attack one of them, all you have to do is clicking attack and selecting the party. The success of this ambush relies on traits and skills. While in an ambush position, you are invisible to hostile parties ONLY if your certain skills are better than their party leader. This means, character X can see you and attack you directly if their skills are better than yours even though you are ambushed. The bad part of this for you is that, you can't simply disassemble your setup instantly because it takes time, so if AI sees you and runs towards you, a hunter might become hunted. However, upon successful ambush, you can attack the enemy army's camp and win even while outnumbered. It opens a normal battleground map. But in this map, unlike normal battle, they will be unaware of your location and intentions. Depending on certain conditions ( crouching, night-time, distance, and visibility ) they can spot you easily on the battlefield or they can see your troops when it's too late. While you are undetected, they won't realize that your troops are in the battlefield and they will continue their disorganized position ( sleeping, playing games, drunk, laying on the ground and scouting etc )
All "camps" are automatically generated hence the content is random and dynamic to troop culture and count (for example, looters won't have outer palisades) and can be generated in all terrains - snow, desert, forest. They are also culture-specific in terms of items they are using and this idea can be extended with more culture-specific things ( how they set up camps, structure shapes, etc )
- Pros:
A new mechanic where you can feel the stealthy side of the game.
Ambushed enemies will have lower morale - keener to flee.
Ambushed enemies will be in a disorganized state and will not have unit cohesion.
The horseman will be on foot at the start ( this isn't implemented properly in the demo video )
- Cons:
You can fail to ambush, which will make you fight with an overpowered enemy. And your soldiers will be the one who starts with lower morale.
Building and disassembling take time. If your skills are bad, they can spot you and hunt you down.
Might add extra food consumption to avoid lurking in ambush state

Can AI also ambush? Yes. Well in the demo version it wasn't fully implemented because it's a POC but in theory, AI can do the same. Shouldn't be possible to do this while in Army. Ambushing can add extra traits/skills to AI and/or can be decided by them.

Variations: In the demo, I only added camp ambush but it could be that we can also have a scene/scenario where the enemy party moves from point A to B, unaware of our presence until they spot our soldiers on the battlefield or until we attack. This would be better if we do it at noon, and the camp scenario can be used at night/early morning/late daytime.

All demo videos:
Because it's a night attack, seeing distance is short and this grants chance for our troops to sneak in closer. If we were not crouching, however, they would notice our troops from a longer distance. Some tents are causing issues for AI when they need to pathfind, but this can be easily avoided if I had time to create new prefabs.
I used RTSMod and MBSuperspeed for view and speeding up. Reason why soldiers are crouching is to decrease detection chance. At 02:47 , enemy detects our soldiers and we get the notification. After that moment, they are trying to defend their ground FPS drops are happening because I have an old pc with bunch of development related stuff running on the background.
The reason why you are seeing some soldiers are moving while some of them are sleeping/sitting is that ones that are awake and moving are actually camp guards. Once they spot your soldiers from a distance, your position is revealed to the enemy and they immediately try to notify all other soldiers to get into battle formation. Some tents are causing issues for AI when they need to pathfind, but this can be easily avoided if I had time to create new prefabs.
Pretty interesting idea:smile:
 
A BIG YES, for camps.



I would have a counter-proposal (which can be integrated) which takes into consideration the mechanics of ambushes but which not only binds it to numerical parameters, but also to other factors, such as the march formation of the enemy army and the way in which our ambush formation is positioned or directed.
GEOGRAPHICAL COVERAGE: marching formations, ambush, interception of armies,resting
I doubt @Bloc will publish his demo, but I'm pleased to see he's still playing and modding Bannerlord.
 
Excellent, 5/7.
Bloc has plenty of sound judgement and focus on gameplay, really a rarity among technically-minded modders.
It was a shame TW discarded their ideas for it.
Strange, isn't it? "We didn't like our first try at this idea so we axed it completely, without trying to improve it."
They said the same about upgrading villages too. It's almost like a generic excuse for cutting features, for who knows what reason, but it's not the official one because that one is stupid or lazy.
 
Last edited:

Terco_Viejo

Spanish Gifquisition
Grandmaster Knight
Well, to me it seems fun for the player... and to you @Callum do you find it so? 🎷:iamamoron:

giphy.gif


Good job @Bloc as always, more than bringing this mechanic in the form of a video test and all the work it has taken you (you say about 4 hours; bravo) what is more meritorious for me is the irrefutable proof that this is possible and enrich the gameplay.

The options you incorporate are great, they add and enrich the gameplay, however I have always "dreamed 😌" them like Total War-style... as Nodice83 says "on transit scene" ambush.

CkNJG8z.jpg

(source)

---
vonbalt, yeah100% agree.
 
Excellent, 5/7.
Bloc has plenty of sound judgement and focus on gameplay, really a rarity among technically-minded modders.

Strange, isn't it? "We didn't like our first try at this idea so we axed it completely, without trying to improve it."
They said the same about upgrading villages too. It's almost like a generic excuse for cutting features, for who knows what reason, but it's not the official one because that one is stupid or lazy.
Yes. I never understood TW's stance and expressed my view/disappointment at the time.
 
Did you finally find legacy code regarding ambushes?

I only know of the existence of this: X:\Steam\steamapps\common\Mount & Blade II Bannerlord\Modules\SandBox\SceneObj\desert_ambush ... half-finished ofc 😌 🎻
I've yet to learn C#, so IDK, but it was nice to see @Bloc using the TW's legacy ambush icon on the campaign map.
 

Bloc

Archduke
WB
I created a really sloppy implementation of "ambush while marching" logic. Not exactly a sweet on transit like you want @Terco_Viejo but does the trick if you wait awhile to see enemy forms the marching order.
I had to rewrite some of the spawning logic and area calculations, for some reason soldier management, moving people from point X to Y isn't that easy - still idea is very fun to explore. Although it's not clear in the video, I actually implemented a message-delay system, meaning that when marching line becomes too long for big armies, head and tail will not immediately know that they had been attacked and will continue to move forward. After 16 seconds ( 8 seconds each ) entire line will be hostile and trying to organize and take their battle formations.
Reason why they are piling up in the spawn is that I'm ordering them to form a line while marching to keep the cohesion but they designed this formation in a way that everyone gets a magic number and waits for the person in-front of him, which creates a "collider" traffic jam. And if I command them not to form a line, then it looks a like scene from GoT where everyone walks like whitewalkers. ( could be useful for those mods though )


Did you finally find legacy code regarding ambushes?
I wonder how that ambush mechanic TW was about to implement looked before they scrapped it.
While implementing I realized that they left some code pieces for the previous ambush as well. Literally something called AmbushMissionController or something obviously similar.
It appears to be that they designed that one in a very static manner. It's heavily relying on the scene. But they have some interesting stuff, like ambushers are on the high-ground and throwing boulders ( or rolling boulders not clear ) to passing army. I think it's a static scene like bandit hideouts, where you can take only a portion of your units. And based on what they said in blogs ages ago, I think they had a design where chokeholds/ambush places are already preset in the campaign map which you could go and lay out and ambush.

TW's legacy ambush icon on the campaign map.
That's actually the forest bandit hideout icon. Your ambush takes icon of the terrain you are sitting on ( desert bandit hideout mapicon for desert etc )

Thanks to others as well. I also want to see something like that in the game and that's why I wanted to show how doable and actually a good mechanic for players. Even if we won't have it, at least I would like to know that.
@Dejan is ambush mechanic in "Nah we are not gonna do it" state or is there a slight chance that we can see it in 2045 (not giving dates just an approximation :wink:)?
 

Julio-Claudian

Knight at Arms
This is great. Not trying to do anything convoluted or at odds with the way the game already works, simply adding variety to warfare. Opening up another way to play the game. Seems like something that could be easily added and that pretty much everyone would appreciate.
 
My suggestion on the topic.
This.
Currently you can all spot enemies within a certain radius, I don't know if forests, terrain, type of party has any affect on the radius but it's not significant either way.
A good idea is creating more dynamism on spotting. Like @Julio-Claudian said, having chance of negating being spotted determined by skill, terrain... even when inside the normal spot radius.
Having spot radius for friendly troops being the highest; For neutral parties, medium radius; And for enemies, according to some skill on spotting and tactics of their party, a radius between the medium radius and a smaller radius.
As for ambushes, parties would require more skill or special skill to be able to evade the small spotting radius of the other army. Let's say if some party with the ambush ability manages to get inside that small spotting radius undetected, then they stay hidden as long as a "spotting threshold" is maintained by the attacker party.
In more practical terms lets say a blue army is passing through some trees, on the opposite way comes a red army, which as more skill in tactics, spotting and the ambush ability. As they come closer to each other the red army spots the blue army while going undetected and proceeds to follow and attack the blue army.
  • Situation 1: While in the trees, the red army (being undetected) manages to close in and ambush the blue army.
  • Situation 2: While in the trees, the red army remains undetected, but it's not fast enough to catch the blue army as he changed direction. The red army ends the chase still undetected.
  • Situation 3: While in the trees, the red army fails to catch the blue army, but red is in his small spotting zone. As both of armies (red still undetected) exists out of that "tree zone" and enter an "open zone", the terrain advantage progressively fades as both get further away (red still undetected), until the threshold where the blue army is able spot red again. Now as the chase still continues, red is no longer able to ambush, as he is detected by the blue army. The red army still got very close and gets to attack as normal.
Note: The ambush ability is not the same as the ability of renaming undetected. Let's say with only just the ability of renaming undetected you could remain undetected, for example, inside a medium spotting range. The ambush ability would enable parties to get inside the small spotting range undetected and thus performing the ambush (in which, for example, could spawn the attacker in proper formation really close to a defender in a messy formation).
 

Piconi

Fashionista
Section Moderator
M&BWBWF&SNWVC
Now that is really awesome. A marching army in thin line Teutoburg Forest style. Now with the incoming order of battle feature where we were told will be able to set formations before the battle without the perk needed, theoretically, we could set up our troops really close to the enemy line and on the both sides and spawn in like that. Endless possibilities.
 
Top Bottom