Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
I'm desperate!!! Well, Not really... But I do need help
Old
islandfever
Guest
 
Status:
Posts: n/a
Exclamation I'm desperate!!! Well, Not really... But I do need help - 08-18-2007, 08:28 PM

I need help making a 2D "object" without a background; just the object, not a background.

I need it for this:
For those of you who know Nintendo and the Paper mario series I want to make a game similar but with different characters. So I go on Google Images and look "Zelda Sprites" up if you will; copy a pic with Link from Zelda sprites into GIMP, and single out one Link. copy it and paste it in Paint and I try a transparent background-I believe it's known as "alpha values"-but I can't!

I'm really excited about making a game such as this but this thing with Paint is putting me down... anyways, any help's appreciated.

I just tried something new with GIMP to try it but Alice can't seem to handle transparency when it comes to billboards. should I just import, or make billboard?

Last edited by islandfever; 08-18-2007 at 08:38 PM. Reason: Forgot to add last paragraph
   
Reply With Quote
Transparent billboard (and cylinder) example
Old
DrJim
Guest
 
Status:
Posts: n/a
Lightbulb Transparent billboard (and cylinder) example - 08-19-2007, 04:07 PM

I'm not surprised that transparency is giving you problems - an amazing portion of the information on the web is incomplete - and often even inaccurate. Therefore, I'm going to start with a bit of background material. (Please note the rest of this information is aimed at Alice 2.0 and Scratch 1.1 users and may be outdated for later versions.)

There are four relavent file formats that are widely used for images (plus many similar formats - both open and proprietary - that are widely used but not really relevant).

.gif (graphics interchange format) - This is probably the oldest format. It a is a bit mapped format with 8 bits of color information (256 colors). Over the years, it has become common to assign one of the colors a "transparent" designation and, if "transparency" is desired, not to display that color when the image is drawn. The fact that .gif files can be animated makes this still probably the most widely used transparency approach. (A variant of it seems to be used internally in Scratch 1.1, for example.)

.jpg (joint photoengineering group) - For photographs, 256 colors were far from adequate (try for your self - print out some 8-bit color versions of photos). The solution is to go to three 8-bit channels (red, green, blue) of color. This gives a problem of file size - hence .jpg files are compressed.

.bmp (bitmap) - This is a very loosely defined standard - about all that is required to be .bmp compliant is that the data not be compressed - the most useful versions support 24-bit color. In principle, the .bmp format could support transparency - but few (if any?) programs do this.

.png (portable network graphics) - This is the format used by Alice. In addition to the three color channels (RGB) it adds an "alpha" channel for other information, including transparency. Support of the alpha channel is optional in general, however. As you have found out, if you edit and then save a .png file in MS Paint, you will loose the transparent background. Also, in nearly all programs, you must explicitly set alpha channel transparency as the desired option when saving .png files, even if the option is supported.

The bottom line - if you want to import an image with a transparent background into Alice 2.0 you must create that image using a program that supports alpha channel transparency for .png format output. This is really all there is to it - just make sure your options are set up right before you save the image. It is also a good idea to make the image size (including a transparent margin) a power of 2 - say 256 x 256 pixels. Some zipped example files are attached in addition to the screen shot.

For editing I personally recommend Photoshop (.psd native format) since it is the de facto standard (even though it is not my favorite program). Even if you routinely use another program (say Gimp, which is free) you are still going to have to learn the conventions of Photoshop if you do any serious graphics work.

One final note - if all you are going to do is move 2D sprites around for games and stuff, I suggest you use Scratch ( http://scratch.mit.edu/home/index ) instead of Alice. It has the big advantage of having a built-in graphics editor that supports transparency (internally only, unfortunately) and is capable of some really great interactive graphics - see http://scratch.mit.edu/projects/Shanesta/9710 or http://scratch.mit.edu/home/index .
Attached Images
File Type: jpg Transparency.jpg (22.9 KB, 337 views)
Attached Files
File Type: zip Transp-Example Data.zip (912.3 KB, 260 views)
   
Reply With Quote
Kudos,1 question...and then 1 more please
Old
Fulkrum
Guest
 
Status:
Posts: n/a
Thumbs up Kudos,1 question...and then 1 more please - 08-19-2007, 11:37 PM

Quote:
Originally Posted by DrJim View Post
For editing I personally recommend Photoshop (.psd native format) since it is the de facto standard (even though it is not my favorite program). Even if you routinely use another program (say Gimp, which is free) you are still going to have to learn the conventions of Photoshop if you do any serious graphics work.
Thank you both for addressing this matter. DrJim, I recently created 'credits' for the end of the 'movie' I've almost completed, but the background [in Alice] was completely black already so it wasn't difficult. I used Photoshop too, and trust me when I say I'm a newbie at that so no worries islandfever; if you have a black background. The problem was that I tried creating a new file on Photoshop with a transparency as the background and I got a checkerd [sp] box on which I could work.

I want a title for my movie while the camera is zooming over the city I've created and hence the need for the transparent background. For the credits, I had to use a black background in Photoshop, white font, save it as a .jpg and then use Paint to crop and just transfer it as a billboard into Alice.But any ideas as to how to get transparencies in Photoshop?

As another question on the side, what's the easiest way to fade out in Alice? I tried playing with the 'world' and 'light' properties, but even if the screen goes black, many objects still stand out. If you have the time, thank you.
   
Reply With Quote
Old
DrJim
Guest
 
Status:
Posts: n/a
Default 08-20-2007, 01:26 AM

Not real sure what your first question is - you already are working with a transparent background in Photoshop if you have the checkered background. Just make sure the options for exporting in .png are set for alpha level transparency. If you go into Paint at all, however, you'll loose the tranparency - you have to go directly from Photoshop to Alice. (If this doesn't answer the question - give me more details on what you want to do and/or post the files.)

As far as the fade goes - you are basically pushing a teaching program past what it is capable of - and what the most simple movie editor can do.

Could give you some options (say put a black billboard directly in front of the camera) but they are all lousy - basically it's time to do a screen capture and use a real video editor - even one as simple as Movie Maker. You can even set the ground to not seen, pick a "bluish-green" for the world lighting color and use the Alice animations in a "blue screen" mode in your editor (though I'm not sure Movie Maker does that).
   
Reply With Quote
Thanks!!!
Old
islandfever
Guest
 
Status:
Posts: n/a
Default Thanks!!! - 08-20-2007, 04:07 PM

Thanks everyone soo much for all this help! But yes, I do in addition to GIMP own an older version of Photoshop (V5 Limited Edition). I like GIMP better because my Photoshop is so old and it doesn't have many of GIMP's features. I'm going with Fulkrum when it comes to knowledge of Photoshop , but I do understand GIMP more and more as I go online and look up tutorials and such.

I do have knowledge of .gif and jpeg's. I just never knew too much about alpha channels (as referred on GIMP)and their settings. But the only reason I have for using this on Alice is that I want to make the backgrounds 3D. IN the Paper Mario series it isn't all 2d, except for people and enemies. I thought it would be cool to program the awesome movement of a 2d character trapped in a 3d environment. I'll post a little example of my 2d in 3d work in a couple minutes (once I get this all worked out). Thanks again!!!

Last edited by islandfever; 08-20-2007 at 04:18 PM. Reason: Wow I used a lot of green smilies
   
Reply With Quote
Old
islandfever
Guest
 
Status:
Posts: n/a
Default 08-20-2007, 04:10 PM

Quote:
Originally Posted by Fulkrum View Post
As another question on the side, what's the easiest way to fade out in Alice? I tried playing with the 'world' and 'light' properties, but even if the screen goes black, many objects still stand out. If you have the time, thank you.
If you want a fade on all of your objects showing, I agree with Dr.Jim. But if it's fine to have a fade on a blank screen you can have the camera move 999 meters up and have the atmosphere slowly turn black.
   
Reply With Quote
Old
islandfever
Guest
 
Status:
Posts: n/a
Default 08-20-2007, 04:14 PM

Quote:
Originally Posted by DrJim View Post
.bmp (bitmap) - This is a very loosely defined standard - about all that is required to be .bmp compliant is that the data not be compressed - the most useful versions support 24-bit color. In principle, the .bmp format could support transparency - but few (if any?) programs do this.
I do believe MS paint is the only program that uses bitmap, but not in transparency standards.
   
Reply With Quote
Checkered background huh? Hmm.
Old
Fulkrum
Guest
 
Status:
Posts: n/a
Default Checkered background huh? Hmm. - 08-20-2007, 04:37 PM

Quote:
Originally Posted by DrJim View Post
you already are working with a transparent background in Photoshop if you have the checkered background. Just make sure the options for exporting in .png are set for alpha level transparency. If you go into Paint at all, however, you'll loose the tranparency - you have to go directly from Photoshop to Alice. (If this doesn't answer the question - give me more details on what you want to do and/or post the files.)
Thank you both for helping. I did NOT know that the checkered background meant I was working on a transparency. Where's the simile for 'Utter Embarrassment' when one needs it. I'll let you know how the title screen with the transparent background works out.

As for the fade out, I ended up using a combination of both your answers and it worked just fine.

1. Turn the atmosphere etc. black as I was doing before.
2. Turn any remaining 'visible' object 0% opaque at the same duration as the world's atmosphere fades.

Thank you and good luck islandfever.
   
Reply With Quote
Help!!!!!!!!
Old
islandfever
Guest
 
Status:
Posts: n/a
Default Help!!!!!!!! - 08-20-2007, 07:26 PM

OK, so I have most of my example of 2d in 3d world done. I just need to add some houses and maybe another person or two. But, now that I've nearly completed the movements, this appears every time I finish running:



Error during simulation.




Alice version: 2.0 04/05/2005

os.name: Windows XP

os.version: 5.1

os.arch: x86

java.vm.name: Java HotSpot(TM) Client VM

java.vm.version: 1.3.1_10-b03

user.dir: C:\Documents and Settings\Owner\Desktop\Ryan's\Alice\Required



Throwable that caused the error:

java.lang.ArrayIndexOutOfBoundsException: -1 not in range [0,2)

at edu.cmu.cs.stage3.alice.core.Behavior$Fork.getNext (Behavior.java:113)

at edu.cmu.cs.stage3.alice.core.Behavior$RuntimeStack .top(Behavior.java:55)

at edu.cmu.cs.stage3.alice.core.Behavior$RuntimeStack .pop(Behavior.java:48)

at edu.cmu.cs.stage3.alice.core.Behavior.closeFork(Be havior.java:176)

at edu.cmu.cs.stage3.alice.core.response.DoTogether$R untimeDoTogether.epilogue(DoTogether.java:85)

at edu.cmu.cs.stage3.alice.core.response.CompositeRes ponse$RuntimeCompositeResponse.childrenEpiloguesIf Necessary(CompositeResponse.java:67)

at edu.cmu.cs.stage3.alice.core.response.CompositeRes ponse$RuntimeCompositeResponse.epilogue(CompositeR esponse.java:73)

at edu.cmu.cs.stage3.alice.core.response.CompositeRes ponse$RuntimeCompositeResponse.childrenEpiloguesIf Necessary(CompositeResponse.java:67)

at edu.cmu.cs.stage3.alice.core.response.CompositeRes ponse$RuntimeCompositeResponse.epilogue(CompositeR esponse.java:73)

at edu.cmu.cs.stage3.alice.core.response.CompositeRes ponse$RuntimeCompositeResponse.childrenEpiloguesIf Necessary(CompositeResponse.java:67)

at edu.cmu.cs.stage3.alice.core.response.CompositeRes ponse$RuntimeCompositeResponse.epilogue(CompositeR esponse.java:73)

at edu.cmu.cs.stage3.alice.core.response.DoTogether$R untimeDoTogether.epilogue(DoTogether.java:81)

at edu.cmu.cs.stage3.alice.core.response.CompositeRes ponse$RuntimeCompositeResponse.childrenEpiloguesIf Necessary(CompositeResponse.java:67)

at edu.cmu.cs.stage3.alice.core.response.CompositeRes ponse$RuntimeCompositeResponse.epilogue(CompositeR esponse.java:73)

at edu.cmu.cs.stage3.alice.core.response.CallToUserDe finedResponse$RuntimeCallToUserDefinedResponse.epi logue(CallToUserDefinedResponse.java:94)

at edu.cmu.cs.stage3.alice.core.behavior.AbstractCond itionalBehavior.internalSchedule(AbstractCondition alBehavior.java:112)

at edu.cmu.cs.stage3.alice.core.Behavior.schedule(Beh avior.java:225)

at edu.cmu.cs.stage3.alice.core.Sandbox.scheduleBehav iors(Sandbox.java:70)

at edu.cmu.cs.stage3.alice.core.World.scheduleBehavio rs(World.java:444)

at edu.cmu.cs.stage3.alice.core.World.schedule(World. java:486)

at edu.cmu.cs.stage3.alice.core.clock.DefaultClock.sc hedule(DefaultClock.java:94)

at edu.cmu.cs.stage3.alice.authoringtool.AuthoringToo l$11.run(AuthoringTool.java:681)

at edu.cmu.cs.stage3.alice.authoringtool.util.Default Scheduler.simulateOnce(DefaultScheduler.java:115)

at edu.cmu.cs.stage3.alice.authoringtool.util.Default Scheduler.run(DefaultScheduler.java:76)

at edu.cmu.cs.stage3.scheduler.AbstractScheduler.run( AbstractScheduler.java:45)

at java.awt.event.InvocationEvent.dispatch(Unknown Source)

at java.awt.EventQueue.dispatchEvent(Unknown Source)

at java.awt.EventDispatchThread.pumpOneEventForHierar chy(Unknown Source)

at java.awt.EventDispatchThread.pumpEventsForHierarch y(Unknown Source)

at java.awt.Dialog.show(Unknown Source)

at edu.cmu.cs.stage3.swing.DialogManager.showModalDia log(DialogManager.java:58)

at edu.cmu.cs.stage3.swing.DialogManager.showDialog(D ialogManager.java:123)

at edu.cmu.cs.stage3.alice.authoringtool.AuthoringToo l.play(AuthoringTool.java:5073)

at edu.cmu.cs.stage3.alice.authoringtool.Actions$15.a ctionPerformed(Actions.java:167)

at javax.swing.AbstractButton.fireActionPerformed(Unk nown Source)

at javax.swing.AbstractButton$ForwardActionEvents.act ionPerformed(Unknown Source)

at javax.swing.DefaultButtonModel.fireActionPerformed (Unknown Source)

at javax.swing.DefaultButtonModel.setPressed(Unknown Source)

at javax.swing.plaf.basic.BasicButtonListener.mouseRe leased(Unknown Source)

at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)

at java.awt.Component.processMouseEvent(Unknown Source)

at java.awt.Component.processEvent(Unknown Source)

at java.awt.Container.processEvent(Unknown Source)

at java.awt.Component.dispatchEventImpl(Unknown Source)

at java.awt.Container.dispatchEventImpl(Unknown Source)

at java.awt.Component.dispatchEvent(Unknown Source)

at java.awt.LightweightDispatcher.retargetMouseEvent( Unknown Source)

at java.awt.LightweightDispatcher.processMouseEvent(U nknown Source)

at java.awt.LightweightDispatcher.dispatchEvent(Unkno wn Source)

at java.awt.Container.dispatchEventImpl(Unknown Source)

at java.awt.Window.dispatchEventImpl(Unknown Source)

at java.awt.Component.dispatchEvent(Unknown Source)

at java.awt.EventQueue.dispatchEvent(Unknown Source)

at java.awt.EventDispatchThread.pumpOneEventForHierar chy(Unknown Source)

at java.awt.EventDispatchThread.pumpEventsForHierarch y(Unknown Source)

at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

at java.awt.EventDispatchThread.run(Unknown Source)



I literally have been trying to fix the bug for 2 hours! Here is the "demo" so far, and if anyone here could please look at it and see what the problem could be I would appreciate it greatly.

PS Sorry the bug report is so long!

PSS use left and right arrow keys to run.
Attached Files
File Type: a2w Link ALice Example.a2w (491.2 KB, 249 views)

Last edited by islandfever; 08-20-2007 at 07:38 PM. Reason: PS part
   
Reply With Quote
Old
PopnTheDeerInHumanForm
Guest
 
Status:
Posts: n/a
Default 09-01-2007, 08:55 PM

I don't know if its the same error but I get it to does it do anything
harmfull otherwise you should ignore it probably its hopfully nothing... HOPE YOUR PROJECT WORKS OUT!!!
   
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.