Texture Editing made easy! (XWE! 1.09.4!)

Status
Not open for further replies.

Shadow Hog

Member
Should be v1.09.4-OK

---

Nearly two years ago (as of the latest edit of this post), I decided to register with you guys to see what I could do about getting custom textures to work. The problem was, the tool I was using (XWE) misinterpreted TEXTURE1, causing all sorts of problems.

A small ray of hope was there, though, as a441 had made tools that worked, and worked well, at converting PNAMES and TEXTURE1 to something that was editable in Notepad. After the four months (ie: the past weekend) I finally managed to secure a copy of those tools, for my own perusement and so forth.

Well, first off, yes, it worked:

SRB2009.gif


But there was an interesting side-effect... XWE was reading TEXTURE1 properly! I confirmed this by converting the lumps to text and back and giving them their own wad, and then setting XWE up so my IWAD was SRB2.WAD; all the textures displayed properly, and with some exceptions (mostly skies, though they still work properly).

Well, obviously, I had to prove this was working A-OK, so I whipped up some old textures I'd ripped from SMB2 (the US one), and tried adding them on to TEXTURE1 and PNAMES... and wouldn't you know it, it worked!

---

But I digress. You're probably waiting for the point of this topic, and I'll be blunt: this is a quick tutorial on how to get custom textures working in SRB2 using XWE. No pictures for now, so follow closely.

First off, you'll need these:
The latest version of the eXtendable Wad Editor
A zip with the valid TEXTURE1 and PNAME lumps in it
A texture to work with; width must be a power of 2 (like 32, 64, 128 and so forth), height must be 255 pixels or less (but it can be anything else otherwise; for taller textures, split it up into multiple textures of, say, 128 pixels height), and for ease's sake, put it in DOOM's 256-color pallette! (The .GIF file should have the right pallette, if I'm not mistaken.)

Yeah, that's pretty much all you need.

---

So how do you get started, you ask? This is easy.

First, open XWE. It'll most likely prompt you for your IWAD; attempt to point it at SRB2.SRB. If it complains, point it to your commercial DOOM2.WAD, and if you don't have that, download FreeDOOM. You can edit the INI later on to point to SRB2.SRB, assuming you know what you're doing (remember, kids, BACK UP FIRST!)

Now, make a new WAD - "MOO.WAD" for example - and insert the valid TEXTURE1 and PNAME lumps. Assuming it still works like it did in the past, it should work perfectly - no random textures with "W" at their ends.

Now, go to Entry->New. Type in "P_START" and hit Enter. You should now see a third lump with the filetype "MARKER". If you don't, something screwy is afoot, delete this lump and try making it again.

Now, Entry->Load. Head over to your texture file and select it. Rename the lump name if necessary (eight characters, folks!). You should now see your texture in the list, and on the right, amongst the cyan, your texture should be clear as day. Congrats, the patch is loaded! But don't start using it in your levels yet, it won't work that easy.

If you have more textures to add (or you're making a big texture but lack the other pieces of it), add them now. If not, then Entry->New, and type in "P_END". This closes off the patch section.

So how do you use these? Good question. Really simple answer, too. Right-click the texture and select "Add to Patch Names" and "Add to Texture", in that order. The patch name is now in PNAMES, and if you select TEXTURE1, your patch will now be in a little box shaped its size. For most intents and purposes, NOW your texture is usable in SRB2. Go ahead and create a level in MOO.WAD using it. (Unless you were making BIG textures, in which case, you'll notice there's a problem. Delete all the parts of it besides the top part from TEXTURE1; I'll explain how to fix this in a bit. Read on.)

---

So what does all this jargon on the upper-right that displays when TEXTURE1 is selected mean, anyway? Well, on the left of the top bar is the list of all the textures. If you want to make a new one, just hit Insert (or Textures->New). Make that texture name, oh, say, "MARIOVIN" with dimensions of 128 by 128.

So, this brings us to the right part of the window. The patches. See, the files you loaded weren't the textures themselves; they're known as "patches", only PART of the whole, which are added one-by-one to make the texture. If you're planning on making large textures, as I've been mentioning for a while, this is a key thing to learn, so, here, I want you to do Textures->New Patch. Fill in the PID for this to 74; this corresponds to its position in PNAMES, so if you need future reference for patch IDs, turn to that lump. Anywho, you should now have a Mario block.

...been there, done that. So now, make another patch (still Textures->New Patch), but this time use a PID of 125. Now you have a Mario block, with one corner with vines on it. Simple, neh?

Repeat that last step three more times, but make the coordinates for each VINE2 (64,0), (0,64) and (64,64) respectively - those should be the other boxes, previously both 0. Now all four corners should be covered with vines. Textures->Save (or try leaving, XWE's pretty good at nagging you about saving). Now you have yet another texture to toy around with.

So, as I've said, you can use this to create REALLY BIG textures. Make it as big as needed - probably tall, if you were making a 256x256 texture - and then just use multiple patches to fill up the black, and you should be fine. Hey, if Zim's Base can do it, why not you?

I'll note that this is why I had you split tall textures up - it creates multiple patches with which you can create a single texture. Tall patches corrupt the bottom-most line of the patch, which is not good by any stretch of the imagination. Thus, two 128-tall patches working together to make one 256-tall texture is BETTER than one single 256-tall patch, but anything smaller can be done just as easily with one patch. Follow? I hope, but do feel free to ask.

---

Now, flats. What level is complete without them? Admittedly I've not done much experimenting here, but mostly everything I've tried thus far works, so bear with me.

Add "F_START". Now, select "Floors" at the list of buttons on the bottom. Now, Entry->Load whatever you want to use as a flat. You'll see the image, but you're not done yet! It's usable, but it'll look all corrupted. a441 often suggested doing some weird hex edit of the lump to get it to look right, but there's an easier and quicker method: Image->Save as Doom Flat. Now it should be on the top left corner instead of the middle; if that occurs, it's a flat now, and assuming the dimensions are 64x64 (maybe 128x128 too, but let's stick with what we KNOW works), you can now use the flat properly in MOO.WAD... well, once you add "F_END".

---

Skies? Make a SKYxx texture, with xx being the number you want (probably "2"), and make it like any other texture. Once you're done, you can use it in your map headers (just set "skynum=xx", or in this case, "skynum=2"). As the picture demonstrates, it does indeed work (see the DOOM sky up there?). That level in MOO.WAD will look plenty nice with a new sky, right?

---

Animation? You got it. You're going to need this pack.

Downloaded that? Good, it contains the command-line program that generates the ANIMATED lump required to have animated textures and flats (XWE won't do this for you, sadly), a very-much outdated .DAT file that tells it how to generate the file (see below for a better one, though I'll note that this is based on an older version of SRB2 - I'll need to go hunting in the source code for the new lump), and a shortcut that will generate the lumps for you.

So how do you tell it to animate things? Easy. Make a copy of the existing DAT file (again, use the stuff provided below, not what's in the ZIP), so you don't mess up the original. Under the appropriate header (depending on if this is a flat or a texture), slap in a new line, and follow the syntax provided by the column names. This is self-explanatory, but just in case, the speed tells the game how many tics to wait before changing frames, the last name tells it which texture is LAST in the loop, and the first tells it which texture is FIRST in the loop (yes, last and first are backwards... get used to it).

That SHOULD be all you have to do... just run SWANTBLS.exe [insert dat name here].DAT and it'll generate ANIMATED.lmp and SWITCHES.lmp. Since SRB2 isn't DOOM, SWITCHES is irrelevant, so just put ANIMATED.lmp into your WAD with XWE and you're all set. (For the record, though, SWITCHES was what determined what a texture's "on" and "off" states were in the original DOOM. You know how the switches worked; this helped make that effect with new textures.)

Anyway, the DAT file you'll need is here, courtesy of Jason. As I said earlier, though, this version is slightly outdated; I'll need to make a new one.

Code:
# ANIMATED defaults for SRB2
# by Jason the Echidna

# Speed is how many tics before the next frame of
# animation. (So a speed of 8 is slower then 2 because
# it waits 8 tics before switching to the next frame.)
# Last is the last frame in the animation.
# First is the first frame in the animation.

# This list is a perfect replica of the one in SRB2's
# source code, right down to the commenting. But I
# took the time to do the boring work of putting it
# in the format below, SO YOU'D BETTER FIND IT USEFUL.

[SWITCHES]
# There are no switches in SRB2.

[FLATS]
#speed  #last    #first
4       NUKAGE3  NUKAGE1
4       FWATER16 FWATER1
4       BWATER16 BWATER1
4       LWATER16 LWATER1
4       WATER7   WATER0
8       SWATER4  SWATER1
8       LAVA4    LAVA1
8       BLOOD3   BLOOD1

#speed  #last    #first
8       RROCK08  RROCK05
4       QUIKSN16 QUIKSN01 # Quicksand
4       CHEMG16  CHEMG01  # THZ Chemical gunk
4       GOOP16   GOOP01   # Green chemical gunk
4       SLIME08  SLIME05
2       THZBOXF4 THZBOXF1 # Moved up with the flats
2       ALTBOXF4 ALTBOXF1

#speed  #last    #first
4       BLUE3    BLUE1
4       GREY3    GREY1

[TEXTURES]
#speed  #last    #first
2       GFALL4   GFALL1   # Short waterfall
2       CFALL4   CFALL1   # Long waterfall
2       TFALL4   TFALL1   # THZ Chemical fall
2       AFALL4   AFALL1   # Green Chemical fall
2       THZBOX04 THZBOX01
2       ALTBOX04 ALTBOX01
4       SFALL4   SFALL1   # Lava fall
2       BFALL4   BFALL1   # HPZ waterfall
4       GREYW3   GREYW1
4       BLUEW3   BLUEW1
4       COMP6    COMP4
4       RED3     RED1
4       YEL3     YEL1

---

Now go, and hopefully you can make some nice textures for us (or at least yourself) to use!

Thanks to hotdog003 for giving me a441's tools, and a441 for making them in the first place; without those, XWE would be as useless as AJ always says it is. Also thanks to JTE for the more-better DAT file for the ANIMATED lump.
 
You're welcome.
XWE isn't useless. It supports Batch Renaming so that making a character is slightly easier.

Thanks for the tutorial, but I'd recommend still using TexTools just to be safe.

Also, there is a better way to do flats:

http://www.sepwich.com/ssntails/mb/viewtopic.php?t=906
In response to Akaira's question said:
Flats are raw bitmaps. There's probably an editor you can use to put them in with, but here's what I do:

1. Flip the image vertically.
2. Save a bmp file (64x64, 128x128, or 256x256 in SRB2's palette).
3. Remove the first 1078 bytes of the file using a hex editor.
4. Insert the file using LumpMod. It doesn't matter what section it's in; you can just put it at the end of the wad file.
 
I don't know why you think that's necessarily better, because it isn't particularly. Using "Save as Doom Flat" will make the thing work just as well; essentially it'll trim the texture and do all that jazz for you, so it'll display correctly in-game. I've only had ONE Flat screw up on me, out of four added, and I don't think I'll have very many more. (Some "reached end of file" error or something similar... I THINK it was displaying okay in SRB2 before XWE started acting up with that 'un. Well, as okay as a 32x32 Flat would, meaning one corner is textured and the others were white.)

That said, if XWE works now, I don't really have much need for TexTools; while TexTools is nice, XWE is easier to use and is just as effective.
 
I've not attempted, but I'm willing to assume it'd work. If you want, you can go ahead and try it. Just be sure we're talking 128x128 or 256x256 here.

As for ANIMATED, I've found a tool (well, okay, the link contains a zip file of MANY tools, and most only really matter for DOOM, but it's there: SWANTBLS.EXE) that will generate it (and SWITCHES, but forget that, that's DOOM stuff). The bad news is, though, that it requires a .DAT file with all the proper animated textures/flats listed to generate properly, and doesn't supply anything to generate it. Once I figure that out and get one working that doesn't rape the game of any and/or all animated textures/flats, I'll be sure to let you know.

I assume all the textures animate at 8 tics-per-frame, like standard DOOM...
 
Yeah, but...

A) If there's a standard DOOM-style switch in SRB2, you all have done a very good job of hiding it, and

B) One of the features of the ANIMATED lump is the ability to modify how fast animations play. 8 appears to be the norm, but for all I know, SRB2 could deviate from that.
 
Don't you think that if animated textures were possible then someone would've tried it?
I'm just saying, it might not be possible, so don't get discouraged if it isn't.
 
hotdog003 said:
Don't you think that if animated textures were possible then someone would've tried it?
I'm just saying, it might not be possible, so don't get discouraged if it isn't.
It is. Remember that Nightclub Rouge entry for a contest WAD oh-so long ago (like, late'03-early '04)? It had an ANIMATED lump, and it worked very well. I mean, it conked out everything else (ie: the water didn't animate or anything else that normally would), but for that one level, it worked like a charm.
 
Yeah, that was why.

Incidentally I found the topic in the Archives, like, January '04's contest. a441 was the one who pretty much spelt it out...

a441 said:
MAP02 - Nightside Rouge Zone by Digiku - 0/10

When I saw all the secret work Digiku had been doing for weeks had culminated in this, I couldn't hide my disappointment. Gameplay is garbage due to the constant shortage of rings (automatics require lots of ammunition), visuals aren't that great either with the lines between floor tiles. I could make this in five minutes with GFZROCK and FLOOR0_3, and it would be better, because there wouldn't be glitchy lines on the floor, it wouldn't be 3 MB, and it wouldn't mess up the animations in all the other maps. (This map's ANIMATED lump, which the contest rules technically don't provide for, is the reason slime, water, and waterfalls don't move when you have the contest wad loaded.)
The WAD's probably still in the add-ons section of the main site, if anyone wants to see it in action. It's pretty tight as far as visuals go.
 
Re: Texture Editing... made easy! And XWE-compatible!

Shadow Hog said:
this is a quick tutorial on how to get custom textures working in SRB2 using XWE.
Noooo! Now everyone can do it! Darn it, first I lose my SOC editing edge, now XWE is a free for all... I had to do all the pnames and texture1 converting for XWE by hand, and now ANYONE CAN DO IT?! :x Darn it... I need to find some new, untouched ground, and fast... Hmm... Digiku's animated flats, eh?... But that makes the others not work? Excellent... I can learn that, and for five more minutes I'll still know more then anyone else...
 
Oh, we're catching up to you, JTE. Even though you try to deny it, we're slowly catching up...

But, I'm sure that you will come up with something new and bright that nobody else has thought of... like a new way of fake slopes, or FOF wind or something like that...
 
Re: Texture Editing... made easy! And XWE-compatible!

Jason the Echidna said:
Shadow Hog said:
this is a quick tutorial on how to get custom textures working in SRB2 using XWE.
Noooo! Now everyone can do it! Darn it, first I lose my SOC editing edge, now XWE is a free for all... I had to do all the pnames and texture1 converting for XWE by hand, and now ANYONE CAN DO IT?! :x Darn it... I need to find some new, untouched ground, and fast... Hmm... Digiku's animated flats, eh?... But that makes the others not work? Excellent... I can learn that, and for five more minutes I'll still know more then anyone else...
You don't need to know more than everyone else to have bragging rights. Just producing consistently good work will usually do the trick.

Besides, the idea's to get as much information out to the public as possible, not to hoard it all for one's self. You'll find sharing how to do things with people will make you more popular than doing that.
 
hotdog003 said:
Oh, we're catching up to you, JTE. Even though you try to deny it, we're slowly catching up...

But, I'm sure that you will come up with something new and bright that nobody else has thought of... like a new way of fake slopes, or FOF wind or something like that...

FOF wind is already possible, it's a water current inside an intangible FOF.
 
The good news: I have the ANIMATED lump generation thing working, so it won't be long now before I release that too, pretty much completing the texture-editing side of things.

The bad news: 8 was too slow, everything was noticably moving in slow-motion based on that one. Looks like I'll have to figure out just what it was...

---

Edit: Okay, by now it, while probably not 100% accurate, is at a point where the difference will be negligible. I'll update the first post with the link and another quickie tutorial in a short while...
 
hotdog003 said:
something new and bright that nobody else has thought of... like a new way of fake slopes, or FOF wind or something like that...
Using wind to make fake physics on a steep slope. If I add to SPMoves, I will make a type of wind that only works when you touch the floor so that it seems as though you are gently falling backwards down the hill and such or speeding down forwards... Instead of using a sticky, that would also push you downwards so that it is even more accurate (well, slightly anyway).
Shadow Hog said:
Besides, the idea's to get as much information out to the public as possible, not to hoard it all for one's self. You'll find sharing how to do things with people will make you more popular than doing that.
I know, I do that for my own projects. I wrote up a large tuteral on how to make an SPMoves bot via SOC edits when that still worked... But everyone will already find out the other stuff anyway, so I'd like to keep it as long as I can. I dunno, right now I can't think too well for you, sorry.
Shuffle said:
FOF wind is already possible, it's a water current inside an intangible FOF.
Yep, I already 'invented' that... Thanks for not noticing -_-'
 
Since I've been getting alot of people asking about texture adding in #srb2fun, I'll just add this little summary for textures:

NOTE: Do all of the steps in the order that I say them.

Add PNAMES and TEXTURE1 into your wad.
Make a lump called P_START, don't put anything in it.
Add in your textures.
Make a lump called P_END, don't put anything in it.
Right click each of your textures, click "Add to Patch Names", then click "Add to Texture".

And that's it, you're done.
 
Status
Not open for further replies.

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top