Hi everyone!
The new update is live in the preview branch. Hopefully you all are seeing improved performance and gameplay. We still want to add a few things and resolve remaining issues, but it appears that the game is stable. The original plan was to have a preview branch on Monday and a full release on Thursday, but everything got delayed. At first the PC that I work on and produce builds on started to lag, and a few days later it just decided to die on me. Most likely an SSD issue, but once I got a new SSD, there was no time to reinstall everything and prepare it for work. Now my days are spent on a laptop in various locations. Progress is slower, but the change of scenery is nice.
We wanted to share what is new and what we did not talk about. Most of the last two weeks was about performance, bugs and small additions that we gathered from various places.
No more being bought by AI in a single month. Companies now have shares that start locked and are unlocked every second month. Company owners will have a chance to buy their own shares first and if they fail to do so, then they will go to the open market for anyone to buy. You will be able to buy already bought shares once all shares are bought from the open market, basically trading without consent. Shares will become locked once you buy 100% of them allowing you to keep company as is, control if it should expand or sustain, merge with it or liquidate. The best option depends on what you are after.
Having shares allows you to collect dividends from other companies profits. By default they are set to 20% if you own 100%, but once you own more than 50% of the company, you will be able to specify dividends yourself.
The share price is based on the company's value and shares bought. If you buy other companies shares, then your share price will increase. The more shares are bought in a company, the bigger price they will have as well. If done right, it is a good strategy to buy some shares at the early game, collect dividends and sell shares later.
Lastly, AI companies will not merge or liquidate players on the hardest difficulty, but you will be stuck working under them and paying dividends from your profits. It is a lose condition if you choose so.
More saves allowed me to debug more, and performance was further improved. Most of the work was put into the memory management. I noticed that there were a lot of allocations made when passengers were searching for routes. It was so severe that it forced GC collections every frame. The culprit was the red–black tree that I was using for the A* path search algorithm. You can insert and retrieve results from it with great performance, but every time you insert something, a new allocation is made. With huge save files on max speed over a 10-second span, over 2GB were allocated.
I made object pooling for threads to reuse all needed classes for the A* search, which removed new object creation. And for the red–black tree I made a radix sort type of system that avoids new allocations. That basically removed allocations for route searching and increased performance dramatically. For some saves, I noticed an increase from 7 FPS to 60 FPS.
This was added today. A great small addition that should make worlds more alive. Once you create a new company and buy a hub, the game will save this information for future use. The next time you start a new game, there will be a chance that your past company will spawn in the same country with past configurations if its name was not taken.
On the same note, the game will remember the last company you created and load your settings in the new game window.
Smarter AI, especially at the game start, to prevent companies that do nothing
Fixed most of the indirect passengers problems and still working on the remaining ones
Fixed most of the passengers boarding in the wrong direction problems