Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4048922
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T13:52:46+00:00 2026-05-20T13:52:46+00:00

I am writing a basic game and I have what I believe to be

  • 0

I am writing a basic game and I have what I believe to be a common scenario. I am drawing two lines on the screen and I have done some basic mathematics to conclude that a point on the screen is not on a line that is being drawn on the screen, however the point and the line are really, really close together. So close that to me it appears as though a collision is actually occurring. Therefore I want to treat everything that looks like a collision (even if it is not a ‘true’ collision) as one anyway.

Is there any standard precision that people use to make this happen, or some precision ration per screen resolution or something similar? If you could point me in the direction of anything standard that would really help too.

Also, there is the fact that I am using floating point values and that they will loose precision over multiple calculations anyway so knowing what level of precision I can get away with is pretty important.

Edit:

Here are some links on precision in games that I have found:

  • A Matter of Precision
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T13:52:46+00:00Added an answer on May 20, 2026 at 1:52 pm

    Of course you can always treat the point as a tiny circle with a radius slightly larger than its pixel size for collision-detection purpose. You might also consider “stroking” the line and/or the point with a brush size larger than 1 pixel to get a display resolution independent look. Collision detection still reduces to line vs. circle checks because you can add the brush radii.

    Regarding the users expectation: I found it quite annoying to be treated as collided even though there was a minor gap between my game object and the obstacle. It occurs in many racing games and it’s really all about driving close to the limit there. Thus “eager” collision detection for player objects is a bad thing. Nobody will complain if luckily being treated as not-collided even if it looked a bit like that.

    On the other hand for non-player objects I would consider it a good idea to eagerly check collisions. The rationale is the same: Nobody will complain if the enemies are treated less favorable.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing a basic game engine and have an abstract class that represents
I'm writing a basic planet viewer OpenGL Perl application, just for fun. I have
I'm interested in writing some basic computerized object recognition application, so I figure I
I'm currently writing a very basic Java game based on the idea of Theme
I'm writing a basic tic tac toe game in Java. In my Board class
I am writing a basic jQuery form validation script and I have something like
I am writing a game for gameboy advance and I am implementing basic AI
I'm writing a game that involves cargo, and I plan to have a large
I am writing a train based game in Facebook Javascript. I have an inverted
I'm writing a basic java card game but I'm getting a java.lang.IndexOutOfBoundsException: Index: 6,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.