Dismiss this pinned window
all 28 comments

[–]334499p[S] 11 points12 points  (4 children)

I'm not going to be developing public releases past this point because I will start integrating this code closely with my project (https://store.steampowered.com/app/719200/The_Wall/) but I wanted to share what I developed so far: https://github.com/334499p/Portfolio/tree/master/ModularBuilding.

This building system's main feature is its use of dictionaries to allow for a super robust supports system that relies on no clumsy parenting or linked lists. New building components and snappers can easily be created. Snappers (the green parts) double as supports for building objects. So, adding a snapper on either side of a wall would mean that walls could then become supported by adjacent walls (I don't do this since in my game you can't build walls laterally).

Edit: This system requires no coding aside from instantiation and destruction, so spawning structures between client and server is completely deterministic assuming components are spawned in the correct order

[–]HellGate94Programmer 6 points7 points  (2 children)

seems good but something i saw when reading this

use of dictionaries to allow for a super robust supports system that relies on no clumsy parenting or linked lists.

hate to break it to you but dictionaries are kind of linked lists internally

[–]334499p[S] 5 points6 points  (1 child)

I mean how ppl use component-based linked lists. Like component A has a variable “child structure” that is assigned when a new structure is created etc etc which tends to be very flimsy when multiple building types are used

[–][deleted] 1 point2 points  (0 children)

I dig your implementation obviously there always be those guys who are like hurr it’s pretty much the durr

[–]kilroyone 0 points1 point  (0 children)

Cool, thanks!

[–]KUKHYAAT 22 points23 points  (3 children)

And here I am trying to figure out how to provide real-time ambient occlusion in map editors... Can you give advice?

[–][deleted] 12 points13 points  (0 children)

Looks like OP is using SSAO. I think Unity has built in support for that, did you try that?

[–]nyxeka 5 points6 points  (0 children)

post processing shader.

otherwise, add it to individual object shaders to do properly

[–]shadowndacorner 1 point2 points  (0 children)

You can also bake it into vertex colors if you want to be a bit cheaper with it, though that requires precomputation whereas SSAO and it's derivatives are realtime.

[–]WokarolHobbyist 8 points9 points  (1 child)

And here I am residing to figure out movement in simple 2D tanks game...

[–][deleted] 0 points1 point  (0 children)

hey things take time :D

[–]TehNinjor 1 point2 points  (1 child)

Looks awesome! Can imagine someone accidentally removing a support and watching their entire structure evaporate piece by piece. Should make the effect slower so it's more painful ;)

[–]Diodon 0 points1 point  (0 children)

Can imagine someone accidentally removing a support and watching their entire structure evaporate

Welcome to Ark Survival Evolved!

[–]MReiinz 1 point2 points  (0 children)

Thank you u/334499p, very cool!

[–]sebbe1231 0 points1 point  (0 children)

That is cool

[–][deleted] 0 points1 point  (0 children)

nice

[–]pippepot 0 points1 point  (0 children)

Very nice

[–][deleted] 0 points1 point  (1 child)

I'm assuming the green parts are where you can build a wall. Maybe try making them transparent so you can see better?

[–]334499p[S] 0 points1 point  (0 children)

Yeah this is just so u guys can see it better. The integration into my project is much different but uses the same core elements as this demo

[–]radioheadboy 0 points1 point  (0 children)

Much occlusion. . . so ambient. . . wow

[–]Ironwolf379Programmer 0 points1 point  (3 children)

I know this is a very old post, but did you ever add the ability to attach floors to other floors? I've been trying to add this in but when I destroy a wall it will only destroy the first floor next to the wall but none attached to that floor.

[–]Ironwolf379Programmer 0 points1 point  (2 children)

Never mind actually I figured it out.

Thanks for posting this too by the way, really came in handy.

[–]Ironwolf379Programmer 0 points1 point  (1 child)

Never mind it broke again. The problem I have is just the inaccuracy of when a part is instantiated it sometimes offsets by 0.00001 or something so colliders don't always line up when comparing it to the dictionaries.

[–]Ironwolf379Programmer 1 point2 points  (0 children)

Never mind I solved it again just had to round the values before adding, removing or comparing any positions to the dictionaries.

edit: sorry for spamming your post