Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I have to download the html code of a web site during the game. I am taking the poster url of a movie from the imdb web site by scrapping the html ( also other informations ). I have to do the download process many times during the game for different movies. I can download and scrap the html but downloading the html takes too much time and it causes the game to slow down(freeze while downloading). How can I solve this problem? My one approach is to download and scrap all the information and store them in a database before the game and during the game access this information from the database. I think this will work properly but that is not what I exactly want. It would be better if it is dynamic. I also thought of using multi-threading but I am a bit confused about how to implement threading in xna. I read some articles about it but it is not so clear. I mean when should I start the thread and what about the update function etc. I need your help guys

share|improve this question

1 Answer 1

up vote 4 down vote accepted

Creating a thread for your downloading operation will solve the problem. It means your game will create thread every time that you need download, than thread runs in parallel independently with download and after downloading is done, thread ends. Make thread for every download you need (so they can run in parallel too).

share|improve this answer
    
You can use the Thread Parallel Tasking library if your using .NET (I think that's what it's called). –  Michael Coleman Jan 15 '11 at 17:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.