Re: [Algorithms] Curve generation
Brought to you by:
vexxed72
|
From: Ola O. <ola...@gm...> - 2008-05-10 08:04:58
|
I would argue that steering behaviours can actually be harmful in this case. I'd go with some kind of interpolated function that is relative to and terminates at the players current position (so it just translates along with the player). For most predictable behaviour, use a time proportional to distance, which will make things catch up faster if the player moves faster. I find it comforting to be able to be sure that something will always terminate after a certain time (as opposed to "will terminate if the velocity is high enough and nothing else is buggered in the steering code"). With steering behaviours or other chase-over-time code it might break (or be weird) if the player gets a superspeed powerup later in development, or gets launched/falls extremely fast in some way (these things do happen in games after all). Also you do not need to do any kind of test to see if a pickup has come in range - you could but dont have to - since when t=0 it has arrived. As a side benefit you can add a very simple cheat that just sucks all pickups in a level in real quick. This solution can also be implemented with an animation system, should one be handy. Could be a good solution depending on how many variations you need and general performance characteristics. cheers .ola ----- Original Message ----- From: "Oliver Charles" <oli...@go...> To: "Game Development Algorithms" <gda...@li...> Sent: Saturday, May 10, 2008 9:25 AM Subject: Re: [Algorithms] Curve generation > Yea, I think Catmull-Rom would be the fastest to implement - the only > thing that you'd have any issues with, is deciding on points - but > that's just a circle around the player with an expanding radius (if I > understood you right). > > I think steering behaviours (suggested above) would be cool but... > seems a little overkill. > > - Ollie > > On Fri, May 9, 2008 at 6:32 PM, Paul at Home <pa...@ru...> wrote: >> Catmull-Rom splines have long been my friend for this kind of thing as >> the >> lines generated pass through the control points. The algorithm is fairly >> trivial and I'm sure a googling will reveal some code snippets. >> Regards, >> Paul Johnson. >> www.rubicondev.com >> >> >> >> ----- Original Message ----- >> From: Zafar Qamar >> To: Game Development Algorithms >> Sent: Friday, May 09, 2008 5:26 PM >> Subject: [Algorithms] Curve generation >> Hi All, >> >> I'm wanting to create some nice effects for when pickups in a game are >> effectively 'picked' up. >> Imagine many objects all scattered around over the floor. I want them all >> to >> fly towards the player in weird and wonderful spirals and curves. >> Note that the player will be moving. >> >> Anyone have some neat algorithms/ideas/links for how I may achieve this? >> >> Cheers >> >> Zafar >> __________________________________________________________ >> This mail has been scanned for all known viruses and >> delivered through the MessageLabs Virus Control Centre. >> >> ________________________________ >> >> ------------------------------------------------------------------------- >> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference >> Don't miss this year's exciting event. There's still time to save $100. >> Use priority code J8TL2D2. >> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone >> >> ________________________________ >> >> _______________________________________________ >> GDAlgorithms-list mailing list >> GDA...@li... >> https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list >> Archives: >> http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list >> >> >> ------------------------------------------------------------------------- >> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference >> Don't miss this year's exciting event. There's still time to save $100. >> Use priority code J8TL2D2. >> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone >> _______________________________________________ >> GDAlgorithms-list mailing list >> GDA...@li... >> https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list >> Archives: >> http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list >> > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save $100. > Use priority code J8TL2D2. > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > _______________________________________________ > GDAlgorithms-list mailing list > GDA...@li... > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list |