Wednesday 4 September 2013

Wednesday Choppy Choppy

A Full Code Busy Day

Today was the day I broke my main engine into two pieces. Well in fact I broke it into about twenty pieces, all in the process of creating sub-modules for all the different sections required. 

When I moved the original FPSC source code into the public domain, and allowed modding of the official version to take place, I combined all the sections into a single code base. This helped to keep everything in one place, but the problem with having everything in one file is that the file is over 50,000 lines long and takes an age to compile!

The original project had the code split up, and today I started the process of dividing up the latest source code to recreate a much easier development environment while I work on the main engine.

Map Editor Under The Microscope

The reason for the above turmoil is so I can work on the map editor section quickly and easily, and around 5PM I managed to get the much smaller code base to compile under 25 seconds and a vastly smaller executable to feed into the IDE.  All the map editing is still present, but the test game and all the 'standby game code' has been shifted to a 'game file' for later integration.

I can still make significant reductions in the source code I have now, and hopefully I can reduce it to less than 10 seconds compile time for super rapid development.  I must however guard against spending too much time hunting down every last subroutine to reduce as in the end, it will all go back into one pot for the final software.

My final task before close of business was to get entities selected, loaded and pasted to the editor, which works fine apart from a strange texture problem which I will solve in 5 minutes in the morning. The next step is to disable all segment code from the engine and re-position the start location for editing at 25,000 x 25,000.  This will be the work of Thursday, along with more code reductions and clean-up.

Removing The WHAT! Code

Anyone who tuned into my previous blog will know of my crazy plan to drop one of the most successful features of FPSC from the product, and I am sure many of you are curious what I am going to replace it with.  To ensure everyone knows where I am coming from, I thought it best to sketch out a rough plan of the initial idea for the new structure creator.


As you can see, I am coining the term ROOM BLOB, which is the central building block of the new idea. As you can see, each room blob is capable of interchanging the key elements required for unique creations such as doors, windows and walls. The placement, number and size of these elements are also dynamic, selected by the user through an easy to use GUI system.


The second feature of a ROOM BLOB is that it can connect to another room blob and seamlessly and intelligently merge with it, creating common doors, windows and other features as part of the process of clicking them together. You can use simple arrows to drag the rooms wider and longer, and even higher! Gone are the days of painting two layers to create a realistically sized large room. You can also detach and drag the room blog to a new location, preserving any entities you may have placed inside the room.


Unlike traditional segments, room blobs can specify how many 'floors' you want them to have with a single property, specify what kind of roof it has and perhaps most importantly what textures should be used for each of the many materials that make up the room blobs. If you are happy with the style of a room, you can of course duplicate it and make modifications on top of your original design.

Instead of placing doors and windows at exactly 100 unit intervals, which creates a uniform sense to your levels, room blobs allow doors and windows to slide along the primary axis for pixel perfect positioning.  Stairs and ladders are accommodated by the room blob as walls and floors cut holes where required completely automatically and efficiently.

As a nice bonus, because the room blobs are mostly generated in real-time and constructed in code, the geometry placement is efficient which means less memory used per-square-meter, the performance improves and my personal favorite, every element and facet of the construct can be 'disassembled' in code for some awesome effects. An obvious one will be converting an entire building into brick blocks, tiles, wooden struts and girders, then blowing it up using Bullet physics!

Room Blob VS Segment

ADVANTAGES

  • Create large rooms quicker by simply dragging them out
  • Buildings can be variable height, not just multiples of 100
  • Instant roof generator for more realistic outdoor visuals
  • More refined control over door and window positions
  • Room contents are preserved as rooms are re-positioned & rotated
  • Highly efficient geometry use, no redundant trapped polygons
  • Built-in physics, LOD and AI meta-data (no baking required)
  • Allows all materials to be textured with your own choices
  • Intelligent inter-connectivity - snap rooms together easily
  • Create a structure 20 floors high with a single property change
  • Less memory as buildings are reduced to 'selections' data'
  • Renders and collides faster as fewer polygons required

Conclusion

We will be using the genre and style from the Reloaded beta to influence the capabilities of our first 'room blob' buildings, but will be able to expand them with more sophisticated elements as we move on.  With a clear template and modular system in place, artists will be able to add 'wall element' meshes and new textures to the system that builds the blobs allowing for a greater variety of structures, from angular offices to blobby caves.

Given this new system will take a little while to create, and the fact you are probably itching to get your hands on a beta, we've decided to create the pre-baked building templates first and add them to the library, and follow it up with the 'customize' option as soon as the basics of the editor and game runner are done.  This way you can feedback on editing tools, terrain system, AI, visuals and overall game play while my small team work on a super simple user interface and real-time structure generator that's fast and efficient.

Once the beta launches, we will also be opening up incremental cascade updates to all pledgers so you can check out the progress of the room blob technology as it develops.  As always you will be able to read up on the daily progress of this through the blog, which might go underground after October so only pledgers can read it.  The rationale for this is that my blogs can often paint a picture of the product that is not always complimentary and has an indirect affect on any PR and marketing that may be underway.  Your comments on this are most welcome!

Signing Off

Today started at 6AM due to an extremely early night last night. I am tempted to repeat this again, as I found great clarity coding before the sun came over the mountain!  Any questions on the new structure system, post your comments and I will try to provide more information. Bear in mind this is just a sketch, and almost every detail can change over the course of development, but you get the gist of where I am aiming.


21 comments:

  1. It's....it's wonderful! Oh my gosh, THIS is what will define FPSC Reloaded to be a seperate product to FPSC.

    Initially I was astounded by the old segment system, but as I started to learn as a game creator, I realized that really, it is horrible limiting and very time consuming for more detailed games.

    I hope this also means there will opportunity to implement camera rotation in the editor? So we can see our level at all angles? It made it incredibly difficult to place things in the old editor.

    ReplyDelete
  2. I forgot to add, while I love this approach to level making, will we also be able to, quite effortlessly, create level meshes in external programs and import them into FPSCReloaded?

    ReplyDelete
  3. This looks great,looking forward to trying it out.

    ReplyDelete
  4. The first comment I would like to make is the start location for editing which is good to be seeing going in and I hope everyone will eventually start at that location as it will be so for a reason.

    As to the "Plans" I say go for it as it sounds like it will overall be a better and perhaps much better feature than segments at the end of the day.

    There have been over the years numerous methods of creating and thereafter manipulating building type world objects inside editors and of course also methods of creating externally and integrating or importing and editing them possibly too once in situ.

    I am not sure what technology this new method will employ and do not really wish to know other than when we get to have it or a Beta of it as it were and so I trust in Lee to have given this some prior thought and his judgement in including it.

    As always there are sure to be some disadvantages as well as the advantages as there are usually some in all things or at least some things that some will not like about it.

    The only benefit I could see from the old segments was of course the important one of speed of development though that was never as great a help as might first seem due to various perhaps minor issues and sometimes much time wasted tweaking because of them.

    All that said its the overall benefit that matters over any possible disadvantage so I say Yes Please and I look forward to seeing more of that.

    I have to say a big thank you to Lee and TGC for not missing opportunities to make Reloaded a much better product than its predecessors and going the extra mile to add things not originally in the original set of Goals that will make it even better than planned at that stage.

    Good on you. Thanks

    :-)

    ReplyDelete
  5. Nice idea, we need to see where it is going.

    I just want to comment on the part with the blog "going underground"...
    I don't like the idea. You will loose a lot of different ideas from other people who might have not pledged. I don't see a good point in doing something like this.

    Just my 2 cents...

    ReplyDelete
    Replies
    1. I agree with DarkGoblin...I can't afford to pledge to FPSCR and I still want to read the blog. I discovered it near the beginning of 2013 and went all the way back to the very first post and read from there. I haven't missed a post since. It would be very sad if I were suddenly cut off simply for PR...

      Delete
  6. Hello Lee, this is definetly a great way creating rooms. I agree with your decision, this is a real improvment! Only one question, please may you reply? question is, what happen if i place a room blob half outside and half inside the terrain layer?
    Regards!

    ReplyDelete
  7. It all seems great. I just hope you don't lose sight of all the features you were going to add. Dynamic lights to weapons. Camera on weapon. Finishing off inventory and other things. Clouds and particle weapons and sound distance And other great things. This sounds like a huge detour from the other stuff which you may end up not giving us for a system that is better but not essential really to game play but better performance for spectrum users and admit more dynamic building etc. But as long as the other stuff is going to be pretty certain to be done hope before the new blob builder. Eta on completion and a promise or near that all the huds and that ilk will be done before then I am well in

    ReplyDelete
  8. awesome
    and lets be honest the room blob idea
    is better then what you got in udk or unity
    why?
    simply because unlike in those
    reloaded (according to the roomblob idea)
    is going to make it easier and more accurate along with more flexible
    placing buildings, copying those
    creating variations of the same and so on, damit am excited to see this happening

    and even more excited to read this "....Once the Beta launches..."
    @lee how possible is it that we see the beta in october?

    and ofc i understand the concerns above
    but lets face it, if Reloaded is going to be succesfull
    then it has to make some impact
    and features like those - they make big impacts

    ReplyDelete
  9. It seems like a really good idea, Lee, but I'm still a bit worried as to how flexible it'll actually be. For example, do we HAVE to use the automatic roof generator? If we do, how flexible is it? Are there a few pre-set shapes of roof?

    Another question: Can we change the textures on any part of the building? So we can have half a room blob as one texture and half as another?

    ReplyDelete
  10. You can create 3D meshes and simply import them as static entities, then add them to your level as scene geometry. If you provide a low level LOD mesh and name it appropriately, it will use that for Physics calculations.

    Sinking a building beneath the terrain would require cutting a hole into the landscape, which the technology does provide. I have not given too much thought on the best way to do that yet from a user editing point of view, but I am warming to the idea that because the segment imposed height limit of 20x100 has been removed, it would simply be a case of automatically removing the terrain when a room blob penetrates it. The issue will be how to stitch the terrain geometry (which would show little holes) to the sunken building. A level designer might hide such artifacts with clever artwork, but I am hoping my brain will come up with a completely automated solution.

    Don't concern over the order of things. The priority is to get the editor and game runner working first with all the features we've touched on, and use pre-baked buildings to start everyone off with. Once we're there, I can then assemble a small team to work 100% on the structure maker until it's ready for integration.

    My aim is to have a beta for all pledgers sometime in October, not fully assembled but certainly able to create and play Reloaded levels.

    The roof generator does not have to be used at all. You can leave your roof flat (like the old segment system), and simply place static entities on top of it for a roof of your own 3D design. I am pretty sure you don't want to repeat the horror of creating a roof the old segment way :)

    The current plan is that the room blob has X number of materials describing walls, floors, frames, fittings, edgings, e.t.c. and each material will have an associated texture and shader settings. These properties can be changed when you customize the room blob, and of course room blobs can be added together and walls removed to transition from one texture style to another as you see fit. The objective is to introduce additional flexibility, not restrict it.

    ReplyDelete
  11. Very awesome. Looking forward a great lot to this. Like it has already been pointed out, I think a freed up editor view is becoming a necessity. Of course, all in good time :)

    ReplyDelete
  12. Hi Lee, if you need any advice on wall / building structure for destruction at a later stage please ask. I was in the construction industry as a draughtsman and senior architectural technician for a long time. Also I understand how physics systems work to a large extent ;)

    ReplyDelete
  13. Thanks Steve! My blog will chronicle my every step, both good and bad, and I am sure you will not hold back if I magically float five levels of building on small wooden lintels ;) I won't be rushing this part of the project hopefully we'll have the time to get it looking good, running fast and architecturally accurate when it comes to blowing it up with barrels of fuel :)

    ReplyDelete
  14. Lee, when you said you plan to have a not fully assembled but able to create and play levels; what kind of freedom and restrictions were you speaking of? I will be making my pledge this weekend, and was hoping to get a bit of an idea as to what the beta would be capable of. Keep up the awesome work and can't wait to hear more.

    ReplyDelete
  15. Hi Lee, awesome work for the new FPSCR! I have one question, if the new editor does not use segments, It means that the segments included in all the Model Packs of the old FPSC will not work in the new version? It will be some kind of "converter" or something to use them?

    thanks!
    Igor

    ReplyDelete
  16. @lee
    regarding stitching terrain for hiding holes
    how about a export function for the terrain
    so when we create holes - for lets say underground passages
    and or buildings

    we can use the exported terrain to build our building/prop models exactly, so that it covers that area.

    since the terrain might endup pretty big/ it might be best to be able
    to mark such areas with a brush and the the export would only
    take those in account that are marked.
    anyways thanks lee for the info regarding october.

    ReplyDelete
  17. I must admit, when you writed that the segment system will be trashed i worried! But reading the events evolution in theese days i can say one word about the new room system: AWESOME! Double thumbs up for it! Impressive work! Giving the ability to build rooms blobs not only in fpsc:r but on other software too like 3dsmax is power! I will not worry about holes on terrain, if the editor have basic meshes to use, like cube, cylinders, pyramid etc.. we can use it, stretch, rotate to make example walkways, and cover artefacts.

    ReplyDelete
  18. I'm still not sure why we need to stitch the terrain to anything...BlitzTerrain has built-in support for and exclusion map that cuts holes in the terrain. Although maybe it does it in large "dots" that could be just in the wrong place and leave a gap at the edge of a wall, say. Ok I can see the point now.

    Also, the ability to cut holes in the terrain (even if we have to cover "artefacts" ourselves) is really necessary, but should definitely not be automatic. What if we WANT the terrain to show through the wall, as though there's been a cave-in or the wall has collapsed or something? So don't automatically cut the terrain just because there's a room blob intersecting it.

    I'm finally starting to believe that maybe, just maybe, this new system could be as awesome as it sounds :D *fingers crossed*

    ReplyDelete
  19. If it helps with memory preservation then let's try it out. As you said, we'll have a chance to test it out once the beta goes Live. However what I am worried about is that you have not mentioned the possibility of fine-rotate and tilting rooms to create a more realistic layout of (for example) a sub-urban refugee camp. Also I hope that room snapping can be toggled so that it could be a little bit smaller or larger than a standard FPSC block.

    X Y Z Rotation of Room Blobs - For scenes of roaming through demolished buildings, tilting environments, things that mess with your mind, Tilting underground facility systems etc.

    ReplyDelete
    Replies
    1. I definitely agree with you, Damian. I hadn't thought of the ability to rotate rooms, but it's a very, very good idea and IMO almost necessary. And I too want to be able to make rooms any size (not x100).

      Delete