Partical Laser Beam Trail ???

Posted By: TerraSame

Partical Laser Beam Trail ??? - 10/31/10 14:30

Hi...
I'm working (among other thing) on a project of a National Park that has many hiking/walking trails.
The park name is "Isle Royale" and it's located in the middle of Lake Superior.
(This game is the largest I've created. It's one full degree of latitude and one full degree of longitude which is about 60 square miles.)
I'd like to identify all the trails with a laser beam.
So, I suppose it would be cool if the beam followed the irregular mountains, up and down etc.
It would be nice if I could attach an action to an entity at the beginning of the trail and the beam would run from entity to entity along the route.
(Each entity would be invisible and passable, so all you'd see is the beam.)
Then I would copy the action, change it's name and beam color for different trails.
Does such a piece of code exist? If not, could someone develop this?
I imagine such a concept could help many people in their games...
Thanks!
Posted By: muffel

Re: Partical Laser Beam Trail ??? - 10/31/10 15:29

Don't know whether it exists
One algorithm would be
- give each way-point(node) the same action
- set some FLAGS/other stuff to signalize that this is a node.
- set one skill to a number of the path ( all nodes of path 1 will have skill1 set to 1,all nodes of path 2 will have skill1 set to 2 )
- give them a node-number (node1 node2) to order them in their paths
- scan the nodes environment for the next higher node of his path, saving this handle in a skill
- saving every first node of a path in an array ( by handle or Entity pointer )
Now you have setup the data structure

each frameyou do:
- start a funktion for each first node giving it a particle funktion as a parameter
this function does:
- make beam to the next node run the same function on the next node

Actually there could be one performance problem:
- I believe that the recursion is quite slow.


Hope this allgorithm is clear.

muffel
Posted By: TerraSame

Re: Partical Laser Beam Trail ??? - 10/31/10 15:47

Hmmmmmmmmmmmm
Thanks for the advice but (as usual) my understanding is quite un-clear....
Unfortunatly, the same applies to my code writing skills...
(I usually cut, copy & paste and experiment like a mad man.)
This one, I'll need more help with other than just good advice...
Muffel, I do (none-the-less) thank you ...
© 2024 lite-C Forums