Jump to content
  • entries
    13
  • comments
    80
  • views
    34,829

Level Building: Lego Construction Set


Road Kill Kenny

2,358 views

 Share

Hi All,

 

Currently I am working on making my level building in my game much more diverse and easy. Formerly I was having to create custom models for each room in the game. This worked but was hardly efficient, very time consuming and did not leave much hope for the end user to create and share levels either.

 

So I set off to kill two birds with one stone:

  • Make a level building system & editor to streamline level creation in my game
  • Make the editor easy to use to open up the possibility of the end user gamer being able to make custom levels using the pre-made building blocks.

So the idea around this whole system is to make lego blocks, The lego blocks get constructed together in any different way specified by the user to make a level and the user can simply slap on any texture they want. This will make level building very fast. There are a number of things that were musts for this system in my eyes:

  • Data Driven (of course... did you think I would do a blog without talking about that...)
  • Utilize unit lengths and snapping (no decimal point dimensions & positions)
  • Optimize UV's so that the pieces can utilize different materials easily (sort of like creating a standard for Level part UV's that all pieces and materials must comply with to work)

 

So with out further ramble, please enjoy the below video that goes through the process of me exploring this. This is part one of 3 which I will show in separate blogs.

 

 

Problems Encountered:

 

1. Origin of Level Pieces At first I thought that putting the origin at the center of the pieces would be a good idea. However, this turned out to be the worst idea ever as it totally screwed up the unit length idea. For example you have a 1X2m floor piece, if you put the origin in the center the origin is at 0.5X1 <-not unit scale... At first you may think this does matter but it does. consider placing a 1X2 piece next to a 2X2 piece. if 1X2 floor piece was at position (0,0,0) then the 2X2 piece would have to be at position (1.5, 0 0) otherwise it would overlap. see image below:

 

blogentry-3220-0-06387800-1348221276_thumb.jpg

 

So to solve this I put the origin at the very corner of each piece with each piece extruding out into the positive X Y and Z directions as shown below.

 

blogentry-3220-0-26071300-1348221287_thumb.jpg

 

Sure it was a stupid mistake but an easy one to make.

 

2. There is no problem number 2

 

Whats Next:

The next thing I will be doing is creating the editor. This entails a bit of windows programming. I don't want it to be like the HAARP editor I made. I want it to be nice and easy to use for just about anyone who would play my game. It will be using proper save and open dialog boxes and other such Windows utilities to make it familiar. I will blog about this next time.

  • Upvote 7
 Share

4 Comments


Recommended Comments

Very nice blog with solid good info on what you are doing. Have been thinking of this my self but not come to it. Thanks for sharing.

Link to comment

Thanks guys. Currently working on the editor. Very fun, very excited cuz I'll be able to throw my bro(artist), or anyone really on the editor and, without having any programming experience, he'll be able to make full levels for my game with full interaction between objects and AI etc. etc.

Link to comment
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...