• entries
    41
  • comments
    189
  • views
    26,837

Mutant Madness - Building placement

Sign in to follow this  
AggrorJorn

476 views

Something I have never tried before is working with terrain and placing buildings on top of it. The idea is that you can build everywhere on the map as long as the slopes aren't to steep and there is no building already placed.

 

The Grid.

Although you have the freedom of building a tower where ever you want, the underlying system still works with a grid system. That means that gridpoints can be tagged as "can not build". It also leaves space between buildings which is nice because I don't have to check for colliding with other buildings. The grid displays cubes for every 2 meters. Cubes on a steep slope are colored red. All the other cubes are green and therefore enable building.

 

blogentry-45-0-50817500-1333841924_thumb.png

 

Building placement

I had a little setback when I had this unusual error in C# (see topic). But instead of using a Pick, I now use Camera Project. It doesn't work entirely the way I want it, but in the end it doesn't look bad. You can see a temporary building being displayed in a green or red color (depending whether you can build it on that location, yes or no). Although the building doesn't exactly follow the camera, it is still accurate enough for good gameplay.

 

Different towers can require more tiles at once. For instance: the most basic tower is a bunker which only takes 1 tiles. However, an other tower (for instance a radar installation) can take 4x4 tiles. Every tower derives from the tower class. A simple multidimensional variable defines which tiles are necessary.

for instance:

[ 1, 1, 1 ]

[ 1, 0, 0 ]

[ 1, 0, 0 ]

[ 1, 1, 1 ]

This tower has a hollow shape: 1 is used for building, while 0 is still free to build something else.

 

 

 

 

 

 

blogentry-45-0-11923300-1333841954_thumb.pngblogentry-45-0-54484400-1333841897_thumb.jpg

Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Create Your Account

Sign in

Already have an account? Sign in here.

Sign In Now