How to define a room

So i’m not sure if this has been asked or answered before also not sure if this is the right section but the question is how do I define a room? I want to add in later on down the road a way to build rooms, walls, windows, doors etc. Once a room is defined it will contain values like oxygen, pressure and maybe a few others. I just don’t know how to say once a room is fully constructed that it is now a room and these values are attached to it. Also I plan on making the environment destructible the walls, floors, ceilings and so on; So when one of them is broken I don’t want the room to lose continuity but say there is a breach and only until the whole room is deconstructed does it get removed. Maybe make it so I can put limits on its size might be useful as well because having a billion 1x1x1 little rooms floating around might not be good for lag or even enormous ones.

Anywho this is going be a space station sim where you can build new sections on by hand and connect pipes to pressurize it and fill it with oxygen. So being able to make it sealed and recognize its integrity would be very helpful.

Also forgot to mention this is going to be multiplayer so having the changes show up on server and client would also be helpful :stuck_out_tongue:

Thank you in advance for any help.

hmm been a couple weeks no one got any ideas?

I think you should start with some actor with box collision primitive which defines room size, and it must contain all properties/variables you want.

When player character enters this box, you can pass all it’s properties to him by overlap event.

ya I kinda pretty much have that going already I have a room with an array on it called gasses oxygen being 0 and toxin being 1 I also set up some code on the character for breathing so when they enter the space they start gaining oxygen from the room when they leave they start loosing oxygen that all works fine if there is toxin it just starts hurting them until all the toxin has been consumed/breathed in or they leave the room

the problem is I want to add in a grid snapping system and with materials spawn object actors in the level for a building system and I want it so when they place down either a certain component the code on that component should check to see if the room has walls,a floor and a roof all connected making it sealed then generate this box collision actor to the size of the room that has been built with a few branch conditions being that the size of the room cant be to big or to small also it needs to be sealed so not detecting just one wall and saying yup sealed

You should create a scene component that has all the needed logic to define your room. This can then be added to anything that appears to be, or might be turning into a room. It will also make it much easier to build in a module manner. I have a similar device in a boat game, where I have a vessel component. This is something I can add to any object and it then knows that it is a boat, has certain boat abilities, and must gather certain boat information for me. This system would make it very simple to add new data to a room for your space station simulation as well, seeing that you only have to change this one blueprint, and all your rooms now or in the future will be updated. You can also add custom logic beyond this component on certain actors, like I have on a submarine, or even reduce functionality depending on your needs.

You should create a scene component that has all the needed logic to define your room. This can then be added to anything that appears to be, or might be turning into a room. It will also make it much easier to build in a module manner. I have a similar device in a boat game, where I have a vessel component. This is something I can add to any object and it then knows that it is a boat, has certain boat abilities, and must gather certain boat information for me. This system would make it very simple to add new data to a room for your space station simulation as well, seeing that you only have to change this one blueprint, and all your rooms now or in the future will be updated. You can also add custom logic beyond this component on certain actors, like I have on a submarine, or even reduce functionality depending on your needs.

Just a few thoughts to your last comment:

Designating the size should a matter of scaling from whatever base mesh you are using for the room. If it has modular walls and such even better. Your idea of traces to detect the environment should work fine. If you have problems with corners you could always cheat a bit by placing specific collision primitives to represent these areas.

wow been a while haven’t gotten anything guess this was harder than I thought :stuck_out_tongue:

yea thats what I kinda figured for the holding of info but the size and Shape of the room is what im interested in once the walls are placed im not sure how to basically tell the scene component what size to be and it has to be aware of the walls floor and roof its inside of so when a piece gets removed or destroyed it can then start losing oxygen or any gas depending on the space beyond

I figured something along the lines of when I place down a certain object shooting out a few line traces to get the surrounding area the problem with that is if you have a corner the line trace wont be able to detect the environment beyond but as a basic cube this would work I have to go to work or I would explain the idea further but for now I hope this puts a little more perspective on the issue

Welp I think i’m not gonna leave it to automating the process and make it more manual just easier that way just gonna make a tool with which the player can map out a grid for where the room will be and use that as the base to set the overall size and shape then once the starting part is placed the room will spawn the scene component holding the variables for it should be fairly easy to add any other rooms touching this to an array or detect if the others are already in one and add the new room to it so when the wall,door, window whatever is broken/removed then the variables being oxygen, Co2, N2 what ever can be mixed/transferred accordingly so with that I am marking this as resolved I guess not the original idea but it gives the player a bit more control and gives me more control over the overall structure thank you though for the ideas if anything they may come in handy to someone else if they don’t like my work around