User Tag List

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

Thread: Snow!

  1. #11
    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,959
    Level
    33
    vBActivity - Bars
    Lv. Percent
    26.21%

    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. #12
    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,142
    Level
    18
    vBActivity - Bars
    Lv. Percent
    10.56%

    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!

  3. #13
    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,959
    Level
    33
    vBActivity - Bars
    Lv. Percent
    26.21%

    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.

  4. #14
    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,579
    Level
    46
    vBActivity - Bars
    Lv. Percent
    60.35%
    Achievements It's over 9000!

    Re: Snow!

    Quote Originally Posted by Joe123 View Post
    You need to
    Code:
    import "std.zh"
    ST =)
    Quote Originally Posted by pkmnfrk View Post
    Oh come on. Surely that's implied by now...
    Pretty much the reason for me asking and wondering, is that it wasn't implied, as if I even have to wonder why it was left out, then it's not obvious. Wouldn't it be better to include the line at the beginning of the script so this sort of conversation wouldn't happen? (lol you're dealing with an idiot here.. *sigh* ) It'd be easier just for the skilled scripter to remove the line as necessary than to leave it out and have people tripping over it because they thought the person who write the script would have included everything necessary in the first place. Non-scripters wouldn't know any better, and isn't the point of writing the scripts and showcasing them that nonscripters could just pick them up and plug them in?


    Otherwise, snow looks very cool. :) I don't suppose we can change the value of D1 on the fly, mid-game?

  5. #15
    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,142
    Level
    18
    vBActivity - Bars
    Lv. Percent
    10.56%
    Just set different FFC's to use different values. So, you can't change it one one screen, but different screens can have different values.
    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!

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

    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. #17
    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,142
    Level
    18
    vBActivity - Bars
    Lv. Percent
    10.56%

    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. #18
    &&
    ZC Developer
    Joe123's Avatar
    Join Date
    Sep 2006
    Age
    32
    Posts
    3,061
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    7,303
    Level
    26
    vBActivity - Bars
    Lv. Percent
    8.74%

    Re: Snow!

    It could be defined in the ~init script maybe

  9. #19
    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,579
    Level
    46
    vBActivity - Bars
    Lv. Percent
    60.35%
    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