Project Perfect Mod Forums
:: Home :: Get Hosted :: PPM FAQ :: Forum FAQ :: Privacy Policy :: Search :: Memberlist :: Usergroups :: Register :: Profile :: Log in to check your private messages :: Log in ::


The time now is Thu Apr 18, 2024 10:18 am
All times are UTC + 0
Experimenting with scripted map units...
Moderators: Global Moderators, Red Alert 2 Moderators
Post new topic   Reply to topic Page 1 of 1 [20 Posts] Mark the topic unread ::  View previous topic :: View next topic
Author Message
G-E
Defense Minister


Joined: 09 Feb 2015

PostPosted: Mon Jun 10, 2019 4:22 am    Post subject:  Experimenting with scripted map units...
Subject description: (problem with helicopters)
Reply with quote  Mark this post and the followings unread

So let me begin by saying I have several maps with planes flying through, in all cases they are [AircraftTypes] and Spawned=yes, however I decided to try doing the same with helicopters and it just doesn't work. This then leads me to try alternate moves, and later debugging with aircraft again.

1. A Landable=yes helicopter using "move to waypoint" will arrive and attempt to repeatedly land without succeeding, despite having room to do so on land. When the waypoint is outside the visible edge of the map, the helicopter tried to land within the visible limit, but in any case, it does not proceed to "finish" and will not disappear.

2. The same helicopter told to move to a series of waypoints, the first one being on water, results in arriving and endlessly hovering, never going to the next waypoint.

3. Using "patrol to waypoint" gets the helicopter to land at a land based first waypoint, but once arriving at the final waypoint, it repeats the attempting to land failure in #1, thus never completing the script.

4. Observing this odd behaviour, I repeated #2 with spawned aircraft, where I get endless circling as seen in the pic attached. I had figured that since they couldn't land they would pass over the waypoint and move to the next, but this doesn't happen, and can't complete the script.

Is there a workable way to have helicopters do a realistic patrol that I've missed?

I realize that the paradrop planes are given an order to do an operation at a point, but once complete they are allowed to freely leave the map as all spawned aircraft do automatically, so there is no such confusion about multiple waypoint moves.

As an aside I also see how the circling aircraft issue could be used to make a flock of voxel birds circle like vultures over a spot hah!



wayp.jpg
 Description:
 Filesize:  625.35 KB
 Viewed:  1592 Time(s)

wayp.jpg



_________________
http://www.moddb.com/mods/scorched-earth-ra2-mod-with-smart-ai

Back to top
View user's profile Send private message
E1 Elite
General


Joined: 28 May 2013

PostPosted: Mon Jun 10, 2019 4:39 am    Post subject: Reply with quote  Mark this post and the followings unread

Do you have BalloonHover=yes?

For larger arc path problems, reduce speed and/or increase ROT.

Back to top
View user's profile Send private message
G-E
Defense Minister


Joined: 09 Feb 2015

PostPosted: Mon Jun 10, 2019 7:40 am    Post subject: Reply with quote  Mark this post and the followings unread

No, the helicopter is Landable and BalloonHover would negate that, the waypoint path angle differences were <45deg...

_________________
http://www.moddb.com/mods/scorched-earth-ra2-mod-with-smart-ai

Back to top
View user's profile Send private message
E1 Elite
General


Joined: 28 May 2013

PostPosted: Mon Jun 10, 2019 9:01 am    Post subject: Reply with quote  Mark this post and the followings unread

BalloonHover makes it possible to reach the waypoints for jumpjet units. Otherwise, in general, a unit is supposed to be within 1 cell distance to complete the waypoint reaching script actions.

Back to top
View user's profile Send private message
G-E
Defense Minister


Joined: 09 Feb 2015

PostPosted: Tue Jun 11, 2019 1:59 am    Post subject: Reply with quote  Mark this post and the followings unread

Ok, but that doesn't explain why a helicopter can't land on the waypoint long enough to consider it moved to?

It does explain why aircraft would have trouble though...

_________________
http://www.moddb.com/mods/scorched-earth-ra2-mod-with-smart-ai

Back to top
View user's profile Send private message
cxtian39
Commander


Joined: 11 Feb 2016

PostPosted: Sun Jun 16, 2019 11:38 pm    Post subject: Reply with quote  Mark this post and the followings unread

I guess landing isn’t part of the move command. So when it finishes the move command and arrives the waypoint it’s still in air, check fails, then it starts to land.

Back to top
View user's profile Send private message Skype Account
G-E
Defense Minister


Joined: 09 Feb 2015

PostPosted: Sat Jun 22, 2019 10:30 pm    Post subject: Reply with quote  Mark this post and the followings unread

I tried another experiment with a bus. I gave it MovementRestrictedTo=Road, and it drove to the first waypoint (on road) where it stopped as if it had completed its mission.

Shooting at it made it move to another cell, but still didn't progress to the next waypoint.

Weird.

_________________
http://www.moddb.com/mods/scorched-earth-ra2-mod-with-smart-ai

Back to top
View user's profile Send private message
McPwny
Cyborg Artillery


Joined: 29 Jan 2018

PostPosted: Sun Jun 23, 2019 12:30 am    Post subject: Reply with quote  Mark this post and the followings unread

yep that happens when a unit cant complete a script action it just sort of dies. most common culprit in working scripts is  
a fault in the pathfinding. lat tile errors most especially. trains are also super finicky and id wager whatever your trying to do with
momevementrestrictedto= is going to be a massive nuisance to script.

_________________
visit my moddb profile for .shp downloads and stuff

Back to top
View user's profile Send private message
G-E
Defense Minister


Joined: 09 Feb 2015

PostPosted: Sun Jun 23, 2019 2:40 am    Post subject: Reply with quote  Mark this post and the followings unread

This was a city map with tons of road, and all the waypoints are on the roads. The first thing I thought about was that not all the road tiles have the right type set, especially the crosswalks, but I checked and they all do. Pathfinding should not have been a problem.

EDIT: I should clarify, dirt road tiles are typically 12, paved road is 11, my crosswalks were 12, as are the island medians for trees. I tried both 11 and 12 for these other bits and it didn't make a difference. The bus drove along the paved road happily, but stopped at the first waypoint in all cases.

_________________
http://www.moddb.com/mods/scorched-earth-ra2-mod-with-smart-ai

Last edited by G-E on Sun Jun 23, 2019 3:07 am; edited 1 time in total

Back to top
View user's profile Send private message
E1 Elite
General


Joined: 28 May 2013

PostPosted: Sun Jun 23, 2019 2:45 am    Post subject: Reply with quote  Mark this post and the followings unread

Keep waypoints angle wide, not sharp bends.

Back to top
View user's profile Send private message
G-E
Defense Minister


Joined: 09 Feb 2015

PostPosted: Sun Jun 23, 2019 3:09 am    Post subject: Reply with quote  Mark this post and the followings unread

They were arranged in a rectangle, the bus travels in a box start to finish. That is each waypoint is 90deg off the last.

_________________
http://www.moddb.com/mods/scorched-earth-ra2-mod-with-smart-ai

Back to top
View user's profile Send private message
E1 Elite
General


Joined: 28 May 2013

PostPosted: Sun Jun 23, 2019 3:12 am    Post subject: Reply with quote  Mark this post and the followings unread

Use more waypoints and make the angle larger than 90 deg for every bend.

Back to top
View user's profile Send private message
G-E
Defense Minister


Joined: 09 Feb 2015

PostPosted: Sun Jun 23, 2019 3:25 am    Post subject: Reply with quote  Mark this post and the followings unread

I think you're missing the point here, if I remove MovementRestrictedTo=Road, it drives along the road, turns the corners on the road, and completes just fine. Only when the tag is present does it stop, so I fail to see how angle applies here.

_________________
http://www.moddb.com/mods/scorched-earth-ra2-mod-with-smart-ai

Back to top
View user's profile Send private message
E1 Elite
General


Joined: 28 May 2013

PostPosted: Sun Jun 23, 2019 3:36 am    Post subject: Reply with quote  Mark this post and the followings unread

Use more than 1 waypoint on the turns, so that there is wide angle and possibly it is in the line of sight on the same terrain. Movement restricted flag does that.

Back to top
View user's profile Send private message
McPwny
Cyborg Artillery


Joined: 29 Jan 2018

PostPosted: Sun Jun 23, 2019 12:15 pm    Post subject: Reply with quote  Mark this post and the followings unread

trains will break if you even try and get them to make sharp turns. its an unspoken rule that every 'turn' in the track be several cells long.  
also consider playing with a player owned unit for debugging.

_________________
visit my moddb profile for .shp downloads and stuff

Back to top
View user's profile Send private message
Lin Kuei Ominae
Seth


Joined: 16 Aug 2006
Location: Germany

PostPosted: Sun Jun 23, 2019 3:49 pm    Post subject: Reply with quote  Mark this post and the followings unread

What's the width of your road?
If 2 adjacent vertical/horizontal cells only touch with a corner, MovementRestrictedTo pathfinding may break.
Make sure adjacent cells share an edge.

Pathfinding for horizontal/vertical adjacent cells works only with Land=Railroad.

Do you tried placing 2 waypoints very close to each other? Does the unit then still stop at the first?
A screenshot may also help.

_________________
SHP Artist of Twisted Insurrection:  Nod buildings

Public SHPs
X-Mech Calendar (28 Mechs for GDI and Nod)
5 GDI, 5 Nod, 1 Mutant, 1 Scrin unit, 1 GDI building

Tools
Image Shaper______TMP Shop______C&C Executable Modifier

Back to top
View user's profile Send private message
G-E
Defense Minister


Joined: 09 Feb 2015

PostPosted: Sun Jun 23, 2019 10:24 pm    Post subject: Reply with quote  Mark this post and the followings unread

Lin Kuei Ominae wrote:
What's the width of your road?
If 2 adjacent vertical/horizontal cells only touch with a corner, MovementRestrictedTo pathfinding may break.
Make sure adjacent cells share an edge.

Standard 3-wide paved road. See image.

Lin Kuei Ominae wrote:
Pathfinding for horizontal/vertical adjacent cells works only with Land=Railroad.

By this you mean off-grid axis moves, but I'm not sure in what context this applies? The roads have plenty of cells to move purely along the normal cell axis?

Lin Kuei Ominae wrote:
Do you tried placing 2 waypoints very close to each other? Does the unit then still stop at the first?

I have tried moving the next waypoint, but not closer than 10 cells, and along the same road, so I only changed the theoretical turn angle.



STARTWAY.jpg
 Description:
 Filesize:  35.86 KB
 Viewed:  1247 Time(s)

STARTWAY.jpg



_________________
http://www.moddb.com/mods/scorched-earth-ra2-mod-with-smart-ai

Back to top
View user's profile Send private message
E1 Elite
General


Joined: 28 May 2013

PostPosted: Mon Jun 24, 2019 12:31 am    Post subject: Reply with quote  Mark this post and the followings unread

It works without any problems with MovementRestrictedTo=Road as in the attached image.



WPMovementRestricted.jpg
 Description:
 Filesize:  162.22 KB
 Viewed:  1240 Time(s)

WPMovementRestricted.jpg



Back to top
View user's profile Send private message
Lin Kuei Ominae
Seth


Joined: 16 Aug 2006
Location: Germany

PostPosted: Mon Jun 24, 2019 6:40 am    Post subject: Reply with quote  Mark this post and the followings unread

G-E wrote:
Standard 3-wide paved road. See image.

In this case, no clue why they can't plot a path around a corner.

I would try what happens if there are impassable overlays at the corners next to the road. Maybe the pathfinding has issues since the clear ground cells next to the road are passable too.

You could also try creating a wall type overlay with Land=Road. Then place this on clear ground tiles (not roads) and see if a unit can follow this overlay better around corners.
Maybe MovementRestrictedTo works better when driving on overlays than on terrain tiles.

@E1: placing that many waypoints counters the benefit of restricted movement, which in theory doesn't need one at each corner, but only at the bus stops.

_________________
SHP Artist of Twisted Insurrection:  Nod buildings

Public SHPs
X-Mech Calendar (28 Mechs for GDI and Nod)
5 GDI, 5 Nod, 1 Mutant, 1 Scrin unit, 1 GDI building

Tools
Image Shaper______TMP Shop______C&C Executable Modifier

Back to top
View user's profile Send private message
G-E
Defense Minister


Joined: 09 Feb 2015

PostPosted: Mon Jun 24, 2019 4:18 pm    Post subject: Reply with quote  Mark this post and the followings unread

Lin Kuei Ominae wrote:
G-E wrote:
Standard 3-wide paved road. See image.

In this case, no clue why they can't plot a path around a corner.

I would try what happens if there are impassable overlays at the corners next to the road. Maybe the pathfinding has issues since the clear ground cells next to the road are passable too.

At each corner the traffic lights stop movement onto the sidewalk tile for the turn, so even without restriction, it has to turn onto road.

Lin Kuei Ominae wrote:
You could also try creating a wall type overlay with Land=Road. Then place this on clear ground tiles (not roads) and see if a unit can follow this overlay better around corners.
Maybe MovementRestrictedTo works better when driving on overlays than on terrain tiles.

While this is possible, that a single line path might cure the pathfinding, the effect on building space would negate its utility.

Lin Kuei Ominae wrote:
@E1: placing that many waypoints counters the benefit of restricted movement, which in theory doesn't need one at each corner, but only at the bus stops.

Exactly, the only purpose here was to mimic normal bus stops, without allowing it to traverse onto sidewalks or go offroading the moment there's an obstruction. I would have no qualms with the bus stopping if the road section was impassable, but a gazillion waypoints are just not worth it.

_________________
http://www.moddb.com/mods/scorched-earth-ra2-mod-with-smart-ai

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [20 Posts] Mark the topic unread ::  View previous topic :: View next topic
 
Share on TwitterShare on FacebookShare on Google+Share on DiggShare on RedditShare on PInterestShare on Del.icio.usShare on Stumble Upon
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © phpBB Group

[ Time: 0.1880s ][ Queries: 16 (0.0130s) ][ Debug on ]