Jump to content
phronk

[Released] Phronk's Furniture Script

Recommended Posts

The currently released version still uses the attachTo method, in combination with triggers. It is very unoptimized and may cause significant performance issues (FPS drops as large as 90 or more FPS lost in areas like Kavala on Altis). This will be fixed in the next update.

With that said, the script currently does not support any houses that aren't from Stratis, Malden, or Altis. The next version may include some CUP and Tanoa house support.

 

As far as when that new update is supposedly going to release, I'm still working on it but have run into an issue that may be related to the scheduler becoming overloaded and ultimately rendering [the mission] unplayable once it reaches that point; it's either a hidden bug somewhere in the code or I need to rewrite/restructure the code to further optimize it and make it more efficient (again). No release date, primarily because of this bug.

  • Like 3

Share this post


Link to post
Share on other sites
6 hours ago, phronk said:

The currently released version still uses the attachTo method, in combination with triggers. It is very unoptimized and may cause significant performance issues (FPS drops as large as 90 or more FPS lost in areas like Kavala on Altis). This will be fixed in the next update.

With that said, the script currently does not support any houses that aren't from Stratis, Malden, or Altis. The next version may include some CUP and Tanoa house support.

 

As far as when that new update is supposedly going to release, I'm still working on it but have run into an issue that may be related to the scheduler becoming overloaded and ultimately rendering [the mission] unplayable once it reaches that point; it's either a hidden bug somewhere in the code or I need to rewrite/restructure the code to further optimize it and make it more efficient (again). No release date, primarily because of this bug.

That's fine though. It's only in arma 3 that THE ENTIRE MAP IS EMPTY! It's nice to see what arma 3 was somewhat meant to look like 🙂

  • Like 1

Share this post


Link to post
Share on other sites

i like what you're trying to achieve here, but it rarely works for me. even if i set spawn chance to 100 percent and im in a small malden town i'll see maybe one or two stores that are halfway furnished (i.e. missing cash registers and other stuff) and the rest of the buildings will still be empty. the lag is immense during the furniture spawning/despawning procedure, but i don't blame you for that. it's just how arma is. regardless, i like your interior design choices and i hope that in the future you can amplify this mod to a higher state of being. i hope that you eventually decide to include the structures from the global mobilization and contact dlcs as well, for they both have many enterable structures which are devoid of furniture of any kind.

  • Like 1

Share this post


Link to post
Share on other sites

Wonderful work here mate. I haven't tested it, but it is something that has been missing all that time from ArmA.

 

As I said, I haven't tested the script but I will do so as soon as possible and try to provide as much feedback as possible. We have been working on some compositions and kinda understand how difficult it is to compose them (especially when we are talking about scripts involved and creating so many with additional AI-pathing testing).

 

That's a definite THUMBS UP and thanks a lot for sharing :thumbs-up:!!!

  • Like 2

Share this post


Link to post
Share on other sites

@pognivet The major lag spike and poorly sustained FPS is due to the attachTo command. My new code removes attachTo altogether, as well as other optimizations, which greatly improve FPS and stability. I will most likely never buy Global Mobilization and therefore won't have access to the buildings to make layouts for them, but Livonia buildings absolutely! Still creating more for Altis, Malden, and Tanoa.

 

The new version I'm working on is still being developed -- mostly adding new layouts, optimizing where I can, and working on another feature. The current released version has since been completely rewritten and the work on it is ongoing.

 

  • Like 8

Share this post


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

@pognivet The major lag spike and poorly sustained FPS is due to the attachTo command. My new code removes attachTo altogether, as well as other optimizations, which greatly improve FPS and stability. I will most likely never buy Global Mobilization and therefore won't have access to the buildings to make layouts for them, but Livonia buildings absolutely! Still creating more for Altis, Malden, and Tanoa.

 

The new version I'm working on is still being developed -- mostly adding new layouts, optimizing where I can, and working on another feature. The current released version has since been completely rewritten and the work on it is ongoing.

 

You don't need to buy Global Mobilization to have access to the buildings anymore. The GM team has released all of the mod's content for free on the steam workshop excluding the map from the mod.

 

Good luck with your new version.

Share this post


Link to post
Share on other sites

Ohhhhh well then, in that case I'll have to look into it. 😉

Share this post


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

The major lag spike and poorly sustained FPS is due to the attachTo command.

There was a bug with attachTo that was recently (last week) found and fixed. It would essentially constantly recalculate the bounding boxes multiple times, without any need.

  • Like 2

Share this post


Link to post
Share on other sites

Awesome, maybe the current version won't be so bad after all. Guess we'll find out on Thursday!

 

The only issue I have with PF since its inception is that, regardless if the objects are simulated, disabled simulation, or simple/superSimple objects, the furniture spawns in bursts. There is also sometimes a delay of seeing the furniture pop-up and/or rotate. This only occurs on my dedicated server (Its more of a virtual server though). Singleplayer / local host works fine. Any ideas if its the scheduler due to too many objects spawning at once? Or just bad code? 

Share this post


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

Any ideas if its the scheduler due to too many objects spawning at once?

sounds like scheduler yes.
You could put the spawn/position/rotate block into unscheduled using isNil. Just that one block! Don't put any loop into unscheduled.

  • Like 2

Share this post


Link to post
Share on other sites

are you reusing spawned objects?  Instead of deleting and recreating as player moves to each place, you could setpos/attach already created objects from inactive zone to active zones.  would reduce obj creation/deletion.   just an idea...  g00d luck in this worthy endeavor. 

  • Like 4

Share this post


Link to post
Share on other sites

Those are really good ideas. Also had no idea about the nil thing, will try it tonight!

  • Like 1

Share this post


Link to post
Share on other sites

is it possible to consider whitelist also and not just blacklist. Idea is, during a mission planner already knows in which towns the mission will happen. So in case players are moving through a town, there is no necessity to spawn furnitures in that town. As in Co-Op missions it is usually not dictated which road the platoon should take, blacklist is not working that well. In case whitelist is used, mission maker could give the locations in which he/she needs furnitures and your logic skips all other locations and takes care only whitelisted areas

Share this post


Link to post
Share on other sites

Heya everyone,

Would just like to add my thanks to this wonderful script that makes buildings much less anonymous looking, without dependences(!). 

Guess I can add a tip for the foolish (ie: myself):

If you are bothered by the magenta colored rectangles around towns when playing with this script, then change the PF_Dbug=TRUE value to FALSE in the CFG.sqf .

-Don't go fishing in the PF.sqf and changing _m setMarkerAlpha to 0 ...  

  • Like 1

Share this post


Link to post
Share on other sites

Giant Update Coming Soon
It has been almost 3 years since I last updated this script, but I plan to update it either this month or next. The delay was caused by bugs blocking the release. Now that the bugs have been fixed, I'm satisfied to say that Phronk's Furniture is ready for a giant update soon! Below details what to expect:

  • Completely rewrote all scripts
  • Massive improvements to stability and performance
  • Server-side only
  • Server-side mod will be released alongside it, if you don't want to add the script to your missions
  • Many new furniture layouts for houses in Altis, Stratis, Malden, Tanoa, and soon Livonia (Tanoa and Livonia still have a lot more buildings to go)
  • Furniture placement still respects AI pathing
  • Tons of bug fixes

A full change-log will be posted with the update, but everything was changed and improved. Can't promise a video will come out to showcase it, but I'll at least update the main post of this thread with new pictures.

  • Like 9

Share this post


Link to post
Share on other sites

I received some generous motivation recently, so here's some teaser screenshots of several Livonia furniture layouts. I've decided to start using less objects per house to maximize performance and AI pathing. Shooting for a release in early November.

 

At this point, I'm just working on adding furniture to more house classnames. For me, this is tedious as hell because I want to make it perform well, look nice enough, and be compatible with basic AI pathing (AI can move between all buildingPos in the house).



 

  • Like 6
  • Thanks 2

Share this post


Link to post
Share on other sites

Hi,

are the sets of furniture for a specific house every time the same or will be the interior be new (randomized) set?

 

BTW: Very cool script!

Share this post


Link to post
Share on other sites

Each house has their own furniture templates. Some have just one, others may have up to 3 different templates.

  • Like 2

Share this post


Link to post
Share on other sites

Hi,

 

my question was more like: If I revisit the same house (after deleting interior) will in the house the same furniture (if there is more as one template available) or is template taken randomly?

Share this post


Link to post
Share on other sites

If the house has multiple possible templates, it will always use the same one it randomly selected initially.

  • Like 2

Share this post


Link to post
Share on other sites

Download Link (Google Drive)

Download Link (Steam Workshop)
Download Link (Armaholic)

Version: 0.7

Size: 208 KB

 

ADDITIONS:

• Added: New server-side looping script 'clean.sqf'

• Added: Persistent furniture layouts (WIP)

• Added: New setting in 'CFG.sqf' to adjust furniture activation range

• Added: New furniture layouts for Altis, Malden, and Stratis: (8)

  • Land_Cargo_Patrol_V1_F
  • Land_Cargo_Patrol_V2_F
  • Land_Cargo_Patrol_V3_F
  • Land_Cargo_Patrol_V4_F
  • Land_GuardHouse_01_F
  • Land_i_Shed_Ind_03_F
  • Land_i_Shed_Ind_F
  • Land_FuelStation_01_workshop_F

• Added: New furniture layouts for Tanoa: (4)

  • Land_FuelStation_01_shop_F

  • Land_Shed_01_F

  • Land_House_Native_01_F

  • Land_House_Native_02_F

• Added: New furniture layouts for Livonia: (21)

  • Land_House_1W01_F
  • Land_House_1W02_F
  • Land_House_1W03_F
  • Land_House_1W04_F
  • Land_House_1W05_F
  • Land_House_1W06_F
  • Land_House_1W08_F
  • Land_House_1W09_F
  • Land_House_1W10_F
  • Land_House_1W11_F
  • Land_House_2W02_F
  • Land_House_2W03_F
  • Land_House_2W04_F
  • Land_House_2B03_F
  • Land_House_2B04_F
  • Land_Barn_02_F
  • Land_Shed_13_F
  • Land_VillageStore_01_F
  • Land_Camp_House_01_brown_F
  • Land_i_Shed_Ind_old_F

 

ADJUSTMENTS:

• Changed: Script is completely proximity based without triggers

• Changed: House furniture function is called with an isNil to force scheduler

• Changed: PF Supported houses have a 100% chance to spawn furniture

• Changed: Blacklisting a specific house or an area of houses

• Rebuilt: Furniture layout for large office building (Land_Offices_01_V1_F)

• Tweaked: Height limit increased to infinite, up from 99 meters

• Tweaked: Players in vehicles excluded from activating PF triggers

• Tweaked: 'PF_Houses' variable moved to the 'init.sqf' in the PF folder

 

FIXES:

• Fixed: Elevation detection was slightly broken

• Fixed: Bug which caused furniture to spawn multiple times in houses

• Fixed: Sometimes PF_Houses variable wouldn't load and broke script on init

• Fixed: Functions were being initialized twice

• Fixed: Floating bed in flower shop, for Land_i_Shop_01_V1_F

• Fixed: Floating PC monitor in Land_Offices_01_V1_F

• Fixed: Desk protruding through wall in Land_i_House_Small_02_V1

• Fixed: Some floating objects in Land_i_House_Big_02_V1_F

• Fixed: '_chair13' sinking through floor in Land_i_Shop_02_V1_F - RESTAURANT

• Fixed: Wooden crates were blocking a buildingPos in Land_i_Shed_Ind_F

• Fixed: Undefined variable '_pcMon1' in Land_Offices_01_V1_F

• Fixed: Flickering textures on some vehicles

• Fixed: Hid several selections on vehicles (Lights, clan logo, etc.)

 

OPTIMIZATIONS:

• Optimized: Converted most furniture simpleObjects to superSimpleObjects

• Optimized: Replaced attachTo with setPos+modelToWorld

• Optimized: Code is executed server-side

• Optimized: Script no longer spawns helipads for every building

• Optimized: Replaced while{true}do with waitUntil

• Optimized: Code is no longer executed on duplicates in list of nearby houses

• Optimized: Houses collected via pushBackUnique, with arrayIntersect

• Optimized: Reduced number of objects spawned in layouts

• Optimized: getDir _b is executed only once, instead of for every object

• Optimized: Removed all sleeps in individual furniture scripts

• Optimized: Script calls furniture scripts, instead of spawning them

• Optimized: Code to setDir objects merged into a single forEach

• Optimized: PF variable is no longer a global/public variable

• Optimized: Replaced private variables in furniture functions with local ones

• Optimized: Replaced getPosATL _x with _x, in nearestObjects[]

• Optimized: Replaced private with params in some cases

• Optimized: Replaced select with # in some cases

• Optimized: Replaced a forEach within a forEach, with a count

• Optimized: Replaced preprocessFileLineNumbers with preprocessFile

• Optimized: Replaced preprocessFileLineNumbers with loadFile

• Optimized: Shortened some furniture variable names

 

REMOVALS:

• Removed: Location-based blacklisting

• Removed: PF_Chance setting from 'CFG.sqf'

• Removed: PF_Optimize setting from 'CFG.sqf'

• Removed: 'PF.sqf' script

• Removed: #include reference in 'init.sqf'

• Removed: Crates from Land_i_Shed_Ind_F

• Removed: Unused "CUP" folder

• Removed: Land_i_Shop_01_V2 from list to search thru (Center pos of model is bad)

 

 

 

KNOWN BUGS:

• Vectors not properly setup on some objects

__________________________________________________________________________


Finally, after more than 3 years, I've decided to release this update. It's not as complete as I'd like (In terms of having more furniture templates done) but it is overall a gigantic upgrade in performance and includes support for many Livonia buildings.

 

Thanks and enjoy!

  • Like 5
  • Thanks 2

Share this post


Link to post
Share on other sites

Awesome stuff as always!

Count me as one who watched the video haha 
BTW you might want to remove the armaholic link in your posts now armaholic no longer exists 

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

×