Fixed module ordering

I’ve noticed a few expressions of frustration at the strange ordering of some of the modules. As far as I can tell, module ordering depends on the file name, but the identity of the module as far as the ship design files are concerned, depends solely on the name within the file, so it is safe to rename files. I’ve gone through all the modules and renamed them so that engines etc. appear in the correct order. I’ve also put a categorisation system into the filename of the modules in the following form: {hull type}{design section}{module type}—{module name}

For example:

  • the Guidance Scrambler Beam module goes from cruiser_ecm beam to c_def_pd—cruiser_point_defence_guidance scrambler
  • the Phasor II module goes from being frigate laser to f_weap_gun—frigate_phasor
  • the cruiser Micro Crew module goes from being cruiser_microcrew to c_oth_crew—cruiser_crew 0

Along the way I reordered things like light shields and micro crew modules to fit more sensibly with the normal modules and made the graphics for the frigate engines consistent with the order they come in for fighters and cruisers. I also changed the filenames for phasors etc. so that they appear in a more expected order. This also has the advantage that if you use the ‘All’ view, things will cluster together very sensibly or if you want to mod any files, it’s very easy to find the one you’re looking for.

Finally, I would occasionally get irritated at having to go to the ‘Other’ module section for some modules that seemed to fit better in ‘Weapons’ or ‘Defences’, so I moved repair systems to ‘Defences’ and target boosters and tractor beams to ‘Weapons’.

I was wondering if any of this work would be at all useful for the next patch? The ordering is one of those dull manual-labour things that probably isn’t much of a priority since it’s purely cosmetic, so I thought it might save you some work. I understand if you think my view of where modules belong is daft and its easier to undo that than redo the module ordering from scratch. (93.3 KB)

it would be a joyous day if it was this simple. Tragically, ship designs rely on those textual names, so changing them will kill any existing ship designs, which is of course a nightmare. The ordering thing is on my list of ‘big UI things to improve’ and will get looked at properly one day.


That said… It sounds a lot like it’s a ‘quicker and less painful to fix soon, rather than in 3 months time when there’s even more content to fix’ sort of problem.

It shouldn’t be that bad to fix all the single player content - hopefully some (very) carefully done find-and-replace would get you through it. As for the user generated content… Having all our user created ship designs and challenges break is a lot more tolerable in beta, than after. :smiley:

I must say, as a recovering noob, the odd module ordering in the ship designer sharply increased the learning curve for me. If the ordering was a bit more sensible, as per Jonny’s suggestion, then the game would’ve been a lot less overwhelming in those crucial first few hours of play. It’s also one of the (few) things that reminded me that I was playing a beta.

One could add a “sort by” property to the modules. A module without a “sort by” property would get thrown into the “sort last” list and be finally sorted by filename. That way, new / patched modules all sort correctly, and gratuitous modders can resort things without breaking anything else.

Both dogthinker and teatimegromit’s ideas are nice ones.

Personally I prefer dogthinker’s “Change the file names now and make a quick search-and-replace program which will apply the module name changes to all existing ship designs too.” Because the longer you wait the more ship designs there will be and bigger nightmare it will become to figure out a way how it will be fast and easy to sort all modules in sensible order without breaking the current ship designs.

I think even Notepad2 can do that kind of search and replace commands so maybe you could use that and code a small program to control it upon the next patch? :9

yes this was my thinking too, along with some redone visuals so that the different modules look more different.

better ordering (but so far, the same graphics) will be in 1.18

I hate to suggest that I know something better than cliffski, but my experience tells me that you may have forgotten something about how your code works (or misunderstood me).

As far as I can tell, there are three names for each module:

  • filename - affects ordering in the GUI
  • name variable - used to identify the module internally for designs
  • gui name variable - used to label the module in the GUI

Am I misunderstanding this? Because at the moment, I’ve changed the filename for every module and left the name and gui name variables the same. The game seems to be loading the information from new files, but once it’s internalised, the designs pick up the right information about the modules because the actual module names are the same; the filename doesn’t matter for anything except determining module order in the GUI.

I’ve been using this setup for a while now without any problems - all the standards designs, challenge designs and my own designs from before and after changing the filenames works. Try substituting in my module folder for yours and see. Either I’m imagining things, or this works. Could someone else download the attachment in the first code and verify that I’m not crazy? All you have to do is move your old modules folder somewhere safe and dump the downloaded in.

Sure. I’ll check it out.

Edit: :stuck_out_tongue: Ok. First try, simple copy and paste over the modules folder. I got a copy of each item in my inventory now. :smiley: Other one in order, other one in original order.

I guess next I’ll just replace the folder and not just copy and paste it.

Edit II: Yep. To me it seems to work just fine. Though, you may want to recheck the spelling on some of the Frigate’s modules. :stuck_out_tongue_winking_eye: For example that blue laser turret was something like Blue smallBeam laser or so. And the frigatte micro-crew pod was still in wrong place.

But in other places the order seemed to be correct and work just fine. I even made two new ship designs on rabbit’s chassis and they worked nicely ingame.

And I really do like this kind of order. Makes it a bit more easier to compare modules and also understand which weapon I would pick over another one.

Don’t worry, it’s all done for the next build, I added a new gui sortorder variable, and all is fine. The old order was basically the windows file order, which if I recall, can even change depending on your folder view settings, so it was a nightmare :smiley:
Anyway, the new system is MUCH nicer, and there is a gap of 10 sortorders between each existing one, so if people mod in extra modules, they can be easily put in the right place. Locked modules still get bumped to the end.

Having a sort variable seems very limiting even with gaps. Wouldn’t a more elegant and flexible solution be to have a module type variable then sort them alphabetically by module type and then alphabetically by GUI name within each type? Sorting by numbers seems clunky, particularly if you ended up installing mods from multiple people because then you might have clashing numbers. A modules type variable would be more intuitive and do more of the work for people.

Also, have you given any thought to moving some of the modules from the sections they’re currently in, so that for instance repair modules and tractor beams are in with Defences and target boosters are in with Weapons? It seems to be a more logical arrangement. Personally, I also think that engines should be in with Other - it would reduce the amount of jumping between sections and make the design process quicker and more efficient. It also has a certain amount of historical basis in that ship design has been a compromise between three factors: guns, armour and powerplants (which included engines)

Nicely done with that Cliffski. :slight_smile: That will make it easier to compare weapons and understand what kind of projectiles they fire.