Should this be considered a bug.

    Joined
    Dec 14, 2014
    Messages
    745
    Reaction score
    158
    • Community Content - Bronze 1
    • Purchased!
    • Legacy Citizen 2
    I took a ship out for testing against a pirate station and pirates. You can find the ship here http://starmadedock.net/content/ugly-cube-ship.3549/

    The issue after firing at the station for a short bit I noticed I wasn't getting the damage I expected. However when I stopped firing I noticed damage was still coming up especially when I closed in I could see the red damage values flash up. This continued on one instance about 2 minutes on another station a full 3 minutes went by with the numbers coming up.

    During the time even though all the hits had long since happened turrets and stuff where still firing at me.

    The issue is the game engine was taking so long to calculate all the damage done to the station.

    similar happened when attacked by a squadron of pirates.

    In one aspect it is a limitation of what the game engine can process in another aspect I feel it is a bug in the fact that enemies that should have been long dead are able to continue attacking.
     

    Tunk

    Who's idea was this?
    Joined
    Sep 8, 2013
    Messages
    363
    Reaction score
    153
    • Purchased!
    • Community Content - Bronze 1
    • Legacy Citizen 4
    There is a limit to how many explosions are processed at once (10 by default), and they get put in a queue.
    It is also a memory constraint, so if you are running low on memory within java processing will also be slowed down here.
     
    Joined
    Dec 14, 2014
    Messages
    745
    Reaction score
    158
    • Community Content - Bronze 1
    • Purchased!
    • Legacy Citizen 2
    There is a limit to how many explosions are processed at once (10 by default), and they get put in a queue.
    It is also a memory constraint, so if you are running low on memory within java processing will also be slowed down here.
    Thanks for the reply. That lead me to the server.cfg option.

    That only leaves me 1 question why in hell does it take 20MB per an explosion?
    Impact position size of war head, calculate max radios, place blocks in radios in list near to far.
    run function to use up damage spreading outward block by block stop when damage equals zero or out of blocks.
    Even if I went purely by a system that calculated max damage and then went outward it wouldn't be that much. Then again I have no idea what Java requires for overhead for a thread.

    But rather than doing a thread per explosion. Why no do one thread you can feed impact and warhead size to.

    If java is really as slow and as bloated as this indicates no chance in hell I will ever consider using it for game development like this. I'll stick with C,C++ and even ASM.

    Sorry, if this comes off as me knocking the dev team. Don't mean to I really have no idea if this is related to issues with JAVA or the way they programmed it. So not going to assume one or the other.
     
    Joined
    May 26, 2013
    Messages
    1,176
    Reaction score
    939
    • Legacy Citizen 7
    • Modder
    • Top Forum Contributor
    what tunk said. its not a bug, it's a limitation of the game engine. If you have a beefy enough CPU and RAM 4 days, increase the limit :)

    The game uses 20mb per splosion because it's raytraced (and has a library of different explosion propagation paths, possibly). Every block has different properties and will block more, or less of the explosive force. A single block can protect stuff behind it. The explosions are actually fairly damn accurate compared to the spheres of old.
     
    • Like
    Reactions: GRHayes

    Tunk

    Who's idea was this?
    Joined
    Sep 8, 2013
    Messages
    363
    Reaction score
    153
    • Purchased!
    • Community Content - Bronze 1
    • Legacy Citizen 4
    yep, probably the biggest one is memory.
    If you are running a tight ship and the GC starts going nuts you are going to have a bad time.

    On explosion memory, generally voxel games take a snap of the explosion cube and work with that, if I remember right starmade has a overhead of 8 bytes per block.
    With sorting and ray casting and damage lists it can quite happily reach 20mb per explosion, especially on larger radius ones (which are more like 30mb at least).
     

    Lancake

    Head of Testing
    Joined
    Aug 20, 2013
    Messages
    794
    Reaction score
    560
    • Schine
    • Tester
    All explosions spheres are pre-calculated, that entire file is 45MB. So it's a mix of raytracing + pre-calculated data else missiles would be extremely heavy on the CPU and the server. Everything else got mentioned already.
     
    • Like
    Reactions: GRHayes
    Joined
    Dec 14, 2014
    Messages
    745
    Reaction score
    158
    • Community Content - Bronze 1
    • Purchased!
    • Legacy Citizen 2
    All explosions spheres are pre-calculated, that entire file is 45MB. So it's a mix of raytracing + pre-calculated data else missiles would be extremely heavy on the CPU and the server. Everything else got mentioned already.
    Mind me asking how large the look up table is and had you considered doing the branch or thread after using the lookup table so it doesn't get dumped into each thread.

    Having seen the explosions results I really don't see things like blowouts and so on. Blowout being where one area is weaker and the damage pushes through it more. The explosions look very round. Maybe I am missing it I'll run some tests though today. Not sure if you are running a pressure wave calculation in your simulation or not. If not then the work you are doing to ray race everything is pretty much wasted.

    If you wonder what I mean by pressure wave calculation. Assume you have an explosion at the center position and it is surrounded by the 26 other blocks. 1M atmos are generated. if all things equal all fail. However if one block is weaker it fails first. Even a fraction of a second allows pressure to escape does it prevent the start location from completely failing depends how much pressure escapes in what size space it escapes the new room including the original now hold all the pressure and the explosion pressure wave is tested against it.

    If you ever played with dynamite you know it can be extremely powerful. But you can hang it from a string in an open area and be fairly close to it and it does nothing. The actual pressure wave only extends out so far. It is the shrapnel it throws that does the majority of damage. Pressure waves can be focused to cut like in shape charges or for cutting I-beams.

    Anyway I'll look at what the explosions are doing exactly. Who knows maybe I am missing it.
     
    Joined
    Dec 14, 2014
    Messages
    745
    Reaction score
    158
    • Community Content - Bronze 1
    • Purchased!
    • Legacy Citizen 2
    Ok so I did look into the explosions and the blast effects. The following image is a pretty good tale.
    Three different chambers cut out into crystal armor. The damage being calculated is purely radial in nature.
    More or less damage is done based on what blocks are in the way. But it never extends outside the radios or takes the path of least resistance.
    If it did the shape of the area damaged would change in direction.

    It would have been vastly more accurate to do something to the order of this.
    example 7K explosion.
    Basically there are two primary steps.
    A.Look for path of least resistance if there is one break and calculate pressure change. Max 50%. To deal with losses to space directly.
    If no least resistive path go to C.

    B. recalculate room size adding in least resistive path.

    C. Break all surfaces to room till damage runs out or last surface is broken starting at closes blocks first. In short if a small bomb goes off on the right side of a hanger there is no reason blocks on the left and other places should get damaged by it. That should be the only purpose radios is used in the damage calculation.

    Go back to A.

    In short this should be a recursive function.
    It is sort of a cross between A* and a room fill formula. It uses path finding principles to find the path of least resistance but doesn't through out dead paths.

    Depending on how this implemented it could save memory or cost more memory. The calculation shouldn't be as bad as a ray trace system though.



     

    Keptick

    Building masochist
    Joined
    Sep 26, 2013
    Messages
    4,062
    Reaction score
    1,841
    • Councillor 2 Gold
    • Railman Gold
    • Thinking Positive Gold
    Mind me asking how large the look up table is and had you considered doing the branch or thread after using the lookup table so it doesn't get dumped into each thread.

    Having seen the explosions results I really don't see things like blowouts and so on. Blowout being where one area is weaker and the damage pushes through it more. The explosions look very round. Maybe I am missing it I'll run some tests though today. Not sure if you are running a pressure wave calculation in your simulation or not. If not then the work you are doing to ray race everything is pretty much wasted.

    If you wonder what I mean by pressure wave calculation. Assume you have an explosion at the center position and it is surrounded by the 26 other blocks. 1M atmos are generated. if all things equal all fail. However if one block is weaker it fails first. Even a fraction of a second allows pressure to escape does it prevent the start location from completely failing depends how much pressure escapes in what size space it escapes the new room including the original now hold all the pressure and the explosion pressure wave is tested against it.

    If you ever played with dynamite you know it can be extremely powerful. But you can hang it from a string in an open area and be fairly close to it and it does nothing. The actual pressure wave only extends out so far. It is the shrapnel it throws that does the majority of damage. Pressure waves can be focused to cut like in shape charges or for cutting I-beams.

    Anyway I'll look at what the explosions are doing exactly. Who knows maybe I am missing it.
    Yea, the game doesn't calculate pressure waves (anyways it's space, so there isn't much gas to push on). Honestly I think that your issue is mostly due to the gigantic amount of projectiles it fires at once.
     
    Joined
    Dec 14, 2014
    Messages
    745
    Reaction score
    158
    • Community Content - Bronze 1
    • Purchased!
    • Legacy Citizen 2
    Yea, the game doesn't calculate pressure waves (anyways it's space, so there isn't much gas to push on). Honestly I think that your issue is mostly due to the gigantic amount of projectiles it fires at once.
    Yea, no doubt that ship has that issue.
    It wouldn't have the issue if I could shut off power transfer by choice to a docked entity or if I could tell a weapon system to only fire 1 group at a time.

    However, I got to thinking this could also allow for far better damage effects and allow for a lot larger battles because damage would be easier to calculate than the current method.

    It also doesn't appear they are taking advantage of the compute units on the GPUs. that is what they are for computations like this they excel at it.

    Honestly kind of surprise they didn't come use this type of method to start with.
    I'm also not sure how they implemented their ray trace system to simulate damage. Did they create separate rays to run out from the center to test blocks. Or did they create a recursive algorithm that looks at the block list they pulled in via radios and start testing damage ... 100 different ways they could do it all end with basic same result radial blast pattern.