User Tag List

Page 2 of 2 FirstFirst 1 2
Results 11 to 19 of 19

Thread: Snow!

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    The Time-Loop Continues ZC Developer
    Gleeok's Avatar
    Join Date
    Apr 2007
    Posts
    4,826
    Mentioned
    259 Post(s)
    Tagged
    10 Thread(s)
    vBActivity - Stats
    Points
    12,960
    Level
    33
    vBActivity - Bars
    Lv. Percent
    26.4%

    Re: Snow!

    Quote Originally Posted by pkmnfrk View Post
    Edit, RE PutPixel vs Circle:

    I just did some testing. Although I got slow down for flake quantities > 500 (or so), I discovered something else in favour of using Circle. Although I have absolutely no idea how the primitive drawing system works in ZC, I can make a guess based on this experiment.

    Essentially, I built in a way to switch between 5 PutPixels and 1 Circle. At 500 flakes (thats 500 circles vs 2500 PutPixels), half the PutPixel flakes didn't show up! I would switch between the two, and watch half the snow flakes blink in and out of existence. I am of the opinion that I used up all the Primitive drawing command buffer (or something to that effect).

    So. I'm sticking with Screen->Circle for now.
    Hmm, that's an interesting one....


    Wow, there's a bug or something in there. I couldn't even profile putpixel because of it. This is what I used:

    Code:
    const int LOOPS = 1;
    
    global script slot2 
    {
    	void run() 
    	{
    		while(true) 
    		{
    			for(int i = 0; i < LOOPS ; i++)
    				for(int x = 0; x < 256; x++)
    					for(int y = 0; y < 176; y++)
    						Screen->PutPixel(6, x , y, 2, 0, 0, 0, 64);
    			Waitframe();
    		}
    	}
    }

    It completely crippled the engine. I wonder why?
    This post contains the official Gleeok seal of approval. Look for these and other posts in an area near you.

  2. #2
    Octorok
    Join Date
    Jan 2008
    Age
    32
    Posts
    129
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    941
    Level
    10
    vBActivity - Bars
    Lv. Percent
    64.64%

    Re: Snow!

    Nice script. :)

    But wouldn't it be simple to just draw falling snow combos on layer 5 instead?

  3. #3
    Lynel
    ZC Developer
    pkmnfrk's Avatar
    Join Date
    Jan 2004
    Location
    Toronto
    Age
    37
    Posts
    1,248
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    3,144
    Level
    18
    vBActivity - Bars
    Lv. Percent
    11%

    Re: Snow!

    If you count finding and setting up a separate screen, and then setting it as layer 5, and oops, it's the wrong Palette/CSet as easier than plopping down an FFC, then yes.

    However, try getting dynamic looking snow out of a combo...
    Tale of the Cave - a web comic - Updates Monday, Wednesday, Friday
    ZC Tutorials - Tutorials and Script Library - Updated July 30, 2008
    ZeldaGuard - Corruption in my save files? It's more likely than you think!
    I do script requests!

  4. #4
    Lynel
    ZC Developer
    pkmnfrk's Avatar
    Join Date
    Jan 2004
    Location
    Toronto
    Age
    37
    Posts
    1,248
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    3,144
    Level
    18
    vBActivity - Bars
    Lv. Percent
    11%

    Re: Snow!

    Like I alluded to, I believe that the engine does not simply draw to the given layer when you issue a command. I think it stores the command somewhere, and then executes it when it then draws the layer.

    That way, drawing to layer 2 after drawing to layer 6 works "properly".

    Obviously, it can only store so many commands before it pukes.

    The other thing is that ZScript is orders of magnitude slower than, say, running Allegro's code directly. The overhead of drawing individual pixels way outweighs the actual drawing time. We would get similar results drawing 256x178 rectangles.

    So... In other words, draw as little as possible.

    Edit: The way I would solve to "drawing to layers in the wrong order" problem would be to have 6 canvasses, onto which I draw things. Then, just before showing the frame, I would blit them all together onto the back buffer.

    I don't know if this would be slower, though. It would definitely use more memory...
    Tale of the Cave - a web comic - Updates Monday, Wednesday, Friday
    ZC Tutorials - Tutorials and Script Library - Updated July 30, 2008
    ZeldaGuard - Corruption in my save files? It's more likely than you think!
    I do script requests!

  5. #5
    The Time-Loop Continues ZC Developer
    Gleeok's Avatar
    Join Date
    Apr 2007
    Posts
    4,826
    Mentioned
    259 Post(s)
    Tagged
    10 Thread(s)
    vBActivity - Stats
    Points
    12,960
    Level
    33
    vBActivity - Bars
    Lv. Percent
    26.4%

    Re: Snow!

    You may be right but I remember around build 400 or so testing drawing functions by the thousands. I posted a bug thread in case there is something bottle necking the pixel rendering. Shoot first and sort out the details later is what pappy used to say.

    For the meantime I'd continue to use circles and lines. lol.
    This post contains the official Gleeok seal of approval. Look for these and other posts in an area near you.

  6. #6
    &&
    ZC Developer
    Joe123's Avatar
    Join Date
    Sep 2006
    Age
    33
    Posts
    3,061
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    7,305
    Level
    26
    vBActivity - Bars
    Lv. Percent
    9.01%

    Re: Snow!

    Seeing as all of your scripts have to be in the same file, it's not a good idea to include it at the top of every script incase it creeps into someone's file twice.

    Then you're declaring all the variables in std.zh twice and obviously at that point it won't compile.

  7. #7
    Lynel
    ZC Developer
    pkmnfrk's Avatar
    Join Date
    Jan 2004
    Location
    Toronto
    Age
    37
    Posts
    1,248
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    3,144
    Level
    18
    vBActivity - Bars
    Lv. Percent
    11%

    Re: Snow!

    As an old coworker used to say, "It's six of one, and a half-dozen of the other".

    If I include it, someone's going to say "I get an error: Redefinition of LW_BOMB"
    If I don't, someone's going to say "I get an error: Variable not declared: LW_BOMB"

    I think that std.zh should have #ifdef guards, as in C

    Code:
    #ifndef STD_ZH
    #define STD_ZH
    
    //...
    
    #endif
    (that's a joke)

    (partially)
    Tale of the Cave - a web comic - Updates Monday, Wednesday, Friday
    ZC Tutorials - Tutorials and Script Library - Updated July 30, 2008
    ZeldaGuard - Corruption in my save files? It's more likely than you think!
    I do script requests!

  8. #8
    &&
    ZC Developer
    Joe123's Avatar
    Join Date
    Sep 2006
    Age
    33
    Posts
    3,061
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    7,305
    Level
    26
    vBActivity - Bars
    Lv. Percent
    9.01%

    Re: Snow!

    It could be defined in the ~init script maybe

  9. #9
    On top of the world ShadowTiger's Avatar
    Join Date
    Jun 2002
    Location
    Southeastern New York
    Posts
    12,231
    Mentioned
    31 Post(s)
    Tagged
    3 Thread(s)
    vBActivity - Stats
    Points
    29,581
    Level
    46
    vBActivity - Bars
    Lv. Percent
    60.47%
    Achievements It's over 9000!

    Re: Snow!

    I'd do it up.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Armageddon Games is a game development group founded in 1997. We are extremely passionate about our work and our inspirations are mostly drawn from games of the 8-bit and 16-bit era.
Social