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 9
  • Thanks 1

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.

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 interesting 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 1
  • 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 1
  • 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 3

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×