Jump to content
  • Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

1862 Excellent

1 Follower

About Drew_Benton

  • Rank

Personal Information

  • Role
  • Interests

Recent Profile Visitors

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

  1. The download in the first post is broken. Do you mind fixing it or posting a download link to it somewhere? Thanks. 

  2. Hey Benton,

    This is Halim. I was reading your post "A guide to getting started with boost::asio".

    But I couldn't locate the option to download the zip file.

    Can you please tell me how can  I get the zip file.

    I would appreciate that.

    thanks a lot.


  3. Hei. I am just curious. Are you the same drew benton who created the tools for silkroad? And btw, you can't receive any new PMs :)
  4. Drew_Benton

    A guide to getting started with boost::asio

    [quote] I'm a little confused about the final example implementations, all of a sudden the worker thread pool is gone?[/quote] Yes, simply because a client application such as was shown in 9b does not need really one. In that case, I wanted a simple example that was able to be exited with a keypress (sorry, windows only example!) and did not use the thread pool because it was not needed. Sorry I didn't clarify this, but it was just personal preference for that example. [quote]I'd like to see the next exciting episode implementing thread-pooling - am I correct to assume that would belong in the Hive class, or a derived MyHive ?? If you could clarify this, I would be grateful.[/quote] There's not much more to expand with the thread stuff. The custom Hive class would be for extending the object with your own methods as needed so it's all wrapped up into one object. You can then use boost::dynamic_pointer_cast to change the shared_ptr base type into the derived type. [quote] I'd also like to see a wrapper class which implements both Client and Server functionality under one hood, I can think of several situations where it is desirable for a server application to make outbound connections. A simple socksv4 proxy server would make an excellent example implementation [/quote] More examples are on the way with some fixes to the network wrapper code. I am actively using the code in quite a few different setups so I'll cover all the practical bases. The main use of my code right now is actually similar to what you are requesting and that is a proxy. Needless to say, I feel it works very nice overall in practice.
  5. Drew_Benton

    A guide to getting started with boost::asio

    [quote name='T.T.H.' timestamp='1296588474'] Thank you for that article! I'm already using boost::asio (because it's awesome) but I wasn't aware of the "unordered vs ordered" issue regarding work being serialized through a strand. Please correct me if I'm wrong but as far as I understand it I can ensure ordering in example 4b when I change those lines... [code]io_service->post( strand.wrap( boost::bind( &PrintNum, 1 ) ) );[/code] ...like this... [code]strand.post( boost::bind( &PrintNum, 1 ) );[/code] ..., right?! [/quote] Correct! You have to post through the strand itself to ensure explicit ordering whereas if you just wrap, you ensure serialization through that strand (with no guarantees to the actual order). I too was not really aware of that issue until it popped up in one of my programs and boy was it a pain to track down. I mean the docs do explain this clearly, but it was something I just completely misinterpreted so I am making a point to everyone to be careful about it and closely re-read the docs! [quote] Note that in the following case: async_op_1(..., s.wrap(a)); async_op_2(..., s.wrap( b ); the completion of the first async operation will perform s.dispatch(a), and the second will perform s.dispatch( b ), but the order in which those are performed is unspecified. That is, you cannot state whether one happens-before the other. Therefore none of the above conditions are met and no ordering guarantee is made. [/quote] In example 4b, async_op_1 would be "io_service->post( strand.wrap( boost::bind( &PrintNum, 1 ) ) );" and async_op_2 would be"io_service->post( strand.wrap( boost::bind( &PrintNum, 2 ) ) );". Hindsight is 20/20 but it's only after you make the mistake or someone brings it up that it really stands out, assuming you didn't understand it before (which I'm sure a lot of more veteran programmers and docs readers wouldn't make that mistake, but we are all human after all ).
  6. Drew_Benton


    Best of luck in your future career! However, just because you won't be doing game development stuff doesn't mean we don't want you around still. I've not done any real game development stuff for the past 5 years give or take. I've accepted I'm just not cut out to be a game programmer (yet) so I've been focusing on other things that I can actually excel at. I still like visiting the forums every now and then though to see what's going on. I just come and go depending on what else is going on, when a lot of stuff is I'm hardly here but when times are slow like they have been recently, I'm here more. I hope you still drop in from time to time, maybe blog about some of the other stuff you are doing, or just help the noobies with DB problems. I'm sure there are a lot of people, myself included, grateful for the work and time you've put into the GameDev site over the years.
  7. boost::asio is "is a cross-platform C++ library for network and low-level I/O programming that provides developers with a consistent asynchronous model using a modern C++ approach." It currently has many users and is part of the boost family of libraries. Before getting started, we will want to read over the boost::asio overview. It covers a lot of useful information that we should understand the basics of first. This guide is not meant to teach the complete ins and outs of boost::asio library; that is what the documentation is for! This guide will point us in a practical direction for learning the library and getting on our way to using it in our own applications. In addition, we might also want to check out the blog of the boost::asio author as well. There is a plethora of tidbits of useful information there as well as many stream of conscious posts by the author. Another good site to reference is this one. It is actually a book that has been released online so consider supporting that author for their hard work! At this time, the purpose of this guide needs to be explained. This guide is not going to teach any programming languages. The reader must already be comfortable with C++ to get the most out of the boost libraries, especially boost::asio. This guide is not going to teach network programming in general. The reader should already understand that topic. This guide will simply help get the reader started using the boost::asio library for practical network programming. In other words, this guide's goal is to direct the reader along a path of learning that is most useful for learning boost::asio. It is still up to the reader to spend the time reading the official docs and doing the other research required when using a new library for their projects. Another thing to note is the examples were compiled only on Windows. While an effort has been made to make them mostly portable, there are a few that might need a few logic changes to compile on other platforms or using other compilers. All of the source examples have been zipped up and attached. No project files are included, only the actual source files. This is to make looking over the code more convenient if we do not want to copy and paste the examples. Boost must be properly setup and installed to use them though! We can refer to the main boost site for such instructions. Lastly, this guide is written from my own personal opinions and experiences. While I work hard to make sure no misinformation is spread, sometimes mistakes are made. Please point out any errors or inconsistency if you are also experienced in this domain and I will be happy to correct them. Without further adieu, let us get started! 1. The basics of io_service 2. Getting to know boost::bind 3. Giving io_service some work to do 4. Serializing our workload with strand 5. Error handling 6. Timers 7. Networking basics: connectors and acceptors (TCP) 8. Networking basics: binary protocol sending and receiving (TCP) 9. A boost::asio network wrapper (TCP) 10. The road ahead [page] 1. The basics of io_service The core object of boost::asio is io_service. This object is like the brain and the heart of the library. We will start out with a simple example to get acquainted with it. In this example, we will be calling the run member function. If we check the function's documentation, "the run() function blocks until all work has finished and there are no more handlers to be dispatched, or until the io_service has been stopped." Example 1a [spoiler] #include #include int main( int argc, char * argv[] ) { boost::asio::io_service io_service; io_service.run(); std::cout
  8. Hey Fruny! I know you'll come back and check this eventually. :D
  9. Drew_Benton

    The New Gamedev.Net!

    Dan!! Long time no see man, how you've been? Your projects still look amazing. How many years going on strong has it been now? I'm still waiting for your gang game! I'm sure by now you heard what happened to APB, so if you haven't already, maybe you can pull some useful lessons learned from their post-mortum. I think I read in one of your posts you can't talk about some of the stuff going on with it, so I understand. Anyways, glad to see you around making epicness still! The old site turned me into a lurker for the better part of the past couple of years, but now that the site has been finally revitalized, I feel energized to be active again here. Take it easy
  10. Dang, can't edit my post to fix the link. Not sure what type of images are needed for comments but this is the whole link: http://img189.imageshack.us/i/drewbenton.png
  11. I wondered if you were still around. I was just thinking about you the other day when I was copying over some files:
    Long live the Mushu! :D
  12. Drew_Benton

    The worst PC problem I've *ever* had...

    The past couple of months I've had a really nasty PC bug plaguing my productivity. It all started when one of my development PCs (XP SP3) would randomly freeze in the middle of me doing programming stuff. At first I thought it was just a fluke since it happened so infrequently but eventually the problem intensified. Since I had two development machines, both with the same hardware, I just switched over to the second one and used the first one less frequently. That's why I built two low budget development machines instead of a more expensive higher end one. In the case something should happen to one of them, I'd always have the other to fall back on. Anyways, everything seemed to be fine on the second PC for quite some time until one day it froze just like the other one. O-M-G For the next month or so, I just tried to work around the problem by saving often, but then the problems seemed to intensify more and more. Now, I had two almost identical machines with the same problem. At first, I thought it was because of my hard drives. They both seemed to report some S.M.A.R.T. issues so I went ahead and swapped out the hard drives in one machine with some other spare ones. I spent a couple of days reinstalling everything and getting my development environment back up. It seemed ok at first, but after starting up Visual Studio 2008, *BAM*, freeze. So now I know it wasn't the hard drive. Next, I figured it was possibly the ram. I've never had ram go back on me before, but I went ahead and grabbed MemTest and ran it for a day to see if that was the cause. Almost 24 hours of running it and 0 errors. It wasn't the memory either... At this point, I'm really aggravated since I can't get anything done since the freeze only happens with Visual Studio and I spend the amjority of my day working in Visual Studio. I never had the freeze trigger from movies or games or music, so it was really becoming a nightmare. I decided to check the video card next. I was using an old ATI 3870, but I didn't really think it would be the problem since playing intensive video games never locked up the PC. I took it out and enabled my onboard graphics, a HD 4200 chipset. Lo' and behold, I start up Visual Studio and it freezes again! RAGE! This time though, I got a nice BSOD after the freeze referencing the ATI video driver. I'd never gotten that error before but it mentioned an endless loop error code. I had not removed my ATI Catalyst drivers before trying the integrated graphics so I went ahead and uninstalled it. After I rebooted, I installed the default drivers for the integrated graphics and attempted to start Visual Studio 2008. No freeze! Following the next logical step in this process, I reinstalled my 3870 but choose an older 9.X version of the Catalyst drivers. I started up Visual Studio 2008 once again and got no freezes! I then uninstalled the 10.X drivers on my other development PC and installed the 9.X ones and retested the same way. Yay, problem solved! (for now, I think) I still have to do more time consuming regular use testing, but at least now it seems the problem has been fixed. I simply can't believe running the latest AMD drivers caused such a horrible problem like this. I thought it was software related at first, but I never thought about graphics drivers being the culprit. I use Visual Assist X so I was beginning to think it was the problem until I had uninstalled it and still got the same freezes. I also tried different anti-virus and other software I thought might have done it, but I always got the same freeze each time. This has been by far the worst PC problem I've ever had since you have to litterally check *everything* hardware and software just to try and track down the problem. At least now I know to check for downgrades first before going crazy reinstalling everything over and over and messing with hardware.
  13. Drew_Benton

    Development Update!

    Quote:Original post by evolutional As a general question, why do you want to make an engine rather than a game? The simple answer is that I want to design tools, frameworks, middleware, anything that makes doing other tasks easier. I'm just not into sitting down and coming up with a game idea and then investing the time and resources into trying to make it happen. I like prototyping small throw away projects that show off the features of what I'm using, but not actually making a full fledged game. The main reason behind this is simply because as one developer, I can do those things as they all are programming driven. When it comes to a game, I have to dive into the art, story writing, game play mechanics, etc... I have invested in books that should help me grasp those concepts better, but trying to do it all myself is not efficient. I have no programming complement. It's just me and working with other people is out of the question because I've tried it and I just work at a difference pace than everyone else. For a game you need at least two people, with only one you are missing out on a lot of the fun of actually doing the work and then it becomes just that, work. Since I have no intentions of writing games to sell, all the time and effort will just be to give away, which at that end result, is useless. However, making middleware could be more useful at least for people who want to try a spin off project on something new and get ideas of how to approach the game making process differently. Anyone doing a real game with funds and the whole 9 yards isn't going to be messing around with anything that is not solid, so the target audience are those just doing it for pointless fun, experience, you know. If I really were going to consider a game, I'd really have to join someone else's project as I could not materialize a real game on my own. I just don't have the desire to go through all the non programming stuff at this point in life. Maybe later I'll be able to, but I've noticed when it comes to real "game dev", I just can't do it.
  14. Drew_Benton

    Development Update!

    I've not tried SlimDX yet, but it was on my todo list. Right now, I don't think I'm ready for C# yet as a whole. I thought getting into the xbox live + xna dev membership, I'd be able to get going, but that failed. I'm so attached to C++ still that I've tried breaking away from it once again and quickly ran back to the 'comfortable and known' zone. I think once I get this work done and get a few completed projects, I'll be able to transition into another language having the experience of other real completed projects done. I don't have other things in my way now stopping me from getting this project done, so I won't have any excuses if I bail this time around, which I don't think I will. I've already got OpenGL exposed completely to Lua now (was a couple of hours of work) and boy was it long and tedious. However, I feel more dedicated this time around and certainly don't see a flip-flop again as I've been doing the past year and a half. This is one of the bad things about working alone and without a masterplan, so to speak. I can spend days thinking of what I want to do and start down that path but quickly go back since I have not commitments. Maybe I just make everything more complicated and harder for myself than it should be. Oh well, I really hope to invest most of June on this project and have it near completed by the start of July. This post is starting to seem really incoherent as I reread it, so I'll stop here for now.
  15. Drew_Benton

    Development Update!

    I'm project jumping again, but this time I think I'm back on the right path. I got my 360 and looked into some C# and XNA development and I just couldn't get into it once again. I don't know, maybe it'll take another year or so but I'm stuck in the C/C++ level. I've been playing some Xbox 360 games and don't think I could even compete on that level for middleware or anything for indies. Back to the PC I go for now and will just have that as my leisure activity. Back in March, I made an entry on a game engine project I wanted to start on. Long story short, that went down the drain fast after seeing how Newton was setup and the work required to start porting it into the engine. I got discourage and decided to spend more time on playing with the Leadwerks engine instead, which I had started with in January. Well after spending 6 months with the engine, I've gotten some good ideas of how I should structure my engine. The Leadwerks engine is a real example that shows how engines can be simple yet efficient and powerful still. There are a few drawbacks to the engine itself though, since it is based in Blitzmax, but overall it is a very nice engine. It's one I would still recommend for people to play with and one I'd still support. Anyways though, I'm starting my own engine back up but this time I have a more clear path I want to take. This time around, I will be using: * SFML for the application framework, audio, input, etc... * Lua for scripting interactions * OpenGL for graphics rendering, shaders, etc.. * PhysX for physics * Xinput for my secondary input * Configurable Math Library for additional math related stuff * My UDP IOCP framework code alongside enet for networking * CEGUI for game gui. * Other mini code examples and libraries where needed The deployment strategy I will be using is the one that the Leadwerks engine uses as well as another engine I can't recall the name of right now. The way it works is through a DLL so any language that supports C strings and loading DLLs can use the engine. It's a great strategy if I might say. Basically, I'm just combining everything and writing the glue code to use the components via my own API and then the appropriate Lua binding glue code to expose those to the scripting side. It's a bit of work, but it's what I want to do and I'm working hard each day to make more progress and get something working. The way I am starting out is just getting everything working first, and then I'll go back and add more flexibility, since right now I've got a few things limited in terms of only being able to have one instance at a time. Once that grunt work is done, I have to look into some model formats and integrating simple shader code so things just don't look flaccid. However, I'm not going to focus on the graphics side of things that much. My main goal is getting everything else working together to be able to prototype out a network based game. This stage is a bit away, but it's on the radar. So, that's it for my little development update. I don't think this project is going to get abandoned like my previous ones. I really don't have anything else to work on for the time being, so I think it's a good time to get this done and start making the magic happen! I'm not sure when I'll post another update, but hopefully in a week or two with a lot more progress done.
  • 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!