Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Trying to make an auto patcher

Author
Message
hookkshot
12
Years of Service
User Offline
Joined: 12th Apr 2007
Location: Adelaide, Aus
Posted: 4th Feb 2012 15:09
I don't particularly know where to start for this so any advice would be a great help

MrValentine
AGK Backer
9
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 4th Feb 2012 19:09
Have you looked at Smart Packer Pro?

vitinho444
9
Years of Service
User Offline
Joined: 12th Oct 2010
Location:
Posted: 4th Feb 2012 19:36
once i made one, still works, in Visual basic 6...

C++ Medium 3.5/5
www.oryzhon.com <-- My company's website (W.I.P)
hookkshot
12
Years of Service
User Offline
Joined: 12th Apr 2007
Location: Adelaide, Aus
Posted: 5th Feb 2012 03:02
i prefereably want to program one to use in my launcher

MrValentine
AGK Backer
9
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 5th Feb 2012 10:57
Well have you got an FTP server?

You could simply write out a text file or .dat file with a list of changed files... and parse them through the ftp functions... if you get me...

vitinho444
9
Years of Service
User Offline
Joined: 12th Oct 2010
Location:
Posted: 5th Feb 2012 11:45
Mr valentine i checked the smart packer pro, and thats very cool... but 59€ it's too much :S

Mine in Visual Basic 6 works this way:

You open the program, it check's for updates in a webserver, if there is any update download and install it (download .rar and extract it replacing the old files)

Then once the update is done, a button show's to start the game.

Simple and efective, but VB6 is getting more and more foreign to windows new systems...

C++ Medium 3.5/5
www.oryzhon.com <-- My company's website (W.I.P)
Hassan
10
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 5th Feb 2012 12:20
if i were you i would handle it like this, could take more effort but it's gonna bring good results probably:
first off, your exe will be nothing more than a parser, your data files will contain objects/textures/etc... with scripts and info that allows them to handle themselves, or at least have every object store a name or ID of a script/AI that it will use, and write those scripts in the exe, then to patch, let your launcher check for updates, download then replace files or re-write parts of them, and your exe won't be changed since it just does what the media files order, the exe should be capable of doing/parsing everything related to this EXPANSION or VERSION of your game, so updating the whole exe would mean a new expansion/version, which will be able to handle more variety of instructions from the media
i believe this is how the game World of Warcraft handles it.

hookkshot
12
Years of Service
User Offline
Joined: 12th Apr 2007
Location: Adelaide, Aus
Posted: 5th Feb 2012 13:43
i have a apache server.

and thanks for the info hassan, is there anyway you can direct me in how i would turn all that into code for my game, ie what ill ne in order to accomplish what you are saying. ive only just started using c++. im quite handy with the dbpro functions but im trying to move on from that to incoprate some high level stuff.

vitinho444
9
Years of Service
User Offline
Joined: 12th Oct 2010
Location:
Posted: 5th Feb 2012 17:07
Hassan, my auto updater in vb6 does that all

But basicly you dont need to change anything inside your .exe

C++ Medium 3.5/5
www.oryzhon.com <-- My company's website (W.I.P)
Hassan
10
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 6th Feb 2012 13:49
@hookkshot:
if you're just starting then it could be a little bit hard because it would probably include a lot of OOP and some knowledge in file I/O, and scripting (look up LUA on google) if needed, plus some knowledge about FTP or whatever internet connection method, i've never used anything related to that so no advice on it, for the rest, i can't imagine it (at least, properly) without OOP so if you're not familiar with that, i can't help you, and by the way, if you like C++ and want to keep using it, you should learn OOP as it's very very useful, clean and readable, after a little bit of usage, you will find it easier to code in OOP than procedural code

@vitinho444: Good to hear

hookkshot
12
Years of Service
User Offline
Joined: 12th Apr 2007
Location: Adelaide, Aus
Posted: 6th Feb 2012 13:52
Im doing fine with oop so far its more the file handling that im not clear on. even if someone could point me in the right direction that would be great cause ive been looking on the net for a few days now and cant find any tutorials related to what im trying to do.

Hassan
10
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 6th Feb 2012 16:49 Edited at: 6th Feb 2012 16:50
ok well here it is simplified:
first, no need to write your own file format since you can work around it and it would take too much time, so your setup will be something like: (assuming it's a game involving levels, for example)
Game folder
|_>Game exe
|_>DLLs
|_>txt readme etc.
|_>Data folder
|. |_>Global.FORMAT
|. |_>Maps folder
|. |. |_>Map1.FORMAT
|. |. |_>Map2.FORMAT
|. |_>Media folder
|. |. |_>Soldier.x
|. |. |_>Car.x
|. |. |_>SomeTexture.jpg
names may be whatever you want, FORMAT is also an extension of your choice (it doesn't really matter at all, txt or ASDG, it will be the exact same data inside, it's just a sign to windows so it can choose what application to open the file with)

so it goes like this, exe runs, lead media for menu or whatever, and load Global.FORMAT, not necessary but you may use such thing to apply some global changes through patches, like um, dunno, it could include the number of levels or some info regarding characters and so on, then at loading levels, your exe will open up a map in the maps folder, this file will merely include info such as, for every object: name,position,angle,script/AI name, physics data(static/dynamic),etc.., you will read all these lines of objects and save them all in an array or better yet, an std::vector(dynamic array), and then right after you finished reading your file, close it and loop through your array or std::vector, and for each one, load the object with the specified name(or check if it's already loaded from a previous level, could save loading time), then link it with a script written in your code since you know the script name.

now from the C++ side, it should look like this:


i added everything in one file, should look simpler when you split it, but thats it, the very basic structure of the code
now for the actual patching all you're gonna do is add or remove entries from map files, add new map files or add/remove media, and you can alter the Global.FORMAT file to apply some global changes of your choice (your exe should include some code to parse that, too)

if you have any questions feel free to ask, im a pretty bad teacher and the code above is probably confusing :/

MrValentine
AGK Backer
9
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 6th Feb 2012 17:26
hookkshot I think you should try the simpler FTP method first as it will reduce in application workload and you could even create a launcher to perform the patching... even better you could use FTP to download a single zip/rar/pack file and extrack to the installed game directory... [or use get dir$ for the current directory]

just a thought... as I might be taking this approach myself...

hookkshot
12
Years of Service
User Offline
Joined: 12th Apr 2007
Location: Adelaide, Aus
Posted: 6th Feb 2012 17:34
thanks heaps for that hassan. though it doesnt explain how i can update the files if a new patch comes out or such. but it definately helps with my game layout.

Hassan
10
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 6th Feb 2012 18:48
well the patcher is simple so i didn't explain it but, here it is:
either let your game starts via a launcher or do it simply in-game, you will just check online for an update, if there is one available download it, the update should contain data like this:

as a text file or whatever, this and another folder which contains the NEW media to import like above: Tank.x and TankTexture.jpg, those are with the download also

now i don't really know how downloading works, but however you do it, the patcher code could look like this (pseudo code):


hookkshot
12
Years of Service
User Offline
Joined: 12th Apr 2007
Location: Adelaide, Aus
Posted: 7th Feb 2012 00:30
this helps heaps i shall get to work on this straight away

Login to post a reply

Server time is: 2019-12-13 21:40:10
Your offset time is: 2019-12-13 21:40:10