Jump to content

Disable unit overlapping


Recommended Posts

Units in A26 and A25 can squeeze themselves into tiny singularities which causes many problems. This screenshot is one example (it's not even the worst case, I missed the worst moment). Inside this picture are 76 spearmen, all crowded into this one small area. As you can see, the middle ones are overlapping each other with body parts inside their friends. 

image.png.b90e8ba13f422d4f4a15446af5790431.png

This is bad. The results of this is 30 or 40 spearman all focusing on one enemy while leaving the rest of your units unattended. It causes very quick death rates and the melees are not doing their job of shielding their ranged units. It is actually less efficient in battles and causes chaos, but hurting both sides. Quick death rate is bad and is the hidden cause of many other problems.

I understand that this feature was implemented in A25 for smoother and more efficient pathfinding. However, it is now just ridiculous and unrealistic to cram dozens of units into such a small area. I propose we let units have their own rigid personal space, no entering your friend's bodies. 

Now, I know it's too late for A27 vanilla, so can someone teach me how to make a mod that disables the squeeze? So that there is a chance that community mod will have this problem fixed. Thanks.

Edited by Yekaterina
  • Thanks 1
Link to comment
Share on other sites

Unit overlapping:

image.png.4bb7267f25182852481aa1d4003c10b7.png

elephant inside ram...

image.png.b47cd0c6358943aad03d7f9c965469a0.png

This small group is 33 spearmen.

The overlap happens when you attack move in formation.

In the most extreme cases, n1met was able to cram 100 units into the size of around 4 spearman. It's totally insane. 

 

I'm not sure which file to edit to disable this, or if it's inside the engine already. 

Link to comment
Share on other sites

  • Yekaterina changed the title to Disable unit overlapping

The advantages of no unit overlap: 

  • Formations become more relevant. Currently, when your units are ordered to attack, the melees stick themselves into a ball and chases the enemy melees. It doesn't matter what formation you were using; everything is permeable and no-one maintains your formation after attack move. Without unit pushing, you can't move melee through yours and your enemy's lines so easily, so whichever formation you go in with will be maintained. And it's necessary to go in with formations now because your melee can't automatically emerge at the right places if you misplaced them. 

 

  • Better-looking battles.  Right now everything is very dense, chaotic projectiles fly everywhere and many units die in just one second. You can't see anything clearly apart from your rapidly falling population count. This is especially bad in 4v4 battles, where 400 units are involved at one place. AI players might not realise this because the AIs always commit a small number of units and never attack move or use formations. 

 

  • Less lag experience. The game turn counter is moving slowly but you miss less things that took place so you don't feel lag and stutter. You feel like a long story. 

 

  • Less frustration, anger and toxicity in the lobby. 

 

Link to comment
Share on other sites

Amazingly, disabling unit overlap can reduce toxicity and arguments in the lobby. The reasoning is as follows:

Observation: Many arguments are caused by teammate not being able to come help in time. One player's army has been wiped out completely when the other has just arrived. 

Reason: units die too fast. 

Even if the other ally was on their way before the battle started, their border allies can't even live long enough for them to walk through their base, especially in the case of 2v1. We shouldn't make a 2v1 situation a certain death sentence for anyone. Currently one person can't survive for more than one minute in 1v2.  @Norse_Harold witnessed such a case between JC and sanafur yesterday. 

Now, if the kill rate has been decreased, sanafur and JC wouldn't have lost everything in that short 2v1 moment, hence there wouldn't be the argument. Same applies for Ivaylo. He arrived 30 seconds late and I lost 80 units in less than a minute.

Due to the extremely quick death, players have to rely on others to arrive in time. If they fail, an argument breaks out. This is also why many new players are excluded because people fear that they couldn't arrive in time to solve 2v1. 

Disable unit overlap is one way to slow down death rate. 

Link to comment
Share on other sites

9 minutes ago, Player of 0AD said:

I'm strongly against removing unit overlap, because it actually means more lag

Please explain how unit overlap solves lag. I don't understand. 

I already tried to make a mod which partially disables unit overlap (doesn't overlap unless I do the formation trick), and I noticed no change in frame rate. 

Edited by Yekaterina
Link to comment
Share on other sites

9 minutes ago, Player of 0AD said:

actually means more lag

From my observations in the template files and pathfinder, the units have a minimum size, a finite volume. So they are not infinitely compressible. When a unit pathfinds through the crowd, they still have to take account of the size of other units around it. The difference is the unit footprint parameter, which is just 2 different constants (with unit squeezing having a smaller value), but it doesn't change the number of calculation work that the CPU does. 

A24 lagged because of many other issues, which were resolved since A25. One of the causes was low refresh rate, which has now been fixed. Unit overlap was not really the absolute main cause. Another problem with A24 was the slow turn rate. This made units look stupid in dense crowds, especially at forests, also which caused the boom rate to be slow. Many were reaching city phase and full pop by minute 14 back then. Nowadays everyone has full pop by 12:00. 

Think back further to A23. There was no unit overlap and there was not a lot of lag. At least less lag than A24. 

Lag can be reduced using other methods such as lowering the details of units and other graphics. 

Link to comment
Share on other sites

it can't be done trough mods, because it's implemented trough c++. there is a configuration file but the options are limited (it's better understood if you try changing it yourself anyway). if you search the forum I've posted quite a lot about this issue. 

Link to comment
Share on other sites

3 minutes ago, alre said:

it can't be done trough mods, because it's implemented trough c++. there is a configuration file but the options are limited (it's better understood if you try changing it yourself anyway). if you search the forum I've posted quite a lot about this issue. 

please link me to it, I can't find your posts

Link to comment
Share on other sites

https://code.wildfiregames.com/D4970

You should be able to easily make a mod based on this patch. From my own experience, there is a steep tradeoff between pathing and overlapping. If units push each other too hard, pathing becomes disastrous, with units walking in place or even moonwalking.

Also, 0 overlap means women may kick each other off of berries for example. I have seen them go through perpetual motion like this lol. just like a newtons cradle.

I found a pretty good 'middle ground' in the comments in that post, so that might be a good place to start from.

Edited by real_tabasco_sauce
  • Like 2
Link to comment
Share on other sites

5 hours ago, real_tabasco_sauce said:

Also, 0 overlap means women may kick each other off of berries for example. I have seen them go through perpetual motion like this lol. just like a newtons cradle.

So the unit overlap should be different for different units. Melee, strictly no overlap! It's just disaster. However, ranged infantry and women can use some overlap for easier pathfinding around berries and trees. 

 

Just look at weirdJokes' melee:

image.png.b27d9bc7ee274d048649c8a4ee545529.png

make no mistake, that is 70 spearman... lol

 

Link to comment
Share on other sites

6 minutes ago, Yekaterina said:

So the unit overlap should be different for different units. Melee, strictly no overlap! It's just disaster. However, ranged infantry and women can use some overlap for easier pathfinding around berries and trees. 

 

Just look at weirdJokes' melee:

image.png.b27d9bc7ee274d048649c8a4ee545529.png

make no mistake, that is 70 spearman... lol

Have you tried the values I suggested in the patch? I think they were a pretty good middle ground, as there are many undesirable behaviors outside of certain ranges.

1. being the "bog down" of pathing units.

2. bulky units can be pushed into interlocked pairs.

and a few more.

I think it was being considered for committing but people lost interest i guess.

  • Like 1
Link to comment
Share on other sites

This is an issue with unit motion, and unit motion is really freaking hard. I made some attempts back in like 2017 to fix unit motion at the time, without full success.

After coming back to the game after years of absence, I'm actually quite pleased with how a26 unit motion works. It's true that units can be packed more than before, but unit used to have the opposite problem where they'd travel single-file everywhere with excess spacing.

Anyway, there's room for improvement in helping units to not bunch up so much, but it's not so simple as just enabling or disabling a setting. You'd have to implement a different algorithm (and then make sure it's performant enough, and doesn't interfere with woodcutting/gathering).

  • Like 1
Link to comment
Share on other sites

4 minutes ago, causative said:

Anyway, there's room for improvement in helping units to not bunch up so much, but it's not so simple as just enabling or disabling a setting. You'd have to implement a different algorithm (and then make sure it's performant enough, and doesn't interfere with woodcutting/gathering).

yeah there is only so far you can optimize the current situation. The tradeoffs become quickly apparent when changing the existing values.

Link to comment
Share on other sites

2 hours ago, Yekaterina said:

@causative @real_tabasco_sauce @BreakfastBurrito_007 what do we think about the pathfinder back in A23? Was that good? I remember seeing youtube videos of A23 and I think everything was quite smooth back then, with little unit overlap and quite quick booms. 

I'd say boom times are quite comparable between a23 and a26. I think the slinger balls had a good bit of overlap at times, hard to say it was better than current overlap. See what you think of my middle ground pushing values, I thought they were pretty good, but its a difficult thing to quantify.

Link to comment
Share on other sites

10 hours ago, real_tabasco_sauce said:

https://code.wildfiregames.com/D4970

You should be able to easily make a mod based on this patch. From my own experience, there is a steep tradeoff between pathing and overlapping. If units push each other too hard, pathing becomes disastrous, with units walking in place or even moonwalking.

Also, 0 overlap means women may kick each other off of berries for example. I have seen them go through perpetual motion like this lol. just like a newtons cradle.

I found a pretty good 'middle ground' in the comments in that post, so that might be a good place to start from.

0.2 0.1 0.3 0.9 0.65 0.2 0.9 0 still gives me death balls. :/ 

Link to comment
Share on other sites

8 minutes ago, wowgetoffyourcellphone said:

0.2 0.1 0.3 0.9 0.65 0.2 0.9 0 still gives me death balls. :/ 

Yeah, as I said before, its a very steep tradeoff, so there is only so far you can optimize. But if you want to experiment more to find even better values, that would be worthwhile.

The video in the patch shows pretty low overlap, but what it doesn't show are units kicking each other off of buildings and resources, and units walking in slow motion, which happens when they push each other more strongly.

Link to comment
Share on other sites

It should be possible to completely disable by setting the 'radius' in pathfinder.xml to 0. But you'll also want to increase unit obstruction radius in that same file to something like '2' if you want no overlap at all. This will generally make pathfinding terrible though.

  • Thanks 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...