-->

main-navbar

Saturday, August 3, 2013

Project Update

The demo video I released last week showed some of the features and capabilities of the editor. This past week I have been cleaning up code and adding a few more essential elements to the infrastructure of the program. I also made it possible to select one or more modules and delete the selected modules.

The last part was the most difficult; not so much the selection system as the deletion system. Normally deleting things would be very easy; but it this case it was not because of the assembly system. With the assembly system, each group of modules that are connected to each other form an assembly. The problem is; how do you handle the deletion of a module that is the only piece holding two halves of the assembly together? Somehow I had to get the assembly to update its internal list of which modules were a part of it and in addition I also had to split the assembly into two individual assemblies. This is what was the really tricky part.

Eventually I came up with an algorithm that worked; but it took a while. Basically the algorithm starts with the first module in the list of modules on the assembly. It takes this module and scans through all of the modules directly or indirectly connected to it. Then the assembly removes these modules from a copy of its internal module array, adds them to a list of groups of modules as a group, then repeats until no more modules are left in the copy of the internal list of modules. After this the first newly created group is assigned to the assembly and for every remaining group a new assembly is created and assigned the contents of that particular group.

Anyways that's what I spent most of the week working on. Next will be adding the input/module properties stuff. This will allow the engine to actually fire, and also will allow the user to make control systems so they can build and fly a ship. This will involve a gui on the right side of the screen as well as some serious infrastructure to handle it all.

No comments:

Post a Comment