Avorion

Avorion

Playerless Events
More suggestions
Hey, hope you don't mind my giving more suggestions. Decided to make a thread so as not to continue to jam up your comments feed with this stuff. Plus there's a larger character limit this way. :P Not that I have that many suggestions! There's just two here (kind of three, I suppose), but I tend to get wordy to explain and give examples. :) And of course it's entirely up to you if you want to do any of this. They're just suggestions. :)

First suggestion:
So looking around at how these various functions interact, it looks like if you wanted to, you can create a separate eventsutility.lua file much like how you did for the eventscheduler.lua file (ie, create a jceventutility.lua). Then in your playerlessalienattack.lua and playerlesspirateattack.lua files, you could reference this new jceventutility file instead of the normal eventutility.

The advantage here is that you won't be altering the true/false conditions for the normal events, and in your version of the file, you can now do something like "if #players > 0 then return false end". This would prevent any chance of both your event and normal events from firing off at the same time (or in conjunction with each other) where ever the player is or accidentally allowing the normal events to fire with the same conditions as yours (ie, no players present). I think this would also keep it open to someone else being able to mod the true/false conditions of regular events without effecting yours (yours can still be modded, but now they'd have to actually plan for that).

To go along with this, you may want to include a check in this file for checking how many ships and stations are present (like you do in the jceventscheduler file for altering the chances of an event happening). If both come up 0, then you may want to have it return false, that way empty sectors can't fill up with pirates and the like (I don't know if gates count as stations in that function, though).


Second suggestion:
In your code for the chance of its firing off one of the playerless events, I believe you have the chance set for like 50% at the moment (with other modifying factors)? My only thought here is that, in single player, a player can have up to 500 sectors being kept alive at the same time. 6 per player in multi, but this is modifiable and it's possible to use a single player sever and config for multi. While I doubt any player is going to have upwards of 500 sectors with stuff in it, it may not be unreasonable to expect 4-6 early game and close to 50 by late game.

Anyway, point is, with the current chances you have in the default file, there's a high probability that they're going to see multiple sectors having events simultaneously or back to back. For me, this gets annoying as I'm constantly monitoring and hoping that whatever escorts I left there can deal with the event before any of the civilian craft get hit. This also increases processing load if too many of these are happening at once.

My suggestion is to decrease the chances to more like 15%, get rid of the factor that increases the chance after each fail, and then apply the modifiers for ships/stations present and warzone differently. IE, instead of directly adding or subtracting them from the base chance number, have them multiply. So, if you change the ship present factor to say 0.95, then it'd be chance * shipfactor^ships-in-sector (so a single ship would bring the chances down to 14.25%, while 5 ships would cut it to ~11.6%, and 0 ships would cause no change). Same with stations, etc. This would allow the chance to decrease or increase as you are trying to do now, but it will never truly hit 0% this way (and in that sense, eliminates the need for increasing the chance after each failed cycle as there will always be a chance).

I know someone could alter the file to give it whatever chances they want. However, not a lot of people are willing or know how to do that and any time you make an update to the mod, their changes will be wiped out.


Again, these are just suggestions. Use or discard what you will.

Thanks for the mod! :)
Last edited by FuryoftheStars; 9 Apr, 2020 @ 10:31am
< >
Showing 1-2 of 2 comments
FloranFan24  [developer] 10 Apr, 2020 @ 12:56pm 
1) Duh, I don't know why I didn't think to just make my own event utility, that would have made things a lot easier. Although there shouldn't be anything spawning in empty sectors, it should only be sectors that have player faction ships and stations, and the event scheduler should deactivate if an actual player is in the sector, but I will check on those and revise it.

2) The problem with setting the base chance that low is that the threat system scaling would have to be decreased as well or the threat system reworked entirely. Otherwise a mining vessel and its guard in a lonely asteroid field would get absolutely obliterated by a large Xsotan/pirate fleet.

I've been doing more digging through the Avorion documentation, and found that it may be possible to set a global variable, using Sector():getValue() and Sector():setValue(), so that it can be guaranteed that events will only happen in one or a few sectors at a time.

As always thank you for your suggestions and insight. I haven't gotten around to doing an actual, proper play through yet as I've been working on my other mod to make torpedoes, which took much longer than I had anticipated due to me not knowing how Avorion treated the UI elements and client values. Now that its finished, and no critical bugs have been reported (so far), I'll try and do an actual play through with this mod and update it accordingly. Again thank you!
FuryoftheStars 10 Apr, 2020 @ 1:27pm 
Originally posted by jakecool19:
Although there shouldn't be anything spawning in empty sectors, it should only be sectors that have player faction ships and stations, and the event scheduler should deactivate if an actual player is in the sector, but I will check on those and revise it.
Well, I'll be honest and say that I haven't given it a good play through since your last major update to it, so i could be wrong. I was just going based on what I could find in the code. If there's another trigger somewhere that disables it when the player is in sector or something, then that works, too. Though the other point of being able to make it so your true/false conditions won't get overwritten by someone else modding the file still work. :)

Originally posted by jakecool19:
I've been doing more digging through the Avorion documentation, and found that it may be possible to set a global variable, using Sector():getValue() and Sector():setValue(), so that it can be guaranteed that events will only happen in one or a few sectors at a time.
That sounds like a good way to help mitigate it!
< >
Showing 1-2 of 2 comments
Per page: 1530 50