# Realistic building sizes and placement

Discussion in 'Modding' started by Francesco_Cavalli, Dec 27, 2016.

1. ### Francesco_CavalliActive Member

Slightly experimental, but quite pretty, this allows you to place buildings far closer together, and also makes them far larger. I'm keen for people to spot sizing issues that particularly stand out. Currently Ukraine and the Islamic states aren't changed but all other countries are.

The ai, of course, isn't a great town planner. Ai cities don't look terrible but won't look quite like the screenshots attached!

To preserve pathing, bound boxes are yet to be changed, so occasionally units walk through the very corner of buildings. To install, drop the buildings folder into data/objects, and the dlc1 folder into cossacks3/dlcs.

#### Attached Files:

File size:
312.1 KB
Views:
70
File size:
876.3 KB
Views:
152
• ###### 333420_20161227213724_1.jpg
File size:
827.7 KB
Views:
141
Demoul, Johny, wildlumberjack and 8 others like this.
2. ### A. SoldierActive Member

Dude, if you keep this up I'll forget about modding the game,this is brilliant.

3. ### Original-Cossacks-PlayerActive Member

Agree with A. Soldier, brilliant work!

GSC did say at one point they may make the buildings a bit bigger, but I have a feeling that they will leave them the size they are, so love your work. Would be good to see ship sizes increased too.

What I am hoping for is that we will be able to zoom out further with the camera too, like in American Conquest, it's the only way to control and asses the battlefield.

4. ### StuActive Member

This is great and good work Francesco_Cavalli; you are discovering and producing some brilliant stuff even without modding tools and support.

5. ### Francesco_CavalliActive Member

Thanks all for the kind words - it's lovely to have the time (briefly) to delve! I'd love to sort the collision out next, but the problem is that the way it's drawn bears no relativity to the scaling numbers - you draw out the pathing like this:

[*] = 000000000000
[*] = 000000011110
[*] = 000000111110
[*] = 000001111110
[*] = 000011111110
[*] = 111111111110
[*] = 111111111100
[*] = 011111111100
[*] = 001111111100
[*] = 000111111000

...which makes it very difficult to judge when you've got it right!

6. ### LonerActive Member

Love your work, by collision do you mean how close one unit gets to another, because that is one thing that annoys me, how so many units are crammed into a small area.

7. ### Francesco_CavalliActive Member

Here I meant the collision between units and buildings, but yes that's it - I think I've cracked that too! What I can't promise is that units maintain formation though when attacking. It works wonders for slowing melee combat down as 70 men can't all attack the same bloke

Stu and Loner like this.
8. ### StuActive Member

Sounds like another great find. This would also be another factor that would help to prevent blobbing of units and go towards capturing a more realistic feel to battles. Given the amount of discoveries that are being made I think there is a huge amount of promise in this game for modding and being creative.

9. ### Eugène de SavoieMember

@Francesco_Cavalli
Did you see the parameter 'ScaleFactor' in the file refbulding.prop in folder \objects\ref? I enlarged it to 2 same as tje defaultScaleFactor. The result was: there is a zoom in effect but it is only for the buildings. The distance between them is reduced also.

In my opinion it is not programmed very well. If they had one general scale factor they could manipulate it for every building in a central routine and trial the best scale.

10. ### Francesco_CavalliActive Member

I did - it would be a lot easier but it's quite nice to be able to adjust some buildings individually, so that Westminster Abbey etc are much bigger than the other buildings. Does it affect the collision too?

11. ### Eugène de SavoieMember

Two factors could be a solution. The first is the individual one. The second is general.
I did not test it yet.

I removed the zeros in the structures of the building. The structure of AUSCENT (Austrian town hall?) looks like the following:
[*] = 111
[*] = 11111
[*] = 1111111
[*] = 111111111
[*] = 11111111111
[*] = 111111111111
[*] = 111111111111
[*] = 1111111111
[*] = 1111111
[*] = 11
[*] =
struct.end

And that's EURSTO (the storehouse?):
[*] =
[*] = 1
[*] = 11 1
[*] = 1
[*] =
struct.end

Do you know, where the program code for it is located? Otherwise every modification is trial and error.

EDIT: the posts in this forum do not display Courier New correctly.

File size:
20.6 KB
Views:
10
12. ### Eugène de SavoieMember

DefaultScaleFactor = 4
See the results! Peasant inside building!

Last edited: Dec 29, 2016
zerr and General WVPM like this.
13. ### KsgripNew Member

You made me want to buy the game back. Could you do the other nations?

14. ### EbelModeratorStaff Member

Thought I wrote about this in the how to add a building guide, it appears I forgot.

Go to editor.exe, place a building, go to "view -> collision" . This is a visual display of the collision mask in the properties.

Code:
   Mask : struct.begin
[*] = 00000111000000
[*] = 00001111100000
[*] = 00011111110000
[*] = 00111111111000
[*] = 01111111111100
[*] = 01111111111110
[*] = 00111111111111
[*] = 00011111111110
[*] = 00000111111100
[*] = 00000000110000
[*] = 00000000000000
struct.end

Now, to easy edit this, select the building in the editor -> right click -> view in "property editor" (F1)
Click on the "Collision mask Properties" tab (not collision mesh) -> press "edit mask"

Click on the mask to add x or remove. To save , simply close the Property editor, it will ask you to save. Save it to your desktop, don't go overwriting the original. Then open it and copy the mask into the original file.
Note: you could overwrite the original, but it's gonna bloat the prop file with every possible option from the property editor ( some 300 lines extra which aren't needed)

It will rotate the building after closing, dont worry about this. Some derp in the editor i reckon. Just place a new building to see your changes.

That should make it a bit easier to judge in real time if you got it right.

Edit: I just had a quick look at your files. I don't quite understand why you are changing the bounding box values to be able to place buildings closer. Not only is this a lot of work to do for every building, it also leads to issues with units walking through walls/being able to hide in a building, which is sketchy. It obviously achieves the goal you intended to.
Why not simply use the value in dmscript.global?
Code:
   // place building restricts
gc_path_mincoldist = 1;
gc_path_minemincoldist = 3.24;
`
This sets it for all buildings. Try it out, set it to 0.1 without collision box values altered. Even if you intend to change the bounding box values (for resizing the building/we), then the gc_patch_mincoldist is the buffer between buildings (defined by their bounding box) that can't be altered by changing the bounding box values. Can't say i tried out much, it may also be possible if values are too close, units won't be able to move between buildings anymore.
I hope that made sense.

Last edited: Dec 31, 2016
Eugène de Savoie likes this.
15. ### Francesco_CavalliActive Member

Many thanks for this - I'd actually increased the bound boxes to try and match the new building sizes somewhat, the problem being that the bound boxes only affect building placement and not unit collision, unless I'm mistaken?

16. ### DaddioModeratorStaff Member

EBEL, you never fail to amaze me!

GSC would be very wise to hire you!

Loner likes this.
17. ### Eugène de SavoieMember

@Ebel:
1. I am lost with the editor. How can I create a building. In the menu layers I managed to create units but I did not found "buldings".
2. I tried an existing map and found the collision mask and could manipulate it but did not understand the rule of the manipulation.

18. ### EbelModeratorStaff Member

1.In 2 steps:
1.1. Go to Advanced - Player -> Add a player, and select "Race" buildings, or leave to 'units' if you want to spawn units.
1.2. Go to Layer - Players (CTRL+ALT+U)-> Click on buildings/units depending on what race you chose in previous step. A tree will open will all the units or buildings. Then simply place on the map. To 'stop' placing, press the spacebar.
2. Bit vague, not quite sure I understand what you mean. Perhaps try 1. again and see if it makes more sense?

19. ### Eugène de SavoieMember

Thank you, Ebel. Sorry for the delay.

I just added some screenshots according to your explanation.
1. menu Advanced - Player after I added a player and selected 'buildings' in drop box Players Race.

2. menu Layer - Players: click on buildings shows the list of available buildings

But...,
you see the original collision mask on the left and my modifications on the right.

How do I know, whether I did it right? Only when I play the game? That's my second question.

20. ### EbelModeratorStaff Member

Just place the building again after having made changes, and turn on "view -> collision". If you see the change, then you've done it right.