Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2

Author Topic: Use UPX on dwarfort.exe  (Read 2509 times)

Nate879

  • Bay Watcher
    • View Profile
Use UPX on dwarfort.exe
« on: June 30, 2008, 03:50:54 pm »

UPX (http://upx.sourceforge.net/) is a utility to reduce the size of executable files. It reduces the size of dwarfort.exe to only 1.6 megabytes. Without UPX it is over 5 megabytes. This will significantly reduce the size of the download.
Logged
There are 10 types of people in the world: those who understand binary and those who don''t.<P>The ultimate fate of the universe.

Align

  • Bay Watcher
    • View Profile
Re: Use UPX on dwarfort.exe
« Reply #1 on: June 30, 2008, 05:10:56 pm »

Is <4 MB really all that significant nowadays?
Logged
My stray dogs often chase fire imps back into the magma pipe and then continue fighting while burning and drowning in the lava. Truly their loyalty knows no bounds, but perhaps it should.

Tahin

  • Bay Watcher
    • View Profile
Re: Use UPX on dwarfort.exe
« Reply #2 on: July 01, 2008, 01:34:35 am »

For people on dialup? Definitely. Still, I don't really see the point.
Logged

Draco18s

  • Bay Watcher
    • View Profile
Re: Use UPX on dwarfort.exe
« Reply #3 on: July 01, 2008, 02:41:44 am »

Even back when I was on dialup anything under 10 megs was fair game, depending on how long I had (really, it was all about duration, if I could get it before I needed to get off I could download it--but 30 minutes was my patience limit if I wanted something NOW, which equates to about 7 to 10 megs).
Logged

SeaBee

  • Bay Watcher
  • Wolves are atheists
    • View Profile
Re: Use UPX on dwarfort.exe
« Reply #4 on: July 01, 2008, 05:07:33 am »

Might save on bandwidth costs a bit. No idea what kind of hosting deal Toady has, though, so it may well be a moot point as he may have a huge limit that is in no danger of being reached anytime soon. UPX is cool stuff, though, and that is a considerable reduction in size! Multiply it by a few thousand downloads if you don't agree.  :P
Logged

Lazer Bomb

  • Bay Watcher
  • Sine! Cosine! TANGENT!
    • View Profile
    • Homepage 60☼
Re: Use UPX on dwarfort.exe
« Reply #5 on: July 01, 2008, 09:15:24 am »

This sounds like a good idea, but are there any problems related to using this tool? Does it mess up the code or is there some "un-zipping" required?
Logged
Kagus: "Still, demonic spelunking is always a promising idea."

Nate879

  • Bay Watcher
    • View Profile
Re: Use UPX on dwarfort.exe
« Reply #6 on: July 01, 2008, 12:04:46 pm »

I used this tool on my own copy of Dwarf Fortress, and it didn't cause any problems.
Logged
There are 10 types of people in the world: those who understand binary and those who don''t.<P>The ultimate fate of the universe.

Sean Mirrsen

  • Bay Watcher
  • Bearer of the Psionic Flame
    • View Profile
Re: Use UPX on dwarfort.exe
« Reply #7 on: July 01, 2008, 12:34:04 pm »

I vote against it, simply because it might no longer be possible to scan through the exe to see all the possible (and possibly unused) modding tags. Toady has mirrors for reducing total traffic, and all in all, 5 megs isn't much of a download for a dial-up user. A better way to save bandwidth is downloading the "small" version without music.
Logged
Multiworld Madness Archive:
Game One, Discontinued at World 3.
Game Two, Discontinued at World 1.

"Europe has to grow out of the mindset that Europe's problems are the world's problems, but the world's problems are not Europe's problems."
- Subrahmanyam Jaishankar, Minister of External Affairs, India

Mikademus

  • Bay Watcher
  • Pirate ninja dwarves for great justice
    • View Profile
Re: Use UPX on dwarfort.exe
« Reply #8 on: July 01, 2008, 04:32:38 pm »

A saving of 2/3rds is significant, taken bandwidth in total. Also, UPX'ed .exes can be unpacked (it's like running unzip), so a text file with instructions how to do it would solve the previous posters concern.
Logged
You are a pirate!

Quote from: Silverionmox
Quote from: bjlong
If I wanted to recreate the world of one of my favorite stories, I should be able to specify that there is a civilization called Groan, ruled by Earls from a castle called Gormanghast.
You won't have trouble supplying the Countess with cats, or producing the annual idols to be offerred to the castle. Every fortress is a pale reflection of Ghormenghast..

Toady One

  • The Great
    • View Profile
    • http://www.bay12games.com
Re: Use UPX on dwarfort.exe
« Reply #9 on: July 01, 2008, 07:26:38 pm »

I remember an email about this, but I don't remember the details -- are programs like Wine affected by this?  With the mirrors and no release, I was still up around 40% bandwidth last month, so options like this are looking more attractive.
Logged
The Toad, a Natural Resource:  Preserve yours today!

bartavelle

  • Bay Watcher
  • Coin coin!
    • View Profile
Re: Use UPX on dwarfort.exe
« Reply #10 on: July 02, 2008, 05:03:40 am »

If UPX can pack it, your archiving program should pack it better. UPX programs have high entropy and obviously will not compress well. Sure the .exe on drive will be smaller, but what's the point?
Logged

Mikademus

  • Bay Watcher
  • Pirate ninja dwarves for great justice
    • View Profile
Re: Use UPX on dwarfort.exe
« Reply #11 on: July 02, 2008, 05:07:04 am »

Last poster is absolutely right. If DF is downloaded as an archive then there's no benefit whatsoever in UPX-packing the executable. If it is downloaded as a .exe installer then there might be significant benefits. Afaik there should be problems with Wine since UPX'ed executables contains their own expansion code.
Logged
You are a pirate!

Quote from: Silverionmox
Quote from: bjlong
If I wanted to recreate the world of one of my favorite stories, I should be able to specify that there is a civilization called Groan, ruled by Earls from a castle called Gormanghast.
You won't have trouble supplying the Countess with cats, or producing the annual idols to be offerred to the castle. Every fortress is a pale reflection of Ghormenghast..

Jeon

  • Bay Watcher
    • View Profile
Re: Use UPX on dwarfort.exe
« Reply #12 on: July 02, 2008, 07:06:50 pm »

dwarfort.exe currently takes up 2.1 mb of the archive download so that would be 0.5 mb of savings by using UPX on it first.

While I'm not personally a fan of using other formats, max compression .rar yields a 4.7mb archive; .7z yields 4.4mb archive; .cab yields 4.6mb archive; .arc yields 4.5mb (dwarfort.exe compresses to about 1.5mb in most of these)

Trying to compress dwarfort.exe with UPX gives me an error :/


Logged

Idiom

  • Bay Watcher
  • [NO_THOUGHT]
    • View Profile
Re: Use UPX on dwarfort.exe
« Reply #13 on: July 02, 2008, 08:34:12 pm »

My vote goes to 7zip.
Logged

Janus

  • Bay Watcher
  • huffi muffi guffi
    • View Profile
    • Dwarf Fortress File Depot
Re: Use UPX on dwarfort.exe
« Reply #14 on: July 02, 2008, 08:43:39 pm »

I remember an email about this, but I don't remember the details
Yeah, that was from me quite a while ago.  :)
I use UPX a fair bit myself, and I seem to recall testing a UPX packed executable in Wine without a problem.

I vote against it, simply because it might no longer be possible to scan through the exe to see all the possible (and possibly unused) modding tags.
This would be one problem. Another, I've found that some of the utilities (Regional Prospector or Reveal or something like that, I forget which) will also not work on a UPX packed copy of the DF executable. I'm not sure if they could be updated to work or not.
« Last Edit: July 02, 2008, 08:45:58 pm by Janus »
Logged
Tomas asked Dolgan, "What place is this?"
The dwarf puffed on his pipe. "It is a glory hole, laddie. When my people mined this area, we fashioned many such areas."
     - Raymond E. Feist, Magician: Apprentice  (Riftwar Saga)
Pages: [1] 2