Thứ Tư, 4 tháng 9, 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.


Không có nhận xét nào:

Đăng nhận xét