Tuesday, October 11, 2011

61 – Borderland

I managed to finish the new border system. Oh boy, did I ever. I created and absolute abomination. Probably the worst piece of code from the whole project. And the worst part was that after I thought I was done I realized I forget some special cases. I don't know what was wrong with me. Probably it was too late and I was coding on autopilot, with my fingers moving but my mind on some warm tee and hot cookies (literally speaking; get your mind out of the bloody gutter :) ).

So I was forced to rewrite it. The new solution is at least 20 times shorter! It handles all cases fine. The old solution did have one advantage though: it handled the small visual artifacts. The new one does not, but it will be able to do so quite easily. But I won't fix it right now. I don't want borders to turn into "ramps 2.0". The horror!

An "Anonymous" user had a really great comment and mock up which I ended up implementing. Thank you! And hooray for me for not knowing lighting basics.

In the next video you can see the two techniques working together to better illustrate the structure of the level:



It is a little bit rough around the edges, but I am really starting to love the look and feel of it! The little arrows have double function: they help to better differentiate borders and also point you to the direction the border will move when you dig out a wall. What do you think?

There is one problem though: the border system is a huge resource hog. Even if I limit borders only to the active level it might still be a little bit too slow on older computers, especially with a full fortress and freeform fly camera.

4 comments:

  1. That's excellent!

    I must admit when I saw Anon's mock up a lightbulb went "ding!" above my head :D

    I'm currently working on 3d models for you atm :) Today I hope to complete a barrel, chair and table and fully texture map them. Tomorrow I'll bake on some ambient occlusion to the textures to make them look less flat. I would make shaders for them but it's extra work and it doesn't look like you're ready for shader librarys just yet ;)

    ReplyDelete
  2. here's a snippet of a barrel I made for DH this morning :)

    Hope you like it!

    http://s2.postimage.org/5cbld9xtu/Barrel.png

    ReplyDelete
  3. I love the borders! They make things stand out and much easier to understand. I generally find objects in 2d and isometric games easier to “parse” because they have good contrast, compared to objects in 3d games.

    ReplyDelete
  4. The borders looks nice and does what it's supposed to do. About performance... Somewhere down the road you probably have to add graphics options in the engine since people have very different computer setups. And maybe a recommended map size depending on CPU, GPU and RAM after testing it on a few systems. Atleast then you can warn people on a 1.6Ghz Atom CPU, 1GB RAM and whatever intel GPU that maybe a 5000x5000 map might not be the best idea.

    ReplyDelete