Vaclav

Member
  • Content count

    19
  • Joined

  • Last visited

Community Reputation

147 Neutral

About Vaclav

  • Rank
    Member

Personal Information

  • Interests
    Art
    Design
    DevOps
    Education
    Programming
  1. Thank you both of you. I don't have much experience with C++ so let's leave the weak_ptr to the experts. I'm programming in Java. I didn't know Java has WeakReference too. With C#/Java WeakReference, you don't know when the garbage collector will actually collect the object, it may be done only later. In consequence you would also have to check a player.isConnected() flag before working with the object. This would also bring a kind of non-determinism to your code, which is bad (same principle as Effective Java Item 7: Avoid Finalizers). I think what I'm going to implement in Java is something like this: interface PlayerEnteredListener entered(player) interface PlayerLeftListener left(player) class PlayerManager entered(Player) left(Player) addListener(PlayerEnteredListener) addListener(PlayerLeftListener) removeListener(PlayerEnteredListener) removeListener(PlayerLeftListener) //other methods: List<Player> getAllPlayers() Player getPlayer(int ID) This should be simple and easy to debug.
  2. Hello, This is a general programming architecture question. In a multiplayer game, what is your approach to handle if one of the players has left? The problem: * Let's say there is one Player object that represents this player who has left the game. * Now every game component that referenced this Player object has to set its references to NULL, so the Player object can be either garbage collected. * These game components may also have to reset their internal state. Possible approaches: 1. Subscribe all such game components that deal with Player objects class to a "Player Left" event which is broadcasted by the framework. 2. Do not store references to Player objects in any classes, but instead store only a Player ID number. Then the Player object can be received from the framework by the ID, or the framework shall return NULL if the player has already left the game. 3. Any other approach? So what do you think about 1-3 points?
  3. hi all,   Should the Game Design Document contain the layout of the GUI (Graphical User Interface)?   Or is it enough to list the items needed on the GUI and their types (eg. Name, Password [Input boxes]; OK, Cancel [Buttons]), and let a specialist design the layout somewhat later?   In case you say it should include the GUI layout, then how detailed/precise should that be, or is a rough sketch enough?  
  4. Thank you for your answers. I was asking because I work alone or with 1-2 developers so we don't have a group of testers. I believe open beta could be a solution.
  5. Hello there,   Most games have a debug and a release configuration. Runtime checks (eg. asserts or #ifdef DEBUG) in debug code help discovering errors and they are excluded from the release binary. So testing is done on the debug configuration to discover all errors. When there are no more unfixed bugs, configuration is switched to release and the game is rebuilt. How much is needed to be tested in the release version again? Testing everything all over again would be too much. Not testing anything would be also crazy, as the code changed and it should not change the behavior but in software development people make mistakes... How would you chose what/how to test again in the release?
  6. Hello,   I'm here to announce my finished game, so you guys can play it.   SpeedBird is an online multiplayer minigame. It's the race of two little birds that can't fly, only run and jump.   You can play against a friend, or find an opponent in Lobby chat.   It's free to play, please donate if you enjoyed the game. The game is browser based, make sure your browser is updated. Android is also supported with Chrome, Firefox or Opera.   The game uses latest browser technologies: HTML5 Canvas Websockets WebRTC Website (play): http://speedbird.tk   On Indie DB: http://www.indiedb.com/games/speedbird  
  7. Chain of Events

    I like it very much. Though killing your father sounds too harsh to me. Can you tell more about the game?  
  8. Oh thank you, you're absolutely right!
  9. Hi Say I'm the server, a client is connected to me using TCP. How can I get the client's MAC address from it's socket using the SDL_net library? Thank you for your help.
  10. Hey, I use the code from the following great tutorial: http://content.gpwiki.org/index.php/SDL:Tutorial:Using_SDL_net But I can send only from the client to the server. Can you help me what do I have to add the code to send from the server to the client? Do I have to create another socket, or I can use that one already open? Note that I need only one client per server, so I want just something simple. Thank you, Václav
  11. I've been trying to create a car model with the ODE physics engine. I set the rear wheels to always face forward parallel with the chassis: dJointSetHinge2Param ( joint, dParamLoStop, 0.0); dJointSetHinge2Param ( joint, dParamHiStop, 0.0); When the car is moving forward it's fine but when the car turns the rear wheels get turned somehow. I control only the front wheels, it's not four wheel steering. I've tried to set other parameters of the Hinge2 joint as well like dParamERP and CFM, dParamStopERP and CFM or dParamBounce but they had no effect on this, I've also tried number 1 and 2 from these. (See in the ODE manual: Joint types -> Parameter Functions.)   Here are two screenshots to see the problem better: [spoiler][/spoiler]   Thank you for your help.
  12. Well what I want to do is like a multiplayer racing game over network, so something with physics over network. I have read some articles about it, here is what I think how it would work: Say I have a client and a server. I measure the latency between them, one direction it's ping/2. Let's say ping is 200 ms, so one way latency is 100 ms. The physics simulations runs on the server, but the client also tries to approximate it. If the client gets an input for example to move, sends it to the server that it wants to move. Then the server has to roll back time of the physics with 100 ms, because the action of the client happened at that time. Then apply the action, and go forward with time 100 ms again. The server sends the actual positions and velocities let's say 10 times a second. When the client receives positions, the ones it got are the positions reflecting the physics state 100 ms earlier, so the client sets those positions and velocities and advances time by 100 ms. For this, restarting the simulation every time when teleporting objects, would be too often to do. I'm going to use Box2D. I don't know if you have problems with collisions when setting the new positions and velocities. So is it correct what I think of? Or do I make it overcomplicated?
  13. Thank you for your reply. [quote name='Waterlimon' timestamp='1355834227' post='5012016'] b)Save snapshots at some interval, then either interpolate or simulate forward/backward from closest point (whichever works the best) [/quote] So I'm going to do this. Set the position, rotation, velocity and angular velocity at the earlier of the two frames next to the desired time. Then advance physics by the difference between the desired time and the frame time. This should be better than interpolating between two frames myself, because a collision might happen in the meantime.
  14. Hello I'm looking for a free, cross-platform (windows and linux is enough for me), C/C++ physics library which can also step physics back in time, not only forward in time. For example, what I want to do looks like this: [source lang="cpp"]world.update(0.05); world.update(0.05); ... world.update(-0.025); world.update(-0.05); world.update(-0.025);[/source] And I want to get the same state in the end as it was at the beginning. I have already tried Box2D and chipmunk physics. Box2D only stops time for negative values (does nothing), chipmunk does the thing (ok not very accurately) as long as there are no collisions. If there was a collision meanwhile, I get completely different result when rolling things back in time. Without any collisions it works. Have you guys ever did this, or know which library can do it well? I could even try ODE, if it can do this. It's 3D, but I can use it for 2D too I guess.
  15. [SDL] Pixel access segfault

    Yes, I'm sure because exactly the same code works for 32 bit surfaces. If would try to access with invalid parameters, it would cause segfault for 32 bit surafces as well.