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 85091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T22:02:05+00:00 2026-05-10T22:02:05+00:00

I’ve got no experience with this, so i suspect my logic is overly complicated,

  • 0

I’ve got no experience with this, so i suspect my logic is overly complicated, or perhaps not complete enough to do what I want.

I have a basic tile based system, but want to move units over the terrain in a coninuous fashion. Right now they are ‘teleporting’ from one tile to another.

I already have a lot of the game logic set up on the tile system,for things like path-finding, cover, terrain type, etc.

My first guess it to have a floating point x/y offset from the center of the unit and the center of a tile, having 0.0 being in the center, and 1.0 being on an edge. This would be for each tile a unit overlaps. Then i can do math to figure out which tile the unit is ‘most’ on, and use that tile for the path-finding logic.

To make it nice, as the unit moves I’d have it adjust the ofset so that he gradually will position himself with the tile line, and not make a bunch of 90* turns to hit the path’d tiles. I could then do some fancy stuff to make him curve gracefully around corners.

For things like wepon distances, i could use the x/y tile distance, then subract out the x/y offsets to get a simple pathagorean distance.

What would be a sucessful way to decouple the movement from the tile, and still be able to ‘link’ the unit to the tile?

  • 1 1 Answer
  • 1 View
  • 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. 2026-05-10T22:02:05+00:00Added an answer on May 10, 2026 at 10:02 pm

    It wasn’t clear from your question, but the approach I would use is different depending on whether your game is in 2D or 3D.

    For a 2D game, you would be best off using pixels as your coordinates.That way you can use integers to store them keep things nice and simple. You can easily figure out which tile a unit is in by dividing their coordinates by the tile size.

    For a 3D game that uses tiles, just use floats as your coordinate system. It would probably be easiest to keep the units in ’tiles’ if that’s how you’re thinking of things like weapon ranges.

    Whatever system you use, do yourself a favor and put the conversions from position to tile number in one place in your code. If you litter /100 and *100 everywhere just because your current tile size is 100 it’s eventually going to come back to bite you. Just replacing the ‘100’ with a constant called TILE_SIZE is probably not the best way to go either because it’s entirely possible that somewhere down the road you will want to use a different origin for the two coordinate systems.

    Once your units can move inside a tile your path finding problem will get more complicated. Even if all your units are the same size, you might need to make sure they don’t get too close to the edge when the adjacent tile is impassable. I would suggest that you keep all your pathing in tile-space and post-process the paths to smooth out all the unnecessary 45 degree turns.

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

Sidebar

Ask A Question

Stats

  • Questions 104k
  • Answers 104k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer SwingExplorer looks promising (and free) May 11, 2026 at 8:35 pm
  • Editorial Team
    Editorial Team added an answer how about: @ranked_users = User.all :order => 'users.points' then in… May 11, 2026 at 8:35 pm
  • Editorial Team
    Editorial Team added an answer Try $(document).click(function(e) { // Check for left button if (e.button… May 11, 2026 at 8:35 pm

Related Questions

I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I am currently running into a problem where an element is coming back from
Seemingly simple, but I cannot find anything relevant on the web. What is the
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.