Page 1 of 2 12 LastLast
Results 1 to 40 of 65

Thread: Anyone want to make a few tutorials ?

  1. #1

    Thread Starter
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359

    Anyone want to make a few tutorials ?

    I'd like to have a tutorials page for Games&Graphics stuff in here.

    Ideally, someone would be appointed to create the thread, and then deal with all submissions and what not themselves.
    Once you feel that you have enough material put together, then the thread would be made sticky.

    Would anyone be interested in this ?
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  2. #2
    Lively Member Professor29's Avatar
    Join Date
    Feb 2002
    Posts
    89
    I would like to see this too, but I have no clue how to use DirectX or any other 3D Engine, so I couldn't help.
    ERROR: No keyboard detected. Hit F1 to continue.

  3. #3
    Frenzied Member Zaei's Avatar
    Join Date
    Jul 2002
    Location
    My own little world...
    Posts
    1,710
    I think that I could write a few, depending on what you guys are looking for. Let me know, and Ill tell you what I can do =).

    Z.

  4. #4
    Lively Member Professor29's Avatar
    Join Date
    Feb 2002
    Posts
    89
    Anything with DirectX and game programming, that's what I would like to see.
    ERROR: No keyboard detected. Hit F1 to continue.

  5. #5
    Frenzied Member Zaei's Avatar
    Join Date
    Jul 2002
    Location
    My own little world...
    Posts
    1,710
    Originally posted by Professor29
    Anything with DirectX and game programming, that's what I would like to see.
    Doesnt tell me much =).

    Z.

  6. #6
    Lively Member Professor29's Avatar
    Join Date
    Feb 2002
    Posts
    89
    I would like to see some tutorials on how to build simple games, how to use DirectX, and how to use the Windows API, along with defenitions of each.
    ERROR: No keyboard detected. Hit F1 to continue.

  7. #7
    Frenzied Member Zaei's Avatar
    Join Date
    Jul 2002
    Location
    My own little world...
    Posts
    1,710
    I refuse to write a book =). I need specifics (ie, how do I create my own file format, creating an ingame GUI, etc).

    Z.

  8. #8
    Lively Member Professor29's Avatar
    Join Date
    Feb 2002
    Posts
    89
    I didn't ask you to write a book, I just wanted an example file of how to use DirectX or Windows API for a simple game that would have comments before the confusing areas. Sorry for making you misunderstand what I meant.
    ERROR: No keyboard detected. Hit F1 to continue.

  9. #9
    Frenzied Member Zaei's Avatar
    Join Date
    Jul 2002
    Location
    My own little world...
    Posts
    1,710
    Those are already availible, if you take a look on google. I dont want to simply repeat the work of others =).

    Z.

  10. #10
    Lively Member Professor29's Avatar
    Join Date
    Feb 2002
    Posts
    89
    What should I search for on Google?

    This may seem stupid, but I like to know exactly what to do before I begin something.
    ERROR: No keyboard detected. Hit F1 to continue.

  11. #11
    Frenzied Member Zaei's Avatar
    Join Date
    Jul 2002
    Location
    My own little world...
    Posts
    1,710
    Well, if you are just looking for DX, http://www.directx4vb.com/

    Z.

  12. #12
    Lively Member Professor29's Avatar
    Join Date
    Feb 2002
    Posts
    89
    Thanx, but I think that our "conversation" might have gotten a little off topic.
    ERROR: No keyboard detected. Hit F1 to continue.

  13. #13
    Fanatic Member MoMad's Avatar
    Join Date
    Oct 2000
    Location
    Seattle, WA
    Posts
    625
    This has been done before, search this forum for a post by started by me (i forgot the title, but search for tutorial and started by momad)... and try to use that as a starting point.
    :MoMad:
    Nice Sig!

    http://go.to/momad/ Status: Not Ready

  14. #14
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    I know all sorts of tips and tricks for API Graphics, I don't really want to write anything up but if someone else does, I'll gladly give all the code...
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  15. #15
    Frenzied Member ice_531's Avatar
    Join Date
    Aug 2002
    Location
    Sitting w/ Bob Status: -Next -To- Null- Friend: Philip
    Posts
    1,152

    lol

    lazy eh

    well i dont kno much about direct x or any graphics and game programming, but i'd sure read a tutorial or two and try to learn a bit
    :::`DISCLAIMER`:::
    Do NOT take anything i have posted to be truthful in any way, shape or form.
    Thank You!

    --------------------------------
    "Never heard about "hiking" poles. I usualy just grab a stick from the nature, and use that as a pole." - NoteMe
    "Finaly I can look as gay as I want..." - NoteMe
    Languages: VB6, BASIC, Java, C#. C++

  16. #16
    Frenzied Member Zaei's Avatar
    Join Date
    Jul 2002
    Location
    My own little world...
    Posts
    1,710
    For DIrectX Tutorials go to http://www.directx4vb.com . I refuse to write a tutorial on triangles =).

    Z.

  17. #17
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    Here's something to start us off, would be a good thing to know for a vector drawing program:
    VB Code:
    1. Private Function ScalePoints(ByRef Pts() As PointAPI, ByRef RectSize As RECT, ByVal CentreX As Double, ByVal CentreY As Double, ByVal ScaleX As Double, ByVal ScaleY As Double)
    2. Dim rWidth, rHeight
    3. Dim cX, cY
    4. Dim cTop, cLeft
    5. Dim I As Long
    6.  
    7.     rWidth = RectSize.Right - RectSize.Left
    8.     rHeight = RectSize.Bottom - RectSize.Top
    9.     rWidth = rWidth * ScaleX
    10.     rHeight = rHeight * ScaleY
    11.  
    12.     cX = RectSize.Left + (CentreX * (RectSize.Right - RectSize.Left))
    13.     cY = RectSize.Top + (CentreY * (RectSize.Bottom - RectSize.Top))
    14.  
    15.     cLeft = cX - (rWidth / 2)
    16.     cTop = cY - (rHeight / 2)
    17.  
    18.     For I = LBound(Pts) To UBound(Pts)
    19.         Pts(I).X = Pts(I).X - RectSize.Left
    20.         Pts(I).Y = Pts(I).Y - RectSize.Top
    21.  
    22.         Pts(I).X = Round(Pts(I).X * ScaleX)
    23.         Pts(I).Y = Round(Pts(I).Y * ScaleY)
    24.  
    25.         Pts(I).X = cLeft + Pts(I).X
    26.         Pts(I).Y = cTop + Pts(I).Y
    27.     Next I
    28.  
    29.     RectSize.Left = cLeft
    30.     RectSize.Top = cTop
    31.     RectSize.Right = cLeft + rWidth
    32.     RectSize.Bottom = cTop + rHeight
    33.  
    34. End Function
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  18. #18

    Thread Starter
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Good morning peeps
    Cheers for that code Sastraxi.


    We're all able to write small snippets and what not, and perhaps, with permission from directx4vb.com, for tutorials we could link straight into some of their pages ?

    So that then would mean that us lot would just come up with a few code snippets etc.
    I made a few for BitBlt, StretchBlt, Set+GetPixel etc.

    I'm sure some of you have some common routines that you could write just a few words about ?
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  19. #19
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    How about a flexible game loop?
    VB Code:
    1. Public RunCode As Boolean
    2. Public Const gameRate As Long = 20 '50 ticks/second, 20ms per tick
    3. ...
    4. ...
    5. ...
    6. Dim iDelta As Double
    7. Dim iStart As Long: iFinish As Long
    8.  
    9. RunCode = True
    10. iStart = GetTickCount
    11.  
    12. Do
    13.     iFinish = GetTickCount
    14.     iDelta = (iFinish - iStart) / gameRate
    15.     iStart = GetTickCount
    16.         GameLogic iDelta 'Update the game logic (ex. player movements) with the Delta (ex. if it took 10 ms, this would be 0.5 showing half a frame).
    17. Loop Until RunCode = False
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  20. #20
    Fanatic Member MoMad's Avatar
    Join Date
    Oct 2000
    Location
    Seattle, WA
    Posts
    625
    Ahhhhhhhhhhhh, HScrolls!!
    :MoMad:
    Nice Sig!

    http://go.to/momad/ Status: Not Ready

  21. #21
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    That's the price you pay
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  22. #22
    Frenzied Member Zaei's Avatar
    Join Date
    Jul 2002
    Location
    My own little world...
    Posts
    1,710
    Sas, use a while loop =). That way, if initialization fails, the game simply quits out with no extra logic on your part =).

    Z.

  23. #23
    Fanatic Member MoMad's Avatar
    Join Date
    Oct 2000
    Location
    Seattle, WA
    Posts
    625
    I got code but its not vb
    :MoMad:
    Nice Sig!

    http://go.to/momad/ Status: Not Ready

  24. #24
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    Yeah, I thought about that... The only reason is there's this site that states that While...Wend loops are slower than conventional loops... if that's the case I don't want to use 'em.
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  25. #25
    Fanatic Member MoMad's Avatar
    Join Date
    Oct 2000
    Location
    Seattle, WA
    Posts
    625
    Slow as in "more ticks" but not as in "human-seeable".. also, this slow you talk of is much faster than the assignment ops in vb
    :MoMad:
    Nice Sig!

    http://go.to/momad/ Status: Not Ready

  26. #26
    Frenzied Member Zaei's Avatar
    Join Date
    Jul 2002
    Location
    My own little world...
    Posts
    1,710
    Its VB =).

    Though with the extra logic, it would probably even out...

    Z.

  27. #27
    Frenzied Member Zaei's Avatar
    Join Date
    Jul 2002
    Location
    My own little world...
    Posts
    1,710
    I was right =)
    Code:
    While..Wend - 1mil: 0.2421875
    Do..Loop Until - 1mil: 0.1953125
    Do..Loop While - 1mil: 0.203125
    Do..Loop Until - 1mil - Extra Logic: 0.359375
    Do..Loop While - 1mil - Extra Logic: 0.3828125
    Extra Logic simply means that there is a single If statement (empty, never actually executes the internal code) within the loop.

    Z.

  28. #28
    Fanatic Member MoMad's Avatar
    Join Date
    Oct 2000
    Location
    Seattle, WA
    Posts
    625
    wow, but how did we end up so OT!!
    :MoMad:
    Nice Sig!

    http://go.to/momad/ Status: Not Ready

  29. #29
    Frenzied Member Zaei's Avatar
    Join Date
    Jul 2002
    Location
    My own little world...
    Posts
    1,710
    This works as tutorial =).

    Z.

  30. #30
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    It really doesn't matter... if the Init fails why do we need to EXIT quickly?
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  31. #31
    Addicted Member
    Join Date
    Dec 2001
    Location
    Great White North, ey?
    Posts
    202

    Question

    So, does anyone know how to make your own file format? Is there a way to build on the windows .bmp format, except make your file not able to open with any bitmap viewer except your own code? Like they do to textures in most games so people wouldn't change the textures however they wanted.??!?

  32. #32
    Frenzied Member Zaei's Avatar
    Join Date
    Jul 2002
    Location
    My own little world...
    Posts
    1,710
    Ah, now THAT is a tutorial request =). Whos up for some writing?

    Z.

  33. #33
    Fanatic Member MoMad's Avatar
    Join Date
    Oct 2000
    Location
    Seattle, WA
    Posts
    625
    I made something similar (in C++ using zlib to compress). I think I posted it on the C++ forums here but im not sure.
    :MoMad:
    Nice Sig!

    http://go.to/momad/ Status: Not Ready

  34. #34
    Fanatic Member MoMad's Avatar
    Join Date
    Oct 2000
    Location
    Seattle, WA
    Posts
    625
    BTW: Check Lucky's VB Site
    :MoMad:
    Nice Sig!

    http://go.to/momad/ Status: Not Ready

  35. #35
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    PNG is open-sourced, correct? If that is the case, I would suggest that format for its power and open-sourcedness If you simply expanded its code and changed it around, it could easily become "your own format".
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  36. #36
    Frenzied Member Zaei's Avatar
    Join Date
    Jul 2002
    Location
    My own little world...
    Posts
    1,710
    Alrighty, Ill offer to write a quickie on the theory behind a scene graph, if anyone is interested.

    Z.

  37. #37
    Fanatic Member MoMad's Avatar
    Join Date
    Oct 2000
    Location
    Seattle, WA
    Posts
    625
    Originally posted by Sastraxi
    PNG is open-sourced, correct? If that is the case, I would suggest that format for its power and open-sourcedness If you simply expanded its code and changed it around, it could easily become "your own format".
    Yes PNG is open source but have you took a look at it?? There is some crazy stuff going on, and it uses the zlib. That png is not easy to "use" much less "modify"!! There is simply waaaayyyy too much "features" in PNG that no windows PNG viewer that I know supports 100%!!!

    I would suggest using the BMP format but simply make your own BITMAP_*_HEADER's and then compress the actual data using zlib.

    If you want to see what I did with this, its open source, here it is:
    Attached Files Attached Files
    :MoMad:
    Nice Sig!

    http://go.to/momad/ Status: Not Ready

  38. #38
    Fanatic Member MoMad's Avatar
    Join Date
    Oct 2000
    Location
    Seattle, WA
    Posts
    625
    And here is the exe (for those of you who want to peek at it):
    Attached Files Attached Files
    :MoMad:
    Nice Sig!

    http://go.to/momad/ Status: Not Ready

  39. #39
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    Well I dont mean modify the actual DATA, modify the header. If you mess up the order, you can make it so only you can view it.

    And concerning bitmaps... how about this. Use zLib to compress a full bitmap inside another file. Then, make your own header with the zLib info. Easy and small, no?

    [edit]HAHA, I didn't even read the 'meat' of your post and I said the same thing, hehe
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  40. #40
    Addicted Member
    Join Date
    Dec 2001
    Location
    Great White North, ey?
    Posts
    202

    Exclamation

    Can someone shed some light here for me? What is zLib? Where can I get it and how do I use it? I never heard of a zLib before

    Thanks

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width