![]() ![]() |
| |||||||||
| Hotspots: Slides and Code TA Corner Comments? Announcements FAQ Static Webspace | ||||||||||
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
| Sorry for the change everybody, but when you submit anything on T-square, make sure that you press the "Submit" button and not the "Save Draft" button as you have done in the past. The "Save Draft" button will keep your work, but will not ever submit it. However, once you have pressed "Submit", you can't change anything without e-mailing your TA the new files, so try not to submit until you are sure that you are done. If you e-mail the TAs after 11:45 PM, your submission will still be late, so make sure that you e-mail them in time if that is what you need to do. Once again, I'm sorry about this change. Thanks! Brittany Duncan |
| You should be able to do this with everything that we have done so far in class. My advice is to write a program initially that has a single sprite "glide" across the maze. Then revise your program, once this works, so that the sprite navigates the maze intelligently. Finally, you can have the program cycle through a bunch of sprites so that instead of gliding, it looks like it is walking, jumping, crawling or whatever. Colin Potts |
| The end of the maze is in the top right corner (the room with the greem dragon in it), and you have to avoid the black space as well as make your character move intelligently through the maze. Hope this helps; let me know if you have any questions. Toni Walden |
| In principle: go for it. In practice: I'm not sure how this would work, since all pictures in JES are 24-bit RGB. Are you suggesting creating a monochrome sprite "mask" to encode the transparent pixels? Colin Potts |
| Feel free to use your own sprites (as long as they are reasonably sized!). Toni Walden |
| JES. Thanks!Brittany Duncan |
| Since the instructions say to call it zeldaRun and does not specify parameters, I suggest having it NOT take in parameters because it will make it easier for TAs to grade, unless you hear otherwise from someone else.Jon Cohen |
| No, you can go in those rooms. The "avoiding black space" part of the assignment refers to the black area outside of the maze to prevent people from taking a direct route to the final room ignorong the maze completely.Toni Walden |
| Use more images. If you have two images that you are alternating to make your sprite run, it will go through that sequence 15 times in one second (because the assignment says to use 30 frames per second). I am not sure if you are making your own sprites or using the ones in the .zip file provided, but if you look in that file there are several that have multiple images (8+) to represent running. The more images you have your motion broken into the smoother it will seem.Toni Walden |
| Alteratively, if you really only want to use two images and you wanted to use each one for – say – 0.50 sec in a 16fps movie, you could do find out whether frameNumber%16 is greater than or less than 8 and choose one of the two sprites accordingly. Since the sprite will be positioned differently on each of eight consecutive frames during the half second, it will look as though it is skating rather than running. Colin Potts |
| See example posted to the slide page and discussed briefly in class yesterday. Colin Potts |
| Don't worry too much about "solving" the maze. The homework is designed to get you to practice with animation. If you make the sprites move intelligently around the rooms of the maze, changing direction a few times because of the doors that get in the way, we will give you the extra credit. |
| You could just leave it as one big picture, and I believe that what is intended. However, if you would like to cut the maze into smaller images to where you do not "see" the next room until the sprite enters it, feel free. With things like this, it's not so much we tell you how you HAVE to implement the background, but give you a little freedom for creativity. If you would like more spefics, e-mail one of us and let us know exactly how you were thinking of setting up the homework, that way we can make sure you are still meeting the minimum requirements for the assignment. I hope this helps and feel free to contact me if you have any questions. Toni Walden |
| Anyone who has not already broken up the background, please don't. If you do, you will have to submit a number of extra files (and it is also a lot of extra work for you). Thanks! Brittany Duncan |
| Preferably not, because once again, you will have to submit an extra file. Thanks! Brittany Duncan |
| They know that it will take a while, it always does. Thanks! Brittany Duncan |
| They can just go over. Thanks! Brittany Duncan |
| That's fine. Thanks! Brittany Duncan |
| Either is fine. Thanks! Brittany Duncan |
| Move the background while animating the sprite. Thanks! Brittany Duncan |
| You should scroll across the big maze image and not make smaller pictures. Thanks! Brittany Duncan |
| Look near the top of this page. Colin Potts |
| Are you asking for advice about your program or your personality? ;) Seriously, that's the problem with animation: it is computationally intensive, and JES is slow. If you are still working on parts of your program and testing them, you can comment out the expensive commands (e.g. some of the writePictureTo/writeFrame calls) while you fix problems elsewhere. If you have divided your program into several smaller functions, you may be able to run those functions separately to test/debug/refine them. That way you don't need to wait so long. If you're nearly done with the program and just fine-tuning, I'm afraid that you need to be patient and wait for it to do its thing. Colin Potts |
| Depends. You should check your indentation. Are you doing something inside a loop that should be done outside? (For example writing the sprite for every pixel in the sprite, rather than once.) Colin Potts |
| I don't know. It sounds as though you are making the movie with the wrong pictures. First, the background should not be white if you have created the frames correctly. (You HAVE bothered to look at some of them haven't you?) And if you are selecting, say, 60 frames at 30 fps, the movie should last for 2 seconds. You suggest that your movie is shorter than that. How many frames are there between the first and last frame? Colin Potts |
| Yes. addText(). It is in the JES function help menu. You can only draw black text, though. Colin Potts |
| Thank you for pointing this out. I had forgotten that this had been added to JES (although the online documentation has not been updated.) In fact ALL of the drawing functions take an optional final color argument. Colin Potts |
| Great! For those of you who are wondering what on earth we are talking about (99% of you probably), we will deal with classes, a concept in object-oriented programming in a few weeks. Colin Potts |
| Is it (1) ignoring you and not writing the files; (2) Giving an error message, saying that the folder is write-protected; or (3) Creating empty files - i.e. 0kb in size? If (1), you are writing the files correctly, but you haven't set the media path, so you don't know where to look for them. If (2), you need to set the folder you are saving the files into not to be read-only and/or set the folder that JES is in not to be read-only (writePictureTo actually writes a temporary file in the JES folder before transferring it to where you want it to be, so both folders must be writable.) If (3), we're working on that one. Colin Potts |
| Are you calling the zeldaRun() function, then? And are you making sure that everything is nested properly within your for loops? Chris Phillips |
| It could be, if you're moving the image one pixel at a time. You might try moving it faster. Or, to speed up the runtime (but not change the frame number), you could try writing the code so that it only shows one room of the map at a time. Chris Phillips |
| No. While it's ultimately up to Colin, it wouldn't be fair to, essentially, be punishing those who started early on it. I already emailed Brittany and Colin both when I first saw the ambiguity (before it was changed on the coweb), and got their okay to have the sprite moving, since it was ambiguous. I believe the wording was changed to try and remove the ambiguity, since it was causing concern for some people. So if you've already done it differently, before the directions were changed, don't worry about it. Chris Phillips |
| As the directions don't say it should move simultaneously, I assume you can have it run right after. However, it shouldn't be -too- difficult to make it run simultaneously if you want it to. You'd need to have it run off of the same loops you've created for the first sprite, but you could handle the different movement by including if clauses. I'd recommend using if clauses, just 'cause it'd make it execute faster then (and be a shorter movie too), which makes TAs happy. But then, I'm biased. Chris Phillips |
| Yes. That is exactly what Brittany's revised directions seem to indicate, in fact. Chris Phillips |
| You should use chromakey to make the backgrounds not solid. Thanks! Brittany Duncan |
| Don't try to fix it. You will start making little changes here and there that seem plausible. But that is really just trial and error and you will probably only waste time. Work out instead exactly what your program is doing. Be thorough and stupid about this – as stupid as a computer. Don't try to second guess anything. Write down the values that your program is setting. Once you have done that, you will eventually see what is going on, why y can get to 211 instead of 210, and fixing the code will be automatic. Colin Potts |
| BTW, I'm not trying to be cute. I don't know what you're doing wrong. You might sit down with a TA on Monday or come to my office hours if you are still stuck. Colin Potts |
| Don't worry about the program taking a long time to run. The TAs are prepared for this. Just be sure that you have indented everything correctly so that you aren't doing something completely crazy like writing a file every time you get a pixel (which will take too long). Animation is time consuming. (See next question.) Colin Potts |
| Two frames per second. That sounds about right. Remember the sunset demo that I gave in class would have taken about 20 minutes if I had run it to completion. This is the problem with animation: it's computationally intensive, and JES is slow. Colin Potts |
| Perfectly fine to zip them up. Chris Phillips |
| We're not asking you to change the sprite's direction. Chris Phillips |
| Depends on how you approached the problem, but generally speaking, set the statement that makes the maze.png file into a picture into the for loop. So, if you currently have, say, canvas = makePicture(getMediaPath("maze.png")), and it's outside the for loop that is generating your sprite's movement, place it inside the for loop instead. It'll mean every iteration of the for loop, the background will be reassembled from that picture, and no longer contain the sprite. Chris Phillips |
| No problem. The blurring is a side effect of the compression that takes place when JES saves a JPG image and MovieMaker compresses the frames of a movie. Colin Potts |
| Absolutely! You write a program in your first CS course that takes an hour to run... How could we say that's not okay?! (Actually, we have a secret way to test your program that won't take that long, so don't worry.) Colin Potts |
| You don't need to rotate it. If it always faces left/right when going up/down it will look like many 1970s-80s video game animations anyway and you'll get full credit. Of course you can rotate your sprite if you like. It's not as difficult as you might think, especially if your sprite is square. Colin Potts |
| You would have to e-mail it to your TA. If you did not make any changes to the background, don't worry about it. Thanks! Brittany Duncan |
| That seems to meet the critera, so that is fine. Thanks! Brittany Duncan |
| If you are meeting the critera that we posted then yes, but you need to run through the maze. Thanks! Brittany Duncan |
| That is fine. Thanks! Brittany Duncan |
| Yes (as long as your sprite is moving). Thanks! Brittany Duncan |
| MovieMaker lets you choose the frame rate, so you get to decide how long the movie will run for. Fractions of a second are okay. E.g. 200 frames at 30 fps lasts for 6.67 seconds. Colin Potts |
| You can use anything that makes a movie file. We teach you about MovieMaker, because it works on all platforms and is free. Colin Potts |
| You're not really "moving" the background, although that's how it will look. You are really panning a viewport across the background, by copying only a part of the background onto the canvas for your frame – a different part for each frame as you pan across the background. A partial copy of a background like this is often called a viewport, because it is like moving a window over a bigger background. As a practice exercise, think about how you would copy the top 200x200 pixels onto the first frame's canvas (easy) and then how you would copy another 200x200 pixels that are, say 5 to the right and five down, onto the second frame, and then 200x200 that are 10 over and 10 down onto the third frame, and so on. Do this enough times and it will look like the background is moving up and to the left from frame to frame or that a stationary sprite is moving down and to the left across the background. Obviously, you need to do this in a loop that specifies how the top-left x,y location of the viewport changes from frame to frame. Colin Potts |
| The office hours schedule has been posted for two months. Several people, including me, are free to help you tomorrow. Colin Potts |
| Bizarre!!!! Colin Potts (Email me your code and the text of the error message, and I'll have a look.) |
| You can use getMediaPath and name the file. For example, the spriteMovie() function in the Homer crawling across bottom of canvas example has no inputs. Many of the examples of picture manipulations from the first part of the course don't take inputs. Colin Potts |
| You could run one sprite through the maze, then run the other sprite through a different route. Thanks! Brittany Duncan |
| If you did not change the map, please don't worry about uploading it. If all of your files cannot be uploaded, please e-mail the entire assignment to your TA. Thanks! Brittany Duncan |
| Have you seen a TA? Thanks! Brittany Duncan |
| Try copying the sprite as is onto the frame - i.e. without chromakey. It won't look right with the green or magenta background, but it is a start and you will get partial credit for it. Once you have the sprite moving around correctly, you can worry about using chromakey to make its background field transparent. One Thing At A Time. Colin Potts |
| You don't say this, but I suspect that the sprite disappears at the point where it is supposed to change direction for the first time. If so, check what is going on in the second loop (probably when the sprite starts to move up the screen?) I'm not sure that the x,y locations are invalid. This might be true if you were drawing a geometrical shape, as in pong, but when you are copying a sprite and addressing pixels by their x,y coordinates, if you tried to paint outside the canvas you would get an error message. (1) If the canvas is very large, are you sure that the sprite is disappearing and not being positioned incorrectly on a part of the canvas that you have to scroll to when you open it? (2) Are you sure chromakey is working correctly in the second segment? If you give it the wrong input picture or set the wrong threshold, you may be getting a "ghost" sprite that you can't see at all. Colin Potts |
| Check out the pong code. It makes the box bounce around the screen. I would also ask that no one post their sprite code to the Coweb. Go see a TA if you need that much help. Thanks! Brittany Duncan |
| Wow. That does sound high. I just created a movie while helping a student test their program. For 80 frames with the complete 1024x1408 background, it was 26MB. So yours is about 6-7 times as big, which is feasible if you have 400+ frames. If your file is this large, you may have a problem uploading it. If you encounter problems, upload your code and email your TA. Colin Potts |
| What you mean to say (I think) is that your program cannot access your picture files. The error message clearly indicates that it is looking for the sprites on the second computer's desktop and they are not there. Either the sprites aren't on that computer at all or they are but are in a folder that you need to set as your mediapath. Colin Potts |
| It's normal for animation programs to take a long time to run. You have to live with this. I don't know what the issue is with the movie, but it may be a machine limitation that you're not responsible for. My questions (actually, make these your questions, rather than getting frustrated) are: (1) How many frames is the program writing, and is this the number you are expecting? If not, maybe there is something weird about the final picture that is generated that is causing Quicktime to crash. This shouldn't happen, but maybe - just maybe it is. (2) By looking at a few of the thumnails of the JPGs, does it look as though the animation WOULD be correct if you could generate and run the complete movie? If so, don't worry too much about a QuickTime/Windows/Mac bug. (3) Does MovieMaker indicate any problems? It barfs out a lot of messages in the terminal window that we usually ignore. Check that it isn't throwing an error. Maybe it starts to write the .mov file but then stops for some reason, leaving the movie in a corrupt state. Again, this shouldn't happen, but I suppose it could. (4) "Buffer overrun" is a clear indication that QuickTime is running out of memory. How large is the movie file? How large are each of the frames? Does it crash immediately? When you start to run the movie? Half way through? Colin Potts |
| That depends how clearly you can describe your problem. The more information you have, the better. In descending order of preference, (1) bring your code on a laptop (OK you can't do this), (2) Copy your code onto a USB drive and bring that, (3) Print your code and bring it on paper (preferably with any error messages that refer to line numbers), (4) Have it all in your head and don't forget anything (A last-ditch desperate measure almost guaranteed to fail, but better than staying away!) Colin Potts |
| Use addText() Remember to set y at 10 or more so that you can see the text. Colin Potts |
| Did you go to ANY classes on movies? Look at the slides/code page for a link to MovieMaker. Colin Potts |
| But answer those questions first to your own satisfaction. YOU have all the information to answer them. We can then work out if you need to do anything. Colin Potts |
| I'm referring to the questions that I put under your posting. You may not have seen these, since I answered questions out of order. Colin Potts |
| Submit your code, and we will work something out. Colin Potts |
| Try to make the movie again, if that doesn't work, e-mail a TA. The length of time that it takes question has been answered multiple times. Thanks! Brittany Duncan |
| Everyone is not saying anything of the kind. Either solution is satisfactory. Colin Potts |
| You mean scrolly? It doesn't leave its viewport always at 1,1, so ask yourself how does it move its viewport? Colin Potts |
| That's right. It's just an example that may help you. It isn't the solution to your homework. Colin Potts |
| Please do not include the frames. The .zip folder is fine. Thanks! Brittany Duncan |
| Colin answered this question earlier by referring the student to the Moviemaker explaination on the Code and Slides page. Thanks! Brittany Duncan |
| Only if you have modified it in some way. Thanks! Brittany Duncan |
| Already answered above Colin Potts |
| It sounds like you are doing too much work inside your frame loop(s). Look at your indentation carefully. Colin Potts |
| If you were more explicit in your description of the problem instead of just saying "it won't work" and had not left it until the deadline, somebody could have helped you. You should at least submit your code. Colin Potts |