Teach me splines for $

Discussion in 'Help Wanted (PAID ONLY)' started by Leper, Oct 24, 2005.

  1. Leper

    Leper
    Expand Collapse
    Original Member

    Joined:
    Sep 9, 2005
    Messages:
    759
    Likes Received:
    0
    Hey, I pmed IndiePath about it and he suggested I ask others about this, so here I am. Seeing as how he hasn't used splines yet, I'd much rather pay for someone who has. But unless anyone else steps to the plate, ultimately I'll still accept his guidance seeing as how he is an advanced coder and could probably grasp the spline concept quickly.

    I'll pay roughly $50.00 or even $100.00 (or something you can negotiate with me) to anyone to take some time out of their day to hold my hand and teach me splines like a tutor would teach a kid fractions.

    I think I would learn splines rather quickly if I just had someone who could sit with me and show me what to do, walk me through the steps, and hold my hand. I firmly believe this could be done via ICQ.

    I would need them to be available and take time out of their day at 5pm to 7pm on a monday, thursday or friday. Saturdays are a no go, and sundays are a no go too.

    At any rate, please PM me if you would like to step to the plate and show me splines. It should only take two hours and I will pay somewhere around $50.00 to $100.00 so you can just stop what you're doing and teach me for 2 hours. That's it! If I need more schoolin' then I'll need more cash. Hopefully not! But it's just that simple.

    This project will be outlined on a written contract, as a contractor I'm good at writing these. However, we can change the contract multiple times until we feel mutual about it. Then we will both sign the contract via SNAIL MAIL, and after signage payment will be sent via the terms outlined on said contract.

    I am highly professional and will expedite the contract immediatley to anyone who is sincerely interested and requests me to do so.

    I will pay via credit card, personal check, paypal, or money order in US money.
     
    #1 Leper, Oct 24, 2005
    Last edited: Oct 24, 2005
  2. patrox

    patrox
    Expand Collapse
    Indie Author

    Joined:
    Jul 27, 2004
    Messages:
    218
    Likes Received:
    0
    Try the PTK game engine, it has build in splines, and it's very easy to use ( several blitz basic programmers got it to work within hours )

    pat.
     
  3. Leper

    Leper
    Expand Collapse
    Original Member

    Joined:
    Sep 9, 2005
    Messages:
    759
    Likes Received:
    0
    Sounds promising, but I dont know the first thing about including .h files (thats a c++ library isnt it?) into a blitzmax program.

    I can imagine the poeple that got it to work within hours already knew how to convert libraries right? I can imagine they "translated" from C to BlitzMax..

    But seeing how C is usually this:
    Code:
    
    void functionsarekewl(int,float,string)
       {
       }
    
    void main()
       {
       float Fsoblah
       int Iblahblah
       int Iblah
       int Iblah
       string Syoyocheckitout = ("yo yo check it out"); // lol
       while Iblah <= 10
           {
           Fsoblah == 0.5;
           Iblahblah ++;
           Iblah ++;
           Iyoyocheckitout == Ihomeboyyyyy;  // yeahhh comment homeboy!
           SendMessage(Syoyocheckitout);  //Send the message via function
    
           if (Iblahblah = Iblah)  && (Iblahblah = Iblahblah) || (Iblah=Iblah)
                {
                Iblah==FloatToInt(Fsoblah);
                }
           }
       functionsarekewl(5,5.5,"lol")
       }
    
    ++ means incriment by one
    -- decriment by one
    && means AND
    || means OR
    == means assign variable

    am I right? I think I am but this is off of memory.
     
    #3 Leper, Oct 24, 2005
    Last edited: Oct 24, 2005
  4. ManuelFLara

    ManuelFLara
    Expand Collapse
    Indie Author

    Joined:
    Jul 29, 2004
    Messages:
    470
    Likes Received:
    0
    I think that when he's says "got it to work within hours", he actually means that people who used to code in Blitz switched to PTK & C++, not that they ported the code to BlitzMax.

    If you want to understand how to "use" splines (if you already have some code to handle them), that is really really easy. It's like using quaternions. Understanding them from a mathematical point of view is a whole different story and a lot more complex, as with quats, but fortunately you don't have to in order to use them. Just grab some spline handling source code from the web and use it. It looks very similar to PTK's KSpline functions.

    Also, can I ask what are the splines for? If your intention is writing a Zuma clone let me tell you "spline code" will be the smaller of your problems.
     
  5. Jack Norton

    Jack Norton
    Expand Collapse
    Indie Author

    Joined:
    Jul 28, 2004
    Messages:
    5,130
    Likes Received:
    0
    I'm one of those blitzbasic users who managed to make a working program in 2h with PTK, knowing nothing of C.
    I still don't know C++ even today, this didn't prevent me from making 8 games in 2 years (about the quality well judge yourself)... once you get used to VC debugger you won't come back to blitz one, trust me :D
     
  6. Leper

    Leper
    Expand Collapse
    Original Member

    Joined:
    Sep 9, 2005
    Messages:
    759
    Likes Received:
    0
    I am trying to create a Galaga clone right now. Galaga was my most favorite game growing up (I spent hours at the local arcade pumping my dad's quarters into that game)

    I even went to dave and busters and played galaga a few weeks ago and got to level 50! I was so amazed with myself. I love galaga. I want to make a galaga clone.

    I also want to add in my own additions to it etc. I know that galaga clones are everywhere but I still want to make one as a galaga fan, and it would be my first shmup of hopefully many to come! :)

    Right now I have good sfx, good music, and a good engine built, but the alien ships just fly down and go randomly left and right and its retarted.
     
    #6 Leper, Oct 24, 2005
    Last edited: Oct 24, 2005
  7. joe

    joe
    Expand Collapse
    Original Member

    Joined:
    Sep 28, 2004
    Messages:
    420
    Likes Received:
    0
    here is some bmax code for you to play with. do you mean something like this?

    Code:
    Strict
    
    Graphics 640,480,0
    
    Global x1:Int=100     
    Global y1:Int=100    
    Global vx1:Int=100    
    Global vy1:Int=100     
    Global x2:Int=540    
    Global y2:Int=380     
    Global vx2:Int=540     
    Global vy2:Int=380 
    
    Global point:Int=0
    
    Repeat
    	Cls
    
    	drawbezier (x1,y1,vx1,vy1,x2,y2,vx2,vy2)
    
    	SetColor 255,0,0
    	Select point
    		Case 0
    			DrawOval x1-2,y1-2,5,5
    			If MouseDown(2) Then 
    		        x1=MouseX()
    		        y1=MouseY()
    			EndIf
    		Case 1
    			DrawOval vx1-2,vy1-2,5,5
    			If MouseDown(2) Then 
    		        vx1=MouseX()
    		        vy1=MouseY()
    			EndIf
    		Case 2
    			DrawOval x2-2,y2-2,5,5
    			If MouseDown(2) Then 
    		        x2=MouseX()
    		        y2=MouseY()
    			EndIf
    		Case 3
    			DrawOval vx2-2,vy2-2,5,5
    			If MouseDown(2) Then 
    		        vx2=MouseX()
    		        vy2=MouseY()
    			EndIf
    	End Select
    
    	If MouseDown(1) Then changepoint
    	
    	DrawText "Use left mousebutton to select next point",10,10
    	DrawText "Use right mousebutton to move current point",10,30
    
    	Flip
    	FlushMem
    	
    Until KeyDown(KEY_ESCAPE)
    
    End
    
    Function changepoint()
    	point=(point+1) Mod 4
    	While MouseDown(1)
    	Wend
    End Function
    
    
    Function drawbezier (x1,y1,vx1,vy1,x2,y2,vx2,vy2)
    	For Local t:Float=0 To 1 Step.01
    	Local pointx:Float = x1*(1-t)^3 + 3*vx1*(1-t)^2*t + 3*vx2*(1-t)*t^2 + x2*t^3
    	Local pointy:Float = y1*(1-t)^3 + 3*vy1*(1-t)^2*t + 3*vy2*(1-t)*t^2 + y2*t^3
    	Plot pointx,pointy
    	Next
    End Function
    
     
  8. Leper

    Leper
    Expand Collapse
    Original Member

    Joined:
    Sep 9, 2005
    Messages:
    759
    Likes Received:
    0
    Joe: You're just the guy to teach me this. I'll pay you, since you're in Germany we can work this out. you can always send me lesson plans and I'll pay you $25.00 for each tutorial, and I'd like 4. If you want to, pm me and we can get something started! If anyone else is reading this and is willing to make some $ for tutorials pm me also.

    Jack: VC? Visual C? Does that mean I'd have to purchase the msdn Visual C++ that is overpriced? then purchase the PTK SDK and then learn how to use PTK? I just bought blitzmax and would honestly hate to have to switch over because I dont know splines. I think that knowing splines would be better than switching because of a handicap per se
     
    #8 Leper, Oct 24, 2005
    Last edited: Oct 24, 2005
  9. Savant

    Savant
    Expand Collapse
    Original Member

    Joined:
    Feb 8, 2005
    Messages:
    1,674
    Likes Received:
    0
    I don't want to offend, but the vibe I'm getting from your posts is that splines are the least of your worries right now. You need a more solid grasp on programming languages before you start delving into more complicated subjects.

    Maybe spend some time doing some simpler projects and work up to the project you want to use these splines for. Skip Galaga for now - do Space Invaders.

    Currently this has all the earmarks of someone shooting WAY beyond their limits and the project crashing and burning is only a matter of time.

    Just trying to be helpful, seriously, please don't take personal offense.
     
  10. Leper

    Leper
    Expand Collapse
    Original Member

    Joined:
    Sep 9, 2005
    Messages:
    759
    Likes Received:
    0
    Perhaps you're right. I tend to get over-zealous at times. Maybe I'll just do space invaders for now, I appreciate your honesty! Actually you are only posting what a little voice in my head has been sayin' :rolleyes:
     
  11. Savant

    Savant
    Expand Collapse
    Original Member

    Joined:
    Feb 8, 2005
    Messages:
    1,674
    Likes Received:
    0
    Yeah, plus, think about it - Space Invaders has a LOT in common with Galaga. Controlling a player ship, shooting, collisions, points, etc. Building that game first and then expanding on it to build Galaga will give you a good leg up.

    Good luck with it!
     
  12. Batley

    Batley
    Expand Collapse
    Original Member

    Joined:
    Jul 30, 2004
    Messages:
    77
    Likes Received:
    0
    Pong, Space Invaders and Break out clones are best to do when you're learning.
     
  13. joe

    joe
    Expand Collapse
    Original Member

    Joined:
    Sep 28, 2004
    Messages:
    420
    Likes Received:
    0
    @Leper: I'm sure you can master it yourself. I am also no expert on bezier curves.

    First, I have changed the source a little bit so it is easier for you to play with (I have inserted that the tangents will be displayed):

    Code:
    Strict
    
    Graphics 640,480,0
    
    Global x1:Int=100     
    Global y1:Int=100    
    Global vx1:Int=200    
    Global vy1:Int=100     
    Global x2:Int=540    
    Global y2:Int=380     
    Global vx2:Int=640     
    Global vy2:Int=380 
    
    Global point:Int=0
    
    Repeat
    	Cls
    
    	drawbezier (x1,y1,vx1,vy1,x2,y2,vx2,vy2)
    
    	SetColor 255,0,0
    	
    	If point=0 Then SetColor 255,255,0 Else SetColor 255,255,255
    	
    	DrawOval x1-2,y1-2,5,5
    	If MouseDown(2) And point=0 Then 
    	       x1=MouseX()
    	       y1=MouseY()
    	EndIf
    
    	If point=1 Then SetColor 255,255,0 Else SetColor 255,255,255
    
    	DrawOval vx1-2,vy1-2,5,5
    	If MouseDown(2) And point=1 Then 
    		vx1=MouseX()
    	    vy1=MouseY()
    	EndIf
    
    	If point=2 Then SetColor 255,255,0 Else SetColor 255,255,255
    
    	DrawOval x2-2,y2-2,5,5
    	If MouseDown(2) And point=2 Then 
           x2=MouseX()
           y2=MouseY()
    	EndIf
    
    	If point=3 Then SetColor 255,255,0 Else SetColor 255,255,255
    
    	DrawOval vx2-2,vy2-2,5,5
    	If MouseDown(2) And point=3 Then 
    		vx2=MouseX()
    		vy2=MouseY()
    	EndIf
    	
    	SetColor 255,255,255
    
    	If MouseDown(1) Then changepoint
    	
    	DrawText "Use left mousebutton to select next point",10,10
    	DrawText "Use right mousebutton to move current point",10,30
    
    	Flip
    	FlushMem
    	
    Until KeyDown(KEY_ESCAPE)
    
    End
    
    Function changepoint()
    	point=(point+1) Mod 4
    	While MouseDown(1)
    	Wend
    End Function
    
    
    Function drawbezier (x1,y1,vx1,vy1,x2,y2,vx2,vy2)
    	DrawLine x1,y1,vx1,vy1
    	DrawLine x2,y2,vx2,vy2
    	For Local t:Float=0 To 1 Step.01
    		Local pointx:Float = x1*(1-t)^3 + 3*vx1*(1-t)^2*t + 3*vx2*(1-t)*t^2 + x2*t^3
    		Local pointy:Float = y1*(1-t)^3 + 3*vy1*(1-t)^2*t + 3*vy2*(1-t)*t^2 + y2*t^3
    		Plot pointx,pointy
    	Next
    End Function
    
    Then you can read the following tutorial. It's OpenGL but the main point is to get the maths stuff into your brain (you even don't need to understand it because you just have to enter those formulas into your source) :)

    http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=28

    And here some more math to dive into (I think you don't have to understand everything, just if you want to get deeper in it):

    http://www.moshplant.com/direct-or/bezier/
    http://astronomy.swin.edu.au/~pbourke/curves/bezier/
    http://www.math.ubc.ca/~cass/gfx/bezier.html
    http://www.ibiblio.org/e-notes/Splines/Bezier.htm
    http://antigrain.com/research/adaptive_bezier/

    If you have any questions you can pm or mail me at any time, of course - I won't take your money ;)
     
  14. adrian

    adrian
    Expand Collapse
    Original Member

    Joined:
    Oct 11, 2005
    Messages:
    14
    Likes Received:
    0
  15. Leper

    Leper
    Expand Collapse
    Original Member

    Joined:
    Sep 9, 2005
    Messages:
    759
    Likes Received:
    0
    What's Lingo?
     
  16. Jim Buck

    Jim Buck
    Expand Collapse
    Indie Author

    Joined:
    Jul 27, 2004
    Messages:
    1,158
    Likes Received:
    0
    Lingo is the language used inside of Director for creating Shockwave files.
     
  17. Leper

    Leper
    Expand Collapse
    Original Member

    Joined:
    Sep 9, 2005
    Messages:
    759
    Likes Received:
    0
    Hmm I wouldnt be good at porting it!
     
  18. techbear

    techbear
    Expand Collapse
    Original Member

    Joined:
    Aug 10, 2004
    Messages:
    251
    Likes Received:
    0
    Might I recommend a Catmull-Rom equation? This is similar to splines, but better (for me, anyway) because the line passes directly thru all four points that make up the line.

    To use the function below, just plug in the four consecutive points that define the line, along with the position (t) between the second and third points that you're looking for (0.0 - 1.0). You get back the x,y point you were looking for.

    //***************************************
    struct TrackPoint
    {
    float x,y;
    };

    //***************************************
    void PointOnCurve(TrackPoint &out, float t, TrackPoint p0, TrackPoint p1, TrackPoint p2, TrackPoint p3)
    {
    float t2 = t * t;
    float t3 = t2 * t;
    out.x = 0.5f * ( ( 2.0f * p1.x ) +
    ( -p0.x + p2.x ) * t +
    ( 2.0f * p0.x - 5.0f * p1.x + 4 * p2.x - p3.x ) * t2 +
    ( -p0.x + 3.0f * p1.x - 3.0f * p2.x + p3.x ) * t3 );
    out.y = 0.5f * ( ( 2.0f * p1.y ) +
    ( -p0.y + p2.y ) * t +
    ( 2.0f * p0.y - 5.0f * p1.y + 4 * p2.y - p3.y ) * t2 +
    ( -p0.y + 3.0f * p1.y - 3.0f * p2.y + p3.y ) * t3 );
    }
     
  19. Jim Buck

    Jim Buck
    Expand Collapse
    Indie Author

    Joined:
    Jul 27, 2004
    Messages:
    1,158
    Likes Received:
    0
    I also give a thumbs-up to Catmull-Rom curves for the same reasons (curve passes through the points). I used these in Twisted Metal 4 for various objects in the world that travelled around on paths (train, helicopter, etc). Though, I don't know how easy they are to work with for the person that has to create them.
     
  20. Leper

    Leper
    Expand Collapse
    Original Member

    Joined:
    Sep 9, 2005
    Messages:
    759
    Likes Received:
    0
    I simply do not understand these whatchamacallit roms. I'll try to decipher them tonight when I get home.... Keyword... TRY.....

    I've just finished the level structure of my game.. (the ship will warp from level to level now and its pretty sweet!)

    My warp fx are kinda oldschool though and I know you guys will make fun (just lines that go fast then turn back into dots to represent the stars) of them! :p

    I'm now ready to start programming my levels..

    I'm going to post a question about that on the forums here.
     

Share This Page