Jump to content

Splutty

Members
  • Posts

    258
  • Joined

  • Last visited

Posts posted by Splutty

  1. Good to see people provide updates for my mod while I was AWOL :)

     

    I'm not sure if I'm coming back to Avorion any time soon. This mod was the thing I wrote while I was stuck sick at home, just to see if I still could. It was mainly meant to be used by myself, but I decided to post it.

     

    Good to see people have been using it and thanks from everyone for those who modified it to make things work with newer versions!

  2. I think he means that it doesn't work with a factory complex, which is a mod that merges stations together into one (made by Laserzwei). That's probably why it isn't working, as it's no longer a normal station.

     

    There's a list of all the stationscripts used in determining what's a station, so that should be easy to do, as long as Laser has a script that defines the combined station as an actual station.

  3. I love your mod.  It doesnt seem to work with Complex3s mod though.  Is there a way to make it work.

     

    If you use the / commands to control your ships, the mod shouldn't interfere with any other mods at all, since it doesn't modify any source files.

     

    Not sure which mod you mean that gives problems, though :)

  4. After testing it a while on our server it seems there is an increase in server load when multiple ships are hauling goods in multiple sectors. It came to mind after jumping around trying to narrow down the cause but all I could find were 3 afk players hauling goods in their sectors that could have a significant load.

    It might have more to do with how the game handles updates as one laggy sector slows down everything else and the cause might also lie somewhere else as we use many more mods tho.

     

    Would it be possible to somehow limit the amount of ships a player can use to haul goods?

    The few players I found were using 3-6 ships so that might have something to do with it.

     

    It must be some other mod interfering with mine, since there's no way my mod uses up any sort of significant CPU even with 100 haulers. (And yes, I've tried that :)

     

    So not sure what's affecting it. But each sector only has 1 ship building the actual list, and if it fails that it'll try to rebuild it in increments of 5 seconds, and the rest basically does nothing and will also increase their polling interval by 5 seconds up to 60 seconds.

     

    So the most impact you can possibly have is one goods rebuild every 5 seconds if there's nothing to haul (and with my system with 50 stations that takes a very short time), and one inter-object call for each of the haulers doing nothing every 60 seconds.

     

    If they actually *are* doing something, they do a check every 5 seconds if the previous step has finished, and kick off a new flying or docking step. That's about it. I can't see how any of that has any impact.

     

    I'll build some timings in my next version, though. Always interesting to see what might be causing this sort of stuff :)

  5. For completeness sake, this is the bit of code that Laser and I are talking about:

     

    function setProduction(production_in, size)
    
        factorySize = size or 1
        maxNumProductions = 1 + factorySize

     

    maxNumProductions is used to determine the maximum amount of productions the factory can run at the same time, so it's completely dependent on the size of the factory.

     

    Try cloning an XXL Solar Power Plant, and you'll see what we mean.

     

    ps. How this ties in with your original question/suggestion: We just need to be able to make player stations different sizes! :)

  6. Do they have weird stuff sticking out of them?

     

    In that case they're infected by Xsotan and not claimable anymore.

     

    And if you're playing on a server, someone else might have already claimed and sold them.

  7. I end up organizing them in the folder itself, and immediately renaming the templates I want to use to an actual template name that isn't the name of the ship, so it doesn't get cluttered with autosaves.

     

    That's about all you can do right now.

     

    Sorting, Renaming, Folders, all those would be great to have, though.

     

    The same for build templates, actually.

  8. This mod keeps telling me to update to 0.9.7_c I have already done that and I am still getting that message. Is there something I am missing?

     

    Read the notes about the asteroid mod, and make sure you have the same versions on client and server, and read the notes about the different installs for client and server if you're running them separately.

  9. I was asking because of some mods I liked as in;

     

    [Mod] Captined ship salvage command

    [Mod][beta] MineCorp

    [Mod] Casino "Gambling

    [MOD] Regenerative Asteroid Fields

    [Mod] Highlight other players in sector

    [Mod] Compass-like Gate Pixel Icons

     

    I one did not see if they said everyone had to have it or two did not understand the instructions.

     

    That's because most mod coders make no such distinction, and just have you install it on both the client and server.

     

    For Single Player games, that's exactly what it does as well, with the difference that the server install and the client install actually *is* the exact same install.

     

    As I said, everything that makes changes to the UI needs a client component. And most mods don't bother making two different files for client and server.

  10. As I understand, using invokeServerFunction function client can call almost any lua function of any entity on a server side. And if this function isn't supposed to be called by the client, some random junk arguments can cause error on a server side and affected script will be unattached. And this eventually will get us to the entity that doesn't work properly for all players.

    Am I right or I don't understand something? Yes, I know that function must be in the same attached script.

     

    the function is not safe related to your concerns, as every invoked function should be prepared for invocation and you could produce errors with wrong parameters or timing ... BUT i think thats not really an issue, since a normal function call can fuck up the same way! plan the functions, invoke only functions that should be invoked and which have onClient() / onServer() conditions ... with producing "bad" code you are always at risk of corrupting things in the game... and invokeServerFunction is just essential to use, since many important function/properties are not available client-side

     

    I totally agree that invokeServerFunction is essential, but it would be good to just implement some sort of 'flags' or 'labels' in Lua for the functions that can be invoked. Like public/private but in the client-server terms.

     

    Doesn't exist, will never exist, is impossible to do in LUA. Since that's simply not how LUA works.

     

    LUA is a single pass script interpreter, basically, and the invoke functions are something that is implemented in Avorion and not standard LUA.

     

    LUA has no concepts of objects, private or public functions, or anything like that. Even 'worse' from your point of view is that you can actually store functions in variables, and call them through those variables.

  11. In this case you would send the script in a endless loop with no breaks.

    That should be a massive performance impact, shouldn't it?

     

    Nevermind, I've made that changes and now I'm testing it.

     

    Done, here it goes:

     

    Hehe. I'll address the part you crossed out regardless. The check for salvageable materials happens every 'tick'. And yes, this is not ideal. The mods I run myself have variable ticks generally, depending on what's going on.

     

    But in this case, it happens every second, so it's not that huge of an impact if there's nothing to actually find to salvage.

  12. well i hope it works cause the ai in hits regard is utterly stupid....ive had one shove the station right into me....multiple times

     

    another got stuck on it and sailed off with it..hard to do research when the station is in motion...and ya know after along run to get loot and items ....im done....when i get my patience back ill retry its awful...

     

    Hehe. I know exactly what you mean. While I was developing my hauling scripts, the change was implemented with the new thrusters. And my stations were pretty much flying all over the place because of my haulers ramming into them.  :o

  13. Another good adjustment of the script is removing these lines of code:

            ShipAI(ship.index):setPassive()
            ship:invokeFunction("craftorders.lua", "setAIAction")
            terminate()

     

    Those will cause the ship to stop salvaging when there's nothing left, normally.

     

    But you have to manually set them to salvage again. Removing these lines will keep them searching for salvage, so when any new salvage appears, they'll go right for it.

  14. Yeah sorry you didn't really answer my question/s. This shits confusing. I've never done anything like this so I would need specific and detailed instructions.

     

    I followed my assumption and tried using the "Set Launch Options" and used

     bin\AvorionServer.exe --galaxy-name Tuttomenui --server-name "Tuttomenui's Server" --max-players 10 --use-steam-networking 1 

    unsure what to use foe the datapath. It doesn't do anything. And I don't know what to put for the datapath.

     

    bin\AvorionServer.exe --galaxy-name Tuttomenui --server-name "Tuttomenui's Server" --datapath %APPDATA%\Avorion --max-players 10 --use-steam-networking 1

    also does not work.

     

    You need to run the server from a dos window :) The galaxy-name is what the single player galaxy is called. If you called your single player game "Tuttomenui" then that's correct.

     

    This should be shown in %APPDATA%\Avorion\galaxies by default. If it's there, you don't need to do anything with your datapath.

     

    Make a backup of your galaxy! So the folder in that galaxies folder that contains your galaxy.

     

    To run the server, open a command prompt, and navigate to where your avorion install is, steamapps\common\avorion in the steam install directory, generally.

     

    Then run the command, and it should start up the server. If the server is started up, you can give it commands through that same command prompt.

     

    Here's how that looks for me:

     

    G:\Games\avorion>bin\AvorionServer.exe --galaxy-name dedicated_server --server-name "Splutty's Server" --datapath g:\games\avorion\servers --max-players 10 --use-steam-networking 1
    Installed exception handler: 8289776
    Previous: 8788560
    Enabled Traces:
    Avorion server Beta 0.11 r7854 running on Windows 7 starting up in "g:\games\avorion\servers\dedicated_server"
    CPU: GenuineIntel 8 Cores
    name: Splutty's Server
    seed: IhvEDkJ7q4
    port: 27000
    max online players: 10
    save interval: 300
    broadcast interval: 5
    max loaded sector time: 300
    weak update: yes
    worker threads: 8
    generator threads: 2
    difficulty: Normal
    infiniteResources: no
    collision: 0.25
    access list: Blacklist
    public: yes
    authentication: no
    listed: no
    steam networking: yes
    administrators: 'splutty'
    Initializing sector database...
    Initializing faction database...
    Starting up 8 worker threads...
    Loading jumping entities...
    Loaded 37 jumping entities.
    Loading groups...
    Galaxy initialized.
    Listed server version: 0.11.0.7854
    Setting breakpad minidump AppID = 445220
    Game Port: 27000
    Steam Port: 27021
    Steam Query Port: 27020
    Query Port: 27003
    
    Installed Steam exception handler
    Server startup complete.
    Server connected to Steam successfully
    Server is not VAC Secure!
    Game Server Steam ID: 90107949051602946

     

     

    At that point I can type commands into that window, like /status for example, which for me gives the following output:

     

    /status
    0 players online, in 0 sectors
    0 players in memory, 7 registered
    2 factions in memory, 332 registered
    0 sectors in memory, 2898 sectors in total
    Memory used by scripts: 4.85MB
    avg. server load: : 0.2%
    avg. update: : 0 ms
    max. update: : 3 ms
    min. update: : 0 ms
    Printed profiling stats to "G:\Games\avorion\profiling_stats.txt"
    Profiling is disabled, no sector profiling stats printed. Enable profiling in server.ini.

     

     

    And to check your player type the following command:

    /run print(Player(1).name)

     

    If all that works, then you can start running commands on your galaxy instance.

     

    You can save and stop the server with:

    /save
    /stop

     

    I hope this can get you started.

     

    Logging in to this server, you can start your client and go to 'Join LAN', which should list this server if it's running.

  15. If you have all the stuff in the appdata path, make a backup of that galaxy.

     

    Your server name is as far as I know mostly cosmetic, but doesn't really matter.

     

    When you start the server from the commandline like that (from the Avorion steam directory), then you can paste the command into the window it started from. You can directly give it console commands basically.

     

    You don't even have to log on or start a client for that.

  16. removeScript removed a script that isn't the current one, terminate() removes the script that is the current one.

     

    That's exactly the way you're supposed to do it.

     

    For commands for example it's best practice to finish the attached script with a terminate() so they don't stay with the player or entity when they're not used.

     

    There are a bunch of examples in this mod forum that use that.

×
×
  • Create New...