Jump to content
  • Advertisement


GDNet+ Standard
  • Content count

  • Joined

  • Last visited

  • Days Won


Lactose last won the day on April 9

Lactose had the most liked content!

Community Reputation

11547 Excellent

1 Follower

About Lactose

  • Rank

Personal Information

  • Industry Role
  • Interests

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Then you should put you MMO idea on hold for probably at least 5 years. Start with something really small and simple. Create a Pong clone. Create a Mario clone, etc. This will also give you experience with various engines and languages/frameworks.
  2. Lactose

    C# Unity coding error

    This forum generally doesn't help out with homework or school assignments. Talk to your teacher and/or other students in your class.
  3. Err... What makes you say multi-threading sucks, and why does this game not look like one?
  4. It's important to know that you can make a bad game in any engine, using any language. Unity used to have a difficult time with multi-threading, which affected console performance especially. I'm not sure if that's better now or not, but it's fully possible to make awesome games with Unity. For example, see Ori and the Blind Forest.
  5. Then making games isn't your best bet. That aside, worry less about reducing piracy and cracking/hacking. Spend that time on improving the game instead. This doesn't really change depending on which language is used to create the game.
  6. Lactose

    C++ Connect Four in C++

    Talk to your teacher. We generally don't help with homework or similar here.
  7. GetActiveScene() returns a Scene. This Scene has various properties, e.g. name. It's the same as doing the following, just shorter to write: Scene scene = SceneManager.GetActiveScene(); scene.name
  8. Lactose

    Raycasting in 2D Pong

    If I understand you correctly, the pseudo-code I posted should have dealt with this case. I haven't really read your initial code in much detail. It's been a while since I touched Unity, and I don't immediately see what's going on.
  9. How long should I expect search indexing to take? When I go to an Activity Stream now, it just says "The search index is currently processing. Activity stream results may not be complete.", and no content is displayed. It's been like this since I hit follow on you yesterday.
  10. Well, I just hit Follow on you, so we'll see soon enough 😃
  11. I don't understand how to use these features. I have several forums followed. When I select the default story stream Content I Follow, no posts are displayed. The story stream seems to be set to list both unread and read. There are unread posts in some of the forums I follow. On the Following tab from the main page, it just says I haven't followed any members, which admittedly I haven't, but I would expect to see (unread) posts from the forums I follow here as well.
  12. Lactose

    Raycasting in 2D Pong

    A raycast is an information request -- a snapshot of the world, and doesn't persist, auto-update, change, or move around. It's literally "from the given position, looking in the given direction, what do I see/intersect?". The result you get from a raycast is something you can store, but if the world changes, your results are out of date, and you'll need to ask again to get updated information. You can think of a raycast as photographing something. You might photograph Anna reading a book, and the result is a picture. You can store the picture, and get various information from it ("Anna is reading Wheel of Time, and is on page 87 in book 5 of the series"), but when Anna turns the page, swaps to another book, turns on Netflix or goes to sleep, the picture doesn't update. The act of photographing (the raycast) isn't something that persists. The resulting picture (the raycast result) is something that can be persisted, but what it depicts doesn't change, even if reality does. This analogy, I think, also applies to most of your other questions.
  13. Lactose

    Raycasting in 2D Pong

    Using this as reference and converting into code... NOTE: Untested, probably doesn't even compile. Use at your own peril, etc.. Should only need to call this when the ball hits the player's paddle (i.e. doesn't need to be every frame/in Update). Will fail if called while the ball is moving away from the opponent. Vector2 collision; collision.x = opponent.position.x; //Or opponentWall.x or whatever. float playAreaHeight = border.max.y - border.min.y; float distanceX = collision.x - ball.position.X; float timeToTarget = distanceX / ball.velocity.x; float verticalDistanceCovered = timeToTarget * ball.velocity.y; int numBounces = Int(verticalDistanceCovered / playAreaHeight); float remainder = verticalDistanceCovered % playAreaHeight; bool movingUpwards = (numBounces % 2) == 0; float distanceAfterBounces = movingUpwards ? remainder : playAreaHeight - remainder; float ballPositionAfterBounces = ball.position.y + distanceAfterBounces; if (ballPositionAfterBounces > border.max.y) { float delta = ballPositionAfterBounces - border.max.y; collision.y = border.max.y - delta; } else if (ballPositionAfterBounces < border.min.y) { float delta = border.min.y - ballPositionAfterBounces; collision.y = border.min.y + delta; } else { collision.y = ballPositionAfterBounces; }
  14. Lactose

    Raycasting in 2D Pong

    No, I didn't mean anything about initial collision points. I'll try to type it out shortly. A ray is just from a position an in a direction. A single ray itself does not move. You can have as many raycasts as you want (performance might not be your friend if lots are created, though). A raycast doesn't persist. A raycast is basically "at the current point in time, what intersects something going from point A in direction N". It doesn't auto-update, it doesn't move around or change direction, etc.
  15. Lactose

    Raycasting in 2D Pong

    Assuming there's just constant speed with perfect reflection upon collision... If this is the specific problem you're trying to solve, I'm thinking this can be done without raycasts. You know what the x position of the ball will be (thus, you also know the distance the ball needs to travel). You also know the velocity with which the ball travels. You can figure out how long it will take the ball to reach the other side based on that information. Given travel time, you can calculate the distance travelled in the y direction. Using that and the known height of the playing area, I'm thinking you can just straight up calculate the number of bounces and use the remainder to figure out the exact y position.
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!