petak, 31. svibnja 2019.

Preview release v0.7.4

A long awaited tooltips are here, you can finally find out what is what and fleets can now find shortest path on their own.

Download Stareater 0.7.4

Tooltips look small on the screen and trivial to the player but that simplicity hides quite a lot of complexity under the hood. First of all positioning a tooltip is mildly complex, it is tied to both mouse position and originating GUI component placement, it must be moved horizontally in order to not be clipped by the edges of a window and moved below a cursor if it wouldn't fit above. That two dimenstions but there is a matter of depth, tooltips should be above regular UI components and not block mouse events on them. I went a step further with this one to lay the groundwork for pop-up windows so this is more complex than it need to be for now. And then there is the time dimension, a tooltip appears after a small delay but not if a mouse has moved away in the mean time. All four dimensions are simple to moderately complex on their own and look trivial to a user but they have to work in tandem without hiccup and that's where true complexity arises and where a robust GUI framework pays off.

For now tooltips can be added only to in-engine GUI elements so old WinForms that sorely need explanation can't benefit from them. But that will eventually be solved through ongoing process of conversion to new GUI framework. On top of that I'm trying to work out something better for text rendering. As you can see on the image above, it is not very sharp and there are some stray dots. I'm prototyping SDF based solution for half a year already but it still needs more time in the oven. Naive approach is not very practical and doesn't produce very good results, more advanced approach that promises awesome results takes time to implement, mainly due to how uncooperative (and archaic) font manipulation in standard .Net is. I've only recently solved the hurdle of getting a list of lines and curves out of letters so I can proceed with porting aforementioned advanced SDF method from C to C# but it has also opened a new avenue to explore. I can make a somewhat simpler method that sacrifices the quality of result for a speed of prototyping. In any case I hope to sort out text rendering before the summer vacation.


Ship pathfinding is another big feature in this version, allowing your fleets to automatically pick the quickest path over the starlane network. This greatly helps colony ships and other population transporters that are by default automated. Previously they'd just plot a direct course to a destination and in early game that could result in 200 turn journey unless a player didn't override the route. This feature doesn't necessarily limit the movement to the starlane network because starlanes add to the speed rather than multiply it, much like a conveyor belt. When you get to faster star drives pathfinding will likely give you a path that is partially or wholly off lane and there is a way (ctrl+click) to force direct flight anyway.

Here I took some time to refactor transport automation code and and some parts of fleet command code. Previously automation code was quite messy to read, figure out what is going on and where and why it's not working properly. Now it's one third shorter and ten times more readable. There are still some issue but they will be much easier to correct then with the old code.

And finally there are three more small changes made in this version: biology is merged with chemistry, fuel production is increased and ships can be sent even if you don't produce enough fuel. While testing transport automation I've found fuel mechanic to be too restrictive, it is supposed to prevent you from sending a large fleets deep into enemy territory, not to prevent you from colonizing neighboring star. So now you can freely send a fleet on the long journey if you are OK with economic penalty instead of outright being blocked from doing that. Base fuel production is increased 2.5 times and I'm inclined to increase it further so a homeworld could support at least a few colonization fleets for free but I'll will wait for now to see how that will mesh with technology balance. Speaking of which I found it hard to come up with 24 (8 tiers, up to 3 items each) biology technologies that are distinct enough and since chemistry was a bit sparse too, I've decided to merge the two. This unfortunately means removal of UKSA, an organization specialized in biology.