Advertisement Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Everything posted by Paulus_newbieus

  1. Paulus_newbieus

    Dealing with websocket message overload on client

    Thanks for the help guys. You were correct - by turning off the Nagle algorithm, my jitter completely vanished! For interest of other readers, in .Net this is possible by toggling the NoDelay property to true (by default its false) on the System.Net.Sockets.Socket class. I believe this change will soon be integrated into the Fleck library by the project developer. Cheers
  2. I have a web-socket server sending object positions to all clients at a fixed rate (say 40 Hz). Client side (HTML5 browsers) I receive these messages and draw the object (canvas) at that new position. My problem is that sometimes, if there is not a great deal of other JavaScript processing activity on the client, the objects seem to skip a bunch of updates and get transported over a large range. So instead of a nice smooth animation, I get stuttery movements. I have some code to handle lagging updates using linear interpolation - but this problem is different, this is not where the updates are coming in too slow, its where they are coming in too fast! How the heck do I solve this without resorting to decreasing the server update rate, which I really don't want to have to do?! Any suggestions greatly appreciated!
  3. Paulus_newbieus

    Dealing with websocket message overload on client

    OK, interesting. I cant see any obvious way to disable Nagle (never heard of it) or how to turn off delayed-ACK. I don't suppose you guys could point me to a good source of on-line explanation for these things? I do broadcast a single message to all my client connections once every 25 milliseconds, and I do actually already attach a time stamp to the message - I use this to work out the rate to animate (linear interpolation). So even though I have the time stamp, It's not yet clear to me how I can use this to re-arrange my packets. At the moment, positions are just drawn straight away. Should I be buffering the updates, re-arrange them depending on time stamps, and then draw them? This feels like yet more lag time. Appreciate the help guys!
  4. Paulus_newbieus

    Dealing with websocket message overload on client

    Aaah! Of course, why not, this sounds extremely likely. I must admit I was expecting them to arrive in the correct order. Running this simulation locally (debugging on my PC) with server local) I do not get this issue, so I did not consider the ordering to be different. I am using Fleck: I am just using it in its default set-up - I have not done any tweaking or tuning whatsoever, just running it out the box.
  5. Paulus_newbieus

    Max Payne 3 - Plays best on PC or PS3?

    So I loved all the previous Max Payne games and am really looking forward to the new one. I have started playing games on my console more and more, although I come from a heavy PC gaming background. My problem is that I cant decide whether to buy the game for PC (better graphics?) or my PS3 (couch comfort?)! What do you guys think?
  6. Hi, I am looking to build a pseudo-randomly generated game level/map. A map is divided into blocks of areas, and using a seed I want to be able to regenerate the same content of any of these areas anywhere in my game map. So if I teleport to a far-off area, it will look the same as the next time I visit the same area after restarting the game. I know lots of games already use this mechanic, but my issue is with the fact that to seed a pseudo-random number generator you typically supply a single value such as an unsigned integer. What I have instead is an x,y grid coordinate, not a single value, because that is the only way I can think of how I would identify a map area, especially if the map is potentially infinite in size. For example, the first area may be 1,1. To the right is 2,1, and below is 1,2 etc. So I guess what I am asking is how can I use a coordinate as a seed?
  7. Paulus_newbieus

    Seeding a pseudo-randomly generated game map

    Thanks, much appreciated guys.
  8. Paulus_newbieus

    Seeding a pseudo-randomly generated game map

    So short is the x coord and short2 is the y. You are bit shifting the x by 16 and adding it to the y, to make it a unique single value? This is so the point {1;2} will not result in the same seed as {2;1}, am I right? And alvaro, you are doing something similar. [/quote] I am doing something similar, but my code works. What Waterlimon posted has several issues. He probably meant to say `(short1 << 16) + short2' or `(short1 << 16) | short2'. With '&' you'll get 0. And you can't use `short' as a variable name. [/quote] Thanks for clarification and taking the time to help me out alvaro! I actually come from a VB .Net programming background (*hangs head in shame*) so could you please clarify with the symbols what's going on with the bit shift and addition i.e. should it be adding the results? Also, alvaro what's the [color="#006666"][font="CourierNew, monospace"]10366439865051156459ul [/font]signify, and how would that be better than a bit shift? Many thanks!
  9. Paulus_newbieus

    Seeding a pseudo-randomly generated game map

    Thanks for suggestions guys. So short is the x coord and short2 is the y. You are bit shifting the x by 16 and adding it to the y, to make it a unique single value? This is so the point {1;2} will not result in the same seed as {2;1}, am I right? And alvaro, you are doing something similar.
  10. Paulus_newbieus

    Using Square Root to calculate Area

    To calculate the area of a 2D square or rectangle, you multiply the width by height. However, unless I then get the square root of this value the result is wrong! Public Overrides Function GetArea() As Single Return Math.Sqrt(ShapeWidth * ShapeHeight) End Function Why do I need to apply the square root?
  11. Paulus_newbieus

    Using Square Root to calculate Area

    Thanks for the feedback all, much appreciated! Quote: Someone already asked this, but I'll do it again: Why do you think you need the square root? Can you show us an example? I thought that I needed the square root because I was testing with non-Axis-Aligned rectangles. I have just tried with your simple example figures and I get the same result. Basically I became very confused because I am working in a "zoomed in" scale, and applying the square root seemed to give correct figures but I was in fact just plain wrong. Because I can not guarantee my rectangle will always be AA, I think this is really what I should be using:
  12. Paulus_newbieus

    Using Square Root to calculate Area

    Quote:Original post by Magpie OK the Area of a 4 sided figure, Square or Rectangle is Width * height. If you are using coordinates you need to calculate the distance of the width and the height. IE: Width will be W = Sqrt((X2-X1)^2 + (Y2-Y1)^2) Height will be H = Sqrt((X3-X1)^2 + (Y3-Y1)^2) So area is W * H Ahaha - Yes I am using a 2D coord system. This must be why I need the square root in there, because it needs to be the distance otherwise it doesn't make sense when I convert it to real world measurements. I can expand my actual function - this is what it is doing: Area = Math.Sqrt((m_MaxPoint.X - m_MinPoint.X) * (m_MaxPoint.Y - m_MinPoint.Y)) Does that sit with what you have said Magpie?
  13. Paulus_newbieus

    Using Square Root to calculate Area

    Hmm ... does it have something to do with my coordinates? Perhaps related, why would I also need to square root the result of a distance calculation? Public Function Distance(ByVal Point1 As PointF, ByVal Point2 As PointF) As Single Dim dx As Single = Point1.X - Point2.X Dim dy As Single = Point1.Y - Point2.Y Return Math.Sqrt(dx * dx + dy * dy) End Function
  14. I've been thinking about how you generate content for things like a game, but from a pseudo-random seed. The pseudo-random is important, because I want to be able to re-create the exact same thing if I know my seed value. Generally I know that if you seed a languages randomizer with a certain number, you will get the same sequence of values from the formula. This is of course really useful to store the definition of a game map and its contents just by knowing the seed. So with the seed alone I will be able to generate exactly the same game map on many different machines, without each machine actually having to know the definition of the map up-front. It just takes the seed, then loops through some method calls and constructs the map. I think games use a similar method already, in fact do I think Elite used something similar to generate all its planets? Anyway, the key here when using the random class and the seed is that we have to loop through some procedure. As we go through the loop, we are slowly building up the same content. Now, my question is, is it possible to look ahead into the future to determine what the random number output will be? Think about flying through space in Elite. Lets pretend the game has not yet ran through its routines to generate the entire galaxy, but you go into warp and appear somewhere far away. I come out of warp and appear next to a planet full of amazonians. Now, say I exited the game, reloaded the same map and went into warp at the same place. Would I still appear at the Amazonian planet? Is this possible to tell without knowing the content of the entire galaxy upfront, or is there some procedure that could hop us ahead to that point in space without having to iterate through a loop a bazillion times? I’ve started looking at Fractals and even Perlin noise – am I on the right path? Could you guys direct me to some good reading material please?
  15. Paulus_newbieus

    pseudo-random game content - Where to start

    Yes but is it possible to know the sector seeds of a sector 287634 million miles away, just by say passing in a 3D point position parameter, instead of actually generating the entire galaxy up front?
  16. Also I would suggest you take a look at Crazy Eddies GUI.
  17. Hi, I'm looking into SilverLight for the first time, specifically the new SilverLight 3. I would like to hear any advice or recommendations on whether it is possible / advantageous to move to this tech from .Net 2 tech which we currently use. At the moment we have a winforms application that we want to move onto the web, hence SilverLight. We use the Drawing.Drawing2D functions to render large dynamic scenes of fairly basic shapes (squares, ellipses, polygons etc) and images onto a resulting bitmap graphic. Think of it like a drawing tool that must render thousands of these objects, with zooming and panning. To get good animated render speeds we utilise the BufferedGraphics class and mostly call DrawImageUnscaled to layer a bunch of bitmaps into a final image. Anyway, I have read 2 important things about SilverLight 3: 1) its ability to automatically make use of multi-cores during rendering graphics operations, and 2) the fact that it benefits from hardware acceleration. Could anyone tell me if these two features will help my situation, and just generally what improvements to 2D rendering have been made with SilverLight?
  18. Paulus_newbieus

    [.net] SilverLight 3 vs .Net 2 Drawing 2D

    I thought .net 3 still just used .net 2 core libraries at its heart anyway? We are expecting to re-write most of this thing into the new style anyway - I was just looking for discussion over what enhancements and optimisations we can expect to enjoy when doing all this graphically intensive work under SilverLight - preferably from anybody with experience in using this new tech.
  19. Hi, I'm trying to get to grips with Garbage Collection in .Net, and have a couple questions: Say I have an object that has member variables that implement the IDisposable interface - for example the member variables might be a TextureBrush. The Brush type implements IDisposable and is therefore unmanaged, meaning I need to dispose of it manually. Is this statement correct? So, I go ahead and make my class IDisposable, giving the following: Private disposedValue As Boolean = False ' To detect redundant calls Protected Overridable Sub Dispose(ByVal disposing As Boolean) If Not Me.disposedValue Then If disposing Then ' free other state (managed objects). If Not IsNothing(m_textureBrush) Then m_textureBrush.Dispose() End If End If ' free your own state (unmanaged objects). Set large fields to null. m_textureBrush = Nothing End If Me.disposedValue = True End Sub ' This code added by Visual Basic to correctly implement the disposable pattern. Public Sub Dispose() Implements IDisposable.Dispose ' Do not change this code. Put cleanup code in Dispose(ByVal disposing As Boolean) above. Dispose(True) GC.SuppressFinalize(Me) End Sub When I know that an object is no longer needed, I remove all references to it and call its dispose method. What happens when my application shuts down? Do I still have to call dispose on these objects or does .Net clean it all up automatically? I ask, because when debugging, my Dispose methods are not called automatically when I close the application.
  20. Ok thank you dmatter, I think I got it. How about re-assigning local IDisposable variables? Take the Bitmap as an example - if I have a 100*100 bitmap in a local variable, but then need a new smaller bitmap and create a 50*50 image and just assign it to the same local variable, do I have to make sure I disposed it first so that the larger image is cleared from native memory? E.g. If Not IsNothing(m_bmpImage) Then m_bmpImage.Dispose() m_bmpImage = Nothing End If m_bmpImage = New Bitmap(m_intWidth, m_intHeight, Imaging.PixelFormat.Format32bppPArgb)
  21. Paulus_newbieus

    Left4Dead networking

    What do you think the basic design of the Left4Dead networking code looks like? Normally first person shooting multiplayer games have on average about 32 players on a server playing the same game at the same time. But Left4Dead has 8 players (in versus mode) and tons of zombies – how do they do it?! Each player sends minimal information to the server (e.g. their current speed and orientation etc) to be shared with other players, but in games like Left4Dead, every player also needs to have an update of the zombies position / status. The zombies are all AI driven, so am I right in thinking that a server must be completely authoritative and calculate everything to do with the zombie and constantly keep each player updated? This seems like a huge amount of game calculation on the server, and a high amount of extra networking activity compared to your standard multiplayer game. Does anyone know the specifics of this design?
  22. Paulus_newbieus

    Going for 3D

    This is my suggestion, because it is how I started out and it worked for me: 1) Learn the _basics_ of OpenGL (Look at the excellent NeHe tutorials on GameDev). Already coming from a 2D background I bet you will pick this stuff up quickly. 2) Now that you have a good understanding of the basics of graphics programming (vector math, lighting, texturing, cameras etc) its time to let a graphics engine do the advanced stuff for you: start using the OGRE engine. Additional free libraries I personally use and enjoy: - Use Newton or Bullet for your physics. - Use RakNet for your networking. - Use OpenAL for audio. Enjoy and good luck :)
  23. Hey all, I am developing a small time e-commerce website and I need some advice! We will sell a single product, and we are using PayPal and GoogleCheckout to process the orders. We will not be storing any financially sensitive info on our server. My problem is that we want to implement SSL protection for the logging in stage i.e. the customer has an account with us, and in order to log in and look at their details we want it to be under https. Unfortunately I have no experience with SSL. I have been advised by a friend to purchase an SSL certificate (e.g. Thawte) from our server host. He then said that the best practice is to register another domain name in addition to our current one e.g. and then make all my scripts that need securing be placed under that domain. Now I have attempted to pre-empt this by developing the website such that all the files that need ssl protection (e.g. login.php) are in a subdirectory off the root called SECURE. Is this useful or will I need completely seperate file directories - how will it work from the file system point of view with two domains on the same server? Can they share files (For example, my js and ccs includes files)? Will it be possible to setup my two domains so that I have this secure portion of my website simply covering the files in the /SECURE sub directory? I am worried that it is going to become a pain keeping state session of my PHP files between the domains (http and https). Am I just better off protecting the entire website with SSL rather than a few select web pages? Any hints/tips greatly appreciated!
  24. Cheers, Sander. The world needs more selfless people like you :)
  25. That does indeed help, thank you Sanders :) I am aware of the messages and warnings you get with sites containing mixed content, it looks unprofessional and potentially unsafe so I defiantly want to avoid that. The one option to make the whole site SSL is actually looking pretty good to me to be honest. I have a managed server just for this website, so I don't think it will be too resource intensive for us. Can you think of any other disadvantages for the whole site being under SSL? Could this actually put people off? This SymLink thing also sounds interesting - potentially its not a big problem to duplicate a few images and files and just have them seperate, but I suppose this would mean the user would have to download for example our logo image twice, since it is a different file. Would the SymLink solution mean users wouldn't get the warning messages?
  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!