[Suggestion] Smoke detect/fire alarms/servo valve/poo floods

(previously 'DEVELOPER') Private forum for registered community members. To register, please visit www.prison-architect.com/register.

Moderator: NBJeff

User avatar
aubergine18
level2
level2
Posts: 231
Joined: Sun Jul 05, 2015 3:24 pm

Re: [Suggestion] Smoke detect/fire alarms/servo valve/poo fl

Postby aubergine18 » Fri Jul 24, 2015 1:14 pm

Some screenies:

Image

Rather than have loads of separate objects for fire signs, which would clutter up the build menu, I made it so you can connect them to a switch to cycle through the various designs of each object (or use Debug panel to set desired design directly). There are 7 fire assembly points (A to G) and currently 3 fire safety signs (extinguisher, call point and fire hose).

For now the Klaxon siren is using one of the alarm sounds that come with the game (due to bugs in Lua API I can't currently use my own sounds). I went and recorded 46 different alarm sirens - from an actual Klaxon alarm (Sonos and Nexus versions) - and ultimately hope to allow user to choose which sound the siren will make (again, needs lots of API bugs to be fixed first).

Image

The smoke detector (actually a fire detector) has a range of 5 tiles (so covers a 10x10 area) which is big enough for the majority of rooms. It hovers above the prison in a similar way to lights, and it's slightly translucent so you can see objects and people under it. It has internal battery backup which recharges when the device is powered (or would if the API wasn't broken) and discharges when there is no power, allowing it to function in the event of a power cut. If it's without power for too long it's battery will run flat and the device will stop working.
User avatar
likaboss
level1
level1
Posts: 25
Joined: Thu Jul 02, 2015 2:24 pm

Re: [Suggestion] Smoke detect/fire alarms/servo valve/poo fl

Postby likaboss » Sat Jul 25, 2015 1:47 am

aubergine18 wrote:
likaboss wrote:Honestly, in real world prisons, fires don't happen that often. Frequent fires would just take away from the authenticity of the game.


In real prisons legendary prisoners don't punch their way through solitary doors and kill a bunch of armed guards with a spatula. It's a game, not a real world prison.

likaboss wrote:Prison architect is not simcity, we really shouldn't be worrying about "environmental hazards." We should be thinking about riots, murders, and contraband, and currently the game is doing a great job making us focus on those aspects. It's realistic. It's fun.

I believe a fire alarm/evacuation system, should it be implemented in the game, be some sort of a governmental requirement. All modern buildings are required a fire evacuation system, even if fires are not that common. It should be implemented as a grant, so the government will pay you immense amounts of money if your prison has a proper fire evacuation protocol & infrastructure.


You seem to contradict the first paragraph with the second paragraph, basically "We should not implement environmental stuff, but we should have environmental stuff implemented in the game, because the game is not simcity." Um, wat?


Please read my post carefully before you tell me I contradict myself.
What I'm saying is, fires should NOT be common in the game because it not only is unrealistic, but it will soon become annoying as hell. We should NOT be worrying about fires more than we already do now. A fire happening when water touches electricity is realistic and well balanced.
An optional fire evacuation system that can earn you some money through grants, however, is realistic and fun. All modern buildings are required a fire evacuation system, even if fires are not common in the area. It's a governmental requirement. Thus, in prison architect, building a fire evacuation system, should it be implemented through official update or modding, should not be a countermeasure against the fires that happen EVERY SINGLE FRICKING DAY, but should be a luxury that can earn you some extra bucks from a grant.
User avatar
likaboss
level1
level1
Posts: 25
Joined: Thu Jul 02, 2015 2:24 pm

Re: [Suggestion] Smoke detect/fire alarms/servo valve/poo fl

Postby likaboss » Sat Jul 25, 2015 1:50 am

aubergine18 wrote:Some screenies:

Image

Rather than have loads of separate objects for fire signs, which would clutter up the build menu, I made it so you can connect them to a switch to cycle through the various designs of each object (or use Debug panel to set desired design directly). There are 7 fire assembly points (A to G) and currently 3 fire safety signs (extinguisher, call point and fire hose).

For now the Klaxon siren is using one of the alarm sounds that come with the game (due to bugs in Lua API I can't currently use my own sounds). I went and recorded 46 different alarm sirens - from an actual Klaxon alarm (Sonos and Nexus versions) - and ultimately hope to allow user to choose which sound the siren will make (again, needs lots of API bugs to be fixed first).

Image

The smoke detector (actually a fire detector) has a range of 5 tiles (so covers a 10x10 area) which is big enough for the majority of rooms. It hovers above the prison in a similar way to lights, and it's slightly translucent so you can see objects and people under it. It has internal battery backup which recharges when the device is powered (or would if the API wasn't broken) and discharges when there is no power, allowing it to function in the event of a power cut. If it's without power for too long it's battery will run flat and the device will stop working.


Fantastic job, I look forward to this mod being released. Some mods on Steam Workshop use custom sounds, maybe you could look into them to help you with using your own sounds for the Klaxon?
User avatar
aubergine18
level2
level2
Posts: 231
Joined: Sun Jul 05, 2015 3:24 pm

Re: [Suggestion] Smoke detect/fire alarms/servo valve/poo fl

Postby aubergine18 » Tue Jul 28, 2015 9:03 am

likaboss wrote:Fantastic job, I look forward to this mod being released. Some mods on Steam Workshop use custom sounds, maybe you could look into them to help you with using your own sounds for the Klaxon?


Yes, there are several mods that include custom sounds, however I've not found any that call those sounds from Lua scripts. All the mods I've looked at just replace existing game sounds and it's the game itself that plays the sounds.

The problem is that I can't add new sounds and play them from a Lua script. Full details on what I've tried can be found here: viewtopic.php?f=88&t=53818

I'm pretty sure I've defined the sounds in the right way, and I know from the scripting side the code I'm using works fine with sounds that come with the game but for some reason it doesn't work with any custom sounds.
User avatar
likaboss
level1
level1
Posts: 25
Joined: Thu Jul 02, 2015 2:24 pm

Re: [Suggestion] Smoke detect/fire alarms/servo valve/poo fl

Postby likaboss » Wed Jul 29, 2015 2:38 am

aubergine18 wrote:
likaboss wrote:Fantastic job, I look forward to this mod being released. Some mods on Steam Workshop use custom sounds, maybe you could look into them to help you with using your own sounds for the Klaxon?


Yes, there are several mods that include custom sounds, however I've not found any that call those sounds from Lua scripts. All the mods I've looked at just replace existing game sounds and it's the game itself that plays the sounds.

The problem is that I can't add new sounds and play them from a Lua script. Full details on what I've tried can be found here: viewtopic.php?f=88&t=53818

I'm pretty sure I've defined the sounds in the right way, and I know from the scripting side the code I'm using works fine with sounds that come with the game but for some reason it doesn't work with any custom sounds.


Ah, so there's no real mod that assigns custom sounds to custom events. Then maybe it really is a limitation of the modding API?
I do some C++, but I really don't know anything about Lua, so I guess we'll have to wait for advice by some other experienced modders :(
Good work though, I hope this works out and we get some badass sounding smoke detectors in the mod!
User avatar
aubergine18
level2
level2
Posts: 231
Joined: Sun Jul 05, 2015 3:24 pm

Re: [Suggestion] Smoke detect/fire alarms/servo valve/poo fl

Postby aubergine18 » Mon Aug 03, 2015 11:05 pm

Fire door preview (front and back shown) - having massive problems implementing this; the API is really broken when it comes to anything relating to doors (especially a door as unique as a fire escape).

Image

The additional fire signs - showing extinguisher, fire hose, call point:

Image
Last edited by aubergine18 on Mon Aug 03, 2015 11:21 pm, edited 1 time in total.
User avatar
aubergine18
level2
level2
Posts: 231
Joined: Sun Jul 05, 2015 3:24 pm

Re: [Suggestion] Smoke detect/fire alarms/servo valve/poo fl

Postby aubergine18 » Mon Aug 03, 2015 11:12 pm

Assembly area - Zone D:

Image

As there isn't currently any UI events in the API (eg. right-click, or custom info panel links) the assembly point sign is set using either a logic pulse or calling a function via debug panel (in this case "D()" function was invoked).
Raymuuze
level0
Posts: 3
Joined: Mon Aug 03, 2015 6:23 pm

Re: [Suggestion] Smoke detect/fire alarms/servo valve/poo fl

Postby Raymuuze » Tue Aug 04, 2015 5:38 pm

aubergine18 wrote:-snip-
Fire assembly points

A new zone type to mark fire assembly points. Usually these would be outside buildings?

-snip-


If by fire assembly points you mean designated area's where people gather in the event of a fire, then yes. You don't want people inside of a burning building or a building that is filling up with deadly smoke. :)

I don't know about prisons but most companies have designated escape routes that lead to an outside area that leads to a gathering point. It's common to have regular emergency training events in which people evacuate to said area, they will need to locate the closest fire-exit and leave. People usually know where to find these but some bigger buildings put up (localized) floor plans that show where the closest fire-exit is. These are usually marked with the green lights you mentioned later in your post.

For prisons I assume the yard would be a common choice as most rooms connect to it and you don't want prisoners to evacuate to outside the prison walls. Most prisons have very advanced fire prevention. Paint and other materials that slow down fires, fire extinguishers in every hallway, systems that detect fires well before they grow out of control. These systems are usually hooked up to an emergency line, so when a fire is detected and the signal is not canceled in a certain amount of seconds, a bunch of firetrucks (depending on the size of the prison) is immediately dispatched.
User avatar
aubergine18
level2
level2
Posts: 231
Joined: Sun Jul 05, 2015 3:24 pm

Re: [Suggestion] Smoke detect/fire alarms/servo valve/poo fl

Postby aubergine18 » Tue Aug 04, 2015 11:05 pm

If by fire assembly points you mean designated area's where people gather in the event of a fire, then yes.


Yup, that's what I mean. The way it works currently is that the assembly point sign is what people will head for. It can be placed in any room so long as it's outside, so you could put it in a yard, forestry area, wherever you want. The assembly area is just an alternate room if you don't want to use a yard (as the yard might have zone restrictions applied) and the assembly area also encourages users to add objects such as first aid kits (which is why there's a warning sign on the image above - no first aid kit in that area). The assembly point sign doesn't even need to be in a room - you can place it anywhere outdoors - but for consistency with the rest of the game I've given the general impression that it needs to be in an assembly area or yard.

Image

I'm still fiddling with the code that gets prisoners to move to the assembly point; specifically I want each part of the prison to have it's own designated assembly point and when there's a fire people will follow the fire escape route to that point, most likely reaching it via a fire escape door on an outer wall.

The game already defines properties of objects/materials/etc - for example wood, composite, hollow metal, metal - and fires take that in to account when spreading (wood objects will burn and spread the fire much more than metal). There's no way to apply paints to prevent that though (and it would probably be overkill in context of the game).

I tried making a fire control box but there are just too many issues/gaps in the scripting API to make it work properly. Most notably I can't properly iterate over wired connections, and there's no concise way to script a callout to emergency services (it's possible to create fake callout but that is just too crufty to consider for this mod IMHO; Chad's Drink Mod shows how a custom callout can be done, but it's somewhat limited and overly CPU intensive).
User avatar
aubergine18
level2
level2
Posts: 231
Joined: Sun Jul 05, 2015 3:24 pm

Re: [Suggestion] Smoke detect/fire alarms/servo valve/poo fl

Postby aubergine18 » Tue Aug 04, 2015 11:31 pm

Fire extinguishers I'm currently working on:

Image

Not entirely sure how I'm going to get these to work yet, specifically the scripting API only receives job completion events on the object that 'owns' the job - there doesn't seem to be a way to create a proxy event handler. Also there doesn't seem to be any way to script proper game 'water' from a mod; I can create my own fake water, but it doesn't have same properties as game water (such as causing electrical stuff to explode or being dissipated at drains) without adding lots of crufty code.

(just storing this link here so I can find it at later date: viewtopic.php?f=43&t=54140 )
User avatar
aubergine18
level2
level2
Posts: 231
Joined: Sun Jul 05, 2015 3:24 pm

Re: [Suggestion] Smoke detect/fire alarms/servo valve/poo fl

Postby aubergine18 » Wed Aug 05, 2015 2:36 am

Fire extinguisher sprites complete...

Image
User avatar
aubergine18
level2
level2
Posts: 231
Joined: Sun Jul 05, 2015 3:24 pm

Re: [Suggestion] Smoke detect/fire alarms/servo valve/poo fl

Postby aubergine18 » Thu Aug 06, 2015 12:52 am

Slowly getting there with fire extinguishers...

Image

Had to do some trickery with the objects; there's 4 objects that appear on the build menu to make it easy to associate them with rooms, etc., but once built they are automagically replaced by a centralised fire extinguisher mount object that's pre-loaded with the correct type of extinguisher. This allows my scripts to search for nearest fire extinguisher mount rather than having to search for all four types of extinguisher = faster and easier. It also means that once an extinguisher is in use the mount object will be left behind and can create a job to order a replacement extinguisher.

Next step: Work out how to get staff to use extinguishers to put out fires!
Robbedem
level2
level2
Posts: 167
Joined: Fri May 02, 2014 1:01 pm

Re: [Suggestion] Smoke detect/fire alarms/servo valve/poo fl

Postby Robbedem » Thu Aug 06, 2015 11:41 pm

Why are you making it so complicated?
BTW, CO2 can perfectly be used for small scale solid fire extinguishing. Especially if somebody clothes are on fire, you would prefer to use CO2.
CO2 is often not so usefull against liquids though, because if you can't extiguish it entirely, it will catch fire again almost immediately.
User avatar
aubergine18
level2
level2
Posts: 231
Joined: Sun Jul 05, 2015 3:24 pm

Re: [Suggestion] Smoke detect/fire alarms/servo valve/poo fl

Postby aubergine18 » Fri Aug 07, 2015 1:23 pm

Robbedem wrote:Why are you making it so complicated?


Uhm, because it's fun and I want to push the modding system beyond its limits. :) ...also because there are crazy number of bugs and issues with the modding system (particularly the Lua script API) which makes it really difficult to provide concise UI.

Robbedem wrote:BTW, CO2 can perfectly be used for small scale solid fire extinguishing. Especially if somebody clothes are on fire, you would prefer to use CO2.
CO2 is often not so usefull against liquids though, because if you can't extiguish it entirely, it will catch fire again almost immediately.


True, but last time I checked prisoners don't catch fire, they just receive "damage". I didn't want the extinguishers to be OP as extinguishers alone can completely mitigate the risk of fire in the game. So I emphasised the pros and cons of each extinguisher (like CO2 not being useful on burning materials, otherwise why would anyone install water extinguisher?).

Image

Some thought will be required by the player as to which extinguisher to place and where... When there's a fire people will grab the nearest extinguisher and spray the fire with it. If they pick up the wrong extinguisher they could make the fire worse (eg. spraying water on to a cooker or power gen = big mistake). I've set it up so that the game will suggest the correct type of extinguisher for every room.

Return to “Community Members”

Who is online

Users browsing this forum: No registered users and 1 guest