Game Development Community

dev|Pro Game Development Curriculum

Updated PathManager

by Xavier "eXoDuS" Amado · 05/03/2004 (10:01 pm) · 12 comments

Download Code File

With the current pathManager in TGE when you create a path with over certain amount of path nodes it will generate an assert (in debug mode) or just weird results in release mode, because the packet size is being overflowed. This means that the packet is too small to send all the data it has to send.
This new version of the path manager aids the problem by using different events to send the data in chunked portions. Specifically it uses one NetEvent for the path info and another one for each chunk of data. It uses a hard coded and safe amount of nodes per chunk which is set to 10.

Please give this a go and let us know if it works perfectly or you find some kind of bug.

#1
05/04/2004 (2:56 am)
Then that's why I couldn't use those paths in my motorway :)
#2
05/05/2004 (8:14 pm)
Hehehe, if you try it let us know how it works for you.
#3
05/06/2004 (10:48 pm)
Good deal. I ran into this while using with the PathShape resource. One thing to note. If you mess with the path code and mess it up, you could hang your game, while the pathxyz infinitely sends packets.

Just a warning for those who would implement their own pathXYZ classes based on pathed camera or pathed shape.

Anyways, Cool Beans 'X'

[HOW]EdM
#4
05/07/2004 (3:46 pm)
Works great! Much better than my old solution of setting the max packet size really large!
#5
05/08/2004 (12:56 pm)
@Edward, nice to see you, I was wondering what had been of you last week. Was thinking of emailing you. Anyway, what do you mean by messing it up?

@Chris: Glad to hear that :)
#6
05/08/2004 (9:06 pm)
@eXoDuS - The original path shape resource had a bug that caused it to accumulate copies of the node paths, eventually, this led to an overflow (as described by this resource). I'm just saying, if someone were to make their own XYZ path object and introduce a similar bug (which is easy since it was a scripting bug), your fix would actually spell their doom. :) They'd still accumulated nodes and end up safely transmitting them due to this fix. Now, if there is not timeout per transmission, eventually the game would be spending all its time sending the 'accumulated' nodes, in sets of 10.

By no means was I saying this is a bad resource. In fact, its a great fix and would totally help make longer paths, which I was kind of bugged by since the limit was somthing like 40 nodes without your fix, so again:

Cool Bean.

I've been really busy working on the guide. I' going to release it at the end of this month. Unfortunately for me, Ken Finney has beat me to the punch.

Nonetheless, I've been working on it for a long time and will release my own guide. Then I can finally move on to some other Torque work.

So, cheers, cool resource, and I'll be chatting with you in the future.

[HOW]EdM
Torque Notes and Soon to be realeased 'Essential Guide To TGE' (EGT-TGE)

PS - I'm strongly considering making this an e-book with printed copies available upon request.
#7
05/08/2004 (9:15 pm)
Gotcha.

Yes, he did beat you to it, but what keeps you from having two books on the same subject. There are plenty of OpenGL books per exempla.
#8
03/18/2005 (6:56 am)
@Edward,
above you wrote:
"The original path shape resource had a bug that caused it to accumulate copies of the node paths, eventually, this led to an overflow (as described by this resource). I'm just saying, if someone were to make their own XYZ path object and introduce a similar bug (which is easy since it was a scripting bug), your fix would actually spell their doom. :) They'd still accumulated nodes and end up safely transmitting them due to this fix. Now, if there is not timeout per transmission, eventually the game would be spending all its time sending the 'accumulated' nodes, in sets of 10."

This is a problem I have. My path has 50 nodes and I got the assertion (out of range) on the 42nd node. I don't understand what I did wrong. I thought that this resource allow me set the 100 nodes. So?
But you wrote " similar bug (which is easy since it was a scripting bug)". What do you mean? Could you explain me?

Richard
#9
12/27/2005 (12:23 pm)
Any code example on how to use this?

So I created a path in the world editor named "PathAlpha" with four markers "a", "b", "c", "d". In the code I would go :

a = new PathManager();

then what?

a.updatePath(?,?,?,?); (fill in the blanks)
#10
03/17/2006 (6:17 am)
Is this working in TGE 1.4?
#11
05/22/2006 (2:25 am)
great resource.

thanks
#12
03/27/2010 (12:37 am)
This is excellent - just what we need for long paths.