Git Product home page Git Product logo

Comments (9)

datn avatar datn commented on September 4, 2024

Hell, just compute both and always use the smaller.

from ninjanode.

techninja avatar techninja commented on September 4, 2024

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.

from ninjanode.

datn avatar datn commented on September 4, 2024

How about if you duplicate an average screen's width of map outside each wraparound point?

from ninjanode.

techninja avatar techninja commented on September 4, 2024

So.. that would duplicate all ships and projectiles in that range to be at both positions? The mind boggles. 👀

from ninjanode.

grayside avatar grayside commented on September 4, 2024

There is more than one border.

from ninjanode.

techninja avatar techninja commented on September 4, 2024

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

from ninjanode.

grayside avatar grayside commented on September 4, 2024

This is the intersection of gaming and Cartesian geometry. An equation is
likely researchable.

from ninjanode.

datn avatar datn commented on September 4, 2024

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.

from ninjanode.

techninja avatar techninja commented on September 4, 2024

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

from ninjanode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.