Help me Make Sense of Unity 2D Resolution Management

I am trying to set up an environment for a retro style pixel art game in Unity 2D. I aim for a vertical resolution of 240 pixels, and then, I would like the horizontal resolution to be dependent on the target screen’s aspect ratio, so, on a 4:3 screen 320×240, on 16:9 around ˜432×240, and so on.

I have read a bunch of tutorials, added pixel perfect to my main camera, set up a target resolution in player preferences, set the pixel in a unit to 8 pixels everywhere, but still cannot make heads or tails of how it actually works.

Here is an image of my scene with my camera selected:

enter image description here

If I am correct, the dashed line of the camera is my target resolution, although it is weird as the green image I used as a background has a native resolution of 216 pixel vertical, yet it fills up the supposedly 240 pixel high camera. I have no idea what the solid green line is, and don’t even get me started of the canvas, whose render target is set for camera yet it is obviously many times bigger than that.

Can someone please explain it to me how to properly set up a 2D environment described in my opening, point out my mistakes, point me to a good tutorial, or just give me advice on how to understand Unity’s resolution management?

Padding Inside a Floating div | Need Help

I am in the middle of creating a basic, plain jane, old school div layout. But for the life of me, I can't figure out how to get padding in the content area and side menu without the template distorting with extra padding. I've been searching online for hours — and I'm finding 'apparent' solutions, but when I try to implement them, they don't work. I now have a migraine. If anyone has a solution, I'd be rapt to know what it is.

Note: The template isn't complete, per se. I'm just trying…

Padding Inside a Floating div | Need Help

Need help improving my Flow Field and Unit Avoidance code so that the units can properly surround a unit instead of getting stuck

My setup is like this. Every update my movement system moves all of the units on the field. They use some Boid logic to avoid eachother, and a flow field that directs them towards each other. This is the result. https://imgur.com/a/CaUpfT7

My general setup is to calculate 2 flow fields, one for each player. From every field on the map (32×32 fields) I calculate the vector that points towards the closest enemy. Now this is a fine approach but I’d like to somehow take into consideration obstacles somehow (without another round of for loops)? Or should I handle that in my movement system avoidance? I was maybe thinking of doing A* once a unit is close enough to the enemy but all of these systems together seem rather hacky and overkill.

There are no obstacles currently, maybe a spell will generate it in the future. For now there are only units on the battleground without terrain or obstacles (besides units fighting eachother)

Here is some code. Firstly how I create the flowfields (kinda costly, will look into a way to optimize it further, don’t really need every single tile, can probably merge 2 or 3 together)

func (g *Grid) Update() {     g.entityPositions[0] = g.entityPositions[0][:0]     g.entityPositions[1] = g.entityPositions[1][:0]     entities := g.world.GetEntityManager().GetEntities()     posComps := g.world.GetObjectPool().Components["PositionComponent"]      for _, ent := range entities {         g.entityPositions[ent.PlayerTag] = append(g.entityPositions[ent.PlayerTag], posComps[ent.Index].(components.PositionComponent).Position)     }      for x := 0; x <= g.MaxWidth/FlowTileSize; x++ {         for y := 0; y <= g.MaxHeight/FlowTileSize; y++ {              curPosVector := engine.Vector{X: float32(x * 32), Y: float32(y * 32)}             // find closest tile to this one for both players             minDist := float32(100000.0)             minIndx := -1             for indx, pos := range g.entityPositions[0] {                 d := engine.GetDistanceIncludingDiagonal(pos, curPosVector)                 if d < minDist {                     minIndx = indx                     minDist = d                 }             }              //  fmt.Printf("CurPos : %v, enemyPos : %v,  direction %v \n", curPosVector, g.entityPositions[0][minIndx], g.entityPositions[0][minIndx].Subtract(curPosVector).Normalize())             g.flowTiles[1][x][y].Direction = g.entityPositions[0][minIndx].Subtract(curPosVector).Normalize()              minDist1 := float32(100000.0)             minIndx1 := -1             for indx, pos := range g.entityPositions[1] {                 d := engine.GetDistanceIncludingDiagonal(pos, curPosVector)                 if d < minDist1 {                     minIndx1 = indx                     minDist1 = d                 }             }              g.flowTiles[0][x][y].Direction = g.entityPositions[1][minIndx1].Subtract(curPosVector).Normalize()         }     } }  

And my movement code. A lot of code but just basic allignnment cohesion/ separation. With added 2 look ahead vectors to steer away from the collision.

        desiredDirection := world.Grid.GetDesiredDirectionAt(positionComp.Position, tag)         direction := movementComp.Direction         maxSpeed = movementComp.MovementSpeed          //Avoidance         nearbyEntities := helper.GetNearbyEntities(100, world, index)          avoidance := engine.Zero()         avoidance = avoidance.Add(alignment(world, nearbyEntities, direction).MultiplyScalar(alignmentCoef))         avoidance = avoidance.Add(cohesion(world, nearbyEntities, direction, positionComp.Position).MultiplyScalar(cohesionCoef))         avoidance = avoidance.Add(separation(world, nearbyEntities, direction, positionComp.Position).MultiplyScalar(separationCoef))           //Checking ahead of us whether or not we'll encounter something         lookAheadVectorLong := direction.Add(desiredDirection).MultiplyScalar(maxSpeed * 2.5)         lookAheadVectorShort := direction.Add(desiredDirection).MultiplyScalar(maxSpeed)         maxAvoidanceForce := float32(1.0)          checkPosShort := positionComp.Position.Add(lookAheadVectorShort)         checkPosLong := positionComp.Position.Add(lookAheadVectorLong)          collidedIndexShort := world.Grid.IsPositionFree(index, checkPosShort, positionComp.BoundingBox)         collidedIndexLong := world.Grid.IsPositionFree(index, checkPosLong, positionComp.BoundingBox)          if collidedIndexShort != -1 {             direction = engine.Zero()             avoidance = checkPosShort.Subtract(world.ObjectPool.Components["PositionComponent"][collidedIndexShort].(components.PositionComponent).Position).Normalize()             avoidance = avoidance.MultiplyScalar(maxAvoidanceForce * 1.5)         } else if collidedIndexLong != -1 {             direction = direction.MultiplyScalar(breakingForce)             avoidance = checkPosShort.Subtract(world.ObjectPool.Components["PositionComponent"][collidedIndexLong].(components.PositionComponent).Position).Normalize()             avoidance = avoidance.MultiplyScalar(maxAvoidanceForce * 1.2)         }          direction = desiredDirection         direction = direction.Add(avoidance).Normalize()          positionComp.Position = positionComp.Position.Add(direction.MultiplyScalar(maxSpeed))          positionComp.Position.X = engine.Constraint(positionComp.Position.X, 0, 799)         positionComp.Position.Y = engine.Constraint(positionComp.Position.Y, 0, 511)          movementComp.Direction = direction.Normalize()          world.ObjectPool.Components["PositionComponent"][index] = positionComp         world.ObjectPool.Components["MovementComponent"][index] = movementComp          fmt.Printf("I %d am at %v\n", index, positionComp.Position)     }  }  func limit(p engine.Vector, lim float32) engine.Vector {     if p.X > lim {         p.X = lim     } else if p.X < -lim {         p.X = -lim     }     if p.Y > lim {         p.Y = lim     } else if p.Y < -lim {         p.Y = -lim     }     return p } func alignment(world *game.World, siblings []int, velocity engine.Vector) engine.Vector {     avg := engine.Vector{X: 0, Y: 0}     total := float32(0.0)      for _, siblingIndex := range siblings {         avg = avg.Add(world.ObjectPool.Components["MovementComponent"][siblingIndex].(components.MovementComponent).Direction)         total++     }     if total > 0 {         avg = avg.DivideScalar(total)         avg = avg.Normalize().MultiplyScalar(maxSpeed)         avg = avg.Subtract(velocity)         avg = limit(avg, maxForce)         return avg     }     return engine.Vector{X: 0.0, Y: 0.0}  }  func cohesion(world *game.World, siblings []int, velocity engine.Vector, position engine.Vector) engine.Vector {     avg := engine.Vector{X: 0, Y: 0}     total := float32(0)      for _, siblingindex := range siblings {          avg = avg.Add(world.ObjectPool.Components["PositionComponent"][siblingIndex].(components.PositionComponent).Position)         total++      }     if total > 0 {         avg = avg.MultiplyScalar(1.0 / total * cohesionCoef)         avg = avg.Subtract(position)         avg = avg.Normalize().MultiplyScalar(maxSpeed)         avg = avg.Subtract(velocity)         avg = limit(avg, maxForce)         return avg     }     return engine.Vector{X: 0.0, Y: 0.0} }  func separation(world *game.World, siblings []int, velocity engine.Vector, position engine.Vector) engine.Vector {     avg := engine.Vector{X: 0, Y: 0}     total := float32(0)      for _, siblingIndex := range siblings {         siblingPos := world.ObjectPool.Components["PositionComponent"][siblingIndex].(components.PositionComponent).Position         d := position.Distance(siblingPos)         if d < desiredSeperation {             diff := position.Subtract(siblingPos)             diff = diff.Normalize()             diff = diff.DivideScalar(d)             avg = avg.Add(diff)             total++         }     }     if total > 0 {         avg.DivideScalar(total)     }      if total > 0 {         avg = avg.MultiplyScalar(1.0 / total * separationCoef)         avg = avg.Normalize().MultiplyScalar(maxSpeed)         avg = avg.Subtract(velocity)         avg = limit(avg, maxForce)     }     return avg } 

What I am trying to achieve is:

Units not mashing into each other and just positioning themselves in a free spot around their target.

What are my problems :

  1. Make the flow field direct them away from collision rather than just towards closest unit.
  2. Make it work with the current system without adding too many nested loops and awful checks.
  3. I am doing the avoidance correctly? I have a desired direction that I get from the flow field (that directs me towards closest enemy), then I add avoidance to it to avoid any other units in the area.

My units move really well up untill the point of collision/ going to a spot next to a target. I am not sure how to implemenent that behaviour yet.

(This is my forth iteration of the movement system. I went from pure boid, to grid based, to A*, to this. So I tried a lot of variations and this going surrounding behaviour has been bugging me every time.)

Custom engine (server) written in Golang and then dispatched to Godot for the visuals. Performance is not my concern, but this is a server, so I am more mindful of that, I could probably brute force it but I’d rather hear some better take on it.

Any suggestion/article/ video is greatly appreciated !!

Edit: Thinking about it, flow field is currently useless. I can basically just have a vector pointing to the closest enemy for each unit… Would be less costly as well. But the problem of them clumping and not knowing how to surround still stands.

PLEASE HELP! Can not open shop page in wordpress [closed]

I can not open the (woocommerce) shop page in wordpress. It says "the preview could not be loaded".

After deactivating all plugins, I can view the page after installing Woocommerce, but not after installing Elementor.

I changed my theme, contacted the host regarding any redirects or hosting problems, but didn’t find any.

I searched many articles about it but really do not know, what else I should do. Any advice or experiences?

Thanks a lot! Best regards, Christina

DND 5E – Monk build help and touch mechanics – Also some item questions

first post/question here.

Right now I have a Level 13 Way of the Open Hand Monk (he hits 14 in the next long rest). And I am considering to multi-class after hitting level 17. Sacrificing the capstone and the +5 movement.

I currently have 20 DEX/WIS as a Variant Human. So my AC is 20, I have Bracers of Defense being made so when I attune to that I will have AC 22.

I do get my final unarmed die, my last proficiency bonus and my Quivering Palm when I hit 17, so I am thinking at this point is safest to multi-class.

My decision to do this is dependent on whether if the following setup works.

I wanted to take 2 levels in Fighter and 1 level in Cleric or just 3 Levels in Fighter with Rune Knight Archetype.

Fighter Level 2

Fighting Style: Mariner – This is mostly for the +1 AC for AC 23 with the bracers

Second Wind: Meh, can be useful, but this is just an added bonus.

Action Surge: Biggest reason I want Level 2 Fighter. Having a second action on a boss fight can be big, and with Quivering Palm, ending it in the same round on something that needs to die fast can be crucial. Or having 2 Quivering Palms in 3 turns.

IF I go Level 3 Fighter

Rune Knight – Fire Rune and Stone Rune would be my runes of choice.

Fire Rune does not cost a bonus action to invoke and can be invoked on a successful attack. It’s straight up 2d6 fire damage, but if it fails on a STR save, it is also shackled for 1 min and keeps getting hit with 2d6 until it finally saves.

Stone Rune can be invoked as a reaction on a target that ends his turn within 30 feet from me. It has to save on a WIS throw or become charmed for 1 min, leaving it incapacitated until it saves.

Giant Might – Also learned at 3rd level Rune Knight, for 1 min: become large, Advantage on STR saves/checks, extra 1d6 per turn on my unarmed/weapon strike (I also run Contact Poison when I can, can be 1d4/2d4/2d6 depending on potency added to Giant Might). This can be done as many times as my proficiency score. So at Level 17 Monk, 6 times before a long rest.

The Level 1 Cleric option

Inflict Wounds or Guiding Bolt – 3d10 or 4d6 with advantage on next attack… Since I am a Monk, I am confident I can make Inflict Wounds hit, especially since I have Stunning Strike. Guiding Bolt would be nice for advantage, but I have 2 other melees with me that we get advantage on enemies often, also knocking to the prone and Stunning Strike helps with advantage.

Shield of Faith – +2 to AC for 10 mins on a bonus action… With 20 WIS/DEX, +2 AC from Bracers of Defense, +1 AC from Mariner Fighting style, and Shield of Faith, I am looking at 25 AC. This will be one of my choices for a spell slot.

Cantrips for Cleric is kinda meh for me, I really just want the two Level 1 spell slots for the above. But I would go with Toll of the Dead and whatever else I decide on.

THE QUESTIONS

How does Inflict Wounds work? When I use a spell slot to do this and I go for the hit, does the hit use my Monk/Proficiency modifiers?

Does it count as an Attack Action? (I am new to Spells, as this is my first character in DnD 5E, with 2+ years in the making).

If it does hit, and is counted as an Attack Action, can I still use my bonus action to burn a Ki point and use Flurry of Blows after using Inflict Wounds?

How can I get a stronger Monk Weapon? I paid 6k Gold to get my bracers, but haven’t had much opportunity to get a strong weapon from any where in the game, so I had to pay for the bracers to be crafted…

Additional Info

Party make up is 1 Wizard, 1 Sorcerer (I think?), 1 Cleric (recent addition), Monk (Me) and a Ranger (when he shows up).

Feat: Lucky Weapon: Reg silvered quarter staff

16th Level Feat: Thinking Sentinel or Tough, since I only have 122 HP at Level 13 atm.

I have saved the party from dying with CC, high movement and high AC on more than one occasion. I want the new cleric to focus healing on the Wizard/Sorcerer/Ranger since they have lower AC than I do and I tend to disengage to assist when they are overwhelmed with something else that I am not already fighting. I was thinking of multi-classing into Ranger, but I don’t see a lot of good things from what I have read so far.

Our leveling system is based on Time Played and not EXP from kills, so more than likely we will hit Level 20.

Only have 3 levels to spare since I am going Level 17 WOTOH Monk. Any other suggestions I will consider.