Archived

This topic is now archived and is closed to further replies.

Net code in Adv Game Programming Book

This topic is 5909 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I was just wondering if anyone had any success or experience with the network engine in "Advanced 3-D Game Programming Using DirectX 7" by Adrian Perez. I tried the multiplayer game demo out from his book, and it was extremely choppy (this I assume was a result of the fact they built the networking in AFTER they had built the rest of the engine). I DO like the way this engine functions very much. In it, he uses UDP, set up in 2 different qeues. One is for a "simulated" TCP-IP guaranteeing its delivery for net messages like login, and the other using a simple UDP message for net messages they arent quite as important (like continuous player movement). I would like to study this code more, and perhaps take it to the next level, but I jus wanted to hear what kind of success or failure other have had with this network code before I did. Any comments would be great.

Share this post


Link to post
Share on other sites
Generally speaking, that is the most realistic example of how networking code should be done that I have seen geared specifically toward games. Most books and tutuorials simple say something like "Well, you would really use UDP for a game probably, but we''re just gonna use TCP for simplicity..." It was a good thing that Adrian invited Dan Royer to write that part of the book. The only thing I saw that I didn''t really like is that he used STL containers for his queues. I have seen implementations similar to Dan''s in other types of applications, such as commercial database replication software, but the queueing mechanism was much more robust and performance driven.

If I remember correctly it looked more like peer to peer than client-server, but it''s been a while since I looked at the book and I might be wrong there. But in general, that is the basic method of coding a scalable, robust networking engine. He has a set of articles on the FlipCode website that implement a TCP version of his engine. It is also highly recommended that you take a look at that site. LostLogics books on Multiplayer Game Programming is also a good introduction to networking, and is a great resource for DirectPlay8, should you decide to go that route.

To answer your question specifically, Yes, I ran the code on an Athlon 600 with a Voodoo3 about 4 months ago. It seemed okay, I wasn''t paying attention to the net code much though, I was looking at the quality(?) of his art assets at the time hehe. My own engine is very similar conceptually though, since I worked on said database software mentioned above... If you have access to a profiler, maybe you can take a look at the running code and see where the "jerks" are. It may be something in the network timer code or how Adrian times his "frames" in the graphics engine. Let us know what you find...

Tim/Fingh

Share this post


Link to post
Share on other sites
i tried to use that code, but had no success running the game, and i was too lazy to try it again, so i turned to other topics for the time being. i decided that that engine was a good design, but i also am going to continue studying it until it begins to make sense. but what i''m planning to do, which maybe you might want to try to is, to play around with small apps using winsock udp and dplay8 and just see how they operate. and then, eventually, add your own queues and threads. not sure if i''ll be successful at this, but being new to network programming, it sounds like a plan.

a2k

Share this post


Link to post
Share on other sites
okay, i''ve revisited the networking code that Dan Royer had written for the network library for Adrian Perez''s game. I''m hoping that this library is reliable in performance. perhaps after learning the basics, i''ll see where all the improvements are needed.

my question is: is Adrian''s MESSAGING system a good system? it seems he based it off of the "Why Pluggable Factories Rock my Multiplayer World" article, but looking at the messages, it seems like it''s allocated memory and deallocated on the fly, for each message received. isn''t this kinda slow?

i''d appreciate the input.. thanks

a2k

Share this post


Link to post
Share on other sites