- Home /
Other
Building System
So, I'm currently working on a small survival game, in which, building is a key element.
Now, I'm not particularly great at coding, but I'm learning (I'm doing Computer Sciences in college next year, part of which is game design. I'm trying to scratch up a bit before I start.)
So, with building, I have two ideas. Basically, you have to build shelter for yourself. I'm looking to check whether someone has shelter by checking if, in a 1m radius around the character, the sky cannot be seen directly above. Various effects will be attributed to the character depending on whether they are outside or inside. Leaves for trees will be seen as 'invisible' for this purpose, though I'm also considering on, if I can, taking it a step further and including a sunlight system too (sunburn/buffs from 'getting vitamin D' type thing, in which case, trees would let in rain but not sunlight - and transparent materials such as a tarp would let in sunlight but not rain.)
Anyway, the actual building concept has two different possibilities.
The first is to pre-design several different buildings, from basic to complex. Once the character has the required materials within a certain distance to them (for example, I'm looking to be able to cut down trees & split logs. But I want a realistic inventory, so they'll have to carry them and pile them one by one) they have the option to simply place the building. The main issue with this is getting it to work with the terrain, in my opinion - I don't want it floating, but I don't want the terrain clipping through the floor either.
The other idea is more basic in some ways, but probably would require more work to actually create (and more memory and processing power.) Basically, this system would revolve around nailing or lashing building materials together - and actually forming a structure from that. For this, physics would be important (could build a basic triangle tent-like structure to building walls and a roof.) This, in my opinion, would be much more interesting and a more fun (if not difficult) concept. However, I'm not sure how viable it actually is.
So, which one is the better idea? I'm willing to put a lot of work into this system, though, at this time, I'm fairly inexperienced with Unity. As such, I'm not sure on its constraints and what is actually possible with this. If you have any other suggestions, feel free to give them too.
Of course, if it doesn't work, I can just model a few buildings and place them around the map to use. But I'd love to give this idea a shot.
It heavily depends on the type of game , is it rts or fps ?
Answer by kilian277 · Jun 01, 2014 at 07:56 PM
Well here is my answer:
I would go with the first option because that will require less work.
What yo ucan do with the buildings is work in stages like progression:
Floor only , let the NPC's carry resources from your warehouse to the building site. Each npc can carry let's say 5 wood and your building needs 10 wood it will require 2 npc's to carry that.
One delivered start a timer to time the building progress and update the model accordingly.
You can use a sort of technology tree for more advanced building techniques the player can choose from.
Choosing a place on the terrain for the building will need the RayCast system to determine the point on the screen to translate that to world space. Get the raycast origin and set the building origin to that. You can also change the terrain vertices accordingly with terraindata
Sounds sensible. I'm definitely leaning toward that one just because it's less work and I'm more comfortable with what it required for it. I also think that the other idea might leave the player kind of scratching their head, not sure what they should actually do.
I'll probably use that one, but design it in a way that, if I decide to go for the second one eventually, I'll be able to use at least a little of the code from it for the other (like, get the object 'binding' down so I can have some kind of durability on weaker methods such as tying stuff together working on the simplified building system, then use that afterwards in the more complicated version, should I choose to do so.)
That option is a great learning curve indeed !
If you have implemented that you will have a strong base to build upon that.
Good luck with your project !
Answer by Blayer98 · Jun 01, 2014 at 07:42 PM
I recommend sticking to the basics of Unity first. Model some buildings, then play around with the player controllers. (1st/3rd person)
@Blayer98 Yeah, Blayer is correct - learn the basics of C# and the Unity frameworks first. When you are done with that you could create that fairly easily.
I've already done all of that kind of thing, as well as designed a map (almost finished) on a large scale and all that good stuff.
I've used other game engines before and I'm not new to the area in general. I'm just not sure on Unity's constraints as I've not yet done anything complicated with it yet. Just the basics.
Answer by djasser · Jan 05, 2015 at 09:08 PM
there is an asset in the asset store take a look on it https://www.assetstore.unity3d.com/en/#!/content/26464
Follow this Question
Related Questions
Why can't I build Web Player in Unity while I have no problems with building standalone versions? 2 Answers
my object isnt instantiating in the right place 2 Answers
Is it possible to exclude StreamingAssets depending on target platform? 1 Answer
Mac Standalone build immediately crashes 0 Answers
How to cut a hole in a wall? 3 Answers