Jump to content
  • Advertisement

Litz

Member
  • Content Count

    33
  • Joined

  • Last visited

Community Reputation

122 Neutral

About Litz

  • Rank
    Member
  1. Litz

    XNA 4.0 'Keyboard Input' Help

    When you add the string of a key to your message, check if it's a digit. If it is, add whatever you want to add instead. If not, add the actual string. You just need to edit this piece of code: messageString = messageString + pressedKeys.ToString();
  2. You're confusing some things and now from your last piece of code it looks like you're just teleporting. Have a gravity velocity and a y velocity for the player. When you press the space bar, if the player can jump (use a flag for this), give the player a y velocity (higher than gravity velocity). Then, when you update the player position, add yVelocity + gravity (or - gravity depending on how you want to define it) to your player y, and reduce yVelocity (until 0 or collision with floor). That way your player will jump while yVelocity > gravity, and fall otherwise. Also, don't forget to reset the jumping flag.
  3. Litz

    Lidgren and XNA Interpolation

    That is one of the many possible ways. It all depends on what kind of game (and how "perfect" you want the movement to be). For interpolation, Drew already pointed you in the right direction so study that and try to implement it. If you run into problems, we'll be here. Good luck.
  4. Litz

    Lidgren and XNA Interpolation

    I just skimmed through the code.. You're sending god knows how many packets per second and the way you're doing this I don't really know what you're even trying to accomplish with interpolation. Think about this: if you keep moving to the right for 3 seconds, you'll be sending packets/sec * 3 when you really didn't change the way you're moving at all. And the other clients will be reading those packets and setting your "virtual" character position accordingly.
  5. Thanks for the help everyone, I got everything up and running now. I didn't save the links, sorry. I think some were from here and gamasutra. The rest were found in posts/browsing. As for the zones, I'm not limiting or instancing anything but you can do that if your game allows it. If you limit the amount of people logged in per server, it should be fine (unless everyone decides to camp at the same spot - which probably means something is wrong about that spot).
  6. Understood everything, thank you very much. What I was doing was basically have a database server (made by me) connect to a database (using MySQL), and saving whatever was important, so I ended up doing everything there. I'll keep that server for the sole purpose of querying the database and sending the results back to the Login/World server now, and keep the actual logic on those servers.
  7. I'm making a 2D ORPG for learning purposes and since I never tried to do something like this before, I have a few questions. Since I already have plenty of (offline) game experience, the game will be really simple. The purpose of this is to learn the online aspect so I want to build it in a way close to commercial MMOs' servers. I read some articles and topics about this, and my server architecture is like this: - Gateway server (forwards packets from clients to other servers, and the other way around). - Login server - Database server (this computer would have the actual database, and the idea would be to load the accounts/characters into memory while they were needed, updating the actual database every n hours). - World server I'm having some problems understanding something though. Say I want to create a class "Account" and a class "Character", to hold the information from the database (for the logged accounts/characters). Would these classes be on the Database server? Or should the "Account" class be on the Login server and the "Character" class on World server? At first I thought they would be on the database server since I'll have to load the information there anyways, but I think if that was the case, it would be a bit pointless to have Login/World servers since I'd have to keep updating (and using) the Accounts/Characters on the Database server. However, if the World server had all the Characters logged in on that world, I wouldn't even need to access the Database server until it was time to save/load a character into memory from the database since I could just keep updating the character on the World server. I'd really appreciate if someone could point me in the right direction. I have all the servers running and connected, and everything related to their communication done but I can't continue my project since I don't want to do it the wrong way. Thanks in advance.
  8. This is really disappointing. I was having fun reading the book and seriously thought I was in the right direction. The official specification seems a bit hard to understand and without any actual books on the subject, I guess I'm doomed..
  9. Thank you for the answer. Quote:Original post by Yann L Whatever book/guide/tutorial you are using, stop using it. It is teaching you concepts that are essentially artifacts from the stoneage of 3D. All the functions you are referring to (fixed function lighting, colour material, glColor, etc) are completely obsolete, and should not be used anymore today. Modern OpenGL doesn't even have these functions anymore. You will have to eventually unlearn everything if you continue on this path. Modern implementations should use shaders for this. Oh... Really? I said it on my original post but I'm using the official OpenGL programming guide (red book) 6th edition. The only reason why I'm even following this is simply because it's the official book so I expected it to be correct... What should I even read then?
  10. So I've been studying OpenGL through the red book (just finished the chapter on lighting) and have a question. Until here, to define the colors of objects I just used glColor3f or something similar and they would all show up with that color. When I started adding lights, this method obviously stopped working, and all the objects have the color of the light. If I want to draw, for example, a red cube and a blue cube and I have a white light on screen, do I have to do something like this all the time? (using only ambient and diffuse as an example): glEnable (GL_COLOR_MATERIAL); glColorMaterial (GL_FRONT, GL_AMBIENT_AND_DIFFUSE); glColor3f (1, 0, 0); // Draw cube somewhere here glcolor3f (0, 0, 1); // Draw another cube somewhere here glDisable (GL_COLOR_MATERIAL); This is probably a stupid question but I want to understand this before moving to the next chapter. Thanks in advance.
  11. How can't you figure out a way? You're doing this in your code: Moving Y - Testing collision with: - Wall - Magic user - Boss - River Moving X - Testing collision with: - Wall - Boss - River - Graves - Graves Don't you see the problem here? You're checking for collision with Magic user after you move in the Y direction, but after you move in the X direction, you don't check for collision. You're checking for collision with Graves twice after you move in the X direction. Hint: If you fix the collision on the first condition, the second condition will never run. You need to check for collision with Graves once for Y and once for X.
  12. Litz

    Just starting out questions

    The book your uncle gave you explains things step by step, which might be good if you don't have any experience, but it's really big. If you want a different approach, I suggest Accelerated C++, though you need to pay alot more attention to what you're reading in that book. In my opinion, start reading C++ How to Program since you already have it and do the exercises at the end of the chapter to see how it goes.
  13. Litz

    Pointers and when to use?

    Quote:Original post by Refacull So essentially what you're saying is if the player had 100 different toyota supra's and each one had a class of its own. And each class for those cars contains a variable that defines the owner as 'player A'. But then you can make it so *owner just points to a var 'playerCar' for all 100 different supra's while taking only 1 spot of memory allocation versus the 100 pre-pointer application? If that is indeed how it works, then it makes sense to me now. Yes, something like that. Instead of each supra holding a player that would end up being the same for all the 100 supras, you just point to the original player.
  14. Litz

    Pointers and when to use?

    For now you don't really need them, but there are situations where they are useful. You'll most likely start using them when you start learning about polymorphism. Anyways as an example, imagine a game. This game has some players, and each player can race against eachother for the other players' car. In this situation, you could have a class "game" to hold the players and the cars. If for each car you wanted to see his owner, class "car" could have a pointer to a class "player", where the pointer would be the owner. If you stored the owner as a "player" in the class "car", you would be making tons of instances of the same player (imagine if one player had 100 cars). This isn't a good example, but I think it's understandeable.
  15. Litz

    Pointers and when to use?

    For now you don't really need them, but there are situations where they are useful. You'll most likely start using them when you start learning about polymorphism. Anyways as an example, imagine a game. This game has some players, and each player can race against eachother for the other players' car. In this situation, you could have a class "game" to hold the players and the cars. If for each car you wanted to see his owner, class "car" could have a pointer to a class "player", where the pointer would be the owner. If you stored the owner as a "player" in the class "car", you would be making tons of instances of the same player (imagine if one player had 100 cars). This isn't a good example, but I think it's understandeable.
  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!