How much slower is it to draw on “half pixels”?

I’ve noticed that games like Diep.io are using floating decimal points for thin stroke lines on the grid. I have even tried this myself, by adding 0.5 to all of the positions for the grid lines to make the lines more thin.

I heard it from a friend that drawing on half pixels causes the GPU to do more work to smooth it out, like anti-aliasing. I am really trying to make my game look nice, by making the most smoothest lines as I can. How much slower is it really, and should I use it in an online competitive 2D game using Canvas?

How to find the angle of an arc to draw graphic

I would like to draw an arc from a specific point to a goal point, during the process of drawing a larger path. I would like to do it using bezier curves, which aren’t adequate for modeling circular arcs, but these equations found here seem to potentially estimate the arc pretty well (I can’t tell if these equations correctly implement the circular arc using cubic Bezier curves (yet), but it seems like a good start). Here is the equations from that link.

start coordinate = {   x: R,   y: 0 }  control point 1 = {   x: R,   y: R * 4/3 * tan( phi / 4) }  control point 2 = {   x: R * ( cos(phi) + 4/3 * tan( phi/4 ) * sin(phi) ),   y: R * ( sin(phi) - 4/3 * tan( phi/4 ) * cos(phi) ), }  end coordinate = {   x: R * cos(phi),   y: R * sin(phi) } 

So let’s say I start with a drawing of a path composed of some stuff, in this case just a few connected line segments (doesn’t matter what they are):

enter image description here

Then what we want to do next, from the current point we left off at, is draw an arc. This is what that arc might look like:

enter image description here

You can see that there is a center where we can draw a radius, and a goal point where the arc ends (so it doesn’t complete a whole circle).

enter image description here

My question is, how to determine the angle phi (in the equation above). That way I can use the equation. I am not sure what my current orientation is, if it is all relative to a global coordinate space or what. This is for traditional graphics. So need to figure that part out. Let’s say it is a global coordinate space and not relative to the direction I moved along the path. Then this would be the angle:

enter image description here

I don’t know, I’m already confused. So somehow I need to figure out some angle, which I’m not sure what to do. From there I think I could figure out the rest. Any help would be appreciated.

After the radius is found, then these equations above would take my simple circular arc, and turn it into a cubic Bezier equation so hopefully it could be drawn in an environment that only supports that and not arcs.

Draw checker board

For an assignment, I had to draw a checkers board, with blue and red checkers, in python. What I have works, but I’m wondering if there’s a more elegant and/or efficient way to accomplish this feat? Any and all suggestions are welcome!

import turtle  def draw_box(t,x,y,size,fill_color):   t.penup()    t.goto(x,y)    t.pendown()    t.fillcolor(fill_color)   t.begin_fill()      for i in range(0,4):     board.forward(size)      board.right(90)    t.end_fill()   def draw_circle(t,x,y,radius,color):   t.penup()   t.goto(x,y)   t.pendown()   t.fillcolor(color)   t.begin_fill()   t.circle(radius)   t.end_fill()  def draw_chess_board():   square_color = "black"    start_x = 0    start_y = 0    box_size = 30    for i in range(0,8):        for j in range(0,8):           draw_box(board, start_x + j * box_size, start_y + i * box_size, box_size, square_color)           square_color = 'black' if square_color == 'white' else 'white'           if square_color == 'black' and i < 3:               draw_circle(board, board.xcor() + (box_size / 2), board.ycor() - box_size, box_size / 2, "red")           if square_color == 'black' and i > 4:               draw_circle(board, board.xcor() + (box_size / 2), board.ycor() - box_size, box_size / 2, "blue")          square_color = 'black' if square_color == 'white' else 'white'   board = turtle.Turtle()  draw_chess_board()  turtle.done() 

Can a Fighter use his Extra Attack to draw a weapon as a free action?

The rules State: “You can also interact with one object or feature of the environment for free, during either your move or your action. For example, you could open a door during your move as you stride toward a foe, or you could draw your weapon as part of the same action you use to attack.”

Would the bolded parts apply to the extra attack as well as the triggering attack to allow a second weapon to be drawn?

xamarin forms list view draw cells but they are empty

The listview shows the correct number of ideas in the database, but the label won’t show idea names like the wfa does.

The label in my datatemplate is bound to the idea name variable. For some reason it doesn’t seem to write the name of these ideas in the viewcell’s label.

I know this isn’t a problem with my sql code, since it works perfectly in the wfa. This is a puzzle i’m trying to solve.

Steps I used to debug my code: 1. researched about the listview, how it works and how to use it 2. I spent 4 hours messing around trying to bind the label in multiple ways 3. the label won’t bind to my variables even out of the list view. 4. I searched for a solution on google going 2 pages in for every search term i could think of.

here’s the code the idea list depends on:

The Ideas listview

<ListView x:Name="Ideas" SeparatorColor="Accent" SeparatorVisibility="Default" ItemsSource="{Binding idea}" >         <ListView.ItemTemplate>             <DataTemplate>                 <ViewCell>                     <Frame BackgroundColor="Bisque" Padding="2" Margin="0,1,0,1">                         <Label Text="{Binding idea.idea}" VerticalTextAlignment="Center"  FontSize="Small"  HorizontalOptions="FillAndExpand"></Label>                     </Frame>                 </ViewCell>             </DataTemplate>         </ListView.ItemTemplate>     </ListView> 

The Mainpage class (simplified to only show the code used by the listview)

Class Mainpage { public static bool ShowHiddenIdeas = false;  ListView ideaso;  public static List<Idea> ideas;  public MainPage() {     GetIdeas(0); //get all ideas from the first table in the database   }  void GetIdeas(int id) { ideas = Kaiosql.GetIdeaSQL(id); //reads from the database and compiles a list of ideas in the table  /*  tried using a list of strings instead of the idea class List<string> ideasz = new List<string>();     foreach (Idea i in ideas)     {         ideasz.Add(i.idea);     }  It just does the same thing */  ideaso.ItemsSource = ideas; } } 

the Idea class

public class Idea {     public int ID;     public string idea;     public string Description;     public string Type;     public string Time;     public bool HasFolder;     public string FolderPath;     public bool IsStarted;     public bool IsComplete;     public bool IsUploaded;      public Idea(int iD, string idea, string description, string type, string time, bool hasFolder = false, string folderPath = null, bool isStarted = false, bool isComplete = false, bool isUploaded = false)     {         ID = iD;         this.idea = idea;         Description = description;         Type = type;         Time = time;         HasFolder = hasFolder;         FolderPath = folderPath;         IsStarted = isStarted;         IsComplete = isComplete;         IsUploaded = isUploaded;     } } 

The class has more information than my ideabase currently can output. I hope this isn’t the reason the data doesn’t show up.

Much Thanks! – Zak Kaioken

Does it make sense to draw business processes when designing a software solution

We are working with the design of the software. It is piece already working developed from scratch again. My managers are telling me to draw the business processes. I doubt in this due the fact that I know this piece already and I can start the design and prototype development immediately. Do you see business process as good starting point when designing software ? This is something we can present to the stakeholders. They invest money, so maybe this way they can understand what we are doing. They understand the picture of the business process.

I am interested in alternative ways of the code design. Thank you.

Can I stow and draw the same weapon in a single turn?

I play a level 4 Eldritch Knight who is going use a longsword and whip with the dual wielder feat, which I took at level 4. As it turns out I can’t cast spells with 2 weapons in my hands so I had to think of something.

Can I use the the 2 weapon interactions from the dual wielder feat on a single weapon?

You can draw or stow two one-handed weapons when you would normally be able to draw or stow only one.

I was thinking of the following order of events.

  • I start the turn with both weapons in my hands
  • I stow the whip
  • I use green flame blade with my longsword as 1d10 + GFB damage
  • I draw my whip again.

Is this possible or am I overlooking something?

How to force the user to draw on certain elements if there are images in the layout

mockup

Well, I ran into the problem of distinguishability of content in a mobile application. In fact, there are a huge number of pictures on the page (movie poster, preview of the film as a picture). A lot of information is actually important, so it is made very contrast. And everything would be fine if it were not for the presence of pictures, which can be either unsaturated or very saturated, which is why I fear that everything can confuse the user. Although the main action (view from last place) is always at the bottom right in the form of a Floating Action Button (Which is actually not the best thing to do, but I just don’t really know, what could be better and the same time consistent).