Bounty/Request: Reduce Structure Placement Restrictions (CLAIMED!)

XionicFire

New Member
Joined
May 23, 2017
Messages
46
UPDATE: Bounty has been claimed by Halyn!, the solution is to edit the .sfp files CLIENT side, no changes need be done server side, the most leeway values you can have without "breaking" something are as follows:

Best calculation is by plot size this is if you wish to avoid "flying" bits of the structures on 99% of placements and still have door accesible:

Ran most tests and they check out, so you should be safe with these numbers

Will update as we tweak them.

Industrial:
1x1:4
2x2:4
3x3(Factories/Merch tents): 5
3x4(Harvesters): 5
5x5 and bigger(Structure Factory):7

Exceptions
Wearables Factory: 7

Residential:(x2 of industrial in plot size)
Guildhalls/large/medium houses:14 (2x of 5x5)

GCW:
(will check at a later date but will also report altho these do "flatten" terrain around them. so im not sure how they do it but i suspect angle is not too much of an issue for these)

City Buildings:
Theater: 10
Cantina:14
Cloner: 10
Gardens: 7
Garage: 14
DO NOT MOD, anything over default causes it to fly:
City Hall
Hospital
Bank
 

Special Structures:


I hope everyone enjoys this mod as much as we are, its the best mod ever since server draw distance 750! both these mods make up for a stunning city, will post pictures


===================== Original Post ========================
What the title says

We want to reduce structure placement restrictions to where any structure can be placed in any terrain up to a 45 degree angle difference between one of its sides and the other (currently its around 5 degree angle maxium)

We hereby offer a bounty of $50, $75, to the first person that posts here (and we can successfuly replicate it) the code/file changes required to excecute this modification.


Heres what we know so far:

Modification to allow housing and buildings to be placed on slightly less uneven terrain

Identified server side files and modified them with no success:

All files on:
bin/scripts/object/installation/*.*

/src/server/zone/managers/structure/*.*
StructureManager.*

Posibly:
/src/templates/footprint/StructureFootprint.h
/src/templates/installation/FactoryObjectTemplate.h
/src/templates/installation/SharedInstallationObjectTemplate.h
/src/templates/intangible/*.*

However this modification possibly also requires changes CLIENT side to support these features, that includes modifying the following files on the following TREs

Every SFP file inside:
footprint/*.*
clientdata/building/*.*

And Possibly these:
object/static/base/shared_static_base.iff
object/static/base/shared_static_default.iff
object/static/installation/*.*
object/installation/*.*
object/construction_contract/*.*
 

Lasko

Moderator
Staff member
Moderator
Joined
Feb 13, 2012
Messages
295
RE: Bounty/Request: Reduce Structure Placement Restrictions (PayPal)

Have you tried using a .lay file?

You have to make one for every building type (although the same file could be used by several buildings of the same size).

Found in /terrain in the tre's for reference.

You will need to point to the .lay in the object .iff in the terrainModificationFileName chunk.

Not tried it so don't know how it would cope on really uneven terrain, but it might work??

And I don't need paying:)
 

XionicFire

New Member
Joined
May 23, 2017
Messages
46
RE: Bounty/Request: Reduce Structure Placement Restrictions (PayPal)

Lasko said:
Have you tried using a .lay file?

You have to make one for every building type (although the same file could be used by several buildings of the same size).

Found in /terrain in the tre's for reference.

You will need to point to the .lay in the object .iff in the terrainModificationFileName chunk.

Not tried it so don't know how it would cope on really uneven terrain, but it might work??

And I don't need paying:)
Well thats the thing (and why were paying lol) atm that change you just proposed while it makes sense and will probably work, it iis completly outside of our skillset and unless it would come in like a step 1, 2,3,4 for dummies theres just no way wed know how to do it.

Since we know your time is valuable and we dont expect you to waste your time explaining extreme coding to us mere mortals we would like to pay people like you for your time to make a dedicated step by step post on how to acomplish this.

In the end, even tho wed pay for it, the entire comunity will benefit as the guide would be here, in public for everyone to see.

Were good at variable/code mods but not so good at actual game client hacks lol
 

XionicFire

New Member
Joined
May 23, 2017
Messages
46
RE: Bounty/Request: Reduce Structure Placement Restrictions (PayPal)

Lasko said:
Have you tried using a .lay file?

You have to make one for every building type (although the same file could be used by several buildings of the same size).

Found in /terrain in the tre's for reference.

You will need to point to the .lay in the object .iff in the terrainModificationFileName chunk.

Not tried it so don't know how it would cope on really uneven terrain, but it might work??

And I don't need paying:)
Just to give you an example

1: what is a .lay file?

2: where is it found?
in /terrain in the tres

3: how does it work?

4: how do you make one?

5: what software is involved?

6: does it require special language knowledge?

7: how can i test if it worked?

8: how do i properly add it to a tre?

etc etc lol
 

XionicFire

New Member
Joined
May 23, 2017
Messages
46
RE: Bounty/Request: Reduce Structure Placement Restrictions (PayPal) (Updated!)

Updated Bounty!
 

Halyn

That One Guy
Staff member
Moderator
Joined
Jan 11, 2015
Messages
257
Location
Empire in Flames
RE: Bounty/Request: Reduce Structure Placement Restrictions (PayPal) (Updated!)

You were looking in the right place with SFP files.

Structure Footprints determine whether a building can be placed. The INFO chunk has the important information here - it's four integers followed by two floats - the floats are your tolerance for unevenness of terrain. Increase those and you're in business. In the case of this screenshot, I'm modifying the SFP for the large generic house style 01 - the normal height tolerances are 8/8. With these settings...



I can do this:



You'll need to tweak settings to get something acceptable for your use.
 

XionicFire

New Member
Joined
May 23, 2017
Messages
46
RE: Bounty/Request: Reduce Structure Placement Restrictions (PayPal) (Updated!)

Awesome!

Just to be clear....

do we need to change ANYTHING server side or is it all in in these files?

if we have to change anything in the server files what do we change?

could you attach a sample of say large generic guild hall with the modifications? just so we can edit it and see the diff vs a normal file?

If this works, you sir have claimed a bounty! :D
 

XionicFire

New Member
Joined
May 23, 2017
Messages
46
RE: Bounty/Request: Reduce Structure Placement Restrictions (PayPal) (Updated!)

on an unrelated but related question

How hard would it be to modify it so that when you place a house on uneven terrain,only past a certain degree of incline, the house levels the terrain around it just like the camps do?

maybe add that bit to the structure manager code?

This with the intention of avoiding accidental "doors stuck inside cliffs" situations
 

Halyn

That One Guy
Staff member
Moderator
Joined
Jan 11, 2015
Messages
257
Location
Empire in Flames
RE: Bounty/Request: Reduce Structure Placement Restrictions (PayPal) (Updated!)

Generic guildhall footprint attached. (Note - Corellia and generic guildhalls use the same SFP file.)

And yes, that's all you need - there is no server code that needs to be altered in this case. You may need to bundle the altered SFPs in a TRE for your server, as I've never tested having different versions on the server and client.



Now, the terrain altering-files are a different beast.

Those are the .LAY files Lasko brought up upthread. As it currently stands, they cause some oddities to happen that I didn't catch until we moved to a live server with 100s of players.

Basically, .LAYs are "layers" for a planetary terrain. I don't know if anyone's spent the time I have manipulating them. From what I've been able to tell, there are two critically important things to understand about LAYs:

1.) They're either attached to a building or not, because the morph has to happen on the client. If it happens on the server only, you won't see any difference at all on your client due to how terrain is handled.

2.) The SWGEmu code doesn't properly apply .LAYs attached to building objects. Basically, the terrain is altered on your client but not on the server. I haven't looked into a fix for it yet.

Now, I can think of some very hack-ish workarounds to get a LAY to appear only on rough terrain, but it'd require writing new code I can't say I'm interested in doing at the moment. The idea I have would be to have a .LAY attached to a different object that spawns at the same coordinates as your building, but the server would only spawn said object of the terrain was "rough enough". I have no idea how well such an approach would work, and how much new code would need to be written to make it happen.
 

Attachments

XionicFire

New Member
Joined
May 23, 2017
Messages
46
RE: Bounty/Request: Reduce Structure Placement Restrictions (PayPal) (Updated!)

ill atttempt to mod a different file using your file as a template of what to change/modify

As soon as im successful in replicating your results ill post a step by step guide on how to do it so everyone else can do it as well if they need to , and you can claim your bounty! :D

One last thing just to save me hours of reverse engineering on something your probably figured out already, do you know how exactly the numbers to edit affect the angle? like right now its x but if you double it that means double or exponential or what? like say im looking for a 45 degree angle, what number would that be? its only if you know this number off the top of your head, if not ill trial an error it.

Regarding the layers file i understand what you are saying, well the idea was that it was some setting on the game that said "if x = true then level terrain around x/y center intersection point"

But the way it seems to be done seems extremely complex and honestly i do agree with you that it would require too much code to accomplish a minor upgrade

What we will do is play around with the terrain leeway a little bit, see up to whatinclination point we loose access to the door if we place it on a hill, and leave it at that point, that should take care of 99% of accidental door blocks while still allow a much wider range of placement

Thank you for your help, it has been invaluable!
 

XionicFire

New Member
Joined
May 23, 2017
Messages
46
RE: Bounty/Request: Reduce Structure Placement Restrictions (PayPal) (Updated!)

BTW you are using sytner's iff 3.6.1+ correct?
 

Halyn

That One Guy
Staff member
Moderator
Joined
Jan 11, 2015
Messages
257
Location
Empire in Flames
RE: Bounty/Request: Reduce Structure Placement Restrictions (PayPal) (Updated!)

I think the height tolerance numbers are the total elevation change across a footprint. Not sure, though, and never spent time figuring it out exactly.

And yes, I did this particular file in 3.6.1. I first starting working on these lots of versions of SIE ago, and for SFPs I've never had an issue regardless of version.
 

XionicFire

New Member
Joined
May 23, 2017
Messages
46
RE: Bounty/Request: Reduce Structure Placement Restrictions (PayPal) (Updated!)

Ok soo...

I must be doing something wrong, i knew something was off when i saw your images, if i had seen the text i see in your images i would have immediately figured it out lol

BUT

Heres what I see:
Heres your file:


And heres my file (default)


Soo... what am i doing wrong?

heres the steps of what im doing:
Open the sytners app
drag the file into it
thats what i get, am i missing some sort of step??

Thanks for the assistance
 

XionicFire

New Member
Joined
May 23, 2017
Messages
46
RE: Bounty/Request: Reduce Structure Placement Restrictions (PayPal) (Updated!)

Ok found the problem:

Aparently to read these things you need template files... and these are supposed to be in the sytners already, but aparently waverunners files are NOT properly stored

if you download the file called:
"all of these" "All of these - http://goo.gl/UolMUI"

the file indeed does not contain "all of these" only has the first one, i suspect this was a mistake on his part.

So im guessing sytner made the same mistake i did and just downloaded the "all of these" file and incorporated it.

to open the footprint files and see what you saw, i needed to download the foot print individually

no wonder i would have never understood how it worked, its my first time touching this software, never heard of templates and its just my luck the exact files i need to edit are essentially in gibberish because of an error with one of the files, talk about a perfect storm.

Anyway i got it working let me try it out!
 

XionicFire

New Member
Joined
May 23, 2017
Messages
46
RE: Bounty/Request: Reduce Structure Placement Restrictions (PayPal) (Updated!)

My hat goes off to you sir, you are correct, modifying the SFP files client side is all that was required to do this mod.

You have now claimed this bounty in its entirety!

On Another note:
Wouldn't this be a huuuuuuuuuuge security hole lol, i was able to place a structure blocking another if the structure is on an incline.

Anach said there was some code before that got replaced from a simple limit to a whole bunch of complicated code, i believe this must have been done to allow this to be freely done client side without modifying the server side as it is clear this is not supposed to work this way i mean its nice... it just shouldn't be ahaha.

ANYWAY, more on point, im testing valid numbers, while testing i ended up literally making a merchant tent fly, however i can confirm that if you do this by accident the game will allow yo u "jump" up to the ramp so you can be safe that you wont get stuck outside it.

Im still testing cliffs on doors but i think ill do that on test server in case i really break something will keep updated so you guys can know what valid numbers work and which dont, it will save you the trouble.

I recomend this mod to anyone...... our city is finally looking great! buildings can now fit in orderly ways (yeah OCD, i know but hey! have you gone to paris? what do you think the arondisments are? someone REALLY went OCD there and just look how awesome it looks! :D
 

XionicFire

New Member
Joined
May 23, 2017
Messages
46
I would like to thank EVERYONE for the assistance you gave us, with your help this is how our city looks now:

From our cloner:


Aerial View:


Thanks so much for your assistance!, it was a big step towards bringing our city to its former glory!
 

sunshineunits

New Member
Joined
Nov 3, 2021
Messages
16
RE: Bounty/Request: Reduce Structure Placement Restrictions (PayPal) (Updated!)

Ok found the problem:

Aparently to read these things you need template files... and these are supposed to be in the sytners already, but aparently waverunners files are NOT properly stored

if you download the file called:
"all of these" "All of these - http://goo.gl/UolMUI"

the file indeed does not contain "all of these" only has the first one, i suspect this was a mistake on his part.

So im guessing sytner made the same mistake i did and just downloaded the "all of these" file and incorporated it.

to open the footprint files and see what you saw, i needed to download the foot print individually

no wonder i would have never understood how it worked, its my first time touching this software, never heard of templates and its just my luck the exact files i need to edit are essentially in gibberish because of an error with one of the files, talk about a perfect storm.

Anyway i got it working let me try it out!

how do i get all those templates in 2021? link is dead and...it doesnt seem the SIE tool came with them this year either? ..um? help!
 
Top Bottom