Upgrading the old game assets in 0.6.4

Post all other topics which do not belong to any other category.
Plawerth
Fast Inserter
Fast Inserter
Posts: 120
Joined: Thu Mar 02, 2017 12:57 am
Contact:

Upgrading the old game assets in 0.6.4

Post by Plawerth »

Has anyone else ever tried upgrading the 0.6.4 interface and graphics to be like the modern game, as much as possible?

https://factorio.com/download/archive

If it's been done before, maybe I can download their project? I'd rather not be reinventing the wheel.

Image

I'm no expert with mass image conversion tools, so this is the manual route.

Image

I'm not expecting this to work perfectly as it was designed for its time and some things don't convert properly, like how the new inserter and belt graphics are cropped into the space of the original graphics.

Image

GUI layout code is hidden in the EXE so there's no way to fix any of this. Unless Wube were to release the alpha game source... :D
Last edited by Plawerth on Sun May 23, 2021 8:10 pm, edited 2 times in total.
Plawerth
Fast Inserter
Fast Inserter
Posts: 120
Joined: Thu Mar 02, 2017 12:57 am
Contact:

Re: Upgrading the graphics in 0.6.4

Post by Plawerth »

Moving assets from modern game to 0.6.4

data\core\sound
axe-meat-1 -> (convert to WAV)
axe-meat-2 -> (convert to WAV)
axe-meat-3 -> (convert to WAV)
axe-mining-ore-1 -> (convert to WAV)
axe-mining-ore-2 -> (convert to WAV)
axe-mining-ore-3 -> (convert to WAV)
axe-mining-ore-4 -> (convert to WAV)
axe-mining-ore-5 -> (convert to WAV)
build-medium -> build (convert to WAV)
game-lost -> mission-lost.ogg
message -> (convert to WAV)
new-objective -> new-goal.ogg
research-completed -> research-complete.ogg

data\core\graphics
background-image -> (convert to PNG)
clock-icon -> .
factorio -> .
factorio-icon -> .
shoot-cursor-green -> shoot-cursor
splash-screen-image -> .
too-far -> .

These graphics don't work in 0.6.64:
light-cone
light-medium
light-small


data\core\graphics\icons\alerts
was previously in: data\core\graphics
ammo-icon-red -> .
danger-icon -> .
electricity-icon-red -> .
electricity-icon-unplugged -> .
fuel-icon-red -> .
warning-icon-red -> .

data\base\graphics\icons
(use 2nd mipmap)
assembler-machine-1 -> .
assembler-machine-2 -> .
burner-inserter -> .
burner-mining-drill -> .
electric-mining-drill -> basic-mining-drill
inserter -> basic-inserter
splitter -> basic-splitter
transport-belt -> basic-transport-belt

[ ..... work in progress.... ]
posila
Factorio Staff
Factorio Staff
Posts: 5388
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: Upgrading the old game assets in 0.6.4

Post by posila »

but-why.gif
but-why.gif (3.72 MiB) Viewed 5429 times
Plawerth
Fast Inserter
Fast Inserter
Posts: 120
Joined: Thu Mar 02, 2017 12:57 am
Contact:

Re: Upgrading the old game assets in 0.6.4

Post by Plawerth »

You ask why? So you never wanted to take grandpa out of the nursing home for a night of partying, dressed in the finest tuxedo and polished black leather shoes? Well, okay, so maybe gramps will stumble here and there, but he may enjoy the attention.

Image

It's sorta fascinating how the graphics icons were originally tightly cropped in the 0.6.4 GUI, when swapping in the modern graphics that still have the same name and the same original graphic size. Why did the devs bother to tightly crop around the edges of each icon? Trying to save bytes of VRAM usage?

Image

Also I see the tech tree reuses some icons, and just slaps a number on it for the next phase. Apparently more VRAM space saving.

Image
Plawerth
Fast Inserter
Fast Inserter
Posts: 120
Joined: Thu Mar 02, 2017 12:57 am
Contact:

Re: Upgrading the old game assets in 0.6.4

Post by Plawerth »

Lol, I see upgrading the 0.6.4 game object animations is possible, but would be a ridiculous effort done manually via a mouse.

Someone would need to write a program to select image tiles out of the current game data, and recomposite / resize to fit the smaller and fewer animation frames of the original graphics. Have to throw away about 75%-90% of the current smooth antialiased game animations to cram it into 0.6.4

Probably ImageMagick
https://imagemagick.org/index.php
User avatar
ptx0
Smart Inserter
Smart Inserter
Posts: 1507
Joined: Wed Jan 01, 2020 7:16 pm
Contact:

Re: Upgrading the old game assets in 0.6.4

Post by ptx0 »

Plawerth wrote: Tue May 25, 2021 6:10 pm Lol, I see upgrading the 0.6.4 game object animations is possible, but would be a ridiculous effort done manually via a mouse.

Someone would need to write a program to select image tiles out of the current game data, and recomposite / resize to fit the smaller and fewer animation frames of the original graphics. Have to throw away about 75%-90% of the current smooth antialiased game animations to cram it into 0.6.4

Probably ImageMagick
https://imagemagick.org/index.php
use WSL and Bash scripting, you can write a for loop, such:

Code: Select all

for i in /path/to/factorio/images/** ; do
      echo $i
      y="/new/path/to/$(basename $i)"
      convert $i [options here] $y
done
or somethin
Plawerth
Fast Inserter
Fast Inserter
Posts: 120
Joined: Thu Mar 02, 2017 12:57 am
Contact:

Re: Upgrading the old game assets in 0.6.4

Post by Plawerth »

Assembler-1 new into old:

Factorio_0.6.4.5945\data\base\graphics\entity\assembling-machine-1\
Image
0.6.4 has the same number of animation frames as the current game (32) but uses a 6x6 grid which leaves 4 unused tiles at the end.

magick convert assembling-machine-1.png -crop 6x6@ +repage split\assem1.png
Image

0.6.4 assembler base is 88x88 pixels.
Top-left of base is offset 5x17 px from top-left of frame.
Overall frame size is 141x120 px

200%:
Image

The modern game separates the shadow from the graphics, and the shadow doesn't fit the frame box of 0.6.4.
For the purposes of this exploration, I am going to ignore the shadow and focus on the machine only.

Current game:
Image

Current assembler base is 82x82 pixels.
Top-left of base is offset by 14x19px from top-left of frame.
Red box shows comparison with 0.6.4 base

Image

I don't know yet how important the slight base size difference is between new and old, vs alignment with everything else in 0.6.4 ...
User avatar
NotRexButCaesar
Smart Inserter
Smart Inserter
Posts: 1133
Joined: Sun Feb 16, 2020 12:47 am
Contact:

Re: Upgrading the old game assets in 0.6.4

Post by NotRexButCaesar »

When you finish this, will you be making it public?
—Crevez, chiens, si vous n'étes pas contents!
User avatar
ptx0
Smart Inserter
Smart Inserter
Posts: 1507
Joined: Wed Jan 01, 2020 7:16 pm
Contact:

Re: Upgrading the old game assets in 0.6.4

Post by ptx0 »

Plawerth wrote: Fri May 28, 2021 3:21 am I don't know yet how important the slight base size difference is between new and old, vs alignment with everything else in 0.6.4 ...
Image

ohh not much importance around that subject, really.
Plawerth
Fast Inserter
Fast Inserter
Posts: 120
Joined: Thu Mar 02, 2017 12:57 am
Contact:

Re: Upgrading the old game assets in 0.6.4

Post by Plawerth »

NotRexButCaesar wrote: Fri May 28, 2021 5:22 pm When you finish this, will you be making it public?
Due to the fact that this is Wube's copyrighted content, I probably can't make it available as a direct download without their permission.

However if the image modding actions can all be accomplished via ImageMagick commands, then nothing direct needs to be distributed.
  • Install ImageMagick
  • Make a work directory.
  • Download 0.6.4 and 1.1.34 full from the archive.
  • Unzip and put 0.6.4 in work directory
  • Unzip and put 1.1.34 in work directory
  • Place modding script in work directory and run.
  • Script takes things from 1.1.34, twiddles them with ImageMagick, and puts them in the 0.6.4 directory
Plawerth
Fast Inserter
Fast Inserter
Posts: 120
Joined: Thu Mar 02, 2017 12:57 am
Contact:

Re: Upgrading the old game assets in 0.6.4

Post by Plawerth »

Alas I ain't much of a programmer. The fully automagic would be a script to auto-download all the things and do all the magic hands-free, but that requires knowledge I do not have.

Hmm. How do I make a Windows powershell script to ask for credentials, login to this here webthingy, and download from the archive?

Code: Select all

Invoke-WebRequest https://factorio.com/get-download/0.6.4/alpha/win64-manual | Select-Object -expandproperty InputFields | Format-Table -wrap
<INPUT id=csrf_token type=hidden value=IjE3N2Y1NTZjY2Q4NDRhM2I2ZWU0MWU0MGE4ZGEwZjE0NWRjMDI4Y2Ii.YLJfsg.eK_3hSci7ucdQYZ6gyMbB1gmqPg name=csrf_token>
<INPUT id=next_url type=hidden value=/get-download/0.6.4/alpha/win64-manual name=next_url>
<INPUT id=next_mods type=hidden value=False name=next_mods>
<INPUT id=username_or_email name=username_or_email placeholder="Username or Email">
<INPUT id=password type=password value="" name=password placeholder="Password">
<INPUT id=remember type=checkbox value=y name=remember>
<INPUT src="/static/img/steam-sign-in.png" type=image value="Login with Steam">

The derp solution is to just ask yall to login to and download the archive zips manually. Then run the tweaker script from the downloads directory, using what was downloaded.
Plawerth
Fast Inserter
Fast Inserter
Posts: 120
Joined: Thu Mar 02, 2017 12:57 am
Contact:

Re: Upgrading the old game assets in 0.6.4

Post by Plawerth »

This is now all generated via a Windows 10 batch script, no hand-editing of any of it.

Image

Image

Image

I'm not sure what happened, but the weird UI icon cropping has stopped appearing in 0.6.4. It is possible the cropping was actually being caused by my initial hand-editing and exporting in GIMP... unknown.

This time it's all ImageMagick, overwriting the 0.6.4 icons after mass-extraction.

Snippet:

Code: Select all

Echo. && Echo 3. Extracting 32x32 mipmapped icons for game GUI
set SRC=Factorio_1.1.27\data\base\graphics\icons
set DEST=workdir\d-b-gfx-icons

Call :Sub-ExtractMipmap32 accumulator.png basic-accumulator.png
Call :Sub-ExtractMipmap32 advanced-circuit.png
Call :Sub-ExtractMipmap32 artillery-turret.png rocket-defense.png
Call :Sub-ExtractMipmap32 assembling-machine-1.png
Call :Sub-ExtractMipmap32 assembling-machine-2.png
Call :Sub-ExtractMipmap32 assembling-machine-3.png

:Sub-ExtractMipmap32
magick convert %SRC%\%1 -chop 64x0 -gravity southeast -chop 24x32 %DEST%\%1
IF NOT %ERRORLEVEL%==0 echo Error extracting mipmap for %1 && GOTO Hmm
echo Extracted Mipmap #2 for %1
IF NOT "%2"=="" rename %DEST%\%1 %2 && echo -- Renamed to %2
... and so forth.

I still need to (re-)extract the 64x64 tech tree icons with ImageMagick, but the scripted conversion is moving along.

Windows Batch programming is horrible but I'm not sure there's a more common sharing format for this. Powershell is a pain for sharing scripts, with its signed code policy that I usually end up disabling because it is so annoying.
User avatar
ptx0
Smart Inserter
Smart Inserter
Posts: 1507
Joined: Wed Jan 01, 2020 7:16 pm
Contact:

Re: Upgrading the old game assets in 0.6.4

Post by ptx0 »

did you try Bash in WSL?
MiniHerc
Fast Inserter
Fast Inserter
Posts: 176
Joined: Fri Jun 26, 2015 11:37 pm

Re: Upgrading the old game assets in 0.6.4

Post by MiniHerc »

posila wrote: Sun May 23, 2021 8:12 pmbut-why.gif
Science isn't about Why. It's about Why Not!!!
Post Reply

Return to “General discussion”