• What are you working on? July 2012
    1,611 replies, posted
  • I'm starting to actually like Python quite a bit... still need to get used to the different syntax though. Anyways, got the container files working. Strangely, some of the .tga files aren't actually TGA files, I'll investigate that more tomorrow and see what that's all about. I put the code up on github: [url]https://github.com/Robmaister/VideoGameFormats[/url] [URL=http://i.imgur.com/mzu4I.png][IMG]http://i.imgur.com/mzu4Il.png[/IMG][/URL]
  • While you guys are on the subject of reverse engineering a format, what can you do if a game has compressed all of it's content into a single file? I'd always wanted to get the music and some of the geometry from [url=http://en.wikipedia.org/wiki/Switchball]Switchball[/url], but all of it is compressed into a massive bin archive.
  • So.. In my book I've moved on to doing Arithmetic in Java. It's actually pretty fun, and I'm sure it's actually better than a calculator but w/e. Anyway, I'm just gonna dump my code here incase you guys wanna see it: [code] class arithmetic { public static void main ( String[] args ) { int num = 100 ; int factor = 20 ; int sum = 0 ; sum = num + factor;// 100 + 20 System.out.println( "Addition Sum: " + sum ); sum = num - factor;// 100 - 20 System.out.println( "Subtraction Sum: " + sum ); sum = num * factor;// 100 * 20 System.out.println( "Multiplication Sum: " + sum ); sum = num / factor;// 100 / 20 System.out.println( "Division Sum: " + sum ); } } [/code] Made = [img] http://puu.sh/Jg08[/img] I'm gonna try do one on my own now, only referencing back to the book if I completely don't remember.. (I'll post my errors, if I've made any) [code] class arithmetic2 { public static void main ( String[] args ) { int num = 1337 ; int factor = 1337; int sum = 0 ; sum = num + factor ; System.out.println( "Addition of 1337 shit: " + sum ); sum = num - factor ; System.out.println( "Subtraction of 1337 shit: " + sum ) ; sum = num * factor ; System.out.println( "Multiplication of 1337 shit: " + sum ) ; sum = num / factor ; System.out.println ( "Division of 1337 shit: " + sum ) ; } } [/code] I literally made 0 errors. Hell yeaaaaah. [img]http://puu.sh/Jg3B[/img] How do you guys think I'm doing with Java then, any opinions?
  • [QUOTE=FoohyAB;36807958]While you guys are on the subject of reverse engineering a format, what can you do if a game has compressed all of it's content into a single file? I'd always wanted to get the music and some of the geometry from [url=http://en.wikipedia.org/wiki/Switchball]Switchball[/url], but all of it is compressed into a massive bin archive.[/QUOTE] you're probably going to have to step through the file loading process in some form of disassembler and see how the actual program splits it up into chunks. Might be worth checking first to see if it's actually a zip file or another standard compression system though. [editline]17th July 2012[/editline] 7zip is great for that kind of check. [img]http://i.imgur.com/gRouO.png[/img]
  • [img]http://imgbud.co.uk/images/5eb30f.png[/img] Time to make it look half-decent on OSX!
  • All of this + more in under 3 - 4 hours.. I'm so tired. [img]http://puu.sh/JgRS[/img]
  • I wanted to use box2d for top down, but you need to add forces like friction by yourself, just wondering if anyone had a good formula for slowing down objects(so they dont just flight off like in 0 gravity) I was thinking something like: [cpp] //This is what I dont know how to calculate???? //Having the floor resistance & gravity variables allow for walking on ice where you dont slow down as fast, or walking on gravel where you slow down faster. this could just be one variableas all it does is determine how effectivve the floorResistance is. slowForce = area * ( floorResistance * ( mass * gravity ) ); //Get the direction to apply the force to, to slow it down oppositeDir = Dirrection * -1; applyForce(oppositeDir, slowForce); //Clamp to 0 so that it doesnt start moving in opposite direction newSpeed = clamp(0, currentSpeed, newSpeed); [/cpp]
  • At first I thought assigning values was stupid considering I didn't see the point. Now I do! Woo. I love Java, not too hard but it always has a challenge. Correct me if I'm wrong but when assigning values on Java it basically means keeping the same sum and then changing it as you go on? for example [img]http://puu.sh/Jhbw[/img]
  • [QUOTE=Richy19;36808802]I wanted to use box2d for top down, but you need to add forces like friction by yourself, just wondering if anyone had a good formula for slowing down objects(so they dont just flight off like in 0 gravity) [/QUOTE] Linear damping?
  • [QUOTE=Erasus;36808046]stuff[/QUOTE] You're doing fine, but why did you switch from Lua? [editline]17th July 2012[/editline] [QUOTE=Erasus;36808939]At first I thought assigning values was stupid considering I didn't see the point. Now I do! Woo. I love Java, not too hard but it always has a challenge. Correct me if I'm wrong but when assigning values on Java it basically means keeping the same sum and then changing it as you go on? for example [img]http://puu.sh/Jhbw[/img][/QUOTE] Yeah, variables are for making the computer "remembering" stuff and making you able to change it or read it later.
  • [QUOTE=Erasus;36808939]At first I thought assigning values was stupid considering I didn't see the point. Now I do! Woo. I love Java, not too hard but it always has a challenge. Correct me if I'm wrong but when assigning values on Java it basically means keeping the same sum and then changing it as you go on? for example [IMG]http://puu.sh/Jhbw[/IMG][/QUOTE] Please don't post pictures of code, use the code tags for general code and the cpp tags for C(++)-like syntax. Edit: Apparently not. Carry on.
  • [QUOTE=robmaister12;36806224]So I spent a greater part of the afternoon learning Python and finding my way around Lego Alpha Team's container format. I haven't written the actual code to dump the file contents yet, but I have been able to walk through the file manually with a hex editor. I'm just stuck on the last 8 bytes of a file table entry. As ints, the values are extremely high, so I'm thinking it might be a checksum, but grabbing the checksum of the file contents in a bunch of common formats doesn't match up with any part of those 8 bytes, in both big and little endian. So now I'm thinking that it might be some sort of file permissions setting, but that doesn't seem necessary in a container format... [editline]16th July 2012[/editline] I'm going to see if any of the game dlls have exported symbols, method names should hold some clues...[/QUOTE] Sometimes these old formats include values which are obsolete or just simply not used by the engine. If you can't figure out what it is and you aren't missing any important information, it's usually safe to just skip the bytes in your decoder.
  • [QUOTE=FoohyAB;36807958]While you guys are on the subject of reverse engineering a format, what can you do if a game has compressed all of it's content into a single file? I'd always wanted to get the music and some of the geometry from [url=http://en.wikipedia.org/wiki/Switchball]Switchball[/url], but all of it is compressed into a massive bin archive.[/QUOTE] Looks like game extractor is supposed to handle the file, but I couldn't get it to open the one included in the demo of the game. [url]http://www.koders.com/java/fid2E7F6D9AB8D4166F5373D173CCC2B6DAB9317797.aspx?s=226[/url] The individual files looks like they're compressed or something. They all start with "VNZ".
  • [QUOTE=calzoneman;36809881]Please don't post pictures of code, use the code tags for general code and the cpp tags for C(++)-like syntax.[/QUOTE] If you look at my other posts, you'll see that I do that.. This was just once.. So picky, dude.
  • [QUOTE=vombatus;36806567]These are the one of many reasons I don't recommend Lua for beginners: it has a lot of very nifty things that are so nifty it sometimes hard to understand. Plus, many other languages don't have them, so switching to another will be harder. tl;dr: Java or C# as a first language is a good choice[/QUOTE] I'm pretty sure all major C-like languages have arrays, for loops, and the freedom to name variables. Java and C# are excellent first languages; I have a friend that I recommended they get into Bukkit development by taking on Java and start learning programming that way. However, why would you not recommend Lua for beginners? It's more forgiving than even Java and C#, which already hold your hand, but Lua gives you a bottle to suck on, too. There's a reason why it's recommended for beginners here. There are actually more immediately provided concepts in Java and C# that cannot be replicated in Lua without the help of a module. That being said, he was doing well, so I don't see why he not just try Java or C# instead, since it'll be more rewarding, but Lua is pretty much as easy as it gets without becoming entirely irrelevant. [editline]17th July 2012[/editline] [QUOTE=Erasus;36810246]If you look at my other posts, you'll see that I do that.. This was just once.. So picky, dude.[/QUOTE] Welcome to WAYWO! :v:
  • [QUOTE=windwakr;36810220]Looks like game extractor is supposed to handle the file, but I couldn't get it to open the one included in the demo of the game. [url]http://www.koders.com/java/fid2E7F6D9AB8D4166F5373D173CCC2B6DAB9317797.aspx?s=226[/url] The individual files looks like they're compressed or something. They all start with "VNZ".[/QUOTE] I couldn't get it to work either, but I'm recreating that plugin in C# [img]http://img12.imageshack.us/img12/841/fileefoohysvnsswitchbal.png[/img] You've made me very very happy. :v:
  • Question about some code. [code] result = (num1 % 2 != 0) ? "Odd" : "Even" ; [/code] I understand it all. But what I don't understand is (assuming I'm correct) if the 2 represents the "Odd" and the 0 represents the "Even" how can 2 do that, considering 2 is even? like, how does it make sense?
  • [QUOTE=Erasus;36811314]Question about some code. [code] result = (num1 % 2 != 0) ? "Odd" : "Even" ; [/code] I understand it all. But what I don't understand is (assuming I'm correct) if the 2 represents the "Odd" and the 0 represents the "Even" how can 2 do that, considering 2 is even? like, how does it make sense?[/QUOTE] 2 % 2 == 0, therefore result == "Even" because 0 != 0 == false
  • [QUOTE=Erasus;36811314]Question about some code. [code] result = (num1 % 2 != 0) ? "Odd" : "Even" ; [/code] I understand it all. But what I don't understand is (assuming I'm correct) if the 2 represents the "Odd" and the 0 represents the "Even" how can 2 do that, considering 2 is even? like, how does it make sense?[/QUOTE] You're performing a modulus operation, which means you're going to get back the remainder of the expression. If you divide 3 by 2 (or any odd number), you get back 1 (meaning, it is odd) and if you divide 2 by 2, the remainder is 0. Mathematics!
  • I don't think you do understand the code, the % sign is the modulus sign, meaning it will return whatever is left over when dividing a number by another number. Say you put in 33, if it is divided by 2 you will get 16.5, but the modulus only divides up to 16 and returns 1 (as 16*2 = 32, 32+1 = 33). We then check if the number is 0. If it is 0, then we return even, if it is not, we return odd.
  • Aw man, this is the first time I've got properly stuck using java. This sucks. Right, so basically [code] class condition { public static void main( String[] args) { int num1 = 1000; int num2 = 1001 ; String result ; result = ( num1 % 2 != 0 ) ? "Odd" : "Even" ; System.out.println(num1 + "is" + result); result = (num2 % 2 != 0) ? "Odd" : "Even" ; System.out.println(num2 + " is " + result); } } [/code] It's dividing the numbers by 2, then what?
  • % is the modulus operator. It divides the number by whatever is after it, and returns the remainder. If the remainder isn't 0 it sets result to "Odd", otherwise it sets it to "Even".
  • You've got two operations here. The modulo operator and the Ternary operator The modulo is easy enough, it's maths like 2 + 2 == 4. In this case, 4 % 2 == 0. The Ternary operator is slightly different. It's of the form variable = (expression) ? truth-value : false-value; It is basically shorthand for [cpp]if (expression) { variable = truth-value; } else { variable = false-value; }[/cpp] In this case, your expression is num % 2 == 0.
  • [code]class condition { public static void main( String[] args) { int num1 = 870; int num2 = 1001 ; String result ; result = ( num1 % 2 != 0 ) ? "Odd" : "Even" ; // dividing an even number will leave you with a whole number, for example 870 / 2 = 435 System.out.println(num1 + "is" + result); result = (num2 % 2 != 0) ? "Odd" : "Even" ; // dividing an odd number will leave you with a number, and a remainder, for example 5 / 2 = 2.5 if it's inequal to 0 then it's obviously odd.. System.out.println(num2 + " is " + result); } }[/code] Okay! Correct? I've figured that part out. But does it work like this 2 (Odd) != 0 (Even)? I know what i'm doing now I just don't understand what's representing Odd. != is inequal, so if it's != to 0 then it's odd.. if it isn't then it's even.. What is confusing me though, it's so hard to explain.. Like, how does it transmit it to being odd or even? like how does it make it show that?
  • [QUOTE=Erasus;36811751][code]class condition { public static void main( String[] args) { int num1 = 870; int num2 = 1001 ; String result ; result = ( num1 % 2 != 0 ) ? "Odd" : "Even" ; // dividing an even number will leave you with a whole number, for example 870 / 2 = 435 System.out.println(num1 + "is" + result); result = (num2 % 2 != 0) ? "Odd" : "Even" ; // dividing an odd number will leave you with a number, and a remainder, for example 5 / 2 = 2.5 if it's inequal to 0 then it's obviously odd.. System.out.println(num2 + " is " + result); } }[/code] Okay! Correct?[/QUOTE] It should be.
  • [QUOTE=Erasus;36811751][code]class condition { public static void main( String[] args) { int num1 = 870; int num2 = 1001 ; String result ; result = ( num1 % 2 != 0 ) ? "Odd" : "Even" ; // dividing an even number will leave you with a whole number, for example 870 / 2 = 435 System.out.println(num1 + "is" + result); result = (num2 % 2 != 0) ? "Odd" : "Even" ; // dividing an odd number will leave you with a number, and a remainder, for example 5 / 2 = 2.5 if it's inequal to 0 then it's obviously odd.. System.out.println(num2 + " is " + result); } }[/code] Okay! Correct? I've figured that part out. But does it work like this 2 (Odd) != 0 (Even)? I know what i'm doing now I just don't understand what's representing Odd. != is inequal, so if it's != to 0 then it's odd.. if it isn't then it's even.. What is confusing me though, it's so hard to explain.. Like, how does it transmit it to being odd or even? like how does it make it show that?[/QUOTE] You have to look at each part of the expression. [code] result = ((([B]num2 [/B]% 2) != 0) ? ("Odd") : ("Even")); // num2 = 7 result = ((([B]7 % 2[/B]) != 0) ? ("Odd") : ("Even")); // 7/2=3 and [highlight]1[/highlight] remainder result = (([B](1 ) != 0[/B]) ? ("Odd") : ("Even")); // 1 is not equal to 0, that's true result = ([B](true ) ? ("Odd") : ("Even")[/B]); // true means it will select the first "thing" (Odd) result = ("Odd" ); [/code]
  • [code]class escape2 { public static void main (String[] args) { String header = "\n\tLESSON PLAN FOR THE WEEK:\n"; header += "\n\tMonday\t\tTuesday\t\tWednesday\tThursday\tFriday\n"; header +="\t------\t\t-------\t\t----------\t--------\t------\n"; String lessons = "\tBusiness\tPSE\t\tScience\t\tMaths\t\tHistory\n"; lessons += "\tScience\t\tScience\t\tRE\t\tEnglish\t\tBusiness\n"; lessons += "\tEnglish\t\tMaths\t\tGraphics\tScience\t\tICT\n"; lessons += "\tICT\t\tICT\t\tHistory\t\tPE\t\tMaths\n"; lessons += "\tEnrichment\tEnglish\t\tScience\t\tGraphics\tRE\n"; System.out.print(header + lessons);} } [/code] Well, that was fucking horrible. I had to figure out which individual \t went where and then made sure it didn't misplace itself in the program. I finally figured it out and got it to work. It's my lesson plan for the week at school, I gave myself a self-assignment I suppose, just to see if it'd work. It did. [img]http://puu.sh/JkVB[/img]
  • [QUOTE=Erasus;36812699][code]class escape2 { public static void main (String[] args) { String header = "\n\tLESSON PLAN FOR THE WEEK:\n"; header += "\n\tMonday\t\tTuesday\t\tWednesday\tThursday\tFriday\n"; header +="\t------\t\t-------\t\t----------\t--------\t------\n"; String lessons = "\tBusiness\tPSE\t\tScience\t\tMaths\t\tHistory\n"; lessons += "\tScience\t\tScience\t\tRE\t\tEnglish\t\tBusiness\n"; lessons += "\tEnglish\t\tMaths\t\tGraphics\tScience\t\tICT\n"; lessons += "\tICT\t\tICT\t\tHistory\t\tPE\t\tMaths\n"; lessons += "\tEnrichment\tEnglish\t\tScience\t\tGraphics\tRE\n"; System.out.print(header + lessons);} } [/code] Well, that was fucking horrible. I had to figure out which individual \t went where and then made sure it didn't misplace itself in the program. I finally figured it out and got it to work. It's my lesson plan for the week at school, I gave myself a self-assignment I suppose, just to see if it'd work. It did. [/QUOTE] At some point in the not too distant future, you will gaze once more upon this code with experienced eyes and gently weep.
  • [QUOTE=Erasus;36812699][code]class escape2 { public static void main (String[] args) { String header = "\n\tLESSON PLAN FOR THE WEEK:\n"; header += "\n\tMonday\t\tTuesday\t\tWednesday\tThursday\tFriday\n"; header +="\t------\t\t-------\t\t----------\t--------\t------\n"; String lessons = "\tBusiness\tPSE\t\tScience\t\tMaths\t\tHistory\n"; lessons += "\tScience\t\tScience\t\tRE\t\tEnglish\t\tBusiness\n"; lessons += "\tEnglish\t\tMaths\t\tGraphics\tScience\t\tICT\n"; lessons += "\tICT\t\tICT\t\tHistory\t\tPE\t\tMaths\n"; lessons += "\tEnrichment\tEnglish\t\tScience\t\tGraphics\tRE\n"; System.out.print(header + lessons);} } [/code] Well, that was fucking horrible. I had to figure out which individual \t went where and then made sure it didn't misplace itself in the program. I finally figured it out and got it to work. It's my lesson plan for the week at school, I gave myself a self-assignment I suppose, just to see if it'd work. It did. [img]http://puu.sh/JkVB[/img][/QUOTE] Now make a function to automatically space them! :science: