Page 1 of 1

This fish flies

Posted: Mon Oct 21, 2013 12:24 pm
by Mr.Man
http://pastebin.com/3nvvnhGy

This shark should stay underwater, since the code is added. Anybody know why it doesnt?

In case you need it, the water texture for the surface is SUNWATER

RE: This fish flies

Posted: Mon Oct 21, 2013 12:36 pm
by Ivan
Try to add more force to the Thrustthingz, like making it 12.

RE: This fish flies

Posted: Mon Oct 21, 2013 1:17 pm
by Ænima
A_JumpIf isn't working because you're calling it on an inventory item. It needs to be called from the actor itself.


Btw I made a shark using the exact same method 5 years ago for the original Mercenaries, however I found that the constant A_JumpIf calls eat a lot of bandwidth, so be aware of that.

RE: This fish flies

Posted: Mon Oct 21, 2013 1:27 pm
by Ivan
Now that I think of that, there's a much less bandwidth eating method available. Why don't you place lots of blocking actors at the area where there should be water, on the surface sort of like sprite bridges, but with every other thing having THRUSPECIES so that they can go through it but things that should stay underwater don't? Potentially less bandwidth eating too, since they won't require any constant action calls or sprite drawing.

RE: This fish flies

Posted: Mon Oct 21, 2013 1:34 pm
by Mr.Man
That requires alot doesnt it. Could you show me the way you did it Ænima?

RE: This fish flies

Posted: Mon Oct 21, 2013 1:41 pm
by Ivan
Mr.Man wrote: That requires alot doesnt it.
Not at all! Since you want to be able to shoot things underwater, all you need is the SOLID flag which eliminates the hitscan blockage problem. Next is adding the "Species" property and "THRUSPECIES" flag to the projectiles and actors that you think should go through the water, such as rockets or the player himself.

Of course if the project is not aimed for online play, then I guess Aenima's method is easier to handle.

RE: This fish flies

Posted: Mon Oct 21, 2013 1:49 pm
by Mr.Man
To be honest, i dont get it. I'm not understanding what you mean, must be a beginner problem. Could you make a wad/pastebin giving what i need?

RE: This fish flies

Posted: Mon Oct 21, 2013 2:03 pm
by Ivan
Mr.Man wrote: To be honest, i dont get it. I'm not understanding what you mean, must be a beginner problem. Could you make a wad/pastebin giving what i need?
First, do you know how sprite/texture bridges work?

Second, do you know what "Species" and "THRUSPECIES" are? If not; well I would link pages from Zdoom wiki but it seems to be inaccessible to me atm, with a 502 gateway error...

Anyway, the basic principle is this. Do you know the bridge actors on Doom Builder (2)? Basically, you put an "edited" version of those on the surface of the water sector, to cover the entire sector. With "edited", I mean these added to it;

Code: Select all

Species "WaterBlock"
+SOLID
+THRUSPECIES
Obviously, you do not give these properties to the actors you want to be blocked by this actor. However, the SOLID flag is necessary so that the actors that are meant to be blocked actually get blocked by this. The good thing with this is the height and radius parameters can be adjusted on your end, therefore you can prevent problems like the parts of the shark peeping through the water, creating a somewhat silly look for half of the shark to appear there, or a bug where the shark constantly goes up and down on the surface of the water.

The thing with the SOLID flag is that, all projectiles will actually be blocked by it. Therefore, any projectile you wish that should go through this "blocker" need to have the Species and THRUSPECIES defined as given above. But you do not need to do this for any hitscan type because you know, they go through anything that doesn't have the "SHOOTABLE" flag.

Therefore, the basic principle behind this method is treating the entire water sector as a texture bridge, covering the sector's surface where the water should be with these little actors and providing the necessary properties and flags to make this all work. I could make an example wad, but I do not have the necessary stuff with me as I'm writing this. The entirety of the blocker actor would probably be like this:

Code: Select all

Actor WaterBlocker 10547 // random DoomEd number
{
    Height 4
    Radius 16 // these two numbers can be edited
    Species "WaterBlock"
    +NOGRAVITY
    +SOLID
    +THRUSPECIES
    States
    {
        Spawn:
            TNT1 A -1
        Stop
    }
}

RE: This fish flies

Posted: Mon Oct 21, 2013 2:06 pm
by Mr.Man
Right so height doesnt really matter, but radius? Should this be very high, since i need to cover up a big part?

RE: This fish flies

Posted: Mon Oct 21, 2013 2:06 pm
by Ænima
Mr.Man wrote: Could you show me the way you did it Ænima?
I did it exactly the way you did, except I didn't use an inventory item to run A_JumpIf, i called it directly in the actor's See state.

But when I hosted Merc's v1.9 on a server on that particular map with the sharks, all the players connected would lag *horribly*, to the point where some would get kicked for packet loss.

RE: This fish flies

Posted: Mon Oct 21, 2013 2:07 pm
by Ivan
Mr.Man wrote: Right so height doesnt really matter, but radius? Should this be very high, since i need to cover up a big part?
I'd rather not give it a radius over 48, as the collision detection might become weird after that point.

RE: This fish flies

Posted: Mon Oct 21, 2013 2:09 pm
by Mr.Man
Alright thanks alot.

RE: This fish flies

Posted: Mon Oct 21, 2013 4:44 pm
by Cruduxy
The "eat bandwidth" stuff that happens with swimming-only enemies has a very obvious solution people seem to ignore.. If the actor cant see its target just dont chase -No more checks needed-.. Obviously if you made the most complex ocean map of all time you'll need a better solution but stopping all the checks all together is a pretty safe bet.