.TGA collision mask

Discussion pertaining to resources, which include requesting, suggesting and sharing resources.
Forum rules
Do not create a topic offering to produce resources. Click here for the reason.

Please use above resources section of site so everyone can have access to the resources you create.
001Law
Junior Member
 
Joined: Thu Mar 16, 2017 12:31 pm

.TGA collision mask

Postby 001Law » Sun Apr 30, 2017 1:33 pm

Hey everyone.
Just got ahold of 001 via the recent steam sale. Everything looks great!

My question is a weird one. I came across some tiles that I quite like.
The problem with them is in the way they have setup the collision.
They have an .JPG image for each tile, with a .TGA image matching the filename - which contains black and white indicating a collision mask.
I used this system myself in the old SDL software rendering days, so I get what they are up to.
Trouble is, I don't really have a means anymore of applying the .TGA collision to the image tiles and render out just the vital pixels for use in 001. (The source image does not respect transparency)

Anyone out there encounter this before? Is there a slick way to do this in photoshop or elsewhere that I haven't been able to google. (This is a hard question to google!)

Here is an example set for you to see:
diag1.jpg
diag1.jpg (804 Bytes) Viewed 375 times

(this is the .TGA converted because the board does not accept .TGA)
_diag1.jpg
_diag1.jpg (9.74 KiB) Viewed 375 times


The source image does not have a transparent or magenta or even solid background in some cases.
The only way to achieve transparency is to go in and paint it by hand, or apply it with the included .TGA, but I don't know how to accomplish this.
Once I have the background removed, I can setup the collision within 001 just fine.
Any advice?

Thanks in advance!
Lawrence

User avatar
evs
001 Admirer
 
Joined: Tue May 08, 2012 5:27 pm
Location: Perth, Australia

Re: .TGA collision mask

Postby evs » Tue May 02, 2017 7:28 am

i dont know about photoshop, never used it. but i like SerifDrawplus. by taking out all the colour and then making the origional grey bit transparent you would be left with the lower image. takes about 3 seconds. that is now a legacy program im told :( and only runs on windows 7. they have a new windows 10 drawing program from the same company called affinity though. id say the same process should be available in photoshop. draining the colour to black and white makes the image much less complex..

having said all that, ive been using this program for years and i dont see why/how youd use a TGA as a collision. perhaps its a new feature like heightmaps. anyway if its too time consuming for you, there are easier ways to set up a collision

User avatar
Mr.Numbers
001 Support
 
Joined: Wed Feb 28, 2007 1:50 am
Location: Alberta, Canada

Re: .TGA collision mask

Postby Mr.Numbers » Tue May 02, 2017 6:18 pm

If you use a program like Paint.net, photoshop, or anything that has a magic wand tool and layers, this is quite simple.

All you need to do is open one image in the photo editor, then the second one as a second layer. Select the layer with the "Flat" color (The .TGA I guess?) then use the magic wand tool on the area you want to delete. Then select the layer you want to remove the background from, then press "Delete", or use the eraser tool to delete the selected area. You can then delete the .TGA layer and export the image as .png.
Image
I AM THE ALL MIGHTY SCRIPTING MASTER
Please do not PM me with Engine 001 related questions, rather post on the forums. ;)


Return to Resource Discussion

Who is online

Users browsing this forum: No registered users