Jump to content
tinter

Tinter-Furniture - MP-compatible and dynamically spawned furniture

Recommended Posts

I have with the help of others created a script that spawns and despawns furniture in houses.

Download: https://github.com/Tinter/Tinter-Furniture/releases

At the moment it currently is more of a tool-suite as I'm not an impressive interior decorator. I would very much like to gather up a library of compositions with the help of the community, although I'm not entirely sure on how to organize this yet.

Github: https://github.com/Tinter/Tinter-Furniture

Steam workshop (Does only have a test mission): https://steamcommunity.com/sharedfiles/filedetails/?id=1895377640

Showcase of the script:

 

Quick showcase of how to add make and add compositions:

 

It spawns furniture locally as simple objects in nearby houses, despawning it when you're far away.

The furniture is defined by compositions that you make in eden and using the scripts provided, organize them into files. The compositions are defined on classnames, but a lot of work has gone into trying to make similar buildings compatible, for example the buildings on Altis and Malden are different, but the script will recognize them as the same. Info on how exactly to do this is in the readme file.

Furniture is also spawned on the server so that AI will also (hopefully) consider it.

I have no indepth test of performance with this script active, but I have played missions with it active and it didn't slow the mission to a crawl at least.

 

At the moment it currently is more of a tool-suite as I'm not an impressive interior decorator. I would very much like to gather up a library of compositions with the help of the community, although I'm not entirely sure on how to organize this yet.

Thanks to Diwako, G4rrus, Tennessee,  jonoPorter, Meanwhile

  • Like 19
  • Thanks 3

Share this post


Link to post
Share on other sites

Thank you tinter for sharing this!

 

On the whole of Arma 3 community there are only 2 such scripts, one from @phronk and the other from @haleks.

 

I've personally used @haleks version and it works like a charm and has almost "null" impact on performance being perhaps the only downside that its compositions tend to be on the apocalyptic side of things (like blood and garbage too etc).

 

How would you compare your script to that of @haleks ?

 

PS: You would have to look inside Ravage's PBO's to get to those scripts.

  • Like 1

Share this post


Link to post
Share on other sites

I hope you can get some use out of it!

I haven't actually seen Phronk's and Haleks' scripts. Very interesting!

  • To compare this script with theirs, it looks like the main difference of this is that you can (and at this point in time, will have to) define compositions of your own. So if your mission requires messy or if you require clean furniture you can choose. Downside is of course how I haven't made many compositions so you'll have to do it yourself. This is why I'm very interested in crowdsourcing. This script is built around the idea of adding your own compositions, so that is why I also have scripts to export these.
  • Looking at the the ravage script, it seems they work in very similar ways too.
  • This script will select random compositions(If they exist) and thus has to synchronize that, but I don't know if their scripts have to deal with that at all, maybe they just use one per house?
  • It seems their scripts do not spawn the objects on dedicated servers. I would think this would cause AI to ignore it, whereas they would normally act like they can't see through it.
  • I only looked at Phronk's thread, but it seems it works on towns, through triggers. This script is meant to be more seamless, looking for every building you come across.

I think those are the points worth noting, but this is not an exhaustive list.

 

On another note, I'm going to make a small video to try and illustrate how to build and use compositions.

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites

Also I do not know how they handle buildings being destroyed, but here I have decided that furniture gets destroyed along with it.

  • Like 1

Share this post


Link to post
Share on other sites

My script is extremely out-dated and runs like total shit in large urban environments. I'm noticing it may also be flooding the scheduler with code to spawn furniture and all that, which is part of why I still haven't updated it; needs to be totally rewritten for the 3rd/4th time. I'd recommend using someone else's code if it runs better and gets the job done. With that said, my furniture script deletes the furniture when the house is destroyed because otherwise the furniture will float above the ruin, as if it hadn't collapsed. Also better for performance.

  • Like 3
  • Thanks 1

Share this post


Link to post
Share on other sites
15 hours ago, tinter said:

I hope you can get some use out of it!

I haven't actually seen Phronk's and Haleks' scripts. Very interesting! [...]

 

  • Looking at the the ravage script, it seems they work in very similar ways too.
  • This script will select random compositions(If they exist) and thus has to synchronize that, but I don't know if their scripts have to deal with that at all, maybe they just use one per house?
  • It seems their scripts do not spawn the objects on dedicated servers. I would think this would cause AI to ignore it, whereas they would normally act like they can't see through it.

 

I took a quick look at your code, and yeah, it's pretty much the same general idea - except yours is a lot cleaner! ^^

As to what composition gets spawned, in Ravage it's basically one compo per house type - but each element of the composition has a random chance to (not) spawn. The random selection process is semi-procedural, so the results are identical on each client - no need to synchronise (the only thing that needs to be sync'd is whenever an object has been looted). 

Another difference is that I sort of cache objects to avoid the constant creation & deletion : instead of deleting furniture and having to respawn them back, I just hide them and move them deep underground between frames. The cache handles 150 objects max - it's only once that limit is reached that the script starts deleting and spawning objects again. That made a huge difference performance-wise.

 

Good point regarding AI interactions on dedicated servers, I never thought about that. langue2.png

  • Like 4

Share this post


Link to post
Share on other sites

Nothing helps you find bugs like releasing things. I have to say this is the first time I've been screwed over by the Arma 3 scheduler itself.

Oh well, I guess it's my fault since this might be the first time I've actually tested the script in Kavala. It does stutter a bit when updating, but now it actually works.

 

I hope I can make some more optimizations, but it will not be my priority right now.

Share this post


Link to post
Share on other sites
21 hours ago, LSValmont said:

On the whole of Arma 3 community there are only 2 such scripts, one from @phronk and the other from @haleks.

Not strictly true. I wrote an SP script called TPW Furniture for TPW Mods several years ago, which spawns simple compositions into defined house classes with minimal overhead. @tinter you’re welcome to grab any ideas out of my code if you want.

  • Like 2

Share this post


Link to post
Share on other sites
On 10/22/2019 at 5:49 PM, tpw said:

Not strictly true. I wrote an SP script called TPW Furniture for TPW Mods several years ago, which spawns simple compositions into defined house classes with minimal overhead. @tinter you’re welcome to grab any ideas out of my code if you want.

 

Sorry tpw I didn't know about your script but only because you specialize in SP scripts while all my scenarios are MP focused. 

 

Your work is always impressive! 

  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, LSValmont said:

 

Sorry tpw I didn't know about your script but only because you specialize in SP script while all my scenarios are MP focused. 

 

Your work is always impressive! 

Cheers mate, I wasn't trying to be a wanker, just pointing out that there other other code ideas that tinter could try.

  • Like 1

Share this post


Link to post
Share on other sites

I have added a couple of videos to showcase the script and to show how to add compositions. I hope people will find it simple enough.

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

I don't really have the inclination to run these compositions through your script but your more than welcome to use them for this project. :icon_biggrin:

Spoiler

Malden Structures...

2cGn71D.jpg

Tanoa Structures...

AuW5UBJ.jpg

Some Livonia Structures...

AZAN0rT.jpg

Be aware Furniture_1 and Furniture_2 compositions were created for the Ravage mod so the layouts have a bit of a post-apo feel to them, Furniture_3 compositions are a bit more conservative. 

https://www.dropbox.com/sh/5rsk84t2onxjmqw/AADItuhAoSKptgo_UGbe21yua?dl=0

 

  • Like 2
  • Thanks 2

Share this post


Link to post
Share on other sites
16 hours ago, EO said:

I don't really have the inclination to run these compositions through your script but your more than welcome to use them for this project. :icon_biggrin:

  Reveal hidden contents

Malden Structures...

2cGn71D.jpg

Tanoa Structures...

AuW5UBJ.jpg

Some Livonia Structures...

AZAN0rT.jpg

Be aware Furniture_1 and Furniture_2 compositions were created for the Ravage mod so the layouts have a bit of a post-apo feel to them, Furniture_3 compositions are a bit more conservative. 

https://www.dropbox.com/sh/5rsk84t2onxjmqw/AADItuhAoSKptgo_UGbe21yua?dl=0

 

Thank you! I've taken a look at them, and while it requires ravage mod, I did manage to open it without.

I like the look of the interiors and I'm now in the process of converting them.

I've also made some clean versions without blood and garbage.

You should be happy that you're not converting them, since it turns out that medical garbage is also of type House_F. A bit annoying, but not a huge issue.

Share this post


Link to post
Share on other sites
7 minutes ago, tinter said:

Thank you! I've taken a look at them, and while it requires ravage mod, I did manage to open it without.

Yes, I noticed the Ravage dependency after posting the link, I've since removed the dependency and updated the link, sorry about that. :icon4:

I'm glad you find them useful. 

Share this post


Link to post
Share on other sites

This is really  great Tinter, and great job on the tutorial video.  One thing folks should consider when making compositions is AI pathing and shooting positions.  Its best not to put furniture in the way of AI building paths, and best to not put furniture under windows (shooting positions).  I know Phronk made an effort to test all his compositions didn't block ai.

 

And since Phronk has many compositions already, I wonder how hard it would be to make a conversion script that reads his composition and coverts it to yours (with his permission of course).  That would instantly give you a large composition library to choose from.

 

Regarding performance, one idea I had was to cache a certain amount of furniture objects so they can be re-used when player moves from place and furniture is despawned/respawned.  This would reduce the #of objects being created/deleted over time.  To cache them you can hideObject or setpos them to [0,0,0].  Keep up the great work!

  • Like 3

Share this post


Link to post
Share on other sites

I've opened a ticket for the cache, it's a good idea, I'll have to see if I can implement it without too much overhead.

For now though, I've added the compositions by EO (Thanks again!) along with some from @diwako and @G4rrus from a mission of theirs.

It requires CUP, but I think they're very nice.

  • Like 2

Share this post


Link to post
Share on other sites

First off I just want to say this is amazing and super useful Tinter, excellent work!

 

I do have some questions though:

 

1) Do you have any more composition sets for Tanoa? Lots of buildings with interiors don't have any furniture compositions.

 

2) How exactly do you get the furniture to spawn for a house in Eden? I tried running the command from the github wiki, but it seems like it isn't grabbing the furniture for the correct building as the same stuff spawns no matter which building, and its always like floating or half in walls or something. I'm sure im doing something incorrectly, probably need to specify the building before spawning the furniture in...?

EDIT: Ignore this question, i figured it out. You explained it on your github page I just missed it on my first skim through reading it 😛

 

3) What is your stance on your script being used in script/modpack and/or slightly modified? My long term goal is to make a... fairly ambitious project, and I would love to be able to use your script! I don't want to use it if you aren't ok with that, and I want to give proper attribution in the readme file or wherever else is necessary if you are ok with your script being part of a larger project. Oh also the modifications I'm talking about would be minor things like tweaking spawn distances and making my own custom compositions. I may also use your script and a couple other scripts I've found as a base for making a dynamic spawner/despawner for various assets.

 

When I finish up with my own Tanoa compositions I will... I guess like upload them to pastebin and then post a link here to share?

Share this post


Link to post
Share on other sites
On 2/19/2020 at 6:12 AM, thursday_0451 said:

First off I just want to say this is amazing and super useful Tinter, excellent work!

 

I do have some questions though:

 

1) Do you have any more composition sets for Tanoa? Lots of buildings with interiors don't have any furniture compositions.

 

2) How exactly do you get the furniture to spawn for a house in Eden? I tried running the command from the github wiki, but it seems like it isn't grabbing the furniture for the correct building as the same stuff spawns no matter which building, and its always like floating or half in walls or something. I'm sure im doing something incorrectly, probably need to specify the building before spawning the furniture in...?

EDIT: Ignore this question, i figured it out. You explained it on your github page I just missed it on my first skim through reading it 😛

 

3) What is your stance on your script being used in script/modpack and/or slightly modified? My long term goal is to make a... fairly ambitious project, and I would love to be able to use your script! I don't want to use it if you aren't ok with that, and I want to give proper attribution in the readme file or wherever else is necessary if you are ok with your script being part of a larger project. Oh also the modifications I'm talking about would be minor things like tweaking spawn distances and making my own custom compositions. I may also use your script and a couple other scripts I've found as a base for making a dynamic spawner/despawner for various assets.

 

When I finish up with my own Tanoa compositions I will... I guess like upload them to pastebin and then post a link here to share?

I'm excited to hear about someone actually using it, and sorry for the late reply.

I'm sorry to say that I only have the compositions that are included. A big hurdle is actually making them because I'm not very creative.

By all means, use the script as you see fit. The thing I care most about is that the code stays free for people to use.

If you've made any progress in the last few months since your reply, do let me know!

And if you have any compositions you'd like to share, you can either make a pull request or share them with me and I could include them when I have time.
 

  • Like 2

Share this post


Link to post
Share on other sites
1 hour ago, tinter said:

I'm excited to hear about someone actually using it, and sorry for the late reply.

I'm sorry to say that I only have the compositions that are included. A big hurdle is actually making them because I'm not very creative.

By all means, use the script as you see fit. The thing I care most about is that the code stays free for people to use.

If you've made any progress in the last few months since your reply, do let me know!

And if you have any compositions you'd like to share, you can either make a pull request or share them with me and I could include them when I have time.

Thanks for the generous sharing attitude Tinter.  I really appreciate it, and I'm sure many others do as well.

  • Like 2

Share this post


Link to post
Share on other sites
8 hours ago, johnnyboy said:

Thanks for the generous sharing attitude Tinter.  I really appreciate it, and I'm sure many others do as well.

 

I know me and my mission players do! So thank you @tinter!

  • Like 1

Share this post


Link to post
Share on other sites

So through finishing my semester thus finally getting a break from Uni and a prod from @haleks (Sorry to say that I couldn't use your solution), I've been working on this again over the past three weeks.

I'm pleased to now release Version 2 of Tinter furniture, I'm really proud of the changes that I have introduced and I do think that it's much nicer than it was before.

Here is a commentated list of changes.

Quote

Changes:
  New and more accurate coordinate calculation
    -Big thank you to Nigel for helping me with this. This should make objects spawn exactly where they need to be, but unfortunately makes all previous compositions incompatible
  Position is now based off of bounding center
    -This eliminates the need for specific offsets for models that are the same visually, this is the other reason that compositions are incompatible
  All compositions changed to the new coordinate system
    -There's a script offset.sqf to help with it, and you'll need to import it with the old method, export it with the new one. The easiest way is to load your mission and just export everything again. You did save your compositions in its own mission file, right? (I didn't)
  Added a max house limit
    -Default is 42 houses, this lets the range be a huge 300m, but your FPS won't be murdered if you're in Kavala
  in.sqf will now set the rotation and position attributes in eden
    -This makes editing compositions much nicer, as before they would reset their orientation when you touched them
  Spawning furniture is done in a separate thread
    -This makes it spawn in (relatively) slowly, which should avoid any stutter from all of it being done at once
  Added a seed variable that controls what composition each houses uses
    -I've had 3 houses next to each other all use the same composition out of like 13, so this lets you change the seed and avoid that
  Added object variable "tint_house_index" to set a specific composition index for a specific house
    -You can count the array entry that a specific composition has, but remember to add it up when using multiple files
  Faster load in
    -It seemed like the script would initially have to complete a cycle before spawning in furniture, but I circumvented  that

  New compositions courtesy of JonoPorter
    -Big thanks to JonoPorter for letting me look through all their missions to scour for furniture
  Compositions from the orange DLC
    -These might just be the most detailed compositions so far, having also clean prewar, war and postwar presets
  Compositions separated into categories
    -Tried to seperate compositions into categories so that those who make sense being used together are in the same file, feedback welcome
  Miscellanous composition changes
    -Small tweaks to object positions and so on, check the git commit stack if you really just need to know exactly what is going on

And of course, what would this be without some pictures?

D5BeHhq.png

LpE5Lkt.png

0psrQxm.jpg

As always, the newest release can be found at https://github.com/Tinter/Tinter-Furniture/releases

  • Like 3
  • Thanks 1

Share this post


Link to post
Share on other sites
On 7/17/2020 at 5:44 PM, tinter said:

So through finishing my semester thus finally getting a break from Uni and a prod from @haleks (Sorry to say that I couldn't use your solution), I've been working on this again over the past three weeks.

I'm pleased to now release Version 2 of Tinter furniture, I'm really proud of the changes that I have introduced and I do think that it's much nicer than it was before.

Here is a commentated list of changes.

And of course, what would this be without some pictures?

 

 

 

As always, the newest release can be found at https://github.com/Tinter/Tinter-Furniture/releases

 

Thank you Tinter!

 

Remember to keep the objects count as low as possible.

 

In my opinion as soon as the building feels like it was occupied is enough for immersion and there is no need to add more objects that could possible get in the way of player movement, near buildings and stairs and also prevent the Ai from navigating (they are already horrible at navigating buildings).

 

Another suggestion: I've discovered that when objects are inside each other (colliding) is what causes much of the FPS issues some missions have so try to not clutter them all together.

 

Also spawn the objects as simple objects whenever possible.

 

I will try your script as soon as I am done with some compositions 😉 

Edited by Dedmen
Removed Images. Rule 14.
  • Like 1

Share this post


Link to post
Share on other sites
On 10/21/2019 at 6:24 PM, LSValmont said:

Thank you tinter for sharing this!

 

On the whole of Arma 3 community there are only 2 such scripts, one from @phronk and the other from @haleks.

 

I've personally used @haleks version and it works like a charm and has almost "null" impact on performance being perhaps

the only downside that its compositions tend to be on the apocalyptic side of things (like blood and garbage too etc).

 

How would you compare your script to that of @haleks ?

 

PS: You would have to look inside Ravage's PBO's to get to those scripts.

Using an older post LSValmont, i would like to add to this

dont forget LSD's Modules   ZEI - Zeus and Eden Interiors https://steamcommunity.com/sharedfiles/filedetails/?id=1251859358

@tinter thank you for your work on this fabulous script!

 

    An idea for you if your interested is something like what i linked above

where you put your compositions into a module format where then the module access the compositions in a dynamic way based on the building, or room

via right click of the building and placing furniture there, this could simplify the script  process allowing one to add to specific buildings if they wanted certain furniture

for say a scenario where the player/s are to go to a house or building based on the story of the mission.

          You could also have a component in the module where a large circle like a marker could highlight an area of a town or wherever and you can

define the distance from the center of the circle and spawn furniture that way too so on player's choice.

On 7/18/2020 at 1:40 PM, LSValmont said:

Remember to keep the objects count as low as possible.

Would 40 buildings and over 1500 objects be to much in an area of the map 😉

On 7/18/2020 at 1:40 PM, LSValmont said:

I've discovered that when objects are inside each other (colliding) is what causes much of the FPS issues

So your saying furniture that is clipping through walls, and clipped into each other correct?

On 7/18/2020 at 1:40 PM, LSValmont said:

Also spawn the objects as simple objects whenever possible.

Simple as in single objects in a room, like a chair or the like or a specific type?

  • Like 1

Share this post


Link to post
Share on other sites
Quote

Simple as in single objects in a room, like a chair or the like or a specific type?

Pretty sure he/she means, CreateSimpleObject , to get it rid of any non necessary physics related calculation of our composition objects.

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites

There is no need to worry about physics issues. The script only uses crateSimpleObject in the none super simple object variant. On top of that they are also only spawned in locally to the client, meaning there shouldn't even be network traffic to sync objects in MP. Every player gets their own furniture to look at, but everyone gets to see the same type of furniture in the same place.

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×