Heretic Resource Pack Problem
So I downloaded a resource pack for Heretic. It comes with high res textures, models, particles, redone weapons, all that good stuff. There is a big problem though and I've had this before when I played with a resource pack years ago. Ok here's an example. When I have the crossbow and Im firing there's nice particle effects on the arrows as they travel. When I'm in a large area however the particles dont exist and only the 3d model of the arrows. The big problem is that some of the enemies only throw 3d model objects and in a large area become invisible. So the only thing I can see coming is a flare. It's really hard to explain this. I provided a link to 2 screenshots side by side. You can see what I'm talking about then. Anyone else have this problem or seen this before? Any help is much appreciated!
https://sites.google.com/site/c1rcu1tn3 ... edirects=0
-Matt
https://sites.google.com/site/c1rcu1tn3 ... edirects=0
-Matt
Comments
A few off the top of my head: the old gargoyle (not the one I put out), the Disciple of D'Sparil, the Ophidian (probably the worst one), the Iron Lich whirlwind, and others which I forget. I tried to go through systematically and fix them once, but I ended up not fixing it and so there are probably generators in odd places like perhaps the teleport (I haven't look at it) and such places that I had not seen. Go ahead and see what you can do, and thank you for volunteering your help!
In any case, it's when state-based generators have a -1 max age and especially are static. The "static" flag means that they will not be destroyed by other generators, and the -1 max age means they will not run out during the level, which is actually GOOD for mobj-based and flat-based generators! The problem is that each time a state occurs, a state-based generator is made, and so if you have a bunch of unlimited state-based generators, it will only take 128 states to break it. That is, I think there are 128 maximum generators at one time, anyway... The trick would be to have only one generator for all instances of the map object in question, rather than a million state-based ones.
Here's an example from M-Ophidian.pk3 - more specifically, Snake-Projectile.ded:
I'll deal with the first generator, the ' State = "SNAKEPRO_A1"; ' one.
To make it a mobj-based generator, you would change the type by specifying "mobj" rather than "state"; also, if defining flat-based, you would define it by "flat":
Now, then! It's important to remember that, if you're changing from state- to mobj-based generators, that they will always be in effect, so if you're trying to make an exact change over, you'll have to mess with some values. For instance, see how there are two generators, one for each of the projectiles. Now these are generated each time the first state of each missile occurs. (you can check the objects.ded for reference on the objects and their respective states and the game tics for each one of them, etc.) So you'd have to calculate what the new spawn rate should be for the state. The current spawn rate is 3:
According to objects.ded, the Thing, "SNAKEPRO_A" has four states, SNAKEPRO_A1 - SNAKEPRO_A4, and they are each 5 tics in length, looping. So you have five tics of generation each loop with state-based, being that it's based on only one of the states. All together, it's 20 tics, and so the 5 tics of SNAKEPRO_A1 at a Spawn rate of 3 makes 15 particles each cycle of states. Thus, it's 15/20, which is 3/4 or 0.75.
The spawn age for a mobj-based generator is good at -1, because it shouldn't stop generating particles.
Now, the "Particles" line is how many are to be cached to be generated at one time.
The amount should be as follows:
Maximum particle life in tics multiplied by the spawn rate. For mobj-based generators, multiply this by the amount of sources you think should be visible at one time. Tics * Spawn rate * sources.
For this generator, the spawn rate is 3, and the total tics between the two stages is 12. Notice how the second stage isn't defined, but since the stages interpolate, this is obviously meant to cause the first generator to interpolate towards the null-time state in its values. Now, think about it: the Ophidian shoots 3 of these projectiles, followed by a SNAKEPRO_B projectile. That's three sources at a time for each one. What if he's far away and shoots twice? Then that's six! How many do you think you will see at a shooting? 3, 4, or perhaps 5? So 5 * 2 * 3 would be 30 sources max, and the reason I'm not promoting skimping here is because it's replacing the actual model itself. Otherwise, all you see are dynamic lights flying at you!
So 12 Tics * 0.75 Spawn rate * 30 sources = 1,080 particles. So, to make sure you don't have invisible or limited particles, (as particles are evenly distributed and, once the limit is hit, half-way-done particles will disappear and return to start states over) set the particles to 1,080 (or whatever good judgement says in such a case).
Apparently, the particles are used as a soft, plasma-like replacement for the fireball itself, so the model is nullified by defining a blank model for it:
Notice the explosion frames? They are SNAKEPRO_AX1 - SNAKEPRO_AX5. Mobj-based generators will spawn during all states, even during the death states, so it's important to disable the particle generator for a particular thing once it reaches the death states, or whichever other states that it needs to not occur. An example is in the Wight, which has particles for his axe, but not while he throws it! The generator is disabled when he throws it, because it would look dumb if he threw an axe, not holding one, but yet the particles were still being generated!
There is a catch, though: how do you leave the state-based explosion system, which naturally is destroyed since it's not -1 max age and doesn't need to be altered? Well, since it's based on the first frame, just set the particles to stop on the second frame of the explosion - that should be simple enough:
In summary, this is how everything should for the first projectile generator definitions:
Alternatively, you could just take out the static flag and change the max age to 12 (the maximum length of the particles generated)
Do you have a link to the pack you're using - the one I have doesn't exhibit this problems on E5M1 but I suspect I may have an older pack. In any case, I'll compare the one I have to the one referred to here before making any changes to make sure mine is older.
I downloaded the one on this site. I went to "Wiki" on the main page, then to "Addons" and then down to the jHRP link. Are you using the 2004 one? This one is called "jhrp1_01.box_FINALv4"
All seems to work well for me, well into playing the level E5M1.
If there's a mobj-based generator, it doesn't matter how crowded the level gets, there should be no disappearing of generators - the only thing is that there will be a spreading out or halting of active particles to generate new ones if the particle limit is hit, but that can be upped with consideration to general gameplay and all of that. There's got to be a static generator somewhere in the pack you've got that's filling all the spaces for the particle system to get broken like it did. It would be best if all the state-based generators had max ages EXCEPT for the D'Sparil death particles, where it's activated upon a death frame of his (only going to happen once) and it's necessary for it to be state-based for it to occur like it does. I remember that the D'Sparil system had no problem whatsoever, so I was just mentioning that in case it didn't cross your mind about the -1 max age on that particular generator!
I got the pack I'm using from here: http://www.mediafire.com/?tuwc4kdmyun