View Full Version : Wonder in Aliceland(WIP)
ShaunHBGAcad
04-04-2008, 10:15 AM
This is a work-in-progress demo that I've been using to attract students to our programming classes.
Features a First Person Shooter like view and control scheme, jumping, shrinking/growing, some very basic collision detection on the two gates in the garden, and some fun lighting effects.
I used this project to learn Alice myself, so some of the old code is rather sad and not even in logical locations. Regardless, it works pretty well, and the kids have been loving playing with it.
I also made a downgraded version that has only the control scheme code, to help kids start making their own games a little faster.
Some screenshots:
http://www.harrisburgacademy.org/shansel/images/alice/capture01.jpeg
http://www.harrisburgacademy.org/shansel/images/alice/capture02.jpeg
http://www.harrisburgacademy.org/shansel/images/alice/capture03.jpeg
http://www.harrisburgacademy.org/shansel/images/alice/capture07.jpeg
http://www.harrisburgacademy.org/shansel/images/alice/capture08.jpeg
http://www.harrisburgacademy.org/shansel/images/alice/capture09.jpeg
And you can download the zipped a2w file here. (http://www.harrisburgacademy.org/shansel/Files/AWA.zip)
Tell me what you think.
Oops, controls! I'll need to add a screen for this in the game, but here they are for now.
W = Move forward
S = Move backward
A = Move Left (not turn)
D = Move Right (not turn)
Up Arrow = Look Up
Down Arrow = Look Down
Left Arrow = Turn Left
Right Arrow = Turn Right
Space = Jump
F = Fire a Cat
And obviously, clicking on things with the left mouse button activates them. Use this on people and things.
Proximity is programmed in too, by the way, so for most objects and people to be interacted with, you must be fairly close to them.
Note: Set your camera.SetPointOfView to entire.DummyBunny if you change the camera in the design viewport.
DrJim
04-04-2008, 11:01 AM
Very nice demonstration of the control and graphics capabilities of Alice.
One minor note. Since .a2w files are already zipped, doing another compression on just the file can occasionally (fortunately not often) cause problems with almost no gain. (In your case, “unzipping” only increased the file from 10.7 M to 11.4 M.) If system restrictions require you to zip the world file, I’d suggest also compressing a small text file (ReadMe files are always nice anyway) in the same folder.
DickBaldwin
04-04-2008, 11:01 AM
Very impressive!
Now if there was just a way to make it possible for my skeptical colleagues to view it without having to convince them that they need to download and install the Alice software... Hmmmm
Any suggestions anyone?
Dick Baldwin
Free Alice tutorials: http://www.dickbaldwin.com/tocalice.htm
Free programming tutorials: http://www.dickbaldwin.com/toc.htm
ShaunHBGAcad
04-04-2008, 11:45 AM
Dr.Jim, yes, it mainly has to do with our server not liking people DLing certain file types, and zip is allowed. I've thrown a quick ReadMe in there.
Would an Alice "Projector" type file format be difficult to build?
DickBaldwin
04-04-2008, 11:51 AM
Would an Alice "Projector" type file format be difficult to build?
I'm not familiar with that format.
Building a video isn't too difficult but it doesn't do justice for an interactive program like yours unless it is turned into a video tutorial with narration, etc. Then it can become more difficult.
Dick Baldwin
Free Alice tutorials: http://www.dickbaldwin.com/tocalice.htm
Free programming tutorials: http://www.dickbaldwin.com/toc.htm
ShaunHBGAcad
04-04-2008, 11:58 AM
I'm not familiar with that format.
*snip*
Projector? It's a self-contained Flash file, like the old WinZip self-executables. If you create a projector file in Flash, the person using the file doesn't need ANY version of flash installed on their PC. Basically, it would have only the code that is used when Alice is "Playing" the file, and nothing else. I'm not sure if this would be difficult to do, but I would imagine that the "Play" function in Alice could be isolated, have the dependencies brought over with it, and then come up with a way to create an executable that contains both the "Player" functions, as well as the contents of the individuals World file. Could end up being fairly large, but certainly smaller and easier than DL'ing Alice. But this would allow for users to download and simply play the animation or game, maintaining all interactivity.
DickBaldwin
04-04-2008, 01:51 PM
Projector? It's a self-contained Flash file, like the old WinZip self-executables. If you create a projector file in Flash, the person using the file doesn't need ANY version of flash installed on their PC. Basically, it would have only the code that is used when Alice is "Playing" the file, and nothing else. I'm not sure if this would be difficult to do, but I would imagine that the "Play" function in Alice could be isolated, have the dependencies brought over with it, and then come up with a way to create an executable that contains both the "Player" functions, as well as the contents of the individuals World file. Could end up being fairly large, but certainly smaller and easier than DL'ing Alice. But this would allow for users to download and simply play the animation or game, maintaining all interactivity.
Sounds good to me. Since I have no Flash experience, I can't be of much help but maybe someone else can help.
We definitely need something that can be used to convince skeptical college professors that Alice is a "real" programming language and not just a toy. At least that is true at the college where I teach.
Dick Baldwin
Free Alice tutorials: http://www.dickbaldwin.com/tocalice.htm
Free programming tutorials: http://www.dickbaldwin.com/toc.htm
DrJim
04-06-2008, 12:18 PM
… the "Play" function in Alice could be isolated, have the dependencies brought over with it
I think that might be the difficult part – certainly I don’t see an obvious solution. The problem I see is that Alice is very fundamentally a 3D environment, while Flash is fundamentally 2D with some 3D add-on features (actually more than some if you go high end enough, but I don’t know anything that gives a true 3D capability).
While I’m sure it would be possible to generate a Flash “look-alike” for an Alice world, it seems to me that’s almost a separate development task.
Hopefullly I’m wrong about how difficult it would be :) – it would be a very nice thing to have.
... something that can be used to convince skeptical college professors that Alice is a "real" programming language ...
Alice 3.0, whenever it arrives, will go a long way making that case and convincing the doubters – a group which on most days includes me.
ShaunHBGAcad
04-07-2008, 09:33 AM
Well, I wasn't actually talking about including Flash in any way, shape, or form. I was just saying that Flash has an option that allows you to export a self executing, fully interactive, flash animation, game, or website. No need to install anything, just download, and play. This was more a way to describe what could be done, rather than the solution.
So, basically what I am suggesting, and I'll take a look at the Alice source to see how hard it would be, is isolate all of the Alice 2.0 code that is used when Playing the Alice world file. So, when you click on the "Play" button in Alice, some specific subroutine is called, which may or may not have dependencies.
You take all of that code, and it's dependencies, and you create a new, self-contained executable, but you also integrate the a2w into that executable.
Again, I haven't looked through the source yet, but I imagine that the a2w file contains the "binary" data for all models, textures, properties, and code being used in that specific Alice world.(Edit:yeah, I didn't realize it was just a renamed zip, cool.) So, the a2w file IS the program, it simply hasn't been compiled. So, you use the "Play" code to "compile" it. But since it seems to be all scripting, technically, you aren't compiling, you're just including the script parsing part of Alice to run the scripts.
I'll look at the code, but I'm no Java guru quite yet. Hopefully the source is documented well enough to easily find the routines involved in the Play function.
This has gone way off topic. Apologies.
Edit: I've looked at some of the source and while I see little to no documentation, it does appear that the "Player" and "Editor" parts of Alice are separate packages, which could make this a possibility. If not an addition to the native Alice environment itself, possibly a separate converter program that users could download and convert their own a2w's into exe's.
DrJim
04-07-2008, 01:12 PM
I did missunderstand what you were thinking about - was hoping you had found some way to tie Alice and Flash together.
What you are describing sounds very much like the "export to html" option that is in 2.0 but has really never worked right (and that description is being charitable).
My understanding - which may not be correct - is that some people from Georgia Tech have worked on that and on the movie export option and that some of their work - and I'm sure the work of others - will be included in a release 2.2.
Can't tell you much more - going into that detail of the code is well beyond my personal level of expertise or interest. I will note that one of the reasons the initial decision to go directly to the all Java 3.0 was that 2.0 was quite a complex mix of Java and Python.