Alice Community  

Go Back   Alice Community > Alice 2 > Share Worlds

Thread Tools Display Modes
Prev Previous Post   Next Post Next
Merging Worlds
Senior Member
arty-fishL's Avatar
Status: Offline
Posts: 1,878
Join Date: Mar 2008
Location: In the corner of your eye
Lightbulb Merging Worlds - 12-22-2011, 06:17 PM

I have successfully come across a good way of merging worlds. This involves actually sticking code, events, variables, objects etc from one world into another .

WARNING - advanced

For a simpler, safer and probably better way of just linking worlds see my World Loader Tool.

This method avoids ambiguity be having each world as a separate object, rather than bundling all the stuff from each world into one world. This works kinda like it would with Java projects and packages, each dev has their own package so class names don't get mixed up.

To better describe this I am going to set up a scenario (based on a real question).
I'm teaching a course using Alice.
The students are working on a project as a team.
How can they merge together various parts of the project?
1: Firstly for each world to be merged the "world" object needs to be renamed. Each student should open up their world and give it a unique name. In this case each student should right click on "world", select "rename" and type in their name, plus extra initials if there are students with the same name. The result should be that each world object has a unique name.

2: All students should save their work and pass it on to the teacher so the teacher can merge the worlds, only when all the worlds are completely finished.

3: Now comes the laborious part, depending on how many worlds are to be joined. The students could do this part if the teacher can't be bothered and the students are trustworthy, but tbh if the teacher made such a decision as to merge them in the first place then they have placed this burden on themselves.
To make this less complicated I highly suggest creating a new folder and placing all the merge files in it.

4: Using 7zip, or another archiving application the teacher should open the first world and extract only the file called "elementData.xml"

5: Using a basic text editing program, preferably one that does xml formatting (like Notepad ++) the teacher should open the file they just extracted.
If a program that does not format the xml is used then the teacher will have a much harder time doing this, much harder. Notepad ++ is free, light and awesome anyway.

6: On line 2 the word "World" should be replaced with "Model". So the line reads:
HTML Code:
<element class="edu.cmu.cs.stage3.alice.core.Model" name="studentx" version="2.001">
NB - "studentx" is the name of the student here, and subsequently the world, in every case "studentx" on line 2 should be different and unique to whatever the student called their world, if you change it you will ruin the whole merge.

7: The line that reads
HTML Code:
    <child filename="renderTarget"/>
should be completely removed (it should be line 3).

Find (ie CTRL+F) the word "sandboxes" and replace it with "parts".

8: The file should be saved and put back into the world open in 7zip (or other archiving program) from whence it came, overwriting the "elementData.xml" already in it.

9: Steps 4 to 8 should be repeated for each world. If anything is done wrong then the whole process is ruined, so don't get impatient .

10: Each world should have its file extension change from .a2w (Alice world) to .a2c (Alice class/model)

10: A new blank base world should be opened in Alice. Save this as whatever the whole project is to be called.

11: Have the folder with all the worlds to be merged open next to Alice. Select all of the world files (now with .a2c extensions) together and drag them all onto the Alice window. Alice should go about importing every one.
If any message dialogs pop up just click "Yes" or "OK".
Click to view full size image:

12: Save the world before advancing.

13: Check everything is there. There should now be seperate objects, each in the same structure as all of the worlds saved and imported.
Test the world.
The code will most likely have to then be adapted to run everything when required, or to move stuff out of the way if it all imported on the centre.

Unfortunately anything stored in a group will not be visible in the object tree as only world objects can have groups, so, although its tidy to use groups, refrain from using them when doing this please.

Any questions, then just ask .


I have mostly moved on from Alice, but may still respond to messages if important [¬º-°]¬
Reply With Quote

copy, join, merge, paste, worlds

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 ©2023, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.