View Issue Details

IDProjectCategoryView StatusLast Update
0004406NoesisGUIUnitypublic2025-12-01 11:27
ReporterXaron Assigned Tojsantos  
PrioritynormalSeverityminor 
Status resolvedResolutionreopened 
Product Version3.2.9 
Target Version3.2.11Fixed in Version3.2.10 
Summary0004406: Waypoints disappear in our game
Description

Our waypoints in the map in our game disappear. If you right click in the map you will see that a waypoint is created. Now do "Shift+Right Click" in another location and it will create a new waypoint but the previous one disappears. That did not happen in 3.2.8 where those waypoints where visualized a bit less opaque.

Project download is the same as in this bug: https://www.noesisengine.com/bugs/view.php?id=4404

Thank you!

PlatformWindows

Relationships

related to 0004404 resolvedjsantos Crash in native game 

Activities

jsantos

jsantos

2025-10-08 12:50

manager   ~0011097

Last edited: 2025-10-08 12:50

I am not able to reproduce this, I can "Right Click" on the map to create a "red waypoint", and then I can connect to new points with "Shift+Right Click".

Please, let me know how to reproduce.

Map.png (31,132 bytes)   
Map.png (31,132 bytes)   
Xaron

Xaron

2025-10-08 13:26

reporter   ~0011099

You're right, I'm sorry. I thought it doesn't create those semi-transparent waypoints but apparently it's the same in 3.2.8 so clearly a bug on our side. Can be closed!

image.png (43,807 bytes)   
image.png (43,807 bytes)   
Xaron

Xaron

2025-10-08 13:36

reporter   ~0011101

I'm sorry, have to reopen it. The issue is differently.

I'll create a short video to demonstrate it and to show how to reproduce it.

Xaron

Xaron

2025-10-08 13:51

reporter   ~0011102

Last edited: 2025-10-08 13:52

Ok, here's an example how it should look like. Please note I first switch to "light" mode so it's better visible.

You can clearly see the line to the first waypoint we set and that it also reacts accordingly. And also that the initial line to the left is now set to that first waypoint, so updated.

waypoints-ok.mp4 (2,890,925 bytes)   
Xaron

Xaron

2025-10-08 13:53

reporter   ~0011103

And here's what happens with Noesis 3.2.9. As you can see the original line stays and does not update to the new (first) waypoint you set:

Xaron

Xaron

2025-10-08 13:54

reporter   ~0011104

You can see the difference on those screenshots (between yours and mine) as well.

jsantos

jsantos

2025-10-08 14:10

manager   ~0011106

Last edited: 2025-10-08 14:10

Thanks for the report. I will have a look at it.

Are you 100% sure you started to see this with only upgrading to 3.2.9? No more changes on your side.

Xaron

Xaron

2025-10-08 14:16

reporter   ~0011107

Yes that's exactly the same code beside the Noesis change.

jsantos

jsantos

2025-10-08 15:54

manager   ~0011108

Last edited: 2025-10-08 15:55

As you can see the original line stays and does not update to the new (first) waypoint you set

Could you please give more context about how you are adding the new point and modifying the original line? Just an overview of the API you are using for this.

Xaron

Xaron

2025-10-09 07:52

reporter   ~0011131

Last edited: 2025-10-09 12:56

Edit: Sorry I cannot get the [code]...[/code] <code>...</code> blocks to work.

that's being done with

<mapControl:MapPolyline 
    x:Name="Host" 
    Stroke="{Binding Path=(viewmodels:NightModeBehaviour.CurrentColor), RelativeSource={RelativeSource Self}}"
    StrokeThickness="{sp:UIResource TM_WaypointLineThickness}"
    mapControl:MapPanel.ParentMap="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=mapControl:MapBase}}"
    Locations="{Binding LivePath}">
    <i:Interaction.Behaviors>
        <viewmodels:NightModeBehaviour
            DayColor="{sp:UIResource TM_WaypointsLineColor}" 
            NightColor="{sp:UIResource TM_Night_WaypointsLineColor}"/>
    </i:Interaction.Behaviors>
</mapControl:MapPolyline>

and then MapPolyline works with

public static readonly DependencyProperty LocationsProperty = DependencyProperty.Register(
  nameof(Locations), typeof(IEnumerable<GeoPosition>), typeof(MapPolyline),
  new PropertyMetadata(null, (o, e) => {
    ((MapPolyline)o).DataCollectionPropertyChanged(e);
    }));

that then does

protected void DataCollectionPropertyChanged(DependencyPropertyChangedEventArgs e)
{
  if (e.OldValue is INotifyCollectionChanged oldCollection)
  {
    CollectionChangedEventManager.Instance.RemoveListener(oldCollection, _handler);
  }

  if (e.NewValue is INotifyCollectionChanged newCollection)
  {
    CollectionChangedEventManager.Instance.AddListener(newCollection, _handler);
  }

  UpdateData(true);
}

that then does

protected override void UpdateData(bool dataUpdated = false)
{
  if (ParentMap != null && Locations != null)
  {
    //Debug.Log("Polyline update");
#if NOESIS
    _profPolylineUpdate.Begin();
#endif
    var (scaleMat, translation) = UnpackTransform(ParentMap.ViewTransform.MapToViewMatrix);
    _translateToPosition.X = translation.X;
    _translateToPosition.Y = translation.Y;
    if (scaleMat != _oldScale || _geom == null || dataUpdated)
    {
      _oldScale = scaleMat;
      _geom = MakePolylineGeometry();
    }
    InvalidateVisual();
    var longitudeOffset = Location != null ? GetLongitudeOffset(Location) : GetLongitudeOffset(Locations.FirstOrDefault());
    //AddPolylineLocations(Locations, longitudeOffset, false);
#if NOESIS
    _profPolylineUpdate.End();
#endif
  }
}

and then

protected override void OnRender(DrawingContext context)
{
  base.OnRender(context);
  context.PushTransform(_translateToPosition);
  if (_geom != null && Pen != null)
    context.DrawGeometry(null, Pen, _geom);
  context.Pop();
}

so in a high level summary Locations is a normal array that's atomically shuffled into a INotifyPropertyChanged parameter that then triggers a updated listener on a bound dependency property which updates the path geometry and invalidates the visual to trigger a render

Xaron

Xaron

2025-10-09 13:27

reporter   ~0011132

Ah thank you! I see how to use the code blocks now.

jsantos

jsantos

2025-10-14 17:21

manager   ~0011172

Last edited: 2025-10-14 17:26

I can’t associate this issue with any changes introduced in 3.2.9.

Could you please share the code for MakePolylineGeometry()?

It looks like two separate figures are being created, one for the original line on the left and another for the new polyline. However, in the original (first) video, I only see a single polyline.

jsantos

jsantos

2025-10-15 17:34

manager   ~0011179

Any news on this? We are going to release 3.2.10 very soon.

Thank you!

Xaron

Xaron

2025-10-17 09:01

reporter   ~0011185

Hi sorry for the late answer, I was out of house. I've pinged Ben who's our dev for handling those special cases.

ckfinite

ckfinite

2025-10-18 07:40

reporter   ~0011188

Last edited: 2025-10-18 12:24

Sorry for the delay, the contents of MakePolylineGeometry are

    private StreamGeometry MakePolylineGeometry()
    {
      StreamGeometry geom = new StreamGeometry();
      using (var ctx = geom.Open())
      {
        if (Locations == null)
          return geom;
        var longitudeOffset = Location != null ? GetLongitudeOffset(Location) : GetLongitudeOffset(Locations.FirstOrDefault());
        for (int i = 0; i < Locations.Count(); i++)
        {
          var nextPt = _oldScale.Transform(LocationToMap(Locations.ElementAt(i), longitudeOffset));
          if (i == 0)
          {
            ctx.BeginFigure(nextPt, false, false);
            continue;
          }
          ctx.LineTo(nextPt, true, true);
          if (i > 0 && i % 30 == 0 && i != Locations.Count() - 1)
          {
            ctx.BeginFigure(nextPt, false, false); // make too-long paths into multiple
          }
        }
      }
      return geom;
    }

The two polylines (the static one that's not being updated realtime and the live one that is) are drawn separately for performance; it seems like only the one that's being regularly updated has stopped working.

jsantos

jsantos

2025-10-18 12:28

manager   ~0011189

Last edited: 2025-10-18 12:28

Thanks for the information.

In the video waypoint-line-missing.mp4 posted above: "the original line stays and does not update to the new (first) waypoint you set".

How is that line rendered? Because it doesn't seem to be part of the polyline (code you posted), right?

ckfinite

ckfinite

2025-10-18 14:37

reporter   ~0011190

It's rendered as its own polyline, through the earlier code that Xaron shared. We render two polylines, one for the live updated part (which is the code path that we shared earlier, and what is breaking) and for the static part (which is fine).
That initial leg is still a polyline, it just only has two points in it.

jsantos

jsantos

2025-10-18 14:59

manager   ~0011191

Last edited: 2025-10-18 15:00

Watching the videos, I don't see any problems in the dynamic polyline.

The only problem I see is in the initial leg (polyline with two points). This leg is not connecting with the first point in the dynamic polyline.

Are you sure this leg polyline is being updated correctly?

Please, confirm.

ckfinite

ckfinite

2025-10-18 15:12

reporter   ~0011192

My suspicion is that something in the DependencyProperty binding that updates the polyline used to render the initial leg broke in the upgrade, yes.

jsantos

jsantos

2025-10-18 16:13

manager   ~0011193

How is the second point of the leg connected to the first point of the dynamic polyline?

ckfinite

ckfinite

2025-10-19 10:27

reporter   ~0011194

It isn't, they're separate objects. Sorry for the delay.

jsantos

jsantos

2025-10-19 11:45

manager   ~0011195

Thanks, could you show me the XAML and code where this leg is rendered and updated?

ckfinite

ckfinite

2025-10-19 12:21

reporter   ~0011196

The XAML & C# is in Xaron's post up-thread already, the only thing above that is that LivePath is a INotifyPropertyChanged property with a List<GeoPosition> that notifies when the initial path is updated.

jsantos

jsantos

2025-10-19 12:34

manager   ~0011197

Last edited: 2025-10-19 12:35

The XAML above has a binding to LivePath

Locations="{Binding LivePath}">

I think the leg poyline must be something different right?

ckfinite

ckfinite

2025-10-19 12:42

reporter   ~0011198

Oh - LivePath is the polyline that's drawn from the unit to the first waypoint (or not drawn, as it might be), that's the code behind the part of the display that isn't working. I'll check this tomorrow though.

ckfinite

ckfinite

2025-10-20 22:53

reporter   ~0011200

Okay, I looked into the implementation and the LivePath is indeed what isn't being drawn, so it's the above code path.
My suspicion is that the visual isn't being invalidated when the Locations DependencyProperty is getting updated, though I don't have a good hypothesis as for why that would stop working.

jsantos

jsantos

2025-10-21 11:35

manager   ~0011203

Please, provide a repro project for this.

Thank you!

Xaron

Xaron

2025-11-30 23:07

reporter   ~0011492

We managed to fix it on our end using 3.2.10. So this can be closed. Thank you!

jsantos

jsantos

2025-12-01 11:27

manager   ~0011493

Thanks!

Issue History

Date Modified Username Field Change
2025-10-07 20:39 Xaron New Issue
2025-10-07 20:40 Xaron Relationship added related to 0004404
2025-10-08 12:25 jsantos Assigned To => jsantos
2025-10-08 12:25 jsantos Status new => assigned
2025-10-08 12:25 jsantos Target Version => 3.2.10
2025-10-08 12:50 jsantos Note Added: 0011097
2025-10-08 12:50 jsantos File Added: Map.png
2025-10-08 12:50 jsantos Status assigned => feedback
2025-10-08 12:50 jsantos Note Edited: 0011097
2025-10-08 13:26 Xaron Note Added: 0011099
2025-10-08 13:26 Xaron File Added: image.png
2025-10-08 13:26 Xaron Status feedback => assigned
2025-10-08 13:34 jsantos Status assigned => resolved
2025-10-08 13:34 jsantos Resolution open => no change required
2025-10-08 13:36 Xaron Status resolved => feedback
2025-10-08 13:36 Xaron Resolution no change required => reopened
2025-10-08 13:36 Xaron Note Added: 0011101
2025-10-08 13:51 Xaron Note Added: 0011102
2025-10-08 13:51 Xaron File Added: waypoints-ok.mp4
2025-10-08 13:51 Xaron Status feedback => assigned
2025-10-08 13:52 Xaron Note Edited: 0011102
2025-10-08 13:53 Xaron Note Added: 0011103
2025-10-08 13:53 Xaron File Added: waypoint-line-missing.mp4
2025-10-08 13:54 Xaron Note Added: 0011104
2025-10-08 14:10 jsantos Note Added: 0011106
2025-10-08 14:10 jsantos Status assigned => feedback
2025-10-08 14:10 jsantos Note Edited: 0011106
2025-10-08 14:16 Xaron Note Added: 0011107
2025-10-08 14:16 Xaron Status feedback => assigned
2025-10-08 15:54 jsantos Note Added: 0011108
2025-10-08 15:54 jsantos Status assigned => feedback
2025-10-08 15:55 jsantos Note Edited: 0011108
2025-10-09 07:52 Xaron Note Added: 0011131
2025-10-09 07:52 Xaron Status feedback => assigned
2025-10-09 07:55 Xaron Note Edited: 0011131
2025-10-09 07:57 Xaron Note Edited: 0011131
2025-10-09 07:59 Xaron Note Edited: 0011131
2025-10-09 08:00 Xaron Note Edited: 0011131
2025-10-09 08:00 Xaron Note Edited: 0011131
2025-10-09 08:00 Xaron Note Edited: 0011131
2025-10-09 08:02 Xaron Note Edited: 0011131
2025-10-09 12:55 jsantos Note Edited: 0011131
2025-10-09 12:56 jsantos Note Edited: 0011131
2025-10-09 12:56 jsantos Note Edited: 0011131
2025-10-09 13:27 Xaron Note Added: 0011132
2025-10-10 13:29 jsantos Category Unity3D => Unity
2025-10-14 17:21 jsantos Note Added: 0011172
2025-10-14 17:22 jsantos Status assigned => feedback
2025-10-14 17:26 jsantos Note Edited: 0011172
2025-10-15 17:34 jsantos Note Added: 0011179
2025-10-17 09:01 Xaron Note Added: 0011185
2025-10-17 09:01 Xaron Status feedback => assigned
2025-10-18 07:40 ckfinite Note Added: 0011188
2025-10-18 12:24 jsantos Note Edited: 0011188
2025-10-18 12:28 jsantos Note Added: 0011189
2025-10-18 12:28 jsantos Note Edited: 0011189
2025-10-18 12:28 jsantos Status assigned => feedback
2025-10-18 14:37 ckfinite Note Added: 0011190
2025-10-18 14:59 jsantos Note Added: 0011191
2025-10-18 15:00 jsantos Note Edited: 0011191
2025-10-18 15:00 jsantos Note Edited: 0011191
2025-10-18 15:12 ckfinite Note Added: 0011192
2025-10-18 16:13 jsantos Note Added: 0011193
2025-10-19 10:27 ckfinite Note Added: 0011194
2025-10-19 11:45 jsantos Note Added: 0011195
2025-10-19 12:21 ckfinite Note Added: 0011196
2025-10-19 12:34 jsantos Note Added: 0011197
2025-10-19 12:35 jsantos Note Edited: 0011197
2025-10-19 12:42 ckfinite Note Added: 0011198
2025-10-20 18:25 jsantos Target Version 3.2.10 => 3.2.11
2025-10-20 22:53 ckfinite Note Added: 0011200
2025-10-21 11:35 jsantos Note Added: 0011203
2025-11-30 23:07 Xaron Note Added: 0011492
2025-11-30 23:07 Xaron Status feedback => assigned
2025-12-01 11:27 jsantos Status assigned => resolved
2025-12-01 11:27 jsantos Fixed in Version => 3.2.10
2025-12-01 11:27 jsantos Note Added: 0011493