Level decompilation update.

Everything about the level editing process.

Moderator: Moderators

Level decompilation update.

Postby tmcsweeney » Thu Jul 06, 2006 10:43 am

I've made some good progress, I now understand 99% of the level data and can extract all of the line and point data (including timers and tension) as well as all the sundry stuff like budget, 'dillo and portal positions. There is one block of data that I still don't understand. It comes just after the geometry blocks and is a single empty word on most levels. However in some of my saved levels it is a long list of what looks like indices into the geometry lists. Any ideas anyone?

In more positive news I've discovered some interesting fields that are inaccessible from the editor, but which are still supported (to various degrees by the game):

Armadillo size: stored just after the X and Y coordinates, defaults to radius 0.5. Changing this allows you to change the 'dillo size. I haven't done a lot of testing, but this seems fairly robust. Interactions with the level seem to work fine (I'm not sure if the 'dillo mass increases, I suspect not). You can create a level where the 'Dillo is larger than the portal (which would normally mean the level would never finish), but it seems to be that in this case the game swaps the rules about the armadillo having to be 100% inside the portal to the portal having to be 100% inside the armadillo for the level to end.

Armadillo/portal count: You can specify more than one pair of armadillo/portal coordinates. This is a bit more flaky. Firstly each armadillo will only correspond to it's matching portal, but there is no way to tell visually which is which. Secondly there is no 'dillo-'dillo collision, they just pass right through one another, and finally the level ends as soon as any one armadillo warps out (rather than all of them having to have left the level).

I'm not going to release anything until:
a) I understand the whole structure
b) I've written scripts that can be used to detect the cheating that this power makes possible.

Cheers
Tim
User avatar
tmcsweeney
 
Posts: 48
Joined: Mon May 29, 2006 9:48 am

Postby Running-Armadillo » Thu Jul 06, 2006 5:15 pm

Wow,im amazed, I think it takes a long time and a genius to put that sort of information together, how did you get this all together??? Im amazed! and also if you want to learn how to change the color of an armadillo look under the general forum under the "Changing The Armadillo's Color" topic that i wrote.

[RA] - Great work tmc :D
The Thirteen Year-Old Genius.
User avatar
Running-Armadillo
 
Posts: 91
Joined: Sat Jun 10, 2006 6:56 pm

Postby tmcsweeney » Thu Jul 06, 2006 6:07 pm

Ok, I've worked out the last little piece of the puzzle. The mystery data was a set of link groups (created when you drag out a long line of plates or bars.

So I know have a python script that can completely pull apart a level.

There are checksums in place to validate both the original level, and any solutions derived from it. The level checksum is a pretty straightforward 32 bit xor which is easily modified when tweaking the level. The solution checksum is 64 bits long. I haven't spent any time investigating how it is calculated, and I probably won't as the only possible use for modifying solutions is to cheat (let's hope it is something a bit more robust then a simple xor)

I've uploaded a level to the official site called "Proof Of Concept" which shows off some of this trickery. PeterS may, or may not veto it going live ;)

UPDATE: lvl available here:
http://www.armadillorun.com/levels/data/Proof%20Of%20Concept.lvl

Tim.
Last edited by tmcsweeney on Sun Jul 09, 2006 7:46 pm, edited 1 time in total.
User avatar
tmcsweeney
 
Posts: 48
Joined: Mon May 29, 2006 9:48 am

Re: Level decompilation update.

Postby Armadillo Man » Sun Jul 09, 2006 8:54 am

tmcsweeney wrote:Armadillo/portal count: You can specify more than one pair of armadillo/portal coordinates. This is a bit more flaky.

Still, this is good news. If multiple armadillos/portals are at least partly implemented in the current code, it makes me optimistic that the big patch that Peter is working on will include this feature.
User avatar
Armadillo Man
 
Posts: 46
Joined: Fri Jun 02, 2006 5:25 pm

Postby PeterT » Sun Jul 09, 2006 7:05 pm

I just had a look at "Proof Of Concept". Very interesting. Any chance of you releasing the level format information? (That is, what kind of newly possible cheats would you need to detect?) Does the level file have something like a version string?
PeterT
Site Admin
Site Admin
 
Posts: 473
Joined: Fri May 26, 2006 9:57 pm
Location: Austria

Postby tmcsweeney » Sun Jul 09, 2006 8:18 pm

I'm putting together a first pass at a script that runs static checks for posible irregularities.

Even without my stuff there is already an obvious method of cheating which involve editing the original level (either the budget or the pieces) before you start on your solution. (This is pretty trivial to check for in a script)

There are a whole class of possible exploits that being able to directly manipulate the levels opens up. You can bypass all of the arbitrary constraints the game normally imposes. Thus bars and plates can be longer than two units, pieces can be placed outside the level boundries or inside the armadillo (all of which I'm checking for) and probably lots of other sneaky stuff I haven't thought of yet.

The scripts are written in Python, and there is a set of classes that will parse and load a level as well as a set of driver scripts that use that information to do interesting things. (The static checker is one of these). I could document it all formally, but onceI post it all it should be fairly easy for another programmer to read the code and understand the level format. Unfortunately I'm off on holiday for a week as of tuesday, so unless I havbe a really quiet monday at work it'll have to wait until I get back and finish it off.

I'll try and find time tomorrow to put together and post a set of levels that are empty apart from multiple armadillos and portals so that people with zero patience can use those as a basis to start creating multi-Dillo levels.

I'm sorry for being so cautious with this, I just really love this game and would hate to see all the cool competitions and so on destroyed because of something careless I did. I'm hoping that with a bit of thought and care I can release this and in the process make the game a tiny bit cooler, close up an existing line of cheating and prevent any other abuse.

Cheers
Tim
User avatar
tmcsweeney
 
Posts: 48
Joined: Mon May 29, 2006 9:48 am

Postby tmcsweeney » Sun Jul 09, 2006 8:27 pm

PeterT wrote:Does the level file have something like a version string?


There is no actual version number. The first four bytes are a magic number ("ArmR") which could be changed by PeterS in future revisions to indicate a diferent level format. Alternatively the second 32bits are a set of flags, of which currently on 3 bits seem to be used. it is easily conceivable that some of these unused bits could be used to inidcate extra (or missing) blocks of information in a revised file format.
User avatar
tmcsweeney
 
Posts: 48
Joined: Mon May 29, 2006 9:48 am

Postby PeterT » Mon Jul 10, 2006 1:50 am

tmcsweeney wrote:Unfortunately I'm off on holiday for a week as of tuesday, so unless I have a really quiet monday at work it'll have to wait until I get back and finish it off.
Hmm, depending on how my week goes I won't need it by then ;)
Now that you identified the type of checksum used it should be quite easy. Btw, how did you do that? Trial and error?

[edit]
Success! Even though I was slowed down a bit by your evil omission concerning the checksum :twisted:
(though, thinking about it it's quite logical)
Image

[edit2]
Say tmc, my good man, could you perhaps tell me what I'm missing here? This works, but it took far too long to figure out and seems completely nonsensical. So I'd be really grateful for an explanation.
Code: Select all
chksum ^= 211815584 if length%4 == 2 #WTF?
That is, the checksum changes in a strange way if the file is not 4*n long...
PeterT
Site Admin
Site Admin
 
Posts: 473
Joined: Fri May 26, 2006 9:57 pm
Location: Austria

Postby PeterT » Mon Jul 10, 2006 4:59 am

Disregard the above, I suck. That works well for all files of the specific sizes I tested, but not for a larger one I just tried. Now my guess would be that the file length plays into the checksum somehow. I'll have to look into that.

[edit]
In other news I think I now understand most of the rest of the file format. But that doesn't really help if I have to hack up a specific checksum calculation for each size ;)
So, tmc, it would be great if you could give me a hint or some code just toward that. I just can't imagine anyone going to such extremes just to cheat - but if you want to make sure you can also send it to me via PM. Otherwise I'll just have to figure it out on my own. The reason I'm in a hurry is that I won the last eurogamer contest, and I have a really great level idea using the current multi-armadillo capability that I would like to use.
PeterT
Site Admin
Site Admin
 
Posts: 473
Joined: Fri May 26, 2006 9:57 pm
Location: Austria

Postby tmcsweeney » Mon Jul 10, 2006 10:35 am

Email on it's way.
User avatar
tmcsweeney
 
Posts: 48
Joined: Mon May 29, 2006 9:48 am

Postby PeterT » Mon Jul 10, 2006 7:12 pm

If anyone's interested in what can be made with all this trickery, here is a screenshot of the current eurogamer contest level, Lemmdillos:
Image
PeterT
Site Admin
Site Admin
 
Posts: 473
Joined: Fri May 26, 2006 9:57 pm
Location: Austria

Postby BFC » Wed Jul 19, 2006 5:04 am

I have a level waiting in the wings that builds on this. Hopefully we get a chance to use it soon as it's quite radical!

Thanks to you guys for making this "mod"!

-BFC
BFC
Contest Legend
Contest Legend
 
Posts: 257
Joined: Mon May 29, 2006 10:23 pm

Postby tmcsweeney » Thu Jul 20, 2006 5:51 pm

I have a tension headache :) in order to calculate the expenditure for a level I need to take account of the fact that piece lengths change (and thus change cost) when you apply tension/compression to them.

This is going to be a tedious round of double guessing, and is probably going to take a little while.
User avatar
tmcsweeney
 
Posts: 48
Joined: Mon May 29, 2006 9:48 am

Postby Andrew » Wed Sep 27, 2006 1:52 pm

Hey so tmcsweeney, how did you get on with the format decompilation?
I have a couple of ideas for lvl file generators, ie to do a lot of ground work that can then be finished off by hand... leaving the tedious work to software and creator's creative genius can carry on from there.
I've had a quick look at the level format, shouldn't be too hard to figure out but why go through it all over again if some smart person has figured it out already?
Andrew
Contest Winner
Contest Winner
 
Posts: 393
Joined: Sat Jun 17, 2006 7:57 pm
Location: New Zealand

Postby tomo » Tue Feb 06, 2007 7:38 am

i still dont understand how can i have more dillos in a level....
User avatar
tomo
Contest Winner
Contest Winner
 
Posts: 589
Joined: Sun Feb 04, 2007 5:01 pm
Location: slovenia

Next

Return to Level creation

Who is online

Users browsing this forum: No registered users and 14 guests

cron