As I mentioned in the weekly meeting blog, I’ve been working on a new feature for the star sonata server, that I like to call the “global event system”.
My goal with the system, is to bring back some sort of coherence between the AI in the universe. Currently while we have multiple types of ai (from trader, to miner to pirate etc) you can’t really see their difference and in some case they don’t work nearly as well as before.
This is mostly due to the fact that those AI work alone and only have access to their own data. While this was fine on a small single layer universe, as the universe grew they became unable to achieve their objective on a reliable basis.
There is also the problem that, since the ai are unable to do their specific work, they don’t feel like they contribute to the universe other than just giving xp and drop when killed and being target for some missions.
The global event system will in essence be the part that regive AI their purpose by providing them with specific “events” (in most cases, event that both players and ai can participate in).
Every event will have some kind of indication somewhere (maybe a rumor section in ai base, or global message, or could even be random ai talking in gal chat) when they happen.
The reason it is needed and i can’t just improve the ai to do it on their own, come down to complexity and performance. Ai like most of our objects, are restricted to accessing what is within their galaxy. There are exceptions to this, but those exceptions must be very short on cpu load.
The calculations needed to properly generate those event and keep them controlled is much larger than we can realistically fit without severely slowing down the server.
The global event system will be a system that slowly gather all the informations needed to generate those event, in one place that only it can access. Then in a separate thread analyse that information to figure the best event to initialise if any.
Currently there is only 2 of such events being created, but more will be added overtime as the system become more complete.
* The first event, is a trading event. The system will find source and destination trade routes that are profitable, then create a temporary / limited event where if you buy the commod from the source, and sell it at the destination at a guaranteed profit and make up a story explaining the route (rats ate the rations, workers are depressed and the likes)
** To ensure that only items bought from the source during the event are considered, a new type of item will be created. Name is still to be decided, but basically will be a special type of crate containing the commodity.
*** The crate has a commodity defined inside.
*** when it is bought / sold it remove / add from the stock of the defined commodity
*** when the event is over the crate would transform back into the normal commodity automatically. To ensure you cannot stockpile those items to screw with the event later on.
** During the first half of the event, the source will have its stock replenished multiple times (specific will depend on the event), and the destination will buy infinite.
** At the last half of the event, the source will stop selling the items, but the destination will continue buying until the event is over. This is to make it as easy as possible for trader to actually sell their goods, while still limiting the source / credits input.
** The event will sell and buy those item higher than the normal highest price for those items, so mass buying them to sell the regular commodity later is a bad idea (you’d be guaranteed to lose money)
When this event is active, all trader, pirate and regular police ai that are within a certain distance of the route, will participate in the event.
* Trader ai will obviously, run the trade route (buy at source, sell at destination
* Police ai will patrol the route attacking whoever attack the traders
* Pirate ai will attack trader that they feel they can defeat if the total level of the pirates in the galaxy is higher level than the total level of polices. After killing a trader, they loot and sell the items to the destination then rinse and repeat. If there is too many cops, they will simply patrol until conditions are ripe.
Players with some of the item in their inventory will be considered traders by the pirate ai.
Players who attacked a pirate recently will be considered police by the pirate ai.
If a pirate is attacking a trader and then killed by player, the trader will reward the player part of the profit he made in the event (if multiple players are involved, then it is split using the same formula as xp)
* The second event, is a war between ai team kind of event. It’s a pretty straight forward event. Similar to the trade event, an indication of this event happening will show up somewhere visible, either the ai gossiping about it, or the bulletin board etc.
** in the first part, 2 ai teams of similar strength will regroup in 2 galaxies not too far from the battleground. Extra ai will be spawned to ensure the match is interesting to watch
** once enough of the forces gathered. They will be set to hate the other team and all rush to their target galaxy.
** inside the target galaxies, a few drones for each team will be spawned. Those drones will give 2hours long aura boost varying depending on the ai team (could be based off an average of their gear value count etc)
*** one of those drones will grant splash / chain damage resistance and disable death blossom (sorry gunners, but this would be way too easy if you could just instant splash one side). This effect will be ai only.
If a player attack one of the 2 teams of ai, the other team will invite him in a squad. If the player accept, he will then be squadded with the team of ai he sided with, and receive those 2 hours long aura boosts as well as shared xp from the kills.
Once the galaxy only contain one of the 2 ai team. The war is considered over. At this point, the winning team will see its spawn number in the galaxy doubled for a period of 2 hours (so if you have a mission / drop that you want from one of the 2 team, you might want to make it win).
The first part (call to arm) will last around 30 minutes. The fight will be balanced to last about 1 hour. Altho player intervention can make it much shorter.
There is a 3rd event that i have been thinking about, which would be pvp related (bounty hunting event) but it is still on the drawing board and nowhere near ready to be announced in detail. We will first have those 2 events implemented and running for a bit before we make one that could have a much bigger impact on players gameplay.