Back to the Vavoom Forum Archives


Forum

Replacing sprites with MD2 models

Sat, 24 Jan 2004 01:59:15

Catsy

I would like to try my hand at making some MD2 replacements for the sprites in Strife.  Before I put too much work into it, I'd like to have a clearer understanding of how this is done on the Vavoom end of things.<br><br>For example, when a player is wielding the chaingun, how does Vavoom know to look for "v_chain.md2" instead of using "CHGxxx" from the Doom WAD file? How does Vavoom know to look for the models in the "imp" directory instead of using the "TROOxxxx" sprites?
Sat, 24 Jan 2004 02:50:57

Janis Legzdinsh

Very simple. In states list (i.e. animation and stuff) there's specified which sprite to use and also optionally which model to use. It's all in the progs script files. Download the progs source code and see how it's specified.
Sat, 24 Jan 2004 03:18:54

Catsy

Okay, I downloaded the source progs and I see where the MD2 models are specified for each sprite. I'm not sure what all the parameters in the "__states__" section mean, but it shouldn't be difficult to figure it out through trial and error--although if you have any notes or docs on that, it'd be welcome. (Edit: I just found the States tutorial on the main page. That answers some of my questions about the format of this section. Moving on...)<br><br>However, I'm unclear on how to actually implement my changes. Let's say I've created a model for the Medical Kit. I open up MedicalKit.vc, and it has the following information for states:<br><br>
__states__<br>{<br>      S_MEDICAL_KIT('MDKT', 0, -1.0, S_NULL) { }<br>}
<br><br>Assuming it's only a single frame, I should change it to something like this:<br><br><br>
__states__<br>{<br>      S_MEDICAL_KIT('MDKT', 0, 'items/medkit.md2', 0, -1.0, S_NULL) { }<br>}
<br><br>Then, presumably, compile it using vcc. Do I just compile the one file (just tried it--vcc complains with errors), or recompile the entire game? And once recompiled, then what?<br><br>I'm sorry if it sounds like I'm asking to have my hand held here, but there just really isn't any documentation on any of this. Please don't take that as criticism, because it's not--I understand that you're busy and that writing technical manuals is tedious and time-consuming.<br><br>
Sun, 25 Jan 2004 12:37:24

Catsy

I think I've figured out what I need to do, I just... can't seem to get it to work.<br><br>By playing with WinTex, I discovered that in the wad0.wad for each game, there are lump entries named SVPROGS and CLPROGS, the sizes of which correspond exactly to the .dat files that the compile.bat for each game outputs. Seems logical enough--just compile my changes, and replace the entry in the IWAD with the changed lump file of the compiled progs.<br><br>Except it's not working, and I don't know what I'm doing wrong.<br><br>This is what I've done: in order to test out my theory, I copied the MD2 model of the Doom stimpack (stim.md2) and its texture to the same directory under Strife: models/items/. I then altered Strife's MedicalKit.vc file so that the state was as follows:<br><br>
__states__<br>{<br>      S_MEDICAL_KIT('MDKT', 0, 'items/stim.md2', 0, -1.0, S_NULL) { }<br>}
<br><br>Except for the "S_MEDICAL_KIT" and "MDKT", this is identical to the Stimpack entry in Doom.<br><br>I then compiled the lump and inserted it into the IWAD. I ran Strife, and the default sprite appears. Thinking perhaps WinTex wasn't working correctly, I tried copying the dat files into a /progs directory under Strife and running Vavoom in developer mode--same result, default sprites.<br><br>I'm sure I must be doing something wrong here, but I don't know what it is and I've exhausted the information I can glean from the docs and files that come with Vavoom.<br><br>UPDATE: I did it! When I've finished messing around, I'll post a more coherent explanation of what I did so that other people don't have to go through the same trial and error. <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
Sun, 25 Jan 2004 13:35:24

Catsy

Okay, in retrospect I'm not surprised I had so much trouble with this, since what I was really attempting to learn was a number of completely separate things: how to compile progs, how to get vavoom to recognize my changes, how to use WinTex (which I'd never used before), and how to use Vavoom's developer mode.<br><br>I think I've got them all down. Let me tackle them one at a time. This really won't be a good tutorial, but it'll at least help me get my own thoughts in order, and maybe help someone else too.<br><br>Compiling Progs<br><br>Vavoom comes with all the answers I needed to do this--I just had to know what to look for, and change my approach. At first I had approached each script as a distinct element to compile and replace separately, like you would a single sprite or texture. That's not the case. It's better to think of them as modules, as parts of a whole that must be compiled together--because that's exactly what they are.<br><br>When you download and unzip the progs source code, each game comes with a compile.bat in its directory. This batch file compiles the Client Progs and the Server Progs, and outputs them to clprogs.dat and svprogs.dat respectively. So far, so good--but what do you do with them? You can insert them into the game's WAD0.WAD--the WAD entries are CLPROGS and SVPROGS--but let's first test them out without changing anything permanently.<br><br>Testing Your Changes<br><br>In order to test your changes without changing the WAD files, you'll need to use Vavoom's developer mode. The two Vavoom parameters needed are -file and -devgame, and while useful, they take a little bit of explaining.<br><br>First of all, you need to understand that using -devgame supersedes whatever game you've chosen in the Vavoom launcher. If you use -devgame, you'll need to use -file to specify the main IWAD--DOOM.WAD, DOOM2.WAD, STRIFE1.WAD, etc--manually.<br><br>Second of all, you'll need to make a new directory under your basev/<gamename> directory called "progs", and place the clprogs.dat and svprogs.dat files that you just compiled in it. When you invoke Vavoom with -devgame, it forces Vavoom to, among other things, look for those two files in the progs subdirectory before looking for them in the game's WAD0.WAD.<br><br>Finally, it's very important to understand that both -devgame and -file assume the main Vavoom directory as their starting point. If you installed Vavoom to C:\Games\Vavoom, and you're testing changes to Doom (located in C:\Games\Vavoom\basev\doom), you'd use "-file doom.wad" and "-devgame basev/doom/" as the parameters. This was what was tripping me up until I realized what was happening.<br><br>Run Vavoom with these two parameters, and your changes should be applied for that session only--but will not be made permanent. For that, we'll have to modify WAD files.<br><br>Inserting Progs Into the WAD File<br><br>If you're already familiar with importing and modifying resources in WAD files, then you probably don't need to read this--all you need to know is that a game's progs are stored in the WAD0.WAD file located in the basev directory for each game. Just replace the CLPROGS entry with the contents of clprogs.dat, and replace the SVPROGS entry with the contents of svprogs.dat--both are raw lump data. Your changes will then be permanent whenever you play that game with Vavoom, so I'd recommend making a backup of WAD0.WAD first.<br><br>If you don't know how to do this, then I'll give a quick rundown on how to do it with WinTex 4.3. This will assume a very basic familiarity with the program's interface--in other words, that you're looking at it. In order to <br><br>When you Launch WinTex, there will be an "Edit PWAD" button on the lower left. Navigate the directory tree to the right of that button until you find the WAD0.WAD for the game you wish to modify. Double-click on the name of the WAD file, or select it and click Edit PWAD.<br><br>A new window will open, displaying a list of all the entries in this WAD file. CLPROGS and SVPROGS should be at the very top. Click once on the CLPROGS entry to select it. Then open the Edit menu and select Load entry from file. Navigate to the directory where your clprogs.dat file is located, and type in that filename. WinTex will not give you any kind of a confirmation of success, but if there is no error then the contents have been loaded. Now select SVPROGS, and do the same thing for svprogs.dat.<br><br>Note that although WinTex only displays files with the extension of .lmp, you can type in any valid filename and it will load its contents. I recommend making a copy of compile.bat which outputs .lmp files instead of .dat files to make your job easier, if you're going to be doing this a lot.<br><br>The information has been successfully loaded, but because of the way WinTex handles WAD files, all the old information is still in there. You'll need to clean up the WAD file so that it's not wasting space. To do this, go to the File menu and select Cleanup WAD. Once this is done, choose Quid from the File menu, and Yes to save your changes.<br><br>The next time you launch the game, your changes should take effect.
Mon, 26 Jan 2004 17:05:16

Janis Legzdinsh

Yep, you understood everything correctly. BTW there's also -progs option that enables to test progs easier than using -devgame option.
Tue, 27 Jan 2004 07:34:47

gunrock

Catsy well done! but my problem is after i compile the progs and put them into my custom game progs folder just as Casty did, just for the test change. and fire up the vavoom launcher i get this message :<br><br> Bad class size, class thinker, C++ 36,vavoomc 32)<br> Stack trace: TProgs::Load <-SV_ lnit <-Host_lnit<br><br>What am i doing wrong here?
Tue, 27 Jan 2004 16:24:52

Janis Legzdinsh

Most likely you are trying to use progs from older version.
Thu, 29 Jan 2004 03:28:32

Catsy

Okay, new problem. I've successfully created new models for the Medical Kit, Med Patch, and Surgery Kit in Strife. I successfully changed MedicalKit.vc to point to the new model, and it works in-game. However, when I try to change MedPatch.vc to point to that model, I get strange results.<br><br>My models and modified progs are here: <!-- m --><a class="postlink" href="http://ayashi.net/foo/strfmeds.zip">http://ayashi.net/foo/strfmeds.zip</a><!-- m --><br><br>When I compile and test with the MedKit only, it works fine. When I compile and test either with the MedPatch only, or with both, the MedKit sprite is replaced with the MedPatch model, while the MedPatch sprite remains unchanged.<br><br>If this isn't making sense to you, try making a models/items directory under basev/strife, put my two models in there, and try compiling with the changed progs.<br><br>Am I doing something wrong here, or is this a bug?<br><br>Edit: More strange behavior--I was standing in the hospital, which has examples of all three health items on the back shelf, and I noticed something else which happens when a model is added to MedPatch.vc: the SurgeryKit takes on the model of the MedicalKit for one frame, after which it reverts to the SurgeryKit's correct animation.<br><br>This /only/ occurs when an MD2 model is added to the states in MedPatch.vc.<br><br>Edit again: I've narrowed down the problem, but I'm no closer to a solution. In fact, I'm even more confused. This problem with MedPatch.vc only seems to appear when I'm looking at the health items on the back shelf of the Hospital. All other items I've seen so far--the medkits at the beginning of the level, the medpatch by the entrance to sanctuary--display the correct models.
Fri, 30 Jan 2004 17:12:05

Janis Legzdinsh

Really nice work. And that problem was because of the savegame, as you already guessed.<br><br>BTW when you have new ones, I'd be happy to see them.
Mon, 02 Feb 2004 09:45:31

gunrock

I still don't get it, Cause i downloaded the new 1.15progs and still got the same error message!<br>What am i missing ???
Mon, 02 Feb 2004 16:47:30

Janis Legzdinsh

Check that Thiker class in common/server has a XLevel property.
Wed, 04 Feb 2004 23:35:32

gunrock

okay i checked it here's what i got:<br><br><br>class Thinker:Object<br>      native<br>      abstract;<br><br>Level XLevel;            //      Level object.<br><br>void Tick(float deltaTime)<br>{<br>}<br><br>void Archive(void)<br>{<br>}<br><br>void Unarchive(void)<br>{<br>}<br><br>defaultproperties<br>{<br>}<br><br><br><br>What i'm doing is compiling the doom2 hack strings.vc<br>i'm i compiling it wrong? should i send it to you so you could compile it for me?<br>
Thu, 05 Feb 2004 16:28:40

Janis Legzdinsh

Ok, send them to me and I'll see what's wrong.
Fri, 06 Feb 2004 11:59:34

gunrock

okay sending it to you now.
Fri, 06 Feb 2004 17:17:13

Janis Legzdinsh

It seams fine. Can you get unmodified progs to work. Maybe it loads progs from somewhere else.
Tue, 02 Mar 2004 08:31:09

gunrock

okay i'm back at trying to get progs working for me again! the only thing i can figure out is that i can't seem to compile the progs right. when i ran hack.bat that worked but when i compile it i get this message:<br><br>c:\doom2\vavoom\progs\hack_d2> vcc -I../common -<br>I/doom/client clprogs<br>bad command or file name<br><br><br>c:\doom2\vavoom\progs\hack_d2> vcc -I../common -<br>I/doom/server svprogs clprogs<br>bad command or file name<br><br><br>c:\doom2\vavoom\progs\hack_d2><br><br><br>let the games begin!! ;D<br><br><br><br><br><br><br>
Tue, 02 Mar 2004 16:41:08

Janis Legzdinsh

The simplest thing is to put vcc in the directory where you're compiling.
Wed, 03 Mar 2004 00:23:36

gunrock

alright! as soon as i placed vcc in the doom2_hack folder<br>i ran compile on it and once again more errors >:(<br><br><br>Call frame traceback EIPs:<br>  0x00017f99<br>  0x0001ed98<br><br>C:\Doom2\Vavoom\progs\hack_d2>vcc -I../common -I../doom/server svprogs<br>Exiting due to signal SIGILL<br>Invalid Opcode at eip=00017f99<br>eax=ffffff5f ebx=00000000 ecx=6f4ba005 edx=000000a0 esi=0002e750 edi=000000a0<br>ebp=000f9e08 esp=000f9dd0 program=C:\DOOM2\VAVOOM\PROGS\HACK_D2\VCC.EXE<br>cs: sel=00af  base=82f1e000  limit=000fffff<br>ds: sel=00b7  base=82f1e000  limit=000fffff<br>es: sel=00b7  base=82f1e000  limit=000fffff<br>fs: sel=0087  base=00009f80  limit=0000ffff<br>gs: sel=00c7  base=00000000  limit=0010ffff<br>ss: sel=00b7  base=82f1e000  limit=000fffff<br>App stack: [000f9e28..00079e28]  Exceptn stack: [00079d84..00077e44]<br><br>Call frame traceback EIPs:<br>  0x00017f99<br>  0x0001ed98<br><br>C:\Doom2\Vavoom\progs\hack_d2><br><br>i'm still in the wrong.
Wed, 03 Mar 2004 04:52:06

Janis Legzdinsh

I just remembered that all this DeHackEd stuff hasn't been updated and is not working right now.
Wed, 03 Mar 2004 07:08:55

gunrock

dang! oh well i guess i'll have at it once you update it.<br>in the meantime i'll focus on completeing my project.
Wed, 03 Mar 2004 16:26:52

Janis Legzdinsh

I also would like to see your project completed.
Tue, 09 Mar 2004 02:55:17

cain

Hi...<br><br>I have the project to port all of my model to the vavoom egine to an future support for the " Scattered Evil "<br>frome Korax' heritage...<br><br>I just want to know...Vavoom egine are support the Alpha channel and Png ..?<br><br><br>-|- Cain -|-
Tue, 09 Mar 2004 16:52:57

Janis Legzdinsh

Yes, Vavoom does support skins with alpha channel. Vavoom doesn't suport png files, you must convert them to tga files.

Back to the Vavoom Forum Archives