-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Point arrow at other ships irrespective of wraparound border #18
Comments
Hell, just compute both and always use the smaller. |
That would probably be how it works anyways. Of course, the arrow would be blinking red, and there would be no one to see there. Wraparound right now is pretty cheap in that as soon as the ship passes the border, it's transported. Meaning you can't see or shoot them. This is why I was hoping people would just stay away form the borders, it becomes a far trickier problem if you expect the system to work the same regardless of position. |
How about if you duplicate an average screen's width of map outside each wraparound point? |
So.. that would duplicate all ships and projectiles in that range to be at both positions? The mind boggles. 👀 |
There is more than one border. |
4 to be precise. I did something similar to this in an earlier iteration (Click and move ship). When going off the edge of the screen, a "shadow" copy was made on the exiting side, and kept there until the ship had made it through to the other side. This of course required that the ship be cut in half, and there be two ship entities. The only reason I'm against it in general is because it feels dirty to have shadow elements that must be managed in a very different fashion, but I guess this is really just a necessary evil when dealing with wrapping |
This is the intersection of gaming and Cartesian geometry. An equation is |
Your other option is to have a moving origin relative to each player, a 20,000x20,000 window that moves with the player and on which all necessary object locations are computed mathematically, to point at. Then worry about drawing them only when the viewport intersects with them. |
That has been a semi-planned iteration for the sake of game compression. Massively Multiplayer Online Games use a similar approach: Anything that's too far away to see or hear in your vast world will simply not be sent to you. Currently the system (or client systems) could be brought to their knees just by dealing with the number of entities being created so far off screen they wouldn't ever see them. Though I fail to see how this properly deals with the wraparound. If we're keeping people from getting too far away, we have to keep their relative position correct according to others, while making their absolute position stable |
If I'm at (10,000,1) and someone else is at (10,000,19,001) the arrow should point at the ship's position that is 1,000 pixels away across the wraparound border, not at the ship's position that is 19,000 pixels away.
Thanks! :)
The text was updated successfully, but these errors were encountered: