Locked Data Extension: Network

Locked

  • Saturday, September 15, 2012 4:03 AM
     
      Has Code

    Does anyone have a working example of the client / server functions or is there still a bug?

    Thanks.


    • Edited by kirk_kaf Saturday, September 15, 2012 5:28 AM
    •  

All Replies

  • Saturday, September 15, 2012 5:21 AM
     
      Has Code

    Do you mean the normal Network function, or the extra functions of the power extension?

    EDIT:

    Here is a little code to download a file out of Internet.

    A = Network.DownloadFile("http://www.mediafire.com/?18ur2us69nswra0")
    B = Program.Directory
    File.CopyFile(A, B)

    There is only one problem in my code. The downloaded file is a .tmp file. And I don't know how to convert it...

    But as an idea should this be ok.


    Ich bin Neu


    • Edited by Timo Sö Saturday, September 15, 2012 5:29 AM
    •  
  • Saturday, September 15, 2012 5:28 AM
     
     

    I mean the extra server and client functions from the Data Extension.

    http://social.msdn.microsoft.com/Forums/en-US/smallbasic/thread/c8a5d124-b02d-44dd-982e-abf18d60f4b7

  • Saturday, September 15, 2012 5:54 AM
     
     
    Ah ok. But what do you want to do?

    Ich bin Neu


    • Edited by Timo Sö Saturday, September 15, 2012 5:55 AM
    •  
  • Saturday, September 15, 2012 7:11 AM
     
     
    Want to make a simple server/client application but getting an error which I believe is due to a bug in the extension but wanted to know from someone who has used this before if they ever got it working.
  • Saturday, September 15, 2012 7:32 AM
     
     
    Now, please post your code. Than we can look after mistakes. Without will it hard.

    Ich bin Neu

  • Saturday, September 15, 2012 7:59 AM
     
     

    My code is irrelevant to this topic, I am getting a run time error due to the extension, I am asking if someone can provide a working example.

  • Saturday, September 15, 2012 9:33 AM
     
     
    Now, I don't know what you mean with a "runtime ERROR" (my English is awful). So pls post the ERROR for me. This would help me, to help you. :)

    Ich bin Neu

  • Saturday, September 15, 2012 12:19 PM
    Answerer
     
     Answered

    Runtime is a programming jargon which means something like "in the time/middle of a program execution".

    So, a runtime error is a bug which happens only after you run a program.

    It's the opposite of a compile error, in which a compiler catches/spots it even before generating an executable (.exe).


    Click on "Propose As Answer" if some post solves your problem or "Vote As Helpful" if some post has been useful to you! (^_^)

  • Saturday, September 15, 2012 2:23 PM
     
     

    Runtime is a programming jargon which means something like "in the time/middle of a program execution".

    So, a runtime error is a bug which happens only after you run a program.

    It's the opposite of a compile error, in which a compiler catches/spots it even before generating an executable (.exe).


    Click on "Propose As Answer" if some post solves your problem or "Vote As Helpful" if some post has been useful to you! (^_^)

    Might also be an exception thrown by the CLR; very slightly different. An error from the CLR means the CLR is having problems with the library, and error from the library means there's a problem in the library.

    The CLR's given me problems when I tried to use a library written in D before, but that's irrelevant.

    • Edited by Liam McSherry Saturday, September 15, 2012 2:23 PM
    •  
  • Saturday, September 15, 2012 2:40 PM
     
     
    This is actually an error thrown from the CLR, I can get the server to start successfully but when using the client to connect the server then throws this error. I will post the error later when I am home.
    • Edited by kirk_kaf Saturday, September 15, 2012 2:40 PM
    •  
  • Saturday, September 15, 2012 8:47 PM
    Answerer
     
     Answered

    I have seen this bug on several computers and also other's posts here. Oskariok has confirmed it and says he will fix it in the next release (still no word on when that will be). 

    It is illegal to decompile the extension (not to mention that it is obfuscated, but all of this is for a good reason), so we cannot fix the bug. Making your own extension is a possibility though. Sorry =(

  • Monday, September 17, 2012 1:39 PM
     
     

    I have seen this bug on several computers and also other's posts here. Oskariok has confirmed it and says he will fix it in the next release (still no word on when that will be). 

    It is illegal to decompile the extension (not to mention that it is obfuscated, but all of this is for a good reason), so we cannot fix the bug. Making your own extension is a possibility though. Sorry =(

    It isn't illegal to decompile an extension. It isn't illegal to decompile anything. Sure, you can breach copyright and trademarks by decompiling, recompiling, and re-releasing a product claiming it as your own, which could allow the copyright holder to issue a C&D and attempt to take you to court over it.

    But decompilation? Completely legal.

  • Tuesday, October 09, 2012 1:12 AM
    Answerer
     
     

    Quote from Oskariok from a long time ago:

    If you read section 2.b you can find these lines:

    You may not alter, merge, modify, adapt or translate the Software, or decompile, reverse engineer, disassemble, share without permission, sell, rent, lease, lend, sub license, transfer, resell, modify, use in commercial or any other profitable project, create derivative works based upon the Software or remove anything from the Software or do anything else that is against any laws or is unethical to do.

    So in theory if you decompile Data.dll I could sue you and take your money, stuff and clothes. And Data Extension is fully protected from ILSpy and partially obfuscated.

    --END QUOTE--

    Not illegal, but a breach of contract. Sorry Liam McSherry, poor word choice on my part =(

  • Tuesday, October 09, 2012 4:33 AM
     
     

    I have some question about data extension that I downloaded from here http://dataextension.hostoi.com/#!/ but I cannot access DOC on the site, so I've to ask...

    I wanted to use an image from imagelist as backbuffer and and draw (transparent) images onto an image in memory,  then draw the whole picture to graphicswindow. But it does not work as expected, I don't get no picture at all. The Itellnonsense says: 

    PictureTool.AddImage(Image, ImageToDraw, X, Y, Widht, Height)

    ....

    Results: New image with specified shape added to it or "FAILED" if operation fails.

    Does that mean there is now an additional image in memory?Or do I have to use a shape?

    And - I was a little bit disappointed, there's no data at all...

    @NaochanON (below) : thanks, think I got it now and I've discovered that this method's far to slow for backbuffering, because if have to draw maybe 50 sprites it needs 2 seconds...

    (and it does not draw transparent that way. Does it at all?)



    • Edited by Rene_Miner Thursday, October 11, 2012 8:51 AM
    •  
  • Tuesday, October 09, 2012 8:36 AM
     
     

    PictureTool.AddImage(Image, ImageToDraw, X, Y, Widht, Height)

    ....

    Results: New image with specified shape added to it or "FAILED" if operation fails.

    Does that mean there is now an additional image in memory?Or do I have to use a shape?

    How to use Picturetools.addimage......... Example

    GameWindow.Width=800
    GameWindow.Height=600
    a= ImageList.LoadImage("http://social.msdn.microsoft.com/Forums/getfile/160473")
    b= ImageList.LoadImage("http://social.msdn.microsoft.com/Forums/getfile/145645")
    c=PictureTools.AddImage(a,b,50,50,150,100)
    Shapes.AddImage(c)

  • Wednesday, October 10, 2012 2:01 PM
     
     Answered


    @NaochanON (below) : thanks, think I got it now and I've discovered that this method's far to slow for backbuffering, because if have to draw maybe 50 sprites it needs 2 seconds...

    (and it does not draw transparent that way. Does it at all?)

    TransparencyColor is set as below.

    GameWindow.Width=800
     GameWindow.Height=600
     a= ImageList.LoadImage("http://social.msdn.microsoft.com/Forums/getfile/160473")
     b= ImageList.LoadImage("http://social.msdn.microsoft.com/Forums/getfile/145645")
     c=PictureTools.AddImage(a,b,50,50,150,100)
     d= Shapes.AddImage(c)
    f=PictureTools.SetTransparencyColor(c,"Black") 
     g=Shapes.AddImage(f)
     Shapes.Zoom(d,0.5,0.5)
     Shapes.Animate(d,-100,1000,20000)

    * and see more here

    .http://social.msdn.microsoft.com/Forums/en-US/smallbasic/thread/b03e6721-2b9b-4e10-9056-4d434023c27e/#e34a36ac-19f7-46fb-a7d2-680a6da30bdb

    HRK412      

     
  • Wednesday, October 10, 2012 2:21 PM
     
     

    Very good. That covers all open questions into that direction :D

    I think, a simple backbuffer-object is urgently needed. That's just some picture somewhere in memory (maybe needs 2 pictures) which can be manipulated like graphicsWindow, but it does not need events & stuff. It should be possible to draw transparent-images from Imagelist onto the backbuffer, also write transparent text on it without creating any new images in memory. 

    "Just" needs ordinary drawing functions and two additional methods like

    Enable(0/1)

    '=1  read out screen-size and create the backbuffer-images with same size in memory

    '=0 free resources

     Present()

    ' draw the current backbuffer-image into graphics-window, clear the other image and make it the drawing-destination.


    • Edited by Rene_Miner Wednesday, October 10, 2012 2:22 PM
    •  
  • Wednesday, October 10, 2012 4:05 PM
     
     


    So in theory if you decompile Data.dll I could sue you and take your money, stuff and clothes. And Data Extension is fully protected from ILSpy and partially obfuscated.

    --END QUOTE--

    Not illegal, but a breach of contract. Sorry Liam McSherry, poor word choice on my part =(

    You would still be unable to sue me for it. Generally, a user is allowed to do anything to their personal copy, such as decompile and modify it. Sure, you can get banned from online services run by the original author, but as long as it is your copy and you do not distribute it, it would be fine.

    The author could issue a Cease & Desist, and attempt to take you to court over it, but it is likely the case would fall through, because a user modifying their personal copy without attempting to distribute or redistribute it is not going to cause damage to the company or userbase.

  • Wednesday, October 10, 2012 4:16 PM
     
     
    This thread needs to be locked its way off topic now. If you have any questions regarding extentions please create a new thread.
  • Wednesday, October 10, 2012 4:23 PM
    Answerer
     
     Answered

    I think, a simple backbuffer-object is urgently needed.

    SB has only 1 GraphicsWindow "object" to draw upon.

    I believe that decision was made to make it more intuitive for children who would not understand why a picture wouldn't show up until a "special" command is issued that would transfer what was being drawn at the "back-buffer" into the "real" GraphicsWindow!

    Thus, SB is unsuitable for animations which use conventional drawing methods such as GraphicsWindow.DrawLine(), Turtle.Move() and such. Those are only for static background drawing!

    For animations, the Shapes (even Control  ;-D) object should be used; since it automatically erases its previous position when ordered to go elsewhere!

    So, there's no need for GraphicsWindow.Clear() all the time, as is the case for "normal" drawings,  to render such shape method animation!

    As an example, check FKF358-7 @ Cool Twisted Effect with Small Basic thread. See how flickering it gets due to all of those GraphicsWindow.DrawLine(x1,y  x2,y) being drawn directly on screen, line by line; and then a GraphicsWindow.Clear().

    Compare it to its adapted version translated to a language which uses "virtual" back-buffer method here and see how much smoother it gets!


    Click on "Propose As Answer" if some post solves your problem or "Vote As Helpful" if some post has been useful to you! (^_^)

  • Wednesday, October 10, 2012 6:14 PM
     
     

    OK, then it need's a possibility to re-order the shapes somehow to draw them in the right order (them in the back first, then them in front). And a method to set a shape up that displays transparent images. So it has at least some sprites. The use of triangular shapes to create some kind of simple 3d-view won't make sense then. The other way-> see above seems quiet easier to me. Maybe the Data-Extension-Creators will understand the problem - or - how about opening a thread - "Extensions- new features - wishlist" where every extension-programmer can check what them folks wanna have... If they realize it, is decided by their capabillities first, by their judiciousness - that the feature could be useful in their extension or the ambition to have the best extension of all.

    sorry mine english is not as good as dine






    • Edited by Rene_Miner Wednesday, October 10, 2012 6:29 PM
    •  
  • Wednesday, October 10, 2012 9:25 PM
    Answerer
     
     Answered Has Code

    OK, then it needs a possibility to re-order the shapes somehow to draw them in the right order...

    Well, while you wait for those extensions to be made, here's what I've found out to mend your situation:

    It seems like SB's shapes have a layer priority which is bound to their creation order.
    The latest shape created is always above the older ones when they cross each other!

    At least, this is AFAIK after I've coded this Animation Layer Test below:  Import Code -> KQZ622-0

    ' Animation Layer Test
    ' by GoToLoop (2012/Oct)

    ' KQZ622-0

    ' http://social.msdn.microsoft.com/Forums/en-US/smallbasic
    '/thread/94015515-5579-4463-b885-9d77ec11b2cb

    GraphicsWindow.Width  = 320
    GraphicsWindow.Height = 240
    GraphicsWindow.Title  = "Animation Layer Test"
    GraphicsWindow.BackgroundColor = "Black"

    InitVars()
    CreateShapes()

    Timer.Tick = AnimateShapes
    Timer.Interval = 1000/fps

    GraphicsWindow.TextInput = Pause
    GraphicsWindow.MouseDown = Pause

    Sub InitVars
     
      gw   = GraphicsWindow.Width
      gh   = GraphicsWindow.Height
     
      gwH  = gw/2
      ghH  = gh/2
     
      fps  = 40
      mv   = 4
     
      sz   = 40
      szH  = sz/2
     
      sqrX = gwH
      sqrY = ghH
      crlX = gwH
      crlY = ghH
      trgX = gwH
      trgY = ghH
     
    EndSub

    Sub CreateShapes
     
      GraphicsWindow.BrushColor = "Red"
      square   = Shapes.AddRectangle(sz,sz)
     
      GraphicsWindow.BrushColor = "Green"
      circle   = Shapes.AddEllipse(sz,sz)
     
      GraphicsWindow.BrushColor = "Blue"
      triangle = Shapes.AddTriangle(szH,0  0,sz  sz,sz)
     
    EndSub

    Sub AnimateShapes
     
      sqrX = Math.Remainder(sqrX+mv  gw)
      crlY = Math.Remainder(crlY+mv  gh)
      trgX = Math.Remainder(trgX+mv  gw)
      trgY = Math.Remainder(trgY+mv  gh)
     
      Shapes.Move(square    sqrX,sqrY)
      Shapes.Move(circle    crlX,crlY)
      Shapes.Move(triangle  trgX,trgY)
     
    EndSub
     
    Sub Pause
     
      If GraphicsWindow.LastKey = "Escape" Then
        Sound.PlayChimeAndWait()
        Program.End()
      ElseIf isPaused Then
        isPaused = "False"
        Timer.Resume()
      Else
        isPaused = "True"
        Timer.Pause()
      EndIf
     
      Sound.PlayClick()
     
    EndSub

    At the example above, shapes are created in this order -> Red square, Green circle, Blue Triangle.

    Red one is always below the others, and Blue one is always above all.

    So, if you plan ahead, you can control layer priority for the shapes you use. It's not ideal, but that will do for now.   ;-D


    Click on "Propose As Answer" if some post solves your problem or "Vote As Helpful" if some post has been useful to you! (^_^)

  • Wednesday, October 10, 2012 9:38 PM
     
     

    Yes, I know. But thats the problem. I dont like to recreate a whole bunch of shapes per frame just to get them in the right order. That will slow it down to a program that can do less then one frame per second and is of no use...

  • Wednesday, October 10, 2012 10:26 PM
     
     Answered

    In the Litdev Extension it has LDShapes.ZIndex which allows you to reorder shapes in the way you mentioned.

    The Fremy Extension has functions similar. Namely: FCControls.SetZIndex andFCControls.GetZIndex.


    I am a 10 year old that loves math, games, and computers. "Everyone is potentially great, you just have to turn it into kinetic greatness."

  • Wednesday, October 10, 2012 10:35 PM
    Answerer
     
     

    I don't like to recreate a whole bunch of shapes per frame just to get them in the right order...

    I don't get why you'd need to recreate and/or change a shape's layer in the middle of a main loop!

    Shape's layer priority is defined by their creation order. So, you just need to manipulate that before hand.

    That's why I have a subroutine whose only function is to create and prepare shapes before the animation actually occurs.

    If I wanted my triangle to be at the lowest layer, for example, I'd only need to create it before all the others.

    So, plan ahead and you'll get your desirable effect.  :-P

    Another tip -> shapes can be erased by using either Shapes.Remove() or GraphicsWindow.Clear().

    Thus, If you really need to change layers between 2 shapes in the middle of the actual action, you'd need to erase and recreate both of them in the needed order by a specialized subroutine; briefly wasting some FPS speed, perhaps!  @_@

    Click on "Propose As Answer" if some post solves your problem or "Vote As Helpful" if some post has been useful to you! (^_^)

  • Wednesday, October 10, 2012 10:40 PM
     
     

    In the Litdev Extension it has LDShapes.ZIndex which allows you to reorder shapes in the way you mentioned.


    Now that's some useful information! Thank you

    maybe, I do not know...

  • Wednesday, October 10, 2012 11:31 PM
    Answerer
     
     

    Oh, so indeed there are 2 extensions which provide features to change shape's layer drawing priority.

    My advice was only to mend this situation while nothing better existed.  ^_^


    Click on "Propose As Answer" if some post solves your problem or "Vote As Helpful" if some post has been useful to you! (^_^)

  • Thursday, October 11, 2012 12:04 AM
     
      Has Code

    As we are keeping this off topic here is an example of animation using the shapes object. Please find the images you need here:http://sdrv.ms/PoBNB6 (sky drive).

    NumberOfFrames = 6
    Frame = 1
    x = 50 
    y = 50
    'Set GFX window
    GraphicsWindow.Width = 150
    GraphicsWindow.Height = 150
    GraphicsWindow.Title = "Sonic"
    'Load all frames as images
    For i = 1 To NumberOfFrames
      sonic[i] = ImageList.LoadImage(Program.Directory + "\Images\sonic" + i + ".PNG")
    EndFor
    'Load all images as shapes
    For i = 1 To NumberOfFrames
      sonic[i] = Shapes.AddImage(sonic[i])
    EndFor
    'Hide all shapes but first
    For i = 2 To NumberOfFrames 
      Shapes.HideShape(sonic[i])
    EndFor
    'Move all shapes
    For i = 1 To NumberOfFrames
      Shapes.Move(sonic[i], x, y)
    EndFor
    'Set timer
    Timer.Interval = 100
    Timer.Tick = OnEachFrame
    'Timer
    Sub OnEachFrame
      Frame = Frame + 1
      If Frame > 6 Then
        Frame = 1
        Shapes.HideShape(sonic[6])
        Shapes.ShowShape(sonic[1])
      Else
        Shapes.HideShape(sonic[Frame-1])
        Shapes.ShowShape(sonic[Frame])
      EndIf
    EndSub
      

  • Thursday, October 11, 2012 3:33 AM
    Answerer
     
     Answered Has Code

    Hey Mainchip!

    Made some experiments and found out how to direct download files from SkyDrive.  HEHEHE

    So, I've taken the liberty to make some modifications on your code to download images from your SkyDrive account.

    Just check it out -> RPC846-4:

    P.S.: I've tried, but Silverlight plugin is too buggy for SB!  *_*

    ' Sonic Animation Example
    ' by Mainchip (2012/Oct)
    ' modded by GoToLoop

    ' RPC846-4

    ' http://social.msdn.microsoft.com/Forums/en-US/smallbasic
    '/thread/94015515-5579-4463-b885-9d77ec11b2cb

    'VarInit
    gw   = 320
    gh   = 240
    gwH  = Math.Round(gw/2)
    ghH  = Math.Round(gh/2)

    fps  = 30
    zoom = 5

    isLocal = "False"

    'Set GFX window
    GraphicsWindow.Width  = gw
    GraphicsWindow.Height = gh
    GraphicsWindow.BackgroundColor = "White"

    'Load & create shapes
    ImagePath()
    LoadImages()
    CreateShapes()

    'Set timer
    Timer.Interval = Math.Round( 1000/fps )
    Timer.Tick = Animation

    'Pause & exit
    GraphicsWindow.TextInput = Pause
    GraphicsWindow.MouseDown = Pause

    'Timer
    Sub Animation
     
      idx = idx + 1
      Shapes.ShowShape( sonic[idx] )
     
      If idx > hashIdx Then
        idx = 1
        Shapes.ShowShape( sonic[1] )
        Shapes.HideShape( sonic[hashIdx] )
      Else
        Shapes.HideShape( sonic[idx-1] )
      EndIf
     
      GraphicsWindow.Title = "Sonic " + idx
     
    EndSub

    'Load all frames as images
    Sub LoadImages
     
      For idx = 1 To hashIdx
        
        GraphicsWindow.Title = "Loading " + idx
        
        If isLocal Then
          sonicImg[idx] = ImageList.LoadImage(local + file + idx + ext)
        Else
          sonicImg[idx] = ImageList.LoadImage(http + code[idx] + path + hash[idx] + file + idx + ext)
        EndIf
        
        Sound.PlayClick()
        
      EndFor
     
      sonicWdhSzH = Math.Round( ImageList.GetWidthOfImage ( sonicImg[1] ) / 2 )
      sonicHgtSzH = Math.Round( ImageList.GetHeightOfImage( sonicImg[1] ) / 2 )
     
      If sonicWdhSzH < 5 Or sonicHgtSzH < 5 Then
        sonicWdhSzH = 14
        sonicHgtSzH = 18
      EndIf
     
    EndSub

    'Load all images as shapes
    Sub CreateShapes
     
      For idx = 1 To hashIdx
        
        sonic[idx] = Shapes.AddImage( sonicImg[idx] )
        Shapes.HideShape( sonic[idx] )
        Shapes.Zoom( sonic[idx]  zoom,zoom )
        Shapes.Move( sonic[idx]  gwH - sonicWdhSzH*zoom, ghH - sonicHgtSzH*zoom )
        
      EndFor
     
    EndSub

    'Pause or exit by key or mouse press
    Sub Pause
     
      If GraphicsWindow.LastKey = "Escape" Then
        Sound.PlayChimeAndWait()
        Program.End()
      ElseIf isPaused Then
        isPaused = "False"
        Timer.Resume()
      Else
        isPaused = "True"
        Timer.Pause()
      EndIf
     
      Sound.PlayClick()
     
    EndSub

    'Image URLs
    Sub ImagePath
     
      http    = "http://"
      path    = ".blu.livefilestore.com/"
      local   = Program.Directory + "\Images\"
      file    = "sonic"
      ext     = ".png"
     
      code    = "1=msglqg;2=njztla;3=njypvw;4=njbzyw;5=msfvwq;6=msekzg;"
     
      hash[1] = "y1mYVkmzkFIPUoi7nKSow1rLyiuML_0aN7-ysRFQoGHrn9ejyFwLcHmdyLswYr2mmmolISlSFanje5NzvUYZCychfMqGHRT3KWRRDqdPjoq7vdYSlD6JWpcWA/"
      hash[2] = "y1m_9F2M6eVmDSTtZVOy2A5pqnla06BlAJRq_PYJNu8coxiJoCS-lJQLfdDa47NY33Y4Oi7xi6vd7JU4Fzw6SwiwqV1nheRkbwrzeYq7aawvxKtPO_6dBgV8Q/"
      hash[3] = "y1m_9F2M6eVmDQsdJoGSefI_dFeHO0ZeU-JQK1eiXmAo53riD6zTAdgjz4U_nPdm6e9zJPHlei1N5SfFEW1phRCgt90Ni6uv92NLXM3gBH-hiljvdCgMi3fPQ/"
      hash[4] = "y1m_9F2M6eVmDRzEKv8Ui0GD00DVoW91q48S83o_K9HwoOcR2Ik2TtHJa8-cUmqv0nWQCDBBa_vqmu44AZF-2UNM7Kk6tAPOacU2z25TfZley1gA4WLzz3P0A/"
      hash[5] = "y1mTcPX35zs_Yk_-KZPvNDUJ7CMKxEHc84tuAaap1fi1oYgby2Qx-g8Y9WtFf_-P220SPg1d5WVdp_VAZwKHx-o-NZb8xKMvAQwgEI5q5HkHq5kwCnc6Z64ow/"
      hash[5] = "y1mTcPX35zs_Yk_-KZPvNDUJ7CMKxEHc84tuAaap1fi1oYgby2Qx-g8Y9WtFf_-P220SPg1d5WVdp_VAZwKHx-o-NZb8xKMvAQwgEI5q5HkHq5kwCnc6Z64ow/"
      hash[6] = "y1mTcPX35zs_Ylfl3bRoMzOa5UuWSRmKeWJ5Fp7IB2RFjMQfVEpugSLc0lCf31Y2oDtigVPMUCbg7J1TpizCaMopRuIewYlPRD8i_RX07b6_IYXt--xTvyrbw/"
     
      hashIdx = Array.GetItemCount(hash)
     
    EndSub

    Click on "Propose As Answer" if some post solves your problem or "Vote As Helpful" if some post has been useful to you! (^_^)

  • Thursday, October 11, 2012 9:31 AM
     
     

    Hi GoToLoop,

    I did actually try and get this working on the web you have been more sucessfull than me so well done there. It seems the web may be a little to slow to hide and show the shapes, have you tried showing the next frame before hiding the old one?

    Thanks.

  • Thursday, October 11, 2012 9:39 AM
     
     
  • Thursday, October 11, 2012 11:30 AM
     
     
    yeah, that's a nice one! :D

    maybe, I do not know...

  • Thursday, October 11, 2012 2:22 PM
     
     
    Hmm... Wonder how hard it would be to handle multiple sprite animations - might have to try a small platform game.
  • Thursday, October 11, 2012 2:39 PM
     
     

    that's gonna need some time... I will try to port my one of own 2d-games written in another basic language to small basic. It will be a time-eating process to change all my *.tga-graphics to *.png in order to get it transparent. Its a few hundred little pics that I've to edit now... Wanna play a little bit in the meantime?  Just scroll down and use slow download:  Locker-Unlocker.7z


    maybe, I do not know...



    • Edited by Rene_Miner Thursday, October 11, 2012 2:40 PM
    •  
  • Thursday, October 11, 2012 3:23 PM
    Answerer
     
      Has Code

    It seems the web may be a little too slow to hide and show the shapes. Have you tried showing the next frame before hiding the old one?

    Hello again Mainchip!

    I was so eagerly focused on making the Sub Animation as short & fast as possible that has escaped my mind that hiding the current shape before displaying the next one was a bad idea.

    Your solution is indeed best adapted for Small Basic for the way it works!

    Just for a curious observation in these 2 lines of your code:

    idx = idx + 1
    Shapes.ShowShape( sonic[idx] )

    Have you noticed that there comes a time when idx = 7, which is outta range?

    It's so fortunate that SB doesn't care about arrays w/ "illegal" indeces nor displaying shapes which doesn't exist!   ;-P

    Click on "Propose As Answer" if some post solves your problem or "Vote As Helpful" if some post has been useful to you! (^_^)

  • Thursday, October 11, 2012 6:28 PM
    Answerer
     
     

    Wow! Very well done Rene_Miner! Nice puzzle game in Pure Basic you got there.

    I'm not very good to the genre, but I do expect its conversion into Small Basic.


    Click on "Propose As Answer" if some post solves your problem or "Vote As Helpful" if some post has been useful to you! (^_^)

  • Thursday, October 11, 2012 6:42 PM
     
     

    Sshhht- don't tell about my past and that I used some none-microsoft product to program with... ;)

    Now you get my point about the need of a backbuffer? It's a lot of sprites and it would be easier to draw then. Is *.png the only kind of pictures that can be displayed transparent on small basic shapes? 

    How do I get such a transparent *.png from my non-transparent *.tga images?


    it's not a bug- it's a feature

  • Thursday, October 11, 2012 9:04 PM
     
     

    Hi GoToLoop,

    I must of missed this, thanks for pointing it out.


    Hopefully we will see more games created with SmallBasic.
    • Edited by Mainchip Thursday, October 11, 2012 9:05 PM
    •  
  • Friday, October 12, 2012 1:27 AM
     
     

    How do I get such a transparent *.png from my non-transparent *.tga images?


    it's not a bug- it's a feature

    Try IrfanView32.exe  (It can access tga file and convert tga ---> PNG)

  • Friday, October 12, 2012 4:17 AM
    Answerer
     
     
    I use this über fast wonder for more than a decade. Although I still have to explore most of it can do!

    Click on "Propose As Answer" if some post solves your problem or "Vote As Helpful" if some post has been useful to you! (^_^)

  • Friday, October 12, 2012 4:24 AM
    Answerer
     
     

    Your puzzle game uses tile blocks; and they're perfect to become shapes in SB.

    With shapes, you don't have to worry about erasing their previous position when they're ordered to go to some coordinate. They're done automatically by SB!

    In short, in your specific game which is not even an action game, I don't see the lack of a virtual buff screen as important.

    Like I said before, It is only necessary for simple drawings made w/ GraphicsWindow.DrawLine() or Turtle.Move() types.

    Just check the examples above, 1 using DrawLine, and others using shapes.  :D


    Click on "Propose As Answer" if some post solves your problem or "Vote As Helpful" if some post has been useful to you! (^_^)

  • Friday, October 12, 2012 10:07 AM
     
     

    Thanks to all of you - thats the kind of support I need :D

    Now I'm busy creating transparent  *.png-images, thereafter I got to type into my keyboard a little bit and I've to figure out some way to create a package that can be accessed with an import-code. The challenge of this quest for me is, not to use any extensions for this project. It should stay plain clean small basic.

    As soon as I got it running in small basic, I will give a signal and ask for more help ;)

    PS. But check this: DHK548 small 3d-basic-example... wouldn't be nice to have a backbuffer?

    EDIT: I really tried, converted 240 small pics to transparent png and  just created the cursor (that yellow thing in the game that displays the current selected tile) But it's flickering that much- I don't think that I'll continue...



    it's not a bug- it's a feature




    • Edited by Rene_Miner Friday, October 12, 2012 12:13 PM
    •  
  • Friday, October 12, 2012 10:58 PM
    Answerer
     
     Answered Has Code
    PS. But check this: DHK548 small 3d-basic-example... wouldn't be nice to have a backbuffer?

    Heyya!

    After some intensive laboring in tidying up unnecessary code and optimizing some calculations, I was finally able to reduce flickering to a more bearable level. Check it out -> DHK548-0

    However, the main culprit was GraphicsWindow.MouseMove!!!

    For each tiny mouse movement, a whole huge & slow Draw3dView() call was issued!

    Dunno if you already know it; but in SB, for each event call triggered, a separated asynchronous instance is created. They all run parallel to each other!

    What happens is: if the mouse is moved so many times, there'll be lotsa Draw3dView() subs, which are called from Sub OnMouseMove, running at the same time. I was even able to easily crash your program!  ;-P

    So, what I did was replace that type of event for:

    fps  = 10
    Timer.Tick = OnMouseMove
    Timer.Interval = 1000/fps

    This way, it would give enough time for the whole Draw3dView() sub to complete till its end!  HEHEHE

    But then again, I dunno how a program, which uses GraphicsWindow.Clear() & GraphicsWindow.FillTriangle as an animation drawing method, has anything to do with a game conversion which would be using shapes category to animate tiles!


    Click on "Propose As Answer" if some post solves your problem or "Vote As Helpful" if some post has been useful to you! (^_^)

  • Friday, October 12, 2012 11:05 PM
     
     

    @ GoToLoop

    Great improvement on his code! (Not that it wasn't good before.)

    @ Rene_Miner

    Amazing 3D model!


    I am a 10 year old that loves math, games, and computers. "Everyone is potentially great, you just have to turn it into kinetic greatness."

  • Friday, October 12, 2012 11:19 PM
     
     

    thats nice. still flickery, but I see some methods that I was not familiar with until now... it's like I have Small Basic since maybe 2 weeks. There's a lot of stuff inside that I haven't seen yet... there's always new things to learn.

    Maybe drawing just lines (wireframed) will go even faster- it does not need to sort the triangles nor calc the light :D

    Oh, it's got something to do with it. If I want to draw the animations like explosions or dust clouds or even the animated cursor - its not nice for the eyes... no fun to look at, no fun to play with...


    it's not a bug- it's a feature



    • Edited by Rene_Miner Friday, October 12, 2012 11:28 PM
    •  
  • Saturday, October 13, 2012 1:52 AM
    Moderator
     
     
    I agree so start new thread for new question/discussion.