Important information: this site is currently scheduled to go offline indefinitely by end of the year.

Stumped on a simple XML file in Spin Tires game. (SOLUTION)

The Original Forum. Game archives, full of resources. How to open them? Get help here.
Post Reply
figuare9
n00b
Posts: 16
Joined: Wed Dec 01, 2010 7:39 am
Has thanked: 4 times

Stumped on a simple XML file in Spin Tires game. (SOLUTION)

Post by figuare9 »

I've uploaded it to mediafire. I'd like to edit these files at will. But lack the knowledge to do so. Plainly put, I'm a beginner. I normally just find something and change numbers when I mod. haha.

there may possibly be a chance that this is in a different language as well. But I can't be sure since I'm pretty much retarded when it comes to this.

I'm trying to edit some values on some vehicles but when I try to open these .XML files I get jibberish. If you could find a way to edit them, and teach me how I would be more then happy.

The files are found from this game. It's not out yet, but there's a demo. And would like to get a headstart on the release.

Code: Select all

http://www.kickstarter.com/projects/358753914/spintires-the-ultimate-off-road-challenge 

Code: Select all

http://www.mediafire.com/view/d4s240umz29za43/uaz.xml

http://www.mediafire.com/view/7aazndrso0qqaff/maz.xml
Last edited by figuare9 on Sat Jun 08, 2013 6:24 pm, edited 1 time in total.
bacter
veteran
Posts: 142
Joined: Mon Feb 22, 2010 8:42 pm
Has thanked: 2 times
Been thanked: 83 times

Re: Stumped on a simple XML file.

Post by bacter »

The files are encoded with a simple algorithm. Here is the code of the decoder function (in Delphi):

Code: Select all

Procedure SpinTires_Decoder(pBuffer : Pointer;BufferSize : Integer);
Var I : Integer;
    p : ^Byte;
    B : Byte;
Begin
  p := pBuffer;
  For I := 0 To BufferSize - 1 Do
    Begin
      B := 251 - (I * 14);
      p^ := p^ + B;
      Inc(p);
    End;
End;
figuare9
n00b
Posts: 16
Joined: Wed Dec 01, 2010 7:39 am
Has thanked: 4 times

Re: Stumped on a simple XML file.

Post by figuare9 »

so is it a big deal that you figured that out? Because I couldn't have ever. Probably something easy for you though :)

I'm unsure of what to do though with this.. Like I said I'm a noob with this stuff. I switched over to pc gaming for modding alone. I'm still trying to figure a lot of things out. Is there any way you could give me a step by step way to edit this file and get it to work in game?

Things like:

How do I edit this file? My lack of knowledge on this stuff is crazy.. But I'm hoping someone can teach me a few things.

If I somehow manage to decode this file, do I edit, and then need to re-encode it for it to work in game?

Is delphi a program I need for this?

Also, thank you bactor for taking the time to look at the files.
twisted
veteran
Posts: 100
Joined: Mon Apr 23, 2007 11:25 pm
Has thanked: 2 times
Been thanked: 7 times

Re: Stumped on a simple XML file.

Post by twisted »

bacter wrote:The files are encoded with a simple algorithm. Here is the code of the decoder function (in Delphi):

Code: Select all

Procedure SpinTires_Decoder(pBuffer : Pointer;BufferSize : Integer);
Var I : Integer;
    p : ^Byte;
    B : Byte;
Begin
  p := pBuffer;
  For I := 0 To BufferSize - 1 Do
    Begin
      B := 251 - (I * 14);
      p^ := p^ + B;
      Inc(p);
    End;
End;
I'm trying to implement your code in c# but having never coded in delphi I'm having a hard time understanding what it's doing.
As far as I can tell for each byte in the file you are taking 251 then subtracting the current offset (I) and * by 14 and adding this to the original byte value?
Unless I've missed something I'm not sure how this would work as the value is almost always going to be less than 0 and therefor less than Byte.MinValue?
Last edited by twisted on Thu Jun 06, 2013 10:39 am, edited 1 time in total.
octaviousrex
veteran
Posts: 109
Joined: Mon May 06, 2013 2:58 pm
Location: united states
Has thanked: 119 times
Been thanked: 8 times

Re: Stumped on a simple XML file.

Post by octaviousrex »

I threw it into both 3d studio max and or deep hemisphere 3D file format converter and I cannot seem to open it into either though it is an .xml file format. I have the demo myself and I like the game a lot. I am also looking at modding for this game in the future. sorry I am not more help yet. but I'll keep seeing what I can do on my end.
figuare9
n00b
Posts: 16
Joined: Wed Dec 01, 2010 7:39 am
Has thanked: 4 times

Re: Stumped on a simple XML file.

Post by figuare9 »

Yeah, it's definitely got me stumped. Glad to see some more posts about it. The game is heavy under development, but it'd be great to see it with mods early at release. This game has a very innovative design and I know after the community gets a hold of it it will be more then fun to play. The developer says he wants to support modding, but it's already seeming very difficult to even read the xml files.
chrrox
Moderator
Posts: 2602
Joined: Sun May 18, 2008 3:01 pm
Has thanked: 57 times
Been thanked: 1422 times

Re: Stumped on a simple XML file.

Post by chrrox »

quickbms script to convert these files

Code: Select all

get name filename
string name + .xml
get size asize
set MEMORY_FILE binary ""
for i = 0 < size
set b i
math b * 14
set c 251
math c - b
get tmp byte
math tmp + c
math tmp & 0xFF
putVarChr MEMORY_FILE i tmp byte
next i
log name 0 size MEMORY_FILE
http://pastebin.com/uRds30Zp
twisted
veteran
Posts: 100
Joined: Mon Apr 23, 2007 11:25 pm
Has thanked: 2 times
Been thanked: 7 times

Re: Stumped on a simple XML file.

Post by twisted »

Haven't tested it in game but put together a simple decode/encode app that should do the job, creds to chrrox for the decode algo.

http://www.mediafire.com/?ru9nu9ti7x69ao7
figuare9
n00b
Posts: 16
Joined: Wed Dec 01, 2010 7:39 am
Has thanked: 4 times

Re: Stumped on a simple XML file.

Post by figuare9 »

All of you guys are awesome!! Many thanks.
figuare9
n00b
Posts: 16
Joined: Wed Dec 01, 2010 7:39 am
Has thanked: 4 times

Re: Stumped on a simple XML file.

Post by figuare9 »

twisted wrote:Haven't tested it in game but put together a simple decode/encode app that should do the job, creds to chrrox for the decode algo.

http://www.mediafire.com/?ru9nu9ti7x69ao7
Tested on 0606 Build (Latest) and it's working
Post Reply