Hey all, my first post here on the forum.
I was posting this to ask for abit of structural help,
I want to write a program that randomly places pre constructed rooms together. Each room has a standard door width and height.
At the moment im not worried about collision detection before a room is placed, just that the doors line up.
Just looking for advice on the best structural way to achieve this,
I was thinking:
The rooms can be held as static meshes with all there lighting etc inside ‘room blueprints’.
At the doorway of each ‘room blueprint’ is a sphere mesh (or some object that will turn off its rendering when the game starts) with code to execute the generation of one of the ‘blueprinted rooms’, and connect one of the new blueprinted rooms doorway spheres to the same transform as where the sphere was that spawned it, but rotate the room so it welds together nicely. (kinda using it as a pivot point)
Is this the most logical way to do this?
some flaws, you cant hold geometry in blueprint so it will need to be static meshes, and the environment is harder to use then the level editor.
it seems very convoluted, also, the rooms will never be able to link back on themselves (to make loops) but rather will grow out like trees.
Thanks for your reply Arkenthera, however im trying to avoid the use of random generated rooms, as i think that i will be able to achieve better detail from hand made rooms. (i.e. blueprint rooms)
Sorry i was not very clear. Essentially i want to link together many pre made rooms and im questioning my approach.
I see.So you want to spawn pre-made Blueprint classes.You can simply create different blueprints with different static meshes then you can create an actor in which it can select randomly from that blueprints and spawn where you want them.For this,you will need to check out ConstructorHelpers for getting blueprints with their reference and store them in variables then choose your random logic then Spawn them whenever you want.
Hope this is no thread hi-jacking, Im interested in the general principle of building a room out of pre-build walls, windows, doors, floor and ceiling. Should allow for a row of wall parts, not only 4 sides for the room.
The idea is to have a regular floor grid, lets say 4x4 tiles and you would add 4x4 wall parts with different look.
The next step would be to place rooms with different floor grid sizes next to one another.
Do you have some simple code(c++) or blueprints which I can use as start?
I made my system work but without being able to have child actors in blueprint it was too horrible to level design these chunks of level i was using,
so until that happens, i stopped work on it.
The example uses Unity, and unity uses a solution called prefabs that are better suited to this kind of workflow.
The blueprint editor will improve, as its on the trello, but it could be some time. you could always try another method.
What kind of issues did you run into with having child actors in blueprints?
Seems to be working for me so would really like to know if there are any limitations that I am currently not seeing.
Currently getting a bunch of warnings when a child actor has a static component but have not looked into it yet and seems only reasonable that only movable actors can spawn at run time.
edit: Seems the spawned blueprints are spawned as static so it seems it is just the child actor component that changes mobility when spawning a room.
Hello I’m also trying to figure this one out but I’m not sure if mine is different because my static mesh actor is an entire room. It has a ceiling walls and a floor already but together so these for actors already are made into a single mesh. The only parts I think that are not a static mesh are door ways. But I’m trying to randomly have them in place. If needed I can show you the static mesh actors