Maximum points on a path
by David Sill · in Torque Game Engine · 11/04/2004 (9:11 am) · 32 replies
Is there a way to get around the 18 point limit for points on a (camera) path?
The project I am working on is analagous to being in a train on a track. The user will have play, pause, speed up and slow down controls. An option to 'look' using the mouse would be an added bonus. I am currently using PathCamera, but don't have the controls in yet.
Is PathCamera indeed the best way to do this? Is the 18 point limit set in the executable? Is there a way around it in scripting?
I know, lots of questions. Any help is greatly appreciated!
The project I am working on is analagous to being in a train on a track. The user will have play, pause, speed up and slow down controls. An option to 'look' using the mouse would be an added bonus. I am currently using PathCamera, but don't have the controls in yet.
Is PathCamera indeed the best way to do this? Is the 18 point limit set in the executable? Is there a way around it in scripting?
I know, lots of questions. Any help is greatly appreciated!
#2
and yes, it is my first post.
(none taken)
11/04/2004 (9:40 am)
Actually, I own a commercial license. and yes, it is my first post.
(none taken)
#3
11/04/2004 (10:01 am)
What happens when you have more than 18 path markers in your camera path? I looked in the source files, and I didn't see a hard coded marker limit.
#4
if you have over (approx) 40, it doesn't run at all.
I haven't tried looking at the c++ code.
11/04/2004 (11:06 am)
It goes from number 18 to number 1. it doesn't teleport, just beelines for the first one. it just doesn't recognize the others.if you have over (approx) 40, it doesn't run at all.
I haven't tried looking at the c++ code.
#5
11/04/2004 (11:19 am)
The hard limit is 20 nodes in the code....enum Constants {
NodeWindow = 20 // Maximum number of active nodes
};
#6
1. why can I only use 18
and
2. Is there a way to increase it over 20? I haven't mucked with the c++ but I will if I need to. Is that editable or am I just fscked?
11/04/2004 (11:27 am)
So this brings up 2 questions - 1. why can I only use 18
and
2. Is there a way to increase it over 20? I haven't mucked with the c++ but I will if I need to. Is that editable or am I just fscked?
#7
Using this method (network events) you'll be able to send across as many nodes as you want.
- Brett
11/04/2004 (11:55 am)
I would be wary of increasing the number of nodes. The biggest problem you'll encounter would be packet overflow. Look into the Path Manager resource that came out a while back. It talks about chunking the path nodes across the network in batches of 10.Using this method (network events) you'll be able to send across as many nodes as you want.
- Brett
#8
What should be happening if I remember the code correctly is the NodeWindow is used to send the nodes around the current one over the network, so that the client knows where it's going but doesn't have to keep track of the whole list. So the NodeWindow is largely irrelevant to the actual supported path size. Except in this case something's broken. :)
11/04/2004 (12:05 pm)
That's pretty mysterious. In the demo app, I'm pretty sure we've used longer than 18 node paths. Though I could be wrong... Anyway, it is definitely a bug, and I'd love to get it fixed. There are some limits on path length related to network packet size, but that's more in the hundreds range.What should be happening if I remember the code correctly is the NodeWindow is used to send the nodes around the current one over the network, so that the client knows where it's going but doesn't have to keep track of the whole list. So the NodeWindow is largely irrelevant to the actual supported path size. Except in this case something's broken. :)
#9
If i could seamlessly go from one path to the next, it would be pretty much the same thing except it would have to loop back to the first one.
Don't know if it matters, but the network is irrelevant in this case - this game will only be used as a single player.
Is this the best method to achieve my goals? Or is there a better method to getting the 'on rails like' action I desire?
I know that what I want is possible, and probably not very taxing, I just don't know the best method to achieve it. Any other suggestions would be welcome.
11/04/2004 (2:28 pm)
Iirc, in the demo there are a few different paths. You come to the end of one and it waits for a mouse click, or it loops. Not sure how many points each path has but I'm thinking around 6.If i could seamlessly go from one path to the next, it would be pretty much the same thing except it would have to loop back to the first one.
Don't know if it matters, but the network is irrelevant in this case - this game will only be used as a single player.
Is this the best method to achieve my goals? Or is there a better method to getting the 'on rails like' action I desire?
I know that what I want is possible, and probably not very taxing, I just don't know the best method to achieve it. Any other suggestions would be welcome.
#10
11/04/2004 (3:37 pm)
I think that you have a good idea, and I think that it's probably some minor bug in the code blocking you... I think that spending a little while to fix the issue would probably be well worth the time.
#11
I am using an executable from the demo; I haven't tried making a new one. I suppose there's no chance this got fixed in the new version?
can paths go from one to the next and back to the first?
Any other ideas about how to achieve my ends?
11/04/2004 (4:34 pm)
I heartily agree, unfortunately I am new to this and haven't ever looked at the c++ code, so I wouldn't know what was wrong where.I am using an executable from the demo; I haven't tried making a new one. I suppose there's no chance this got fixed in the new version?
can paths go from one to the next and back to the first?
Any other ideas about how to achieve my ends?
#12
11/04/2004 (5:26 pm)
You can work around it in script, yes, by setting up paths and switching to a new one when you reach the end of the last.
#13
11/04/2004 (6:41 pm)
David, I'll look into the pathCamera stuff sometime tonight to see if I can find a solution for you.
#14
In the demo, there is no pause button. If you F8/F7, it drops you at the beginning of the path. In my version, everytime you F8 it goes to the first node, and F7 does nothing.
Is there hope? Are we all doomed? Will the pathCamera show the one true
path to the promised functionality?
11/05/2004 (5:55 am)
Is it possible to pause/resume (at the same spot) a PathCamera?In the demo, there is no pause button. If you F8/F7, it drops you at the beginning of the path. In my version, everytime you F8 it goes to the first node, and F7 does nothing.
Is there hope? Are we all doomed? Will the pathCamera show the one true
path to the promised functionality?
#15
It is pretty easy to go from one path to the other because there is an
::onEndOfPath( %this, %obj, %path )
function that can be used to change the path when the current one os done. You could use:
%pathCounter++;
%obj.path = "myPath"@%pathCounter;
Hope this helps,
Marrion
11/05/2004 (6:27 am)
David,It is pretty easy to go from one path to the other because there is an
::onEndOfPath( %this, %obj, %path )
function that can be used to change the path when the current one os done. You could use:
%pathCounter++;
%obj.path = "myPath"@%pathCounter;
Hope this helps,
Marrion
#16
In game.cs I create a pathed camera.
%this.player = new PathCamera() {
dataBlock = LoopingCam;
position = "-100 -100 75";
};
MissionCleanup.add( %this.player );
%this.player.scopeToClient(%this);
%this.player.followPath("MissionGroup/Paths/Path3",-1);
In the .mis file, Path3 islooping = "0";
In pathedcamera.cs, I want to move from Path3 to Path2, but it stops at the end of Path3.
LoopingCam::onEndOfPath never gets called, I think because the echo never appears in the log.
datablock PathCameraData(LoopingCam)
{
mode = "";
};
function LoopingCam::onNode(%this,%camera,%node)
{
if (%node == %camera.loopNode) {
%camera.pushPath(%camera.path);
%camera.loopNode += %camera.path.getCount();
}
}
function LoopingCam::onEndOfPath( %this, %camera, %path )
{
echo("end of path");
%camera.path = "MissionGroup/Paths/Path2";
// %this.camera.followPath("MissionGroup/Paths/Path3",-1);
}
11/05/2004 (9:00 am)
Marrion... a bit more info please? In game.cs I create a pathed camera.
%this.player = new PathCamera() {
dataBlock = LoopingCam;
position = "-100 -100 75";
};
MissionCleanup.add( %this.player );
%this.player.scopeToClient(%this);
%this.player.followPath("MissionGroup/Paths/Path3",-1);
In the .mis file, Path3 islooping = "0";
In pathedcamera.cs, I want to move from Path3 to Path2, but it stops at the end of Path3.
LoopingCam::onEndOfPath never gets called, I think because the echo never appears in the log.
datablock PathCameraData(LoopingCam)
{
mode = "";
};
function LoopingCam::onNode(%this,%camera,%node)
{
if (%node == %camera.loopNode) {
%camera.pushPath(%camera.path);
%camera.loopNode += %camera.path.getCount();
}
}
function LoopingCam::onEndOfPath( %this, %camera, %path )
{
echo("end of path");
%camera.path = "MissionGroup/Paths/Path2";
// %this.camera.followPath("MissionGroup/Paths/Path3",-1);
}
#17
I doubt it's this easy, but I'd like to put something in between here like
%this.pathCam.reset(0);
%this.pathCam.followPath(CameraLoop);
// my idea for an easy way
OnEndOfPath::magicallyGoToNextPath //
%this.pathCam.followPath(CameraLoop2);
OnEndOfPath::magicallyGoToNextPath
%this.pathCam.followPath(CameraLoop);
etc
I know it's not this easy.
this is what I have in pathCamera.cs
datablock PathCameraData(OnEndOfPath)
{
echo("end of path");
};
function pathCamera::onEndOfPath( %this, %camera, %path )
{
%obj.path = "cameraLoop"@%pathCounter;
%pathCounter++;
echo("end of path1");
}
//function LoopingCam::onEndOfPath( %this, %camera, %path )
//{
//%camera.path = "MissionGroup/CameraPaths/CameraLoop2";
//}
I don't get either echo.
What am I missing?
11/08/2004 (9:51 am)
I'm kinda in the same boat as Sam. I need further clues to get this to work. Sorry I'm so lame; I've only been scripting for a few months.I doubt it's this easy, but I'd like to put something in between here like
%this.pathCam.reset(0);
%this.pathCam.followPath(CameraLoop);
// my idea for an easy way
OnEndOfPath::magicallyGoToNextPath //
%this.pathCam.followPath(CameraLoop2);
OnEndOfPath::magicallyGoToNextPath
%this.pathCam.followPath(CameraLoop);
etc
I know it's not this easy.
this is what I have in pathCamera.cs
datablock PathCameraData(OnEndOfPath)
{
echo("end of path");
};
function pathCamera::onEndOfPath( %this, %camera, %path )
{
%obj.path = "cameraLoop"@%pathCounter;
%pathCounter++;
echo("end of path1");
}
//function LoopingCam::onEndOfPath( %this, %camera, %path )
//{
//%camera.path = "MissionGroup/CameraPaths/CameraLoop2";
//}
I don't get either echo.
What am I missing?
#18
I'll bet we aren't the only 2 confused by Marrion's post.
11/08/2004 (10:28 am)
Well.... I do know you shouldn't put an echo into a datablock. I'll bet we aren't the only 2 confused by Marrion's post.
#20
?
You need to make sure you're using the right namespaces.
11/09/2004 (5:08 pm)
You probably want something like..function PathCameraData::onEndOfPath( %this, %camera, %path )
{
echo("foo");
}?
You need to make sure you're using the right namespaces.
Torque Owner Gonzo T. Clown
No offense intended