Are you, in fact, a pregnant lady who lives in the apartment next door to Superdeath's parents? - Commodore

Create an account  

 
City walls

How about sealing a city with a City Wall completely?
That is, melee units cannot get into the city.
Or perhaps melee units get a large penalty as well.

This way, you'd be forced to rethink your strategies to conquer a city with city walls.

Oh wait, we can't seal a city, because the AI will never know how to handle that!

I've been analyzing the City Wall code and learned some stuff I never knew.

It turns out that if a unit outside a city wall attacks a unit inside a city wall, that the defender gets a defense bonus of +1, regardless of the state of the wall.
Only if the defender is directly behind an unbroken piece of city wall, he gets a defense bonus of +3.

Did any of you know this?
Is it described somewhere?

For future reference, the +3 bonus is hardcoded in wizards.exe at offset 099F4Ch.

The +1 bonus is also hardcoded, but not as the number 1, making it slightly harder to change it. The code for it is at offset 099F4Fh and consists of the 3 bytes "FF 46 F4".
Replacing it with "90 90 90" will effectively erase it.

I like Serena Wrote:I've been analyzing the City Wall code and learned some stuff I never knew.

It turns out that if a unit outside a city wall attacks a unit inside a city wall, that the defender gets a defense bonus of +1, regardless of the state of the wall.
Only if the defender is directly behind an unbroken piece of city wall, he gets a defense bonus of +3.

Did any of you know this?
Is it described somewhere?

For future reference, the +3 bonus is hardcoded in wizards.exe at offset 099F4Ch.

The +1 bonus is also hardcoded, but not as the number 1, making it slightly harder to change it. The code for it is at offset 099F4Fh and consists of the 3 bytes "FF 46 F4".
Replacing it with "90 90 90" will effectively erase it.
People did quite a bit of research into City Walls on Dragonsword, I recall them finding a few bugs like the ones you mention.

Catwalk Wrote:People did quite a bit of research into City Walls on Dragonsword, I recall them finding a few bugs like the ones you mention.

I see what you mean. I found the following post of Kyrub at DS.

Kyrub Mon Apr 26, 2010 1:08 am Wrote:City walls now:
The defenders get +3 defense, if the walls are intact, if they are disrupted they get +1 only. The defenders not standing in the spaces just behind the walls get +1 only as well (bug, fixed).
The attacker that are non-corporeal and the fliers and the mergers can attack through walls, ignoring the defensive bonus.

Replenishing ammo seems quite logical to me, there must be enough ammo stored in the fortress. I would give simply unlimited ammo to those behind city walls.

Teaching AI to keep more ranged unit... When I know how to do this, I'll know many other important fixes. Like, AI will avoid having full roster in the city, AI will avoid keeping only magical creatures as garrison (it creates unrest). I am not there yet.

By saying "not allowing the stalemate" you mean: after 50 turns, the attacker has to retreat with all the consequences?

I wonder how Kyrub fixed it exactly?
How does it work now in Insecticide?

Either way, the unit standing directly at the entrance is effectively standing behind a broken piece of wall, giving him only a +1 defense bonus, which makes it too easy to force entrance.
EDIT: This is not the case. At the gate the defense is the same as on any wall, which is +3 Defense. Proposal below edited to match.

[Image: citywalls.gif] Unprotected +1, Protected +9 (originally +1 and +3)
I propose to increase the defense bonus directly behind an unbroken wall to +9. (This is something I could do.)
Rationale: Make City Walls more attractive to use and force us to adjust our strategies when encountering a City Wall.
Historically City Walls made a lot of difference. The attacker would need at least 3 times as many men, and required siege engines just to get in!
Btw, I haven't tried yet to consider the consequences for AI.

Hmm, that broken wall thingy is tricky to define. I don't really like how it works currently, ideally the game would track the trajectory of the projectiles to see if the units are protected or not. I know, impossible smile I don't have any good ideas for fixing it satisfactorily.

Alternative approach: How about changing the wall crusher ability to wall piercing somehow? Instead of breaking walls, let units with the wall crusher attack through walls without penalties. Makes it easier to define who's inside a wall instead of that broken wall nonsense.

Catwalk Wrote:Alternative approach: How about changing the wall crusher ability to wall piercing somehow? Instead of breaking walls, let units with the wall crusher attack through walls without penalties. Makes it easier to define who's inside a wall instead of that broken wall nonsense.

I do not consider the broken wall nonsense.
Historicall attackers would typically try to breach the wall, but even when they do, they don't have it easy yet. The defenders are ready for them (def +1)!
On the other side of the city, where the wall isn't breached, the defenders still have their full defense bonus (def +3).
This is how it works and how it should remain.

It's only the gate keeper that has a defense bonus that is too low (only +1), when this part is extra fortified. I propose to make the gate keeper bonus a separately configurable bonus.

This could be done within Insecticde - without changing any numbers.
That gives a mod the opportunity to change the numbers.
--I like ILSe

Then I'm still a little confused about exactly how city walls currently function. Please break it down for me.

Catwalk Wrote:Then I'm still a little confused about exactly how city walls currently function. Please break it down for me.

As I understand it, the City Walls work as follows.

Any bonuses only apply when an attacker from outside the city, attacks a defender that is inside the city. This can of course be melee as well as ranged attacks.
Once the attacker is inside, the City Walls have no effect anymore.

Each defender is standing on its own wall (max 7 units) which gives him a defense bonus of +3 shields. Furthermore a defender on a wall cannot be attacked by melee.

The exception is the gate keeper (max 1 unit) who is not standing on a wall giving him only a +1 defense bonus. This also means the gate keeper is the only unit that can be attacked in melee.

The defenders in the middle of the city (max 3 units) have a +1 defense bonus, but effectively this only applies for ranged attacks (since the attack has to come from outside the city).
Kyrub fixed this in Insecticide, giving these units also a +3 defense bonus (independent of broken walls).

When a wall is broken, 2 things happen: the defender standing on it can now be reached by melee attacks, and his defense bonus is reduced to +1 shields.

Note that I need confirmations on a couple of things, which I will be researching and reporting in the new thread "Explorations with the Tweaker". These are:

  1. Does the gate keeper really have only a +1 bonus?
  2. Does a flyer attacking through the wall really hit against a +3 shield bonus?
  3. Does a Phantom Beast attacking through the wall really hit against a +3 shield bonus?
  4. Does a Wraith attacking through the wall really hit against a +3 shield bonus?
--I like ILSe

My two pence:
Code:
1. +3 def (Gate)
2. +3 def (flyers)
3. 0 def (Phantom Beast)
4. +3 def (Wraith)

2 and 4 seem to be a bug (if they really work like it was said).



Forum Jump: