Student Seeking Mentor

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

  1. Indiepath.T

    Original Member Indie Author

    Joined:
    Sep 4, 2004
    Messages:
    329
    Likes Received:
    0
    1) Turn ints to strings (looked all over blitzwiki couldnt find any info) abnd strings to ints.
    Code:
    myInt = String.ToInt(myString$)
    2) Save a 2D Array into a file and then be able to open it as well.
    Code:
    ' Saving a 1 Dimension IntegerArray
    Local myFile:TStream = CreateStream(myFile$) 
    For Local a = 0 to myArray.Length-1
       WriteInt(myFile,myArray[a])
    Next
    CloseStream(myFile)
    Code:
    'Loading it.
    Local Count:Int = 0
    Local myFile:TStream = CreateStream(myFile$) 
    While Not EOF(myFile)
      myArray[count] = ReadInt(myFile)
      count:+1
    Wend
    CloseStream(myFile)
    
    3) Collisions - What methods to learn.. so many I suppose
    Never used them.

    4) Counters - Counting how many types exist, the best way to do so.
    Code:
    Count = myTList.Count
    5) Animation - Figure out the best way to make things animated.

    Use animated images but use the code I posted on the blitzwebsite as it uses single surfaces as oppose to the BMAX system of using a new surface for every animation frame. (you'll need a registered copy to download that).
     
  2. Leper

    Original Member

    Joined:
    Sep 9, 2005
    Messages:
    757
    Likes Received:
    0
    the fact that I have about 400 objects on one screen.. Is that why the program is running slow? If it is, I'm going to have to completely reprogram the map editor..
     
  3. Indiepath.T

    Original Member Indie Author

    Joined:
    Sep 4, 2004
    Messages:
    329
    Likes Received:
    0
    Your map program is probably crawling because of the image/surface issue.

    Try this, I get a speed increase of about 30% and a VideoMemory Saving of about 40%. It works with OpenGL as well as DirectX.
    Code:
    Type TAnimImage
    	
    	Field Image	:TImage
    	Field width	 :Int
    	Field height	 :Int
    	Field u0	  :Float[]
    	Field v0  	  :Float[]
    	Field u1	  :Float[]
    	Field v1	  :Float[] 
    	
    	Function Load:TAnimImage(url:Object,cell_width,cell_height,start:Int,frames:Int,flags=-1)
    		Local t:TAnimImage = New TAnimImage
    		Local tx:Int
    		Local ty:Int
    		Local x_Cells:Int
    		t.u0		= New Float[frames]
    		t.v0		= New Float[frames]
    		t.u1		= New Float[frames]
    		t.v1		= New Float[frames]
    		t.Image 	= LoadImage(url,flags)
    		x_cells	= t.Image.Width  / cell_width
    		For Local f = start To frames - 1
    			tx	= f Mod x_cells * cell_width
    			ty 	= (f / x_cells * cell_Height)
    			t.u0[f]	= Float(tx) / Float(t.Image.Width)
    			t.v0[f] = Float(ty) / Float(t.Image.Height)
    			t.u1[f]	= Float(tx + cell_width)  / Float(t.Image.Width)
    			t.v1[f]	= Float(ty + cell_Height) / Float(t.Image.Height)
    		Next
    		Return t		
    	End Function
    	
    	Function Free(t:TAnimImage)
    		t.Image = Null
    		t = Null
    		FlushMem()
    	End Function
    	
    	Method Draw(x:Float,y:Float,width:Float,height:Float,frame:Int=0)
    		Local DXFrame:TDX7ImageFrame = TDX7ImageFrame (image.frame(0))
    		If DXFrame
                       DXFrame.setUV(u0[frame],v0[frame],u1[frame],v1[frame])
                    Else
                        Local GLFrame:TGLImageFrame = TGLImageFrame(image.frame(0))
                        GLFrame.u0 = u0[frame]
                        GLFrame.u1 = u1[frame]
                        GLFrame.v0 = v0[frame]
                        GLFrame.v1 = v1[frame]
                    EndIf
    		DrawImageRect(Self.Image,x,y,width,height)
    	End Method
    End Type
    Example:
    Code:
    Graphics 640,480,0,NOSYNC
    Print "Start Memory " + MemAlloced()
    Local now:Int = MilliSecs()
    Local blob:TAnimImage = TAnimImage.Load("gfx/stoneset0.png",32,64,0,32,FILTEREDIMAGE)
    For Local a = 1 To 100
    	Cls
    	For Local b = 1 To 10000
    		blob.Draw(Rand(0,640),Rand(0,480),20,40,Rand(0,31))
    	Next
    	Flip
    Next
    Print "End Memory " + MemAlloced()
    Local time:Int = MilliSecs()-now
    Print "Time Taken " + time
    WaitKey()
    PS. Show me the green!
     
    #23 Indiepath.T, Oct 5, 2005
    Last edited: Oct 5, 2005
  4. Gary Preston

    Original Member

    Joined:
    Aug 5, 2005
    Messages:
    239
    Likes Received:
    0
    Start really simple and make a nice pong game. That will get you using sprites/collisions/sound effects/scoring/input/menu system etc

    Next you could try something like tetris, where you can then think about multiple levels (eg faster block spawn time), how you'll detect winning lines, removing those same lines etc Or create a space invaders clone. Basically anything that requires more complex game logic and multiple levels but doesn't really require a custom map maker.

    After those you can start getting more complex with games that require a map maker (many many ways to do this, some simple some flexible and complex, its up to you) for example a breakout style game or pacman.

    Most people will have created one of more of those game styles whilst learning, so you should be able to find lots of resources on the net to do with them. Whether you'll find blitz code or not, I don't know as I've never used it, but I'm sure someone somewhere has posted their code.

    Final peice of advice. Don't get too hung up on finding "the best way" to do something. Any method that works is good enough for now. As you become more experienced you'll start to recognise areas of your code that are perhaps not as good as they could be, you'll also find it easier to see why someone else did something a different way to you. At which time you can start finding out better ways to do things without wasting time struggling to work out the best way when you don't yet know any ways.
     
  5. Leper

    Original Member

    Joined:
    Sep 9, 2005
    Messages:
    757
    Likes Received:
    0
    First I want to say thanks to you guys and your kind help. I feel blessed that I have found this bulletin board.


    Progress:
    I found the problem that caused it to crawl. I was "looking for the zebra" as my dad always says. The expression means, I was using over-complex logic to do a very simple task. Once I found the problem, I was able to make the map maker really fast. However, as time passes and you delete / add objects more and more, the CPU load increases steadily and the map maker begins to crawl. I'm not sure what it is but I'll figure it out soon.​

    I'm almost done with the map maker, all I have to do is add the "open / save" section and I'm done.Then I'll have to make the game (the game only has the player in it right now)


    Here's a Proposal worth your consideration:
    Would anyone who is familiar with BlitzMax and OOP with Types willing to grade my map maker program for say, 25 bucks via paypal? I'll even send you the money before you grade it! As long as you promise to grade it within 12 hours of payment. If I find your "grading" to be very useful, I will pay you to grade my future projects!​

    I'd really like an expert to atleast grade my "homework!"

    :)
     
    #25 Leper, Oct 5, 2005
    Last edited: Oct 5, 2005

Share This Page

  • About Indie Gamer

    When the original Dexterity Forums closed in 2004, Indie Gamer was born and a diverse community has grown out of a passion for creating great games. Here you will find over 10 years of in-depth discussion on game design, the business of game development, and marketing/sales. Indie Gamer also provides a friendly place to meet up with other Developers, Artists, Composers and Writers.
  • Buy us a beer!

    Indie Gamer is delicately held together by a single poor bastard who thankfully gets help from various community volunteers. If you frequent this site or have found value in something you've learned here, help keep the site running by donating a few dollars (for beer of course)!

    Sure, I'll Buy You a Beer