[Auto-Guiding Rockets] -- Beta 1
- sektor2111
- Godlike
- Posts: 6411
- Joined: Sun May 09, 2010 6:15 pm
- Location: On the roof.
Re: Auto-Guiding Rockets -- [WIP]
How about talking to a tree ? It sounds more comfortable .
Aside, ladies and gentlemen, mutator with rocket and some... other things looks operational somehow... rockets seems interested to avoid wall in small locations rather than tracking an enemy but at least we don't have a spammer console...
THIS is indeed something and it looks like the dog bow wow was helpful for managing unidentifiable errors - finally indentifiable.
So, Gustavo, you have finally done something operational - THIS is how things must be done...
A few corrections for a later time are also good points.
Aside, ladies and gentlemen, mutator with rocket and some... other things looks operational somehow... rockets seems interested to avoid wall in small locations rather than tracking an enemy but at least we don't have a spammer console...
THIS is indeed something and it looks like the dog bow wow was helpful for managing unidentifiable errors - finally indentifiable.
So, Gustavo, you have finally done something operational - THIS is how things must be done...
A few corrections for a later time are also good points.
Last edited by sektor2111 on Thu Sep 08, 2016 10:45 pm, edited 4 times in total.
Re: Auto-Guiding Rockets -- [WIP]
I dont have a magic chrystal ball sorry, I cant read your mindsektor2111 wrote:How about talking to a tree ? It sounds more comfortable .
- Dr.Flay
- Godlike
- Posts: 3348
- Joined: Thu Aug 04, 2011 9:26 pm
- Personal rank: Chaos Evangelist
- Location: Kernow, UK
- Contact:
Re: Auto-Guiding Rockets -- [WIP]
Thank you sektor. Shame nobody flagged it, and shame that me and Geko missed it.
darksonny, clean your post because It is very offensive. Sektor was out of line, but there is no need to make things worse.
You already self-censored some words but not others. If you don't make it presentable, I will have to edit it.
Gustavo, pay attention to the chaos you create.
There is only so much damage limitation I am prepared to do. I clean up stupid mistakes by companies for money.
Here I do it because I am a mug with a bit of spare time.
darksonny, clean your post because It is very offensive. Sektor was out of line, but there is no need to make things worse.
You already self-censored some words but not others. If you don't make it presentable, I will have to edit it.
Gustavo, pay attention to the chaos you create.
There is only so much damage limitation I am prepared to do. I clean up stupid mistakes by companies for money.
Here I do it because I am a mug with a bit of spare time.
UT99.org House Rules
ChaosUT https://chaoticdreams.org
Your Unreal resources: https://yourunreal.wordpress.com
The UT99/UnReal Directory: https://forumdirectory.freeforums.org
Find me on Steam and GoG
ChaosUT https://chaoticdreams.org
Your Unreal resources: https://yourunreal.wordpress.com
The UT99/UnReal Directory: https://forumdirectory.freeforums.org
Find me on Steam and GoG
Re: Auto-Guiding Rockets -- [WIP]
This forum is your not mine, edit whatever you think its wrong, but please don't put in my mouth anything like that word "phaedophilia" that's your invention (or a lie). For the rest im fine with you decision.Dr.Flay wrote:Thank you sektor. Shame nobody flagged it, and shame that me and Geko missed it.
darksonny, clean your post because It is very offensive. Sektor was out of line, but there is no need to make things worse.
You already self-censored some words but not others. If you don't make it presentable, I will have to edit it.
Gustavo, pay attention to the chaos you create.
There is only so much damage limitation I am prepared to do. I clean up stupid mistakes by companies for money.
Here I do it because I am a mug with a bit of spare time.
- sektor2111
- Godlike
- Posts: 6411
- Joined: Sun May 09, 2010 6:15 pm
- Location: On the roof.
Re: Auto-Guiding Rockets -- [WIP]
I'm not sure if this is a chaos or a lesson in how to properly finish a mutator without mooing snippets. Without this circus for sure Gustavo would not finish his work letting another thread in air. So I'm really glad to see that finally he did something functional. It could be done without so much noise but probably this way was more helpful.
Updates are gonna be welcomed too if they are about to be real not only stories.
Updates are gonna be welcomed too if they are about to be real not only stories.
Re: Auto-Guiding Rockets -- [WIP]
This is thread makes me nothing but smile, that picture of Gustavo is so geniously funny
I want something like that too
I want something like that too
This member can only post when permitted.
- Gustavo6046
- Godlike
- Posts: 1462
- Joined: Mon Jun 01, 2015 7:08 pm
- Personal rank: Resident Wallaby
- Location: Porto Alegre, Brazil
- Contact:
Re: Auto-Guiding Rockets -- [WIP]
So, if you find out some way of detecting the spaciest direction perpendicular to the wall then I'd be glad to code so that the rockets can avoid walls by turning by 90°!sektor2111 wrote:rockets seems interested to avoid wall in small locations rather than tracking an enemy
"Everyone is an idea man. Everybody thinks they have a revolutionary new game concept that no one else has ever thought of. Having cool ideas will rarely get you anywhere in the games industry. You have to be able to implement your ideas or provide some useful skill. Never join a project whose idea man or leader has no obvious development skills. Never join a project that only has a web designer. You have your own ideas. Focus on them carefully and in small chunks and you will be able to develop cool projects."
— Weapon of Destruction
— Weapon of Destruction
- sektor2111
- Godlike
- Posts: 6411
- Joined: Sun May 09, 2010 6:15 pm
- Location: On the roof.
Re: Auto-Guiding Rockets -- [WIP]
Let me introduce a bit of logic because you might follow secondary option as primary, which doesn't looks efficient either.
IF rocket has a direct sight with VICTIM tell me for which reason must be busy with wall, just TRACK the damn target. If target is suddenly hiding or was dodging away of sight, get busy to avoid A WALL because default seekingrocket is tracking target even if a wall will destroy it soon. THAT's the point, too busy with walls, almost ignoring pawns even if they are a perfect target.
These are only my thoughts for that after testing it around 3 minutes, then I have to mention spam. What if 6 players are firing 10 rockets ? This has to be reduced somehow because is not the best thing happening. Else I did not test it VIA net yet...
IF rocket has a direct sight with VICTIM tell me for which reason must be busy with wall, just TRACK the damn target. If target is suddenly hiding or was dodging away of sight, get busy to avoid A WALL because default seekingrocket is tracking target even if a wall will destroy it soon. THAT's the point, too busy with walls, almost ignoring pawns even if they are a perfect target.
These are only my thoughts for that after testing it around 3 minutes, then I have to mention spam. What if 6 players are firing 10 rockets ? This has to be reduced somehow because is not the best thing happening. Else I did not test it VIA net yet...
- Gustavo6046
- Godlike
- Posts: 1462
- Joined: Mon Jun 01, 2015 7:08 pm
- Personal rank: Resident Wallaby
- Location: Porto Alegre, Brazil
- Contact:
Re: Auto-Guiding Rockets -- [WIP]
TRACK the damn target? Ok! I just made a class (NavigationHelper):
Which the autorockets use to track their target:
Unless I'm mistaken and there actually is a path-finding function in the NavigationPoint class.
Problem are the Ac. Nones in the NavigationHelper class (undoubtedly in that for loop... ;_;)...
Code: Select all
//=============================================================================
// NavigationHelper.
//=============================================================================
class NavigationHelper expands Pawn;
var NavigationHelper Next;
var Actor This;
simulated function LoadPathToward(Actor Target, NavigationHelper Root)
{
local NavigationHelper NH;
Next = Spawn(class'NavigationHelper');
Next.This = FindPathToward(Target);
Log(self@"spawned"@Next@"to find path towards"@Target);
for ( NH = Root; NH != None; NH = NH.Next )
if ( NH.This == Next.This && NH != Next )
return;
if ( Next.This == None || Next.This == Target )
{
Next.This = Target;
return;
}
Log(self@"takes next path:"@Next@"with"@Next.This);
Next.LoadPathToward(Target, Root);
}
simulated function Actor Helped()
{
Next.Helped();
Destroy();
return Next.This;
}
Code: Select all
//=============================================================================
// AutoRocket.
//=============================================================================
class AutoRocket expands UT_SeekingRocket;
var() float SeekAcceleration, SeekSpeed, TargetAcquiringRadius, WallAvoidSpeed, WallPredictionFactor, WallAvoidSlowdown, ShootDensity, ShootDistance, ShootDistanceFactor, MinHomePathDistance;
var() bool bShootAtTarget, bIgnoreIgnorers;
var() class<Actor> ProjectileClass;
var Pawn User;
var Actor HomeTarget;
var int Slowdown;
var bool bFoundUser;
replication
{
reliable if ( Role == ROLE_Authority )
User,
Slowdown,
bFoundUser;
}
simulated event bool PercentChance(float Percentage)
{
return FRand() * 100 < Percentage;
}
simulated event Vector EstimateLocation(Actor Other)
{
return Other.Location + (Other.Velocity / VSize(Velocity)) * 0.5;
}
simulated event HomeAt(Actor Other)
{
Velocity *= VSize(Velocity cross (EstimateLocation(Other) - Location)) * SeekAcceleration;
Acceleration += (EstimateLocation(Other) - Location) * SeekSpeed;
Acceleration /= 2;
}
simulated event Actor WillHitWall(optional out Vector Location, optional out Vector OutNormal)
{
return Trace(Location, OutNormal, Self.Location + Velocity * WallPredictionFactor);
}
simulated event bool MonsterFriendly(ScriptedPawn Other)
{
return Other != None && Other.AttitudeTo(User) == ATTITUDE_Friendly;
}
simulated event bool CheckSeekable(Pawn Other, Pawn FireAgent)
{
return (
Other != None
&&
(
FireAgent == None
||
(
FireAgent != None
&& FastTrace(Other.Location)
&& Other != FireAgent
&& !Other.IsInState('Dying')
&&
(
!MonsterFriendly(ScriptedPawn(Other))
&&
(
!Level.Game.bTeamGame
|| Other.PlayerReplicationInfo == None
|| FireAgent.PlayerReplicationInfo == None
|| Other.PlayerReplicationInfo.Team != FireAgent.PlayerReplicationInfo.Team
)
)
)
)
);
}
function BeginPlay()
{
if ( Owner == None )
return;
if ( Pawn(Owner) != None )
User = Pawn(Owner);
else
User = Pawn(Owner.Owner);
if ( User == None )
return;
}
simulated function SetTarget(Pawn Other)
{
Seeking = Other;
Log(self@"is now seeking after:"@Other);
}
simulated function bool CanHome()
{
return Seeking != None && FastTrace(Seeking.Location) && ( Pawn(Seeking) == None || !Pawn(Seeking).IsInState('Dying') || ScriptedPawn(Seeking) == None || ( User != None && ScriptedPawn(Seeking).AttitudeTo(User) == ATTITUDE_Friendly ) );
}
simulated event Timer()
{
local Pawn P;
local Pawn Target;
local ut_spriteSmokePuff B;
local Actor A;
local Vector WallNorm, WallLoc;
SetRotation(Rotator(Velocity));
A = WillHitWall(WallLoc, WallNorm);
if ( A != None && !CanHome() && ( LevelInfo(A) != None || !CheckSeekable(Pawn(A), User) ) && ((VSize(WallLoc - Location) / VSize(Velocity * 0.1)) / 256) * 0.1 > (WallNorm dot Velocity) )
{
Velocity /= WallAvoidSlowdown;
Slowdown *= WallAvoidSlowdown;
Acceleration -= WallAvoidSpeed * 2 * (WallNorm dot Velocity) * WallNorm;
}
else if ( Slowdown > 1 )
{
Velocity *= Slowdown;
Slowdown = 1;
}
else bFoundUser = True;
if ( CanHome() )
{
if ( HomeTarget == None || ( VSize(HomeTarget.Location - Location) < MinHomePathDistance && HomeTarget != Seeking ) )
{
HomeTarget = Spawn(class'NavigationHelper');
NavigationHelper(HomeTarget).LoadPathToward(Seeking, NavigationHelper(HomeTarget));
HomeTarget = NavigationHelper(HomeTarget).Helped();
return;
}
HomeAt(HomeTarget);
if ( bShootAtTarget && PercentChance(ShootDensity) && ProjectileClass != None )
Spawn(ProjectileClass, Owner, '', Location + Vector(Rotation) * (CollisionRadius + ShootDistance + ProjectileClass.default.CollisionRadius) * ShootDistanceFactor );
}
else if ( Seeking == None || !FastTrace(Seeking.Location) )
{
foreach RadiusActors(class'Pawn', P, TargetAcquiringRadius)
{
if ( Target == None || VSize(P.Location - Location) < VSize(Target.Location - Location) )
{
Target = P;
if ( CheckSeekable(Target, User) )
SetTarget(Target);
}
}
}
if ( (Level.bHighDetailMode && !Level.bDropDetail) || (FRand() < 0.5) )
{
b = Spawn(class'ut_SpriteSmokePuff');
b.RemoteRole = ROLE_None;
}
}
Problem are the Ac. Nones in the NavigationHelper class (undoubtedly in that for loop... ;_;)...
"Everyone is an idea man. Everybody thinks they have a revolutionary new game concept that no one else has ever thought of. Having cool ideas will rarely get you anywhere in the games industry. You have to be able to implement your ideas or provide some useful skill. Never join a project whose idea man or leader has no obvious development skills. Never join a project that only has a web designer. You have your own ideas. Focus on them carefully and in small chunks and you will be able to develop cool projects."
— Weapon of Destruction
— Weapon of Destruction
Re: Auto-Guiding Rockets -- [WIP]
That definitely happens if the current NavigationHelper is the last in the chain - "Next" is None then. But your code accesses "Next.This" within the loop:Gustavo6046 wrote:Problem are the Ac. Nones in the NavigationHelper class (undoubtedly in that for loop
Code: Select all
if ( NH.This == Next.This && NH != Next )
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
- Gustavo6046
- Godlike
- Posts: 1462
- Joined: Mon Jun 01, 2015 7:08 pm
- Personal rank: Resident Wallaby
- Location: Porto Alegre, Brazil
- Contact:
Re: Auto-Guiding Rockets -- [WIP]
Oh, thanks! I have fixed them now:Barbie wrote:That definitely happens if the current NavigationHelper is the last in the chain - "Next" is None then. But your code accesses "Next.This" within the loop:Gustavo6046 wrote:Problem are the Ac. Nones in the NavigationHelper class (undoubtedly in that for loopCode: Select all
if ( NH.This == Next.This && NH != Next )
Code: Select all
//=============================================================================
// NavigationHelper.
//=============================================================================
class NavigationHelper expands Pawn;
var NavigationHelper Next;
var Actor This;
simulated function LoadPathToward(Actor Target, optional NavigationHelper Root)
{
local NavigationHelper NH;
if ( Root == None )
Root = self;
Next = Spawn(class'NavigationHelper');
Log(self@"spawned"@Next@"to find path towards"@Target);
if ( FindPathToward(Target) == None )
{
This = Target;
Next.This = This;
}
else
Next.This = FindPathToward(Target);
Log(Next@"found next:"@Next.This);
if ( Next.This == Target )
{
Log(Next@"found path to target!");
return;
}
for ( NH = Root; NH != None; NH = NH.Next )
if ( NH.This != None && NH.This == Next.This && NH != Next )
{
Warn("Avoided recursion because of"@NH.This);
return;
}
Log(self@"takes next path:"@Next@"with"@Next.This);
Next.LoadPathToward(Target, Root);
}
simulated function Actor Helped(optional bool bThis)
{
local Actor A, B;
Log(self@"is self-desctructing");
if ( Next != None )
B = Next.Helped();
else
A = This;
if ( bThis )
A = This;
else
A = B;
Destroy();
Log("Final path component from"@self$":"@A);
return A;
}
Code: Select all
//=============================================================================
// AutoRocket.
//=============================================================================
class AutoRocket expands UT_SeekingRocket;
var() float SeekAcceleration, SeekSpeed, TargetAcquiringRadius, WallAvoidSpeed, WallPredictionFactor, WallAvoidSlowdown, ShootDensity, ShootDistance, ShootDistanceFactor, MinHomePathDistance, MinWallAvoidNormal;
var() bool bShootAtTarget, bIgnoreIgnorers;
var() class<Actor> ProjectileClass;
var Pawn User;
var Actor HomeTarget;
var int Slowdown;
var bool bFoundUser;
replication
{
reliable if ( Role == ROLE_Authority )
User,
Slowdown,
bFoundUser;
}
simulated function float MinHomeNormal()
{
if ( CanHome() || HomeTarget != None )
return 0.5 * MinWallAvoidNormal;
else
return 0.1 * MinWallAvoidNormal;
}
simulated event bool PercentChance(float Percentage)
{
return FRand() * 100 < Percentage;
}
simulated event Vector EstimateLocation(Actor Other)
{
if ( Other == None )
return Location;
return Other.Location + (Other.Velocity / VSize(Velocity)) * 0.5;
}
simulated event HomeAt(Actor Other)
{
Velocity *= VSize(Velocity cross (EstimateLocation(Other) - Location)) * SeekAcceleration;
Acceleration += (EstimateLocation(Other) - Location) * SeekSpeed;
Acceleration /= 2;
}
simulated event Actor WillHitWall(optional out Vector Location, optional out Vector OutNormal)
{
return Trace(Location, OutNormal, Self.Location + Velocity * WallPredictionFactor);
}
simulated event bool MonsterFriendly(ScriptedPawn Other)
{
return Other != None && Other.AttitudeTo(User) == ATTITUDE_Friendly;
}
simulated event bool CheckSeekable(Pawn Other, Pawn FireAgent)
{
return (
Other != None
&&
(
FireAgent == None
||
(
FireAgent != None
&& FastTrace(Other.Location)
&& Other != FireAgent
&& !Other.IsInState('Dying')
&&
(
!MonsterFriendly(ScriptedPawn(Other))
&&
(
!Level.Game.bTeamGame
|| Other.PlayerReplicationInfo == None
|| FireAgent.PlayerReplicationInfo == None
|| Other.PlayerReplicationInfo.Team != FireAgent.PlayerReplicationInfo.Team
)
)
)
)
);
}
function BeginPlay()
{
if ( Owner == None )
return;
if ( Pawn(Owner) != None )
User = Pawn(Owner);
else
User = Pawn(Owner.Owner);
if ( User == None )
return;
}
simulated function SetTarget(Pawn Other)
{
Seeking = Other;
Log(self@"is now seeking after:"@Other);
}
simulated function bool CanHome()
{
return Seeking != None && ( Pawn(Seeking) == None || !Pawn(Seeking).IsInState('Dying') || ScriptedPawn(Seeking) == None || ( User != None && ScriptedPawn(Seeking).AttitudeTo(User) == ATTITUDE_Friendly ) );
}
simulated event Timer()
{
local Pawn P;
local Pawn Target;
local ut_spriteSmokePuff B;
local Actor A;
local Vector WallNorm, WallLoc;
SetRotation(Rotator(Velocity));
A = WillHitWall(WallLoc, WallNorm);
if ( A != None && ( LevelInfo(A) != None || !CheckSeekable(Pawn(A), User) ) && ((VSize(WallLoc - Location) / VSize(Velocity * 0.1)) / 256) * MinHomeNormal() > (WallNorm dot Velocity) )
{
Velocity /= WallAvoidSlowdown;
Slowdown *= WallAvoidSlowdown;
Acceleration -= WallAvoidSpeed * 2 * (WallNorm dot Velocity) * WallNorm;
}
else if ( Slowdown > 1 )
{
Velocity *= Slowdown;
Slowdown = 1;
}
else bFoundUser = True;
if ( CanHome() )
{
if ( ( !FastTrace(Seeking.Location) && ( HomeTarget == None || !FastTrace(HomeTarget.Location) ) ) || ( HomeTarget != None && VSize(HomeTarget.Location - Location) < MinHomePathDistance && HomeTarget != Seeking ) )
{
HomeTarget = Spawn(class'NavigationHelper');
NavigationHelper(HomeTarget).LoadPathToward(Seeking);
HomeTarget = NavigationHelper(HomeTarget).Helped(true);
return;
}
else if ( FastTrace(Seeking.Location) )
HomeTarget = Seeking;
HomeAt(HomeTarget);
if ( bShootAtTarget && PercentChance(ShootDensity) && ProjectileClass != None )
Spawn(ProjectileClass, Owner, '', Location + Vector(Rotation) * (CollisionRadius + ShootDistance + ProjectileClass.default.CollisionRadius) * ShootDistanceFactor);
}
else
{
HomeTarget = None;
foreach RadiusActors(class'Pawn', P, TargetAcquiringRadius)
{
if ( Target == None || VSize(P.Location - Location) < VSize(Target.Location - Location) )
{
Target = P;
if ( CheckSeekable(Target, User) )
SetTarget(Target);
}
}
}
if ( (Level.bHighDetailMode && !Level.bDropDetail) || (FRand() < 0.5) )
{
b = Spawn(class'ut_SpriteSmokePuff');
b.RemoteRole = ROLE_None;
}
}
"Everyone is an idea man. Everybody thinks they have a revolutionary new game concept that no one else has ever thought of. Having cool ideas will rarely get you anywhere in the games industry. You have to be able to implement your ideas or provide some useful skill. Never join a project whose idea man or leader has no obvious development skills. Never join a project that only has a web designer. You have your own ideas. Focus on them carefully and in small chunks and you will be able to develop cool projects."
— Weapon of Destruction
— Weapon of Destruction
- SilverSound
- Adept
- Posts: 344
- Joined: Fri Nov 06, 2015 10:12 am
- Personal rank: Curious
- Location: St. Cloud, Florida
Re: Auto-Guiding Rockets -- [WIP]
While you are at this you should try to make ghost rockets. Rockets that move slow but can go through objects. Just imagine the fun someone would have running away from that. Haha. Can make it a game type maybe even
I might even try it sometime.
I might even try it sometime.
"Woah what?! I wish I was recording that...."
Re: Auto-Guiding Rockets -- [WIP]
Haha yeah. Then I happen to have the most genious map idea for that, 1 big maze, like the mazerunner movies.SilverSound wrote:While you are at this you should try to make ghost rockets. Rockets that move slow but can go through objects. Just imagine the fun someone would have running away from that. Haha. Can make it a game type maybe even
I might even try it sometime.
I still have that on my list to make, regardless of gametype.
This member can only post when permitted.
- PrinceOfFunky
- Godlike
- Posts: 1200
- Joined: Mon Aug 31, 2015 10:31 pm
Re: Auto-Guiding Rockets -- Are you satisfied now?
We all are "young coders", we never stop learning and you need to do errors to learn new stuff. Even you are like a "young coder", last thing you told me was that if something works it doesn't need any fix, but I think if something works you can still try to optimize the code for a better efficency and efficacy.sektor2111 wrote:This young "coder"
"Your stuff is known to be buggy and unfinished/not properly tested"
- sektor2111
- Godlike
- Posts: 6411
- Joined: Sun May 09, 2010 6:15 pm
- Location: On the roof.
Re: Auto-Guiding Rockets -- [WIP]
YES, me too, BUT I don't recall which forum I was spamming with USELESS Snipets which mainly doesn't work and are only confusing other young "coders" with None stuff. Learning codes is doable in private and testing them before yelling "awesome" as long as I don't recall stupid useless things to be "awesome". I thought that we clarified this problem since that dude (IpTables if I well recall ID) came for clarification toward a game-type "in work" which was looking the mostly coded by community (due to constant issues appearance) and not by the author who started it. All of us have to learn but without spamming and trying to annoy others, right ? I guess so.PrinceOfFunky wrote:We all are "young coders", we never stop learning and you need to do errors to learn new stuff
Edit: BTW, because of bump here. This super duper rocket I don't see if has an update because is busy with walls rather than tracking a Pawn-Target but suddenly author went to another job leaving this to hang unfinished (as usual).