Upsidedown Tentacle Challenge

Discussions about Coding and Scripting
MrLoathsome
Inhuman
Posts: 958
Joined: Wed Mar 31, 2010 9:02 pm
Personal rank: I am quite rank.
Location: MrLoathsome fell out of the world!

Upsidedown Tentacle Challenge

Post by MrLoathsome » Tue Oct 20, 2015 4:03 am

Post by PrinceOfFunky » Tue Oct 06, 2015 3:58 am
JackGriffin wrote:
OK, now take it as a challenge. Can you make a tentacle that spawns upside down and works online? I briefly tried and I was very surprised at how hard it was to do.
I'm not saying that actors would act like a charm if you change gravity, obviously a tentace couldn't spawn upside down, any other actor neither. But this is cause position, rotation etc are hardcoded inside Unreal Engine, if you want to spawn a tentacle upside down, you would need to create a new tentacle class that acts totally indipendent from the "physic" laws of UE.
Except if you want to try to force an actor to spawn upside down(obviously, without setting the mesh to be upsidedown), without re-creating its class, there you would need to add some "laws" or replace them or override them. And as you obviously know, these laws are hardcoded, sometime as native.
Native levels indeed the values are clobbered at. Did a bit of testing on this the last week.
Pretty sure more than one of the native functions reset things.
Rotation.Pitch specifically.

The same values also get clobbered numerous places in the ScriptedPawn source, both in functions and
the state code. I tweaked every function that called SetRotation, and most of the ones that changed DesiredRotation.
No joy.

I was however able to get the thing to flip in some situations. PlayDying for one.

Here is a bit of code that will make that happen:
(I even added 2 comments to it, just for this post. :tu: )

Code: Select all

function PlayDying(name DamageType, vector HitLocation)
{
	local Rotator newRot;

	newRot = Rotation;
	newRot.Pitch += 32768;       // Pawn will flip 180 degree's from whatever Rotation it had when the function is called
//	newRot.Pitch = 32768;        // Pawn will land flat on surface
	DesiredRotation = newRot;
	SetRotation(newRot);
	PlaySound(Die, SLOT_Talk, 4 * TransientSoundVolume);
	PlayAnim('All', 0.125+(3.0 * FRand()), 0.1+FRand());
}
Note this example differs slightly from what I saw in the Legacy Wiki on vectors/rotation as it did NOT work
unless I had set DesiredRotation. (It would rotate em only about 90 degrees....)
Dunno if that is specific to tentacles, or ScriptedPawns or what, but thats what happened.

Should be releasing a working flying tentacle pawn soon, that will be upsidedown sometimes.
It will be using the above function. The PlayAnim makes em squirm upsidedown and cycle thru every
animation they can do at a random speed. It is cool. 8)
blarg

User avatar
papercoffee
Godlike
Posts: 9653
Joined: Wed Jul 15, 2009 11:36 am
Personal rank: coffee addicted !!!
Location: Cologne, the city with the big cathedral.
Contact:

Re: Upsidedown Tentacle Challenge

Post by papercoffee » Tue Oct 20, 2015 11:00 am

Upside down team-Tentacles?
Instead of team-Cannons... :mrgreen:

User avatar
editor Dave
Inhuman
Posts: 904
Joined: Mon Mar 10, 2008 6:40 pm
Personal rank: Slave of SP Mapping
Location: Germany/Bavaria

Re: Upsidedown Tentacle Challenge

Post by editor Dave » Tue Oct 20, 2015 7:07 pm

This would be fun to use. If you place the Tentacle in grass for example, it will catch you off-guard for sure! :o
Image
10-Year Anniversary on Jun 08, 2019.

User avatar
PrinceOfFunky
Godlike
Posts: 1125
Joined: Mon Aug 31, 2015 10:31 pm

Re: Upsidedown Tentacle Challenge

Post by PrinceOfFunky » Tue Oct 20, 2015 10:58 pm

Why doesn't it work to me? :(
"Your stuff is known to be buggy and unfinished/not properly tested"

JackGriffin
Godlike
Posts: 3766
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

Re: Upsidedown Tentacle Challenge

Post by JackGriffin » Wed Oct 21, 2015 12:21 am

If you guys want I'll make a truly upside down tentacle but it's going to need to be fully recoded and not a tentacle extension. Loath is right, you'll have to step completely away from the engine with this to make it work.
So long, and thanks for all the fish

User avatar
EvilGrins
Godlike
Posts: 7186
Joined: Thu Jun 30, 2011 8:12 pm
Personal rank: God of Fudge
Location: Palo Alto, CA
Contact:

Re: Upsidedown Tentacle Challenge

Post by EvilGrins » Wed Oct 21, 2015 7:11 pm

I gave this a try once · viewtopic.php?p=66155#p66155 · with no luck, though it was more of a sideways thang.
http://unreal-games.livejournal.com/
Image
medor wrote:Replace Skaarj with EvilGrins :mrgreen:
Smilies · viewtopic.php?f=8&t=13758

MrLoathsome
Inhuman
Posts: 958
Joined: Wed Mar 31, 2010 9:02 pm
Personal rank: I am quite rank.
Location: MrLoathsome fell out of the world!

Re: Upsidedown Tentacle Challenge

Post by MrLoathsome » Fri Oct 23, 2015 3:24 am

JackGriffin wrote:If you guys want I'll make a truly upside down tentacle but it's going to need to be fully recoded and not a tentacle extension. Loath is right, you'll have to step completely away from the engine with this to make it work.
3 days ago, I would have agreed with that completely.
The model/mesh needs to be inverted for duplicate upside down tentacle to be created easily.

Today, I am not so sure..... :shock:

After a few days away from it, I messed with my little flying tentacle project some today.
The merging & tweaking of the default Manta and Tentacle code is working far better
than I expected. As is my attempts to get them to flip.
Been trying to work with the engine rather than fight it....
Have discovered that in some of the functions related to the playing of animations
you need to do the exact opposite tweak you would expect to get the desired result.

I can get them to wait upside down, die upside down and fly around some upside down.
Current version they only are in the normal orientation when they are actively attacking
or pursuing something. Which works perfect for these flying tents.*
But would break stationary upside down ones completely.....

When I get the flying tentacle thing done, and the code cleaned up a bit I will post
some snippets here relating to the upside down stuff.

Inverted stationary tentacles are still unlikely, but I am getting an idea or 2....

If I can get these to sit and wait upside down on the floor, until they detect a
player and start flying, that might be close enough.
Imagine a map, with a big cavern or lots of caves, with some normal tents on the ceilings, and
then some on the floor. The ones on the floor flip and fly after any enemy when disturbed.
That might just work ok as is.

*Edit. bFlipMode will be a default option when the flying tent is released.
These things shoot at you while charging, and can also do sting damage on contact.
If I update the Freaking Sharks after this is done, they will have freaking laser beams attached
to their freaking heads.
blarg

User avatar
editor Dave
Inhuman
Posts: 904
Joined: Mon Mar 10, 2008 6:40 pm
Personal rank: Slave of SP Mapping
Location: Germany/Bavaria

Re: Upsidedown Tentacle Challenge

Post by editor Dave » Fri Oct 23, 2015 8:49 am

Actually, I still can't imagine a flying tentacle (like without wings). But I'm looking forward to seeing your result!
Image
10-Year Anniversary on Jun 08, 2019.

JackGriffin
Godlike
Posts: 3766
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

Re: Upsidedown Tentacle Challenge

Post by JackGriffin » Fri Oct 23, 2015 11:45 pm

If you really wanted to do this right, you should go ask Iniquitous for his barnacle model and import it into UT. His has a hanging 'tongue' that can grab you and lift you into it's jaws (think more of a squid action). Link: http://unreal.shaungoeppinger.com/barnacle-monster/
Ini is a fantastic dude and I'm totally confident he'd give you the models and everything if you asked.
So long, and thanks for all the fish

Higor
Godlike
Posts: 1795
Joined: Sun Mar 04, 2012 6:47 pm

Re: Upsidedown Tentacle Challenge

Post by Higor » Sat Oct 24, 2015 5:03 am

Really it's that much of an issue?
ImageImage
Image unreal://23.111.157.138:7777
Image unreal://46.228.199.205:7788

MrLoathsome
Inhuman
Posts: 958
Joined: Wed Mar 31, 2010 9:02 pm
Personal rank: I am quite rank.
Location: MrLoathsome fell out of the world!

Re: Upsidedown Tentacle Challenge

Post by MrLoathsome » Sat Oct 24, 2015 11:03 am

Higor wrote:Really it's that much of an issue?
Well, there is no "issue" really. :roll:

There was some discussion in another thread somewhere recently regarding the
weirdness that occurs if you try to force the tentacle model to be upside down.

Just thought I would share some of the related stuff I was noticing while working
on my little flying tentacle project.

@Jack. That barnacle pawn is interesting, but that would probably be a separate thing.

For this project I am attempting to see how I can use the existing models/meshes etc.
and code to create a "Newish" pawn that is still 100% Unreal.
I am trying to modify the stock code as little as possible for this.
Although a number of functions and a bit of state code are being tweaked a bit, at this
point I have only added 1 new function and 1 new variable.
I have looked at zero 3rd party code while working on this. Nothing but the default scripts.

Actually, I haven't looked at anybody's code other than Epics and my own for a long time now.
Since the TWT_Zombies project even several years back.

*Edit:
@PaperCoffee: If I do this right, these will work fine with any type of team monster mod or gametype out there. Just another ScriptedPawn.

@Editor_Dave: As of tonight, I do have them waiting inverted on the ground with the flat tentacle pancake waiting animation until disturbed.
Then they get up and attack. It is cool.

Gonna hijack my thread now and post 1 line of code that sort of shows how I am attempting to approach things lately.
K.I.S.S.

1st step I did with this project was just to slap the Tentacle mesh onto a Manta. It did not fire projectiles and only had the Manta's
bump/sting attack functioning.
Ran into a minor issue when I first added the Tentacles projectile to the thing. They would shoot themselves sometimes, usually
when turning/changing direction. Accessed none on ScoreKill. Unacceptable.
Default Tentacles cannot damage each other, but these flying ones should be able to when appropriate.
And since these are technically Mantas in a Tentacle mesh, the default check fails anyway for that reason.

A number of solutions came to mind, all of which involved either adding extra checks and code to the functions involved with firing the projectile, or
altering the location the projectile fired from. Either of which added extra code, and still had some issues.

Decided the best solution was to change this 1 line in the TentacleProjectile.uc code:

Code: Select all

		if ((Tentacle(Other) == None) && (TentacleProjectile(Other) == None))
to this:

Code: Select all

		if ((Other != instigator) && (TentacleProjectile(Other) == None))
Now, they cannot shoot themselves, but they can damage other tentacles with stray shots.
And if they decide to fight each other or default Tentacles, it will work right.

Not only does the above change fix all my little issues, it should be faster as it has 1 less typecast involved.

That's how you should tweak UT code.
blarg

User avatar
sektor2111
Godlike
Posts: 4625
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Upsidedown Tentacle Challenge

Post by sektor2111 » Sat Oct 24, 2015 11:14 pm

MrLoathsome wrote:They would shoot themselves sometimes,
Is even often because if you look well at projectile rules they are done to not damage class (NOT SELF) the mostly. In this way you cannot have team monsters too efficient because SkaarjProjectiles won't damage other Skaarj - FireOffset + mesh are total crap. I saw this first time when I was working at better SlithProjectiles. Sliths were damaging themselves but they normally won't suffer based on their immunity. Because I WANT different monsters in different teams I have rewritten some rules, a good example is Krall, when fire it stops charging firing between steps (DesiredSpeed = 0) So I have added this tweak at Slith and it was stop being retarded. For Tentacle probably you need to take in account fireoffset for default and computing it in reverse. Changing meshes is not an answer especially if default codes are calling an unexistent mesh. And yes, it's a challenge to make this things fully functional as long as there are relations between these states. I think you understood why I was doing replacements for stock creatures and I intend to setup more replacements...

JackGriffin
Godlike
Posts: 3766
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

Re: Upsidedown Tentacle Challenge

Post by JackGriffin » Sun Oct 25, 2015 2:31 pm

Meshswapping is cheating. You aren't really making an upside down tentacle, just another monster in a halloween costume.
Image

It's quite hard to truly do, isn't it?
So long, and thanks for all the fish

MrLoathsome
Inhuman
Posts: 958
Joined: Wed Mar 31, 2010 9:02 pm
Personal rank: I am quite rank.
Location: MrLoathsome fell out of the world!

Re: Upsidedown Tentacle Challenge

Post by MrLoathsome » Mon Oct 26, 2015 9:01 am

sektor2111 wrote:
MrLoathsome wrote:They would shoot themselves sometimes,
Is even often because if you look well at projectile rules they are done to not damage class (NOT SELF) the mostly. In this way you cannot have team monsters too efficient because SkaarjProjectiles won't damage other Skaarj - FireOffset + mesh are total crap. I saw this first time when I was working at better SlithProjectiles. Sliths were damaging themselves but they normally won't suffer based on their immunity. Because I WANT different monsters in different teams I have rewritten some rules, a good example is Krall, when fire it stops charging firing between steps (DesiredSpeed = 0) So I have added this tweak at Slith and it was stop being retarded. For Tentacle probably you need to take in account fireoffset for default and computing it in reverse. Changing meshes is not an answer especially if default codes are calling an unexistent mesh. And yes, it's a challenge to make this things fully functional as long as there are relations between these states. I think you understood why I was doing replacements for stock creatures and I intend to setup more replacements...
Well, the reason that started happening is because, as Jack pointed out, these things are just Mantas with a Tentacle costume.... :roll: :what:
That was a good thing, as it made me look closer to find where the best place to address this problem was at. The Projectile itself.

That line of code could easily be modified to not damage others of the same class, make it optional via default var, or just do reduced damage on them.
But none of those should be modified at either the projectile level or the pawn itself, if you want the pawn to be compatible with everything.

Probably the best plan is exactly what I have, that way if you run the pawn with any team monster mods or gametypes, they will be able to fight
others of the same class, but not damage themselves. Any other options would and should be controlled by mutator/mod or gametype code.

Haven't looked at the code for the other ScriptedPawns and their projectiles in any detail lately, they may require different methods to correct any issues.

Of course you can't just change meshes without fixing all the default code that references any of it.... :loool:
For the Freaking Shark thing I did a few weeks back, that is exactly as Jack would call it, a Fly wearing a Shark costume.
Other than tweaking the code so there were no errors and the animations were synced up right, that was easy.

Considerably more code is being modified for this flying tentacles pawn.
You will not play with these and think "This is just a Manta with a Tentacle texture on it".

@Jack. That last post almost sounded like a real challenge. :shock:

I suspect most or at least some of the stuff I have been doing to the TentaFly's will also work
on real Tentacles as far as flipping them. Not sure as I aint tried that yet. I wanna get the
TentaFly's working right first.

I ain't done yet..... :satan:

I also haven't tested the dev version of this online, so it all may fall apart at that point. (At least the upside down parts....)
They will still be flying tentacles eventually in one form or another. And maybe upside down ones. Perhaps. Maybe....

(Is TentaFly a good name for them? Mantacle didn't sound right at all..... :lol2: )

Edit: They can swim too. Flying is optional.

Edit2 (11/13/15): I have upside down Tentacles working now.
Key was a call to SetPhysics in the base TakeDamage function.
This was flipping them back to normal orientation every time.
I found a way to fix this without breaking or even modifying TakeDamage
that seems to be working. Tested ok with U1 and UT online yesterday.

Will post a demo version here in just a few days.

These will be a separate pawn from the Flying Tents.
Both will be included when I release something final.
Possibly a 3rd version also. A "Walking" Tentacle.
All of them will be "Real" Tentacles. bIsA("Tentacle") = True;
blarg

MrLoathsome
Inhuman
Posts: 958
Joined: Wed Mar 31, 2010 9:02 pm
Personal rank: I am quite rank.
Location: MrLoathsome fell out of the world!

Re: Upsidedown Tentacle Challenge

Post by MrLoathsome » Fri Nov 13, 2015 11:25 am

I am double-posting and necro-bumping this thread so you can all read
my cool edit to the above post.

Sadly I will now be banned for breaking the forum rules, so none of you
will ever get to see the cool Tentacles I have been working on. :loool: :mrgreen:
blarg

Post Reply