Thursday, 6 June 2013

Thursday Edits

Back In The Engine

Well my sunburn subsided and I was able to get some coding done. The task of the day was to get the system to handle multiple textures, not just the single texture mesh I was throwing at it so far.

A Maze Of Texture Complexity

Sounds easy enough you would think to add some texture goodness in there, but it turned out the whole system hinged on the fact a single buffer would be created to handle an area of the map. As it happens, for multiple textures to exist, multiple buffers where needed to be created that overlaps other buffers many times. Not so bad in terms of memory usage, but performance took a hit as more buffers where created on demand as new textures appeared, and also the draw call count increased as there are more buffers in the same scene space, each holding their specific texture.

In my prototype, this resulted in a very notification drop in frame rate when segments of 17 frames where stacked left, right and up in front of the viewer (worst case scenario). During the map editor tests, the performance hit was not noticeable as segments are drawn in much much fewer quantity, and the final result will only really be known when we start throwing real scenes at it. It is a necessary addition, and I hope it does not force me into too much distracting optimization work, but there are a few easy speed ups in there I am sure.

The good news is that it's in now, and I can paint segments of different textures, and segments that contain different textures inside them too. I did notice too that only the first segment permutation was drawn, which meant I could not add subsequent walls, floor, e.t.c. That lead me to my next piece of code.

Inter-Tile Editing

A feature of the new instance stamp system is that to change the scene, you must first remove the reference from the map and buffers, and then add a new instance of the object with any changes required such as limb visibility and rotation. A very instant task for sure, but when the tile is already filled it skipped the delete part.

After adding this new code, I could now add walls and floors like a trooper. The downside is that for some reason the delete code can occasionally target other polygons and remove them. I noticed this before, but now this new code is in it is much more reproducible.

My priority task Friday evening will be to find and fix this remaining issue and we will have a 'sort of' working map editor that allows different segments to be added, edited in place and removed from the 500x20x500 scene :)

Art News

No new art to show you today, but I can report that Mark's brain is now irrevocably set to segment art thinking mode, so expect juicy segment and scene art in the weeks to come. I can't wait!!

Signing Off

I have a busy road day Friday as my mail order department shifts 108 miles from Wales to Wigan for 2 weeks as my chief mail order dudette takes a well earned break, and my equally hard working Wigan dudette takes over. This will mean my morning and afternoon will be out of the office, but I plan to throw down a few hours that evening and spend a good part of Saturday chasing this code down too.  All in all, quite pleased with how the map editor is slowly being put back together.


  1. Lee what are your plans for non-segmented levels? I remember in the Kickstarter campaign you promised to implement level mesh loading feature so full levels or perhaps chunks of level like rooms/buildings could be created externally and then imported to FPSCR. I have always frowned upon segmented levels and an option to incorporate static level meshes would definitely add to level design.

    How do you plan to handle these meshes? Will it fit in your current draw process and what are the limitations. I can imagine occluding a huge mesh based level can posse a challenge.

  2. I agree (mostly) with Olby and am quite curious as to how this will work.