Devlog: User Interface, Building, and random stuff

Snap678I am currently overhauling the user interface so you can access all the ship commands that were until now only accessible to the AI factions while improving the general ease of use. It’s still a bit clunky, but we are slowly getting there. There’s many changes including a darker theme for better visibility, various popup menus, a few new windows / improvements to existing ones.

Apart from the user interface, I also made several changes and improvements to the game engine, and ship behaviors. It’s quite hard to fit all of them into categories like usual as it was a fairly unfocussed coding week (GUI aside, of course). I will try to detail the important bits in the full post.

Also don’t forget to check out our new gameplay video

Enjoy  🙂

User Interface

So I have opted for a popup menu to give orders to ships (in addition to the usual RTS’like control and keyboard shortcuts) instead of having to pull another window. The popup menu is context sensitive, for instance if it’s open over another ship, the selected one will have the protect and attack orders ready. Also, as you can see, you can order your Builder class ships to construct space stations. Not all commands are fully implemented yet, and some are missing entirely, but you get the gist of it.

As a result, I decided to remove the give orders menu from the new ship info window. Here’s a few screenshots of the new layout:

The first tab gives information about the pilot and bounties (if any), it will also allow to pay up said bounties when I am done with it. The list of current orders is still present, but you can’t give new ones from there anymore. It would have been difficult to do so without creating tons of sub menus anyway, and my user interface (nor myself) like sub menus very much. I also implemented the Hangar tab wherever it’s needed. And it’s possible, granted it’s one of your ship, to undock it and get information about it from here.

Snap683I improved the Empire manager so you can select which sector your empire will try to invade next (sector selection is done through the galactic view, the same as it’s already done when using warp gates). It’s also possible to cancel an attack from there.

I also fixed a few issues when selecting ships using the mouse, like when lasso-ing one of your ship wouldn’t properly select it most of the time. It’s also now possible to shift lasso ships.

Last but not least, most windows (including the small fleet panel), when relevant, refresh info in real-time. For instance, you don’t need to close and reopen the galactic news to see the most recent items anymore.

I will probably add soon ™ an option to disable the windows’ transparency. As much as I like the effect, it makes for barely readable menus from time to time.

Game Improvements

Snap676It will now take some time for construction ships to build stations and factories. While they are building there’s a small animation as shown in the screenshot. I can’t say it’s very nice looking, and I will probably add the layout of the station slowly appearing, but at least no more instant building.

I also added a new rearm and repair order to ships. When given this order, ships will head for the nearest friendly shipyard to get hull repairs, and if the said ship is a carrier, it will replenish its docking bays with fighters. And of course I added the option for the faction AI layer to use this new order. Right now it’s only used for carriers that are not actively taking part into an invasion but I will expand that later on.

Optimization

In my never ending quest to handle loads of ships, there’s now 2 threads instead of one dealing with the ship and bullet AI. Right now each thread handle 50% of the sectors and it works better than expected (ie it doesn’t crash and it increases the amount of stuff the game can handle), but that doesn’t exactly cover cases where multiple large battles would happen in two sectors handled by the same thread. I will try to balance the workload based on the amount of ships in each sector instead of having fixed sectors for each thread.

While there’s still quite a lot of room for improvement, at one point or another I will have to draw a line about how big battles can get and find a way to do that in a manner that won’t impact the gameplay too much. The issues isn’t the amount of ship itself, the game can manage hundreds of them in the same sector, but the amount of bullets, missiles and lasers they spawn.

A 200 vs 200 battles can quickly have 10.000 “bullets” or more at the same time, not even factoring explosions, shields and loot drops into the equation. As you can imagine that’s a lot of code to run and collisions to check for (especially as it has to do all that in 50 milliseconds or so). It does work when you’re not directly looking at the said battle, because collision detections are only checking for the target. But when you’re looking at it, it’s a buggy slug-fest. I may have to enforce some kind of upper limit to the amount of bullets AI ships can generate in a sector, but that’s the kind of decision that will have to wait until the rest of the code is perfectly more optimized.

Final Thoughts

I am glad with the GUI updates I made these two last weeks, the game is definitively taking form. Sure it’s still quite rough, but we are on track. Once I am done with it, which should take a week more or so, I will get back to the individual ship AI and, more importantly, to the mission stuff, which is the biggest chunk of “yet to be written” part of the code.

Cheers,
SK.