Jump to content
  • entries
    46
  • comments
    207
  • views
    39,693

Mutant Madness - Building placement


AggrorJorn

1,741 views

 Share

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

  • Upvote 1
 Share

0 Comments


Recommended Comments

There are no comments to display.

Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...