Home » MODDING HQ 1.13 » Flugente's Magika Workshop » New Feature: Improved ambush
New Feature: Improved ambush[message #340857] Mon, 04 May 2015 01:04 Go to previous message
Flugente

 
Messages:3507
Registered:April 2009
Location: Germany
As you surely know, if mercs travel around the landscape, there is a chance that enemy patrols will ambush them. Once that happens, battle starts, with no chance of retreat or autoresolve. Your mercs then start combat, grouped together very tightly, all looking in one direction, with the enemy spawning everywhere. Now, while I get that the mercs are ambushed and thus unprepared, I still have a few problems with that:
  • Why would our mercs travel so close to each other? This isn't a japanese subway.
  • As they all look in one direction, it is very likely the enemy gets the first turn...
  • ... and as they are all grouped so close together, a single grenade can effectively be the death of the entire team. Yeah yeah, 'but it's a surprise attack' and everything, but let's be honest. There's no way to avoid that apart from tedious savescumming. At higher difficulty levels, this is practically unwinnable.
  • The enemy does not spawn in any cohesive way - they are all placed as usual. Jeez. You almost think they didn't plan the ambush, as if this is just some small code bit to simulate 'ambush' without any effort on Sirtech's part cheeky
  • Why would the enemy spawn right next to our mercs, at point blank range? How did he come so close?
Yes, I am aware that having a Scout prevents ambushes, but if a part of the game is so undesirable, why not improve it instead?
I have thus added improved ambushes to the trunk. What now happens is that when our mercs are ambushed, we can simply assume that in the few seconds before we enter tactical, they react somewhat. As a result, they are deployed somewhat randomly in a circle around the entry point they'd normally all be clustered at, and look outward to the possibly advancing enemy. This simulates them instinctively facing the danger without really knowing where it comes from.

Similarly, the enemy will no longer spawn at point blank range, they'll spawn a bit apart (after all, they have to first let us walk to the center before finishing their encirclement). How far is up to your ini. And if you want, you can spawn all of them in an encirclement movement.

http://i.imgur.com/q4V7xq4.png?1
The old way of ambushing. Our mercs cuddle in the middle, the enemy is all over the place.

http://i.imgur.com/0dwQ50T.png
The new way of ambushing. Our mercs are a bit spread, facing possible enemy directions, while the enemy has us encircled (minimap) and faces us.

JA2_Options.ini with default options:
; If set to TRUE and mercs are ambushed, they won't start clustered in one location and looking in one direction.
; Instead they will be spread around the map central entry point, no more than AMBUSH_MERCS_SPREAD_RADIUS tiles away, and all looking outwards.
AMBUSH_MERCS_SPREAD = TRUE

AMBUSH_MERCS_SPREAD_RADIUS = 10

; If set to 1 and mercs are ambushed, enemies nearer than AMBUSH_MERCS_SPREAD_RADIUS to the map central entry point will instead be distributed more outward:
; They will be placed around that point, not closer than AMBUSH_ENEMY_ENCIRCLEMENT_RADIUS1 and not further away than AMBUSH_ENEMY_ENCIRCLEMENT_RADIUS2 tiles.
; They will face the center entry point (and thus the mercs).
; If set to 2, all enemies will be placed that way, not just those nearer than AMBUSH_MERCS_SPREAD_RADIUS.
AMBUSH_ENEMY_ENCIRCLEMENT = 1

AMBUSH_ENEMY_ENCIRCLEMENT_RADIUS1 = 15
AMBUSH_ENEMY_ENCIRCLEMENT_RADIUS2 = 30


This is actually not entirely finished, I still have a few more ideas... but still have to code a bit there, while this part here already seems good to go. Note that these are experimental values. I still haven't played with them - it is highly likely that if there are more enemies, you will want AMBUSH_ENEMY_ENCIRCLEMENT_RADIUS1 and AMBUSH_ENEMY_ENCIRCLEMENT_RADIUS2 to be much higher.

This is fully savegame compatible.

This has been added in r7846 and GameDir r2238.



I know now that it could never work between us, as much as we wanted to, it could never be! Not because you're a rabbit, but because you're black.

If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.

Report message to a moderator

Captain

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: New feature: mines require workers
Next Topic: New feature: bear traps
Goto Forum:
  


Current Time: Sat Nov 30 05:33:41 GMT+2 2024

Total time taken to generate the page: 0.01013 seconds