First off, commercial games are coded to be incredibly efficient, however as I don't know how detailed your scenario's are, I don't know if just-too-much-happening is the problem, or, as you say, a limit on assigned RAM.
If you export your scenario to a .jar file, there is a method to give it more RAM:
Open up notepad, and type in the following -
@echo off
java -Xmx1024m -jar "<JarFilePath>"
and save it as "<AName>.bat"
Obviously <AName> can be anything, but I reccomend something like "Run_<YourProgramName>.bat"
replace <JarFilePath> with the link to your program. if it is in the same directory as where this will be saved, then just do YourJarName.jar - however if not, you do C:\Users\YourName\...\YourJarName.jar (except obviously change it to the real path to your jar file).
What -Xmx1024m is doing is setting the maximum heap size for your program (in this case 1024mb, or 1gb). You can change it to whatever memory you need for your program. If you change it to -Xms1024m then its setting the starting heap size.
Other than saying there's a problem with Greenfoot or some huge inefficiency in your code, that's all I can suggest
I don't know if it helps your understanding at all but the scenario itself is 2.7mb in memory.
Ok, I'll try the increase RAM thing. Aside from that are there any tips or anything I can generally do to achieve efficiency in my scenario?
Upload your scenario and when I get back from college (I'm leaving in half an hour) I'll look over it and see what's up
PSS: also, WASD to move, left click to attack, right click to block
I'm currently at college so can't access dropbox - if you upload it to the gallery (you can delete it once I've downloaded it) then I'll check it sooner, else I'll look over it when I get home.
Ok I'll upload it to greenfoot.org then
Sorry I couldn't get on at college later in the day, but I've just got home so I'm downloading it now (so you can take it down)
Will post again soon when I've had time to look at it
EDIT: Before I say anything more, I've got to say that I love the game - both the physics and the fact that you've conquered good graphics and sound (something that I'm always too lazy to do, even on my scenario's that I don't upload). Well, that and the lightsaber - it takes me back :). That aside, I haven't experienced any lag whatsoever yet - can I ask two questions? The first being where are you experiencing lag? (All the time/past a certain number of enemies/when attacking/etc) The second question is what speed processor do you have? I'm on a 3.0 GHz Intel Core i5 (with 6 GB RAM), and its running perfectly. I'll check these forums again in about 40 minutes, I've got to make a start on an essay that's due.
I myself get no lag or slowdown at all on that scenario, and I am running on a not-so-recent laptop. It's also good to keep in mind that games like Minecraft and Call Of Duty use the graphics card almost exclusively for their graphics, which is the reason they can be run so quickly. Greenfoot on the other hand uses pure java, without any graphics card interfaces. This means the CPU itself is forced to do all the drawing and calculating for your games, instead of the graphics card. If this wasn't slow enough, Java itself is being run through a virtual machine, which slows down all code a significant amount.
The only pattern I can notice in the spikes is that it seems to be when objects interact with each other, most of the time it works fine but sometimes just randomly when a projectile hits an enemy, something blows up, I swing the sabre etc.