Download Levels From The Web

Blitz3D Forums/Blitz3D Programming/Download Levels From The Web

boomboom(Posted 2008) [#1]
Right, basically I want to distribute my game exe with no level content, then when its time to play Level1, the level1.pack (for example) package gets downloaded from the net, gets put inside a folder, and can be accessed and executed. Then when its time for level 2, level1.pack is deleted and level 2 is downloaded and run.

What is the best, most fault tolerant, fasted and most compatible way to do the downloading part?

Thanks for your thoughts


Naughty Alien(Posted 2008) [#2]
hmm..why would you do that?


boomboom(Posted 2008) [#3]
...because that's what the publisher wants :)


GfK(Posted 2008) [#4]
You have increased load times (which gamers really do not like), connection to the internet required at all times, a ridiculous amount of bandwidth to pay for due to people having to download the same resources again and again... I'd forget it. Unless there's some convoluted reason for doing it that somehow makes it beneficial to the player.

..because that's what the publisher wants :)
I'd tell them to think it over some more.


boomboom(Posted 2008) [#5]
Ok, so besides it being a silly idea, what's the best way to do this?


GfK(Posted 2008) [#6]
Well its like asking "how do i cut my own hair with a lawnmower?". Sure you could try it, but there's about a hundred reasons why you probably shouldn't.

That aside, there's code in the code archives to download files from a website. If you want all the files to be downloaded in a big lump, then you might use Terabit's packer thingy if its still floating around. Probably is.

Might I suggest *not* deleting level content after its been used? Store a client-side and server-side list of level version numbers, and only download if the server holds a newer version than the client. That'd at least make the idea half way plausible.


Ross C(Posted 2008) [#7]

Well its like asking "how do i cut my own hair with a lawnmower?".



Quality.

Apart from that :o) Keeping the levels downloaded would be a good idea though. Most internet content is cached on your hard drive, to save you redownloading it.


SoggyP(Posted 2008) [#8]
Hello.

There may be 100 reasons against it, but that doesn't really come into it, does it? Humour the poor fellow.

Personally, I can see a number of reasons why you'd want to and it maybe adds another facet to the game. Personalised levels, multiple players affecting the geography.

Anyhoo, if you can help, please do.

Goodbye.


*(Posted 2008) [#9]
TBH I can see reasons why it would be good, chargable content. Level updates (changed with CRC etc), a constantly changing game where things are improved.


boomboom(Posted 2008) [#10]
thanks guys, I perfectly know the disadvantages of this kind of system, so the levels are quite small (under 2 meg) each.

This is what the publisher wants :) if he wanted me to make the interface purple with red spots, then thats what I do :)

thanks for any help with this.


Beaker(Posted 2008) [#11]
You will need some kind of reliable networking. Either HTTP or FTP. If you have control over your server and are feeling very brave you could use either TCP or (home rolled) reliable UDP.

This might help:
http://blitzmax.com/codearcs/codearcs.php?code=24


boomboom(Posted 2008) [#12]
thanks beaker that looks like brilliant code, I will look at it later :)


Zethrax(Posted 2008) [#13]
Rather than deleting the old level, you could encode it after each use in some fashion that requires a generated password/keystring to unlock, and then upload the password/keystring to a database via a server-side script (replacing any existing password/keystring for that user and level). This would mean that you only need to download the password/keystring when you want to re-use the content; rather than the whole level.


Vertigo(Posted 2008) [#14]
LMAO at the lawnmower comment... and I must agree this is not the way to go about doing anything. At most you would prevent certain levels from being accessed in one large file, and should you need to update, use a patcher service. Is this 2d/3d, a compressed file in .zip or .rar should not yeild a "level" file that is that large, unless there is a lot of geometry and textures, and if this is the case, wouldnt you want to reuse the textures/content... any way you look at it its a bad idea....

Not to mention... if you want to charge etc(im guessing since the players dont have access to all files at once), its a bad idea to just use the http get type webserver functions as A. You dont have permissions... EVERYONE would be able to read the files from the directory... and if I wanted more levels, I could just type that path into my web browser and download them. And B, there is nothing stopping someone from keeping a level that they already downloaded... atleast it would be a cat and mouse security game between you trying to prevent them, and them wanting to play...

Aside from all the negative crap I just threw at you(sorry) there are some ways to do this. Get a dedicated server, with some decent bandwidth, and get and external network library(cant multi-thread tcp with blitz on the server side), and have it sync up with some sort of encryption and have the game code talk to the server code etc... one huge benefit of doing this would be that high scores etc would be shared between players, and you could easily make this same server a web server that posts the scores and info etc to people on the web.

I would seriously rethink this whole thing stressing some key points to your client. They may "want" something... but there is a reason they arent coding it themselves... and bringing some of these issues to them may end up saving both of you time and frustration in the long run...

[end rant]

:)


bytecode77(Posted 2008) [#15]
i once made a game called 'Logo' which was downloading level from the web.
i was calling php scripts in order to download the level. if your level is just a file, then you don't need any php scripts. just download the file.

and DON'T use FTP because people can easily read your FTP account password from your executable.


Ginger Tea(Posted 2008) [#16]
being on a mobile broadband connection i pay for what i download (well after my allocated 3gb (up and down) limit)
so being forced to download a level each time i play it sounds pants

i get to level 2 yay for me
i die
boo
new game
i then have to download level 1 again cos your client wants it deleted each time its level 2 time ?!?

im not sure if they are comming from a mobile market where such practices might be commonplace but for a pc it dont sound right

allowing the game to access newer levels as they are published and auto update sounds cool
deleting old levels doesnt

mind you no ones asked what type of game
a shoot em up is a bad model
a dungeon game might be if 'level' is another dungeon not another floor
sort of mmorpg analogy
no need to go back to that level as you looted it completly, its unique to your system so no other player would go their and find your already ransacked dungeon littered with looted corpses
but this hints towards seeded levels which are best generated by the gamers system not a download


bytecode77(Posted 2008) [#17]
i guess you want to be sure that nobody cheats by modifying the level, right?
then you are on the wrong path, because everyone can easily link your server to another one and still can cheat...

if thats the case, i'd suggest you load the game from your local HD and check it for it's MD5 hash.