Jump to content

Rinart73

Members
  • Posts

    416
  • Joined

  • Last visited

  • Days Won

    4

Posts posted by Rinart73

  1. Can confirm - this happens because Trading Posts for some reason now buy and sell the same goods.

    From what I can see only "Resource Shortage" mission is exploitable, but not the "Delivery" one.

     

    trading-posts-bought-goods.jpg

    trading-posts-sold-goods.jpg

  2. 1 hour ago, Avoria said:

    and would give rise to ridiculous and fantasy-like tactics such as instantly spamming armor blocks to raise HP in combat or suddenly swapping out ineffective guns for better ones to easily crush any enemy (or player) while actively being shot at

    Nonono! We don't want to allow this during the combat! Only after the combat. Although I agree than even then - swapping hull blocks with armor is.. tricky.

  3. 1. You mean placing ship blocks. but on low hp? This is an interesting idea. It should still cost some resources but less than a full repair. And the rest could be finished either with mechanics or AI ships/fighters/friends with repair turrets

    3. I kinda disagree with this one. I think the system should allow to change/add turrets and to replace blocks (like an emergency swap from armor to cargo hold), but not to add new blocks.
    I feel like, if a ship was in battle, the priority would be to fix weapons and "reroute ship systems" (by replacing blocks with different ones). Adding new blocks would require a functional energy grid and overall stable ship structure.

  4. Avorion is really missing 2D functions like "UIRenderer():renderCircle()" and "drawCircle()".

    Example from an actual mod: I need to draw bosses encounter areas on the galaxy map. They're circular. But Avorion API doesn't have a way to draw circles. So I draw a pseudo-circle using lots and lots of lines. It works, as you see, but the FPS drops from 60 to 40, because of that.

    spacer.png

    1. From what I know, if you'll destroy stations in nearby sectors, they will stop spreading influence and sectors near them will become unowned
    2. You can already win sectors without stations by building your stations in them or building stations in the sectors nearby.
      And you can build more stations than NPC in their sector and this should make you the new owner of that sector too.
  5. I'm requesting a function that would allow to get all sectors controlled by a faction through influence (client-side and maybe server-side):

    local sectors = {Galaxy():getFactionControlledSectors(int factionIndex)}

    Why?

    Right now on both client & server we can get all sectors that are owned (have stations in them) by a faction (at least the ones that player/alliance know about):

    local sectors = {Player():getKnownSectorsOfFaction(int factionIndex)}

    But all owned sectors have influence that spreads in a circle shape around them. And currently there is no performance-friendly way to get list of sectors controlled by a faction through influence.

    Currently to get that list I have to do the following:

    1. Get all owned sectors of a faction
    2. Get the "influence" stat from their SectorView
    3. Transform this influence value into a radius (which is bigger than it actually is for some reason)
      local approximateRadius = math.sqrt(influenceValue / math.pi)

       

    4. Get all sectors that completely fit in that radius
    5. For each of them call this function:
      Galaxy():getControllingFaction(n, m)

     

    It takes 1-1.2 seconds to get this info for 1/7 of a galaxy. Not very fast, but right now there is just no other way to do this.

  6. It would be great to have a way of knowing text width & height (height is more important actually) before rendering it or creating an element for it.

    -- function getTextDimensions(text, fontSize, maxWidth, fontType, isBold, isItalic, isOutlined, isShadowed)
    -- Arguments:
    -- string text
    -- int fontSize
    -- int maxWidth (maximum text width, after exceeding it text should use new lines)
    -- FontType fontType (optional, default: FontType.Normal)
    -- bool isBold (optional, default: false)
    -- bool isItalic (optional, default: false)
    -- bool isOutlined (optional, default: false)
    -- bool isShadowed (optional, default: false)
    
    local w, h = getTextDimensions("The \\c(0d0)hideout\\c() is located in \\s(45:15)", 15, 400)

    Or maybe it would be easier to implement "textWidth" and "textHeight" read-only properties for TextField and Label elements that would tell the actual width and height of their assigned text, so we could instantly resize it after creating.

    Why?

    Here is an example. Let's say we have multiple rows with various text in a ScrollFrame. If we're using static pre-determined row heights, we will get empty spaces after text or text that goes out of the designated rectangle. Even with auto-resize (shrinking), huge amount of text would look ugly, being too small and unreadable (also auto-shrinking doesn't work with multi-line labels). Having a way to know the actual height of the text would allow to create rows that would fit the text no matter what.

    spacer.png

    Why not just create this function in Lua?

    1. Because we would have to manually extract relative width for every character in Unicode font (TTF fonts support up to 65535 characters ) for every font (not just vanilla, but the modded ones too!)
    2. And because we would have to re-implement the Unicode Line Breaking Algorithm in Lua (which would have low performance)
×
×
  • Create New...