Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - Splutty

Pages: [1]
Bugs / getMaxStock returning too high values.
« on: March 24, 2017, 11:58:28 AM »
So I first started noticing this bug when I sold something to a station that wasn't full, but the stock never updated.

Running my automated hauler script, I ran into this same issue again, only this time my hauler would just keep hauling stuff to the affected factory.

After some digging, I narrowed it down and started putting in some debug messages.

So this is what I eventually ended up with:
Fri Mar 24 11:26:21 2017| Calc MaxStock: space/3646.1279296875 goodSize/0.5 round/73
Fri Mar 24 11:26:21 2017| Calc MaxStock: space/3646.1279296875 goodSize/0.5 round/73
Fri Mar 24 11:26:21 2017| IncreaseGoods(sold): Solar Power Plant I/Energy Cell/delta 4/current 7292/maxstock 7300
Fri Mar 24 11:26:21 2017| IncreaseGoods(sold) current after added cargo: 7292

Turns out that the max is rounded, and in this case, rounded UP. So there is actually only room for 7292 energy cells, but the MaxStock returns 7300. So it'll keep trying and trying to add 4 at a time, which goes fine everywhere, except at the actual adding part, because that's the point where the storage is full.

For my factory, this means that there are *always* 12 ingredients missing. So my hauler keeps hauling and hauling and hauling.

The code that's causing this is in tradingmanager.lua
Code: [Select]
    if space / goodSize > 100 then
        -- round to 100
        return math.min(25000, round(space / goodSize / 100) * 100)
        -- not very much space already, don't round
        return math.floor(space / goodSize)

This causes edge cases to be rounded up, this triggering the never filled stock problem.

I can only imagine this is done so it looks better, since there is no actual reason to do this.

How I've 'fixed' this, and still not have it end on a weird number, is to not do it in 100's but in 10's and round DOWN. This also gives a bit more leeway to relatively low cargospace vs relatively high volume goods.

So then it looks like this:
Code: [Select]
    if space / goodSize > 100 then
        -- round down to 10's
        return math.min(25000, math.floor(space / goodSize / 10) * 10)
        -- not very much space already, don't round
        return math.floor(space / goodSize)

This needs to be done both on client and server side, otherwise the client side interface will still show the 7292/7300 constantly (until these goods are used up, and it'll just be 7200/7300, which looks even worse :)

Gameplay Discussion / Factory Problem
« on: March 22, 2017, 10:54:26 PM »
I'm building production chains with factories, and I've run into a rather annoying problem.

I'm not sure whether this is by design, or just something that's overlooked (I'm going to fix it to my liking in the factory file anyway), but just putting this here.

A factory will stop producing *any* goods as soon as only *one* of the resulting products has filled their particular storage.

This is especially noticeable in such factories as the Gas Collector, where you can collect 5 types of gas. Only you can't, because if one of them is maxed out, none of the others will refill.

So if for example you only need Neon, you're out of luck, since once you get all the Neon from the factory it will never refill unless you empty out the other 3 gas types as well.

Bugs / Extremely nasty fighter bug
« on: March 22, 2017, 08:01:51 AM »
Your own fighters destroying everything you own.

This is how it works: In your carrier, release all your fighters to 'Defend', go to build mode, destroy your carrier (safe mode off, ctrl-a, delete).

Now the fighters will defend your destroyed ship, and try their best to kill you, or to be more precise, whatever ship you spawned back to when you destroyed your carrier.

And when that one dies (in my case, a factory...) and you spawn into another ship, that one will get attacked.

And so on and so on. The fighters are unkillable, so they'll just keep going and going.

Thankfully the second ship I spawned in was one of my defenders, with over 500K shields, so I had some time trying to find a solution.

Found it in time to not get another ship blown up:
/run local target; target = Entity().selectedObject; if (target.isFighter) then target:destroy(1) end

This let me target the fighters and destroy them one by one... The if in there so I don't accidentilly destroy even more of my ships and factories if I misclick and don't pay attention.

Bugs / Ranches are wonky.
« on: March 22, 2017, 02:20:04 AM »
Not sure if this is a bug, or where I should put it, but as it is now, all the cattle ranches and sheep ranches make no sense at all.

You put in water, oxygen and food, and you get 20 animals and 1 biogas back. That seems pretty... Weird :)

Troubleshooting / Captained Ships fairly useless now.
« on: March 21, 2017, 08:51:32 PM »
So I have a bunch of captained ships, but since the patch, they all get stuck on each other, ram into stations, can't break (despite having inertial dampeners), and basically just act like drunken skaters.

When I fly the ship myself, I have none of these issues.

I think there's something borked with the AI flying routines. Since my 'flyToDock' now just rams the station at full speed, even though under manual control, the ship stops just fine.

I'm not sure if the flight routines just haven't been updated, or whether I'm doing something wrong in the design of my ships.

Here's a picture of how they get stuck:
Spoiler: show

I've attached the xml for this ship, if anyone wants to have a look.

Bugs / Too many messages
« on: March 21, 2017, 12:37:51 AM »
I'm unable to chat at all, since no matter what I do, I get the 'Too many messages' error.

I've tried to find a place to turn this off (I personally HATE this feature in all games that have it), but have been unsuccessful.

Any help?

General Discussion / Whoops..
« on: March 20, 2017, 08:30:46 AM »
In playing around, I kind of messed up building a station template with the 'stationextensions' script :)

I accidentilly added 2 arms of farm blocks at 100x100 size... Which came to 120K+ blocks..

I'm trying to delete one now, and the client has been non responding for a while. Haha.

I thought the bounding box was 100x100 in block sizes, but it's in those prebuilt boxes...

Tip of the day: Don't try this at home, kids.  :o

18874 mechanics required...  ::)

2.8 million cargo hold, though!

Mods / [MOD] Goods Hauler (Automatically buy/sell/move goods!)
« on: March 17, 2017, 01:52:50 AM »
So I have a new ship design now that doesn't crash into stations, I still think the calculations are off, but at least my mod still works.

A version for the latest version by Evil33:,2896.msg22268.html#msg22268

Short description: After you've done all the adjusting in this post, you'll have a 'Haul Goods' order on your ship, which will automatically try to figure out what needs to be transported and what can make a profit in the sector you're in. Obviously you need a ship with a captain and some cargo space.

If you want to easy install with commands instead of changing the orders list for ships, then the first part is enough. This gives you a /haulgoods command instead of an entry in the Orders menu. I actually prefer this option myself :)

You can give multiple ships the 'Haul Goods' order, and they will all work together so they don't start doing the same thing. You can see all that at work if you open your console window, quote-key by default.

It only works in your current sector. I mainly use it to run all the supply lines of my factories (0 profit is considered a valid traderoute for my AI :), but I've tested a bit on trade runs in NPC sectors as well, which seems to work.

It produces a fair amount of debug logging, which you can disable at the following place (if you run into problems, turn this back on):
Code: [Select]
function debug_msg(message)
-- if (true) then return end

Easy installation with commands:
The file contains 3 files:

If you unzip the zip file into the data\scripts directory of your Avorion install directory (generally with an 'extract to..' option), these will be put where they belong. These are all server side, but can be installed on your client side as well for single player.

Usage: Target a ship you want to use as a hauler (needs a captain), open your chat input (enter by default) and type /haulgoods start

The commands are:
/haulgoods start
/haulgoods stop
/haulgoods status

Always make sure you have the right ship targeted (you can do this from your fleet list)

By default debugging is on, and you can follow what's going on in the console window (quote key by default), which should show you exactly what your ship is doing (or more than one if you give more than one orders)

If you want a button in the Orders list of your ship, then follow these instructions:

Installation of a menu entry for 'Orders' on a ship:
Spoiler: show

As always, make a backup before making changes!

Changes to be made to data\scripts\entity\craftorders.lua.

In InitUI(), around line 119 and below make the following changes:

At the end of these lines there might already be some entries extra (from for example the salvage mod) but this is how it should look by default without changes:
Code: [Select]
local splitter = UIHorizontalMultiSplitter(Rect(window.size), 10, 10, 6)

    window:createButton(splitter:partition(0), "Idle"%_t, "onIdleButtonPressed")
    window:createButton(splitter:partition(1), "Passive"%_t, "onPassiveButtonPressed")
    window:createButton(splitter:partition(2), "Guard This Position"%_t, "onGuardButtonPressed")
    window:createButton(splitter:partition(3), "Patrol Sector"%_t, "onPatrolButtonPressed")
    window:createButton(splitter:partition(4), "Escort Me"%_t, "onEscortMeButtonPressed")
    window:createButton(splitter:partition(5), "Attack Enemies"%_t, "onAttackEnemiesButtonPressed")
    window:createButton(splitter:partition(6), "Mine"%_t, "onMineButtonPressed")

Add the following line to the list and change the 6 in the first line to a 7 as well.
Code: [Select]
window:createButton(splitter:partition(7), "Haul Goods"%_t, "onHaulGoodsButtonPressed")
The 7 can be a different number if there are already more entries than the first 6. If that is the case, you need to change the last number 6 in the first line to something other than 7 as well.

For example, the list looks like this in my file:
Code: [Select]
    local splitter = UIHorizontalMultiSplitter(Rect(window.size), 10, 10, 9)

    window:createButton(splitter:partition(0), "Idle"%_t, "onIdleButtonPressed")
    window:createButton(splitter:partition(1), "Passive"%_t, "onPassiveButtonPressed")
    window:createButton(splitter:partition(2), "Guard This Position"%_t, "onGuardButtonPressed")
    window:createButton(splitter:partition(3), "Patrol Sector"%_t, "onPatrolButtonPressed")
    window:createButton(splitter:partition(4), "Escort Me"%_t, "onEscortMeButtonPressed")
    window:createButton(splitter:partition(5), "Attack Enemies"%_t, "onAttackEnemiesButtonPressed")
    window:createButton(splitter:partition(6), "Mine"%_t, "onMineButtonPressed")
window:createButton(splitter:partition(7), "Salvage"%_t, "onSalvageButtonPressed")
window:createButton(splitter:partition(8), "Clean Sector"%_t, "onSalvageAllButtonPressed")
window:createButton(splitter:partition(9), "Haul Goods"%_t, "onHaulGoodsButtonPressed")

Then at this spot:
Code: [Select]

function checkCaptain()

copy the following code between the 'end' and 'function'

Code: [Select]
function onHaulGoodsButtonPressed()
    if onClient() then

    if checkCaptain() then

There doesn't seem to be a nice way yet to add commands to a ship from other scripts. If anyone knows how to do this nicely, please let me know.

Bugs / Block Stats hard length limit. (client crash)
« on: March 16, 2017, 01:53:03 AM »
When typing/pasting something too long in one of the number boxes of the Block Stats window, the game crashes.

Easiest way to reproduce it:
Open the Block Stats box, type in any box 1.6(and hold the 6 for a few seconds), click on the box to 'enter' this number and the game crashes.

Following exception in the log:
Thu Mar 16 01:47:19 2017| <Splutty> I'm probably going to crash :)
Thu Mar 16 01:47:29 2017| An exception occurred: basic_string::substr: __pos (which is 41) > this->size() (which is 7)

This suggest the max size in that box is 7, and anything longer than that will crash the game.

First time I noticed was because I accidentilly pasted a URL in there.

Gameplay Discussion / All pictures in spoiler tags?
« on: March 14, 2017, 07:23:35 PM »
I'm missing something here, I'm sure, but why do almost all people post images in spoiler tags? To avoid large posts?

General Discussion / Fonts, font sizes, chat, tooolboxes, etc.
« on: March 14, 2017, 06:59:06 PM »
I've tried finding a place to change these, but not having a lot of luck so far. What am I missing?

The chat font is really hard to read for my old eyes on my high resolution monitor :(

Suggestions / Change "Delete" behaviour in regards to templates
« on: March 12, 2017, 02:11:21 AM »
It's great that you can delete your templates! However, I've accidentilly deleted tons of them to the point I'm now pasting 4 or 5 of what I want to keep, just to make sure I have at least one copy..

How? Because when I have the window open with building blocks/weapons/templates, and I select something on my ship to delete, it will instead delete whatever template I have selected first and not delete the ship block I selected.

I've lost so many templates this way... So is there any way this can be changed?

General Discussion / Graphics resolutions/Windowed vs borderless
« on: March 12, 2017, 02:03:16 AM »
So I'm not sure where to post this.

I have multiple monitors, and I would really like the game to be borderless on a specific monitor. I know other games have these settings so it's not impossible to do, but currently I'm stuck with windowed (which I need to make smaller than the monitor due to it not being able to resize), or borderless on what Windows considers my main monitor.

It would be nice if 'windowed' is actually windowed and not with a set resolution, so you can resize it, maximize it, etc.

Anyone knows if I'm missing something somewhere? If this is at all possible in the current game, or if this needs to be added?

Bugs / Server hangs on a mutex exception
« on: March 11, 2017, 05:04:12 AM »
I'm posting this here (I've already sent in 2 bug reports with attached log files) just to see if others have the same problem.

Basically at one point the server will hang when I try to jump into a new sector. The last bit of the logfile (if I let things get that far before killing the server) will contain and end with an exception, like this:

Sat Mar 11 04:29:30 2017| 12 failed to aquire <path>\SpaceServer\Server\Galaxy.cpp: 703, sectorsMutex after 30000000 tries
Sat Mar 11 04:29:30 2017|
Sat Mar 11 04:29:30 2017| Exception in WorkPool worker thread: 12 failed to aquire <path>\SpaceServer\Server\Galaxy.cpp: 703, sectorsMutex after 31000000 tries
Sat Mar 11 04:29:30 2017|

I've now resorted to killing the server immediately when this happens, since it will accept connections still and my other players will get stuck in the Connecting phase, with the server running at 100% CPU on one thread on my machine.

I hope something can get done with my logs. It's not exactly critical, just annoying. Although it has caused issues with other players.

(I do have a logfile of this occurring with debug enabled, but it doesn't really add anything that seems abnormal in the minute or so before the hangup, it's also 9GB, so kind of hard to put on pastebin :)

Pages: [1]