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 next 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

Re: New Feature: Improved ambush[message #340863 is a reply to message #340857] Mon, 04 May 2015 08:36 Go to previous messageGo to next message
smeagol is currently offline smeagol

 
Messages:2705
Registered:June 2008
Location: Bremen, Germany
As for the issue that came up on IRC last night (not sure if already solved or not):

The center entry point can be placed manually in the map editor, but it certainly should be locatable via its GridNo., no?

Report message to a moderator

Lieutenant

Re: New Feature: Improved ambush[message #340865 is a reply to message #340863] Mon, 04 May 2015 10:10 Go to previous messageGo to next message
silversurfer

 
Messages:2791
Registered:May 2009
That certainly sounds like a good improvement. I have a scout in my main squad but the others don't have that luxury.


smeagol wrote on Mon, 04 May 2015 07:36
As for the issue that came up on IRC last night (not sure if already solved or not):

The center entry point can be placed manually in the map editor, but it certainly should be locatable via its GridNo., no?

The center grid number should be in "gMapInformation.sCenterGridNo". Why do you ask?



Wildfire Maps Mod 6.07 on SVN: https://ja2svn.mooo.com/source/ja2/branches/Wanne/JA2%201.13%20Wildfire%206.06%20-%20Maps%20MOD

Report message to a moderator

Lieutenant
Re: New Feature: Improved ambush[message #340866 is a reply to message #340865] Mon, 04 May 2015 13:00 Go to previous messageGo to next message
Flugente

 
Messages:3507
Registered:April 2009
Location: Germany
Yeah, I'm aware of the solution - I just didn't have the time yesterday to add that, will try to add that today.


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

Re: New Feature: Improved ambush[message #340867 is a reply to message #340866] Mon, 04 May 2015 17:06 Go to previous messageGo to next message
Deleted.

 
Messages:2657
Registered:December 2012
Location: Russian Federation
Very useful feature!
I always disabled enemy ambushes because they were completely unplayable. Now they should be much more interesting to play.

Maybe the distance to nearest enemy should depend on merc's stats and skills?
For example, scout skill instead of preventing ambushes gives +10 distance to nearest enemy.
Or having a binoc in the hand/inventory while travelling can give similar bonus.

Also a scout/leader/guerilla background can give a bonus to player interrupt on the first ambush turn.



Left this community.

Report message to a moderator

Lieutenant

Re: New Feature: Improved ambush[message #340894 is a reply to message #340867] Wed, 06 May 2015 00:52 Go to previous messageGo to next message
Flugente

 
Messages:3507
Registered:April 2009
Location: Germany
Don't have any coding problems with this, but... you know that feeling when you've discovered a new series you enjoy late? When there's already entire seasons finished, just there for you to watch? Well... that happened cheeky Plus busy at RL work speechless

[Updated on: Wed, 06 May 2015 00:53]




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

Re: New Feature: Improved ambush[message #340935 is a reply to message #340894] Sun, 10 May 2015 13:30 Go to previous messageGo to next message
Flugente

 
Messages:3507
Registered:April 2009
Location: Germany
As previously announced, I made another improvement here (r7854 & GameDir r2241):
  • The enemy encirclement radii are now dependent on your mercs' experience. The reasoning being that if your mercs are more experienced, they notice the enemy sooner, when he's further away... in pseudocode:
    radiusmodifier = ( 10 * (merc's experience level) + 50 * (merc is a scout) + (background ambush radius modifier) ) / 100
    
    This modifier is multiplied with AMBUSH_ENEMY_ENCIRCLEMENT_RADIUS1 and AMBUSH_ENEMY_ENCIRCLEMENT_RADIUS2. It is determined for each merc, the highest value counts.
  • The radii values have also been increased in the ini. Still needs testing, perhaps even higher would be better, feedback welcome.
  • A new background property (<ambush_radius>) is used in the above formula, values from 0 to 50. This effectively increases the range at which an enemy can appear in an ambush, and has been added to some backgrounds - mostly to special forces and mercs very experienced in ambushes.
  • If your team has a member that is a very, very good leader, we presume they are quick-witted and determined enough to organize your team before combat - you can then deploy your mercs around the central entry point.
    http://i.imgur.com/YGtGxBL.png
    The check needed to pass is
    leadership + 50 * (number of squadleader traits) > 120 (new trait system)
    respectively
    leadership + 30 > 120 (old trait system)
    
    It is determined for each merc, the highest value counts.
    As we can only draw rectangular overlays in this screen, some parts of that rectangle are inaccessible (as the allowed deployment zone is a circle), but that is a graphical 'bug' only.



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

Re: New Feature: Improved ambush[message #346769 is a reply to message #340935] Thu, 01 September 2016 14:47 Go to previous messageGo to next message
Boojum

 
Messages:11
Registered:September 2016
Excuse me, but it is quite strange. There are 4 mercs who can organize the team before combat (Miguel, Raider, Leon, and Gus). After the short training Scream is able to do this too. But with the old trait system only Miguel can do this, because merc's leadership must be > 90 for this action. Maybe that value of 90 could be a bit lowered?

Report message to a moderator

Private
Re: New Feature: Improved ambush[message #346776 is a reply to message #346769] Thu, 01 September 2016 20:33 Go to previous message
Flugente

 
Messages:3507
Registered:April 2009
Location: Germany
One can always argue which values are correct. As this should be really hard to pull off, the value seems fine to me.


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

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


Current Time: Sat Oct 12 10:14:03 GMT+3 2024

Total time taken to generate the page: 0.01416 seconds