Which version shall I use?[message #251552]
|
Fri, 14 May 2010 18:06
|
|
fuji |
|
Messages:10
Registered:May 2010 |
|
|
Hi,
I'm back to JA2 after a few years and discover stracciatella... but I don't know which version to use: I found one version on http://tron.homeunix.org/ja2/ and another one on svn://tron.homeunix.org/ja2/trunk.
They are not the same though and I've different problems:
- on the http version the starting money isn't right (84472 more than supposed to)
- on the svn version the corpses disappear once they hit the ground.
I didn't play much yet since I'd like to know which version I should use.
Cheers guys.
Report message to a moderator
|
Private
|
|
|
|
|
Re: Which version shall I use?[message #251603]
|
Sat, 15 May 2010 11:47
|
|
bbun |
|
Messages:74
Registered:April 2004 Location: Amsterdam |
|
|
That fixed it, mgl. Thanks.
Does the job. You have to configure SGPDATADIR in your config.default though.
[Updated on: Sat, 15 May 2010 11:48] by Moderator Report message to a moderator
|
Corporal
|
|
|
Re: Which version shall I use?[message #251611]
|
Sat, 15 May 2010 15:34
|
|
fuji |
|
Messages:10
Registered:May 2010 |
|
|
Sorry guys, I think I swapped the versions: the svn version doesn't start with the correct amount, no problem with the corpses...
For lowercase I also tried 1.13, and there's a script in project/lowercase.sh (just for reference)
[Updated on: Sat, 15 May 2010 15:38] by Moderator Report message to a moderator
|
Private
|
|
|
|
|
|
|
|
|
|
|
Re: Which version shall I use?[message #252019]
|
Sat, 22 May 2010 11:39
|
|
fuji |
|
Messages:10
Registered:May 2010 |
|
|
Ok, I can try... shouldn't take more than ten years or so.
EDIT: can I ask you in which file a new game is initialized?
[Updated on: Sat, 22 May 2010 11:45] by Moderator Report message to a moderator
|
Private
|
|
|
|
Re: Which version shall I use?[message #252049]
|
Sun, 23 May 2010 00:47
|
|
fuji |
|
Messages:10
Registered:May 2010 |
|
|
mglI think it's "Build/Strategic/Game_Init.cc"
Look for "cash" in this file to find where the starting funds are allocated.
The "Finances" screen and most of the money functions are in "Build/Laptop/Finances.cc".
Look for function names like "GetTodaysBalance()" to find the variable in which your money is stored. Its name is something like "LaptopSaveInfo.Balance".
All the money changes are written in the file "finances.dat" somewhere in "$HOME/.ja2/data/...". I think it's "$HOME/.ja2/data/temp/finances.dat" but I'm not sure. You can see this file only when you are playing. It's removed when you leave the game. Today's debits are guessed from all the other values written in this file. When you start a new game, I think its size is 18 bytes. The first 4 and last 4 bytes are your current money at this point.
Cheers, I'll have a look and see if I can understand
mgl
I already ran a debugger on all of this and didn't notice anything interesting except (for info only) that all the read/write functions depend on your processor's endianness while I was wrongly led to think that they were endianness-independent, guessing from their names. But it's not related to your problem.
Does that mean stracciatella can run on a ppc mac? Had I known i would have bothered you way before.
EDIT: here is my finance.dat: C0 F9 01 00 01 00 DC 05 00 00 C8 AF 00 00 C0 F9 01 00 (new game, novice)
So yeah, my starting money (129472) is the first and last 4 bytes and the actual 45000 are bites 11 and 12.
[Updated on: Sun, 23 May 2010 10:19] by Moderator Report message to a moderator
|
Private
|
|
|
Re: Which version shall I use?[message #252106]
|
Mon, 24 May 2010 00:17
|
|
mgl |
|
Messages:255
Registered:December 2007 Location: France |
|
|
fujiDoes that mean stracciatella can run on a ppc mac? Had I known i would have bothered you way before.
I think the endiannes-independent port is not complete yet. You would have all the bytes coming from the data files swapped.
fujiEDIT: here is my finance.dat: C0 F9 01 00 01 00 DC 05 00 00 C8 AF 00 00 C0 F9 01 00 (new game, novice)
So yeah, my starting money (129472) is the first and last 4 bytes and the actual 45000 are bites 11 and 12.
The only money event you have is a type "0001h" (2 bytes MSB) at date "05DCh" (4 bytes MSB), the beginning of the game. It's your account being credited $45000. Your balance should be set to 0 when you start a new game, before the $45000 are added to it. I think it's enforced by a C++ exception thrown when the file "finances.dat" doesn't already exist. I don't remember clearly because it was last week, but I believe there is a call to memset() on the "LaptopSaveInfo" structure (I still don't remember its exact name) too to clear your balance and several other things even long before the exception is thrown.
Your balance manages to bet set to 84412 instead. As Gumpy says, "Doo doo doo doo doo doo doo doo". On the finances screen, today's debits are computed from your balance and all the other money events i.e only the $45000 credit and a negative debit of -84412 is guessed to match your balance.
If you can do it, try to see when your balance gets its strange value with a debugger. You should start by watching the finances initialization function in "Build/Laptop/Finances.cc". I don't remember its name, but it may be something simple like "InitFinances()". The variable you want to watch is "LaptopSaveInfo.iBalance" or something like that. If I remember well, the memset() call was done earlier in "Build/Laptop/Laptop.cc" and your balance should already bet set to 0 when you enter the function. Then the function will try to restore your balance value by reading the "finances.dat" file from your savegame, which you don't have because it's a new game. The default behaviour when the file doesn't exist should be to set your balance to 0. Try to print your balance value several time while the function is progressing...
Report message to a moderator
|
|
|
|
|
|
|
Re: Which version shall I use?[message #252178]
|
Mon, 24 May 2010 23:31
|
|
mgl |
|
Messages:255
Registered:December 2007 Location: France |
|
|
Luchs14is it somehow achievable to get the permission by the game to load a savegame (e.g. a quicksave) even while the enemy's turn is active in the moment? The original Ja2 does not allow this, but one may load savegames at any time in 1.13
I think Tron won't change anything that he doesn't see as a bug.
Luchs14And one more thing: obviously the sampling rate for the audio files has been changed, some sounds are now higher in pitch, I would prefer the old school way with original sounds, is there also some way to change this ..?
Several years ago, Tron found out that some sound samples were played at an incorrect rate. He fixed it. Now some of them sound better, like the Russian 5.45 I think, and some sound worse, like the .45 which sounds like a bottle of champagne would. The only way to change that is to change the code. The wrapper function for sounds is called "Play...JA2Sample()", if you want to look at it.
But the major change is that enemies climb roofs! It was seen as being disabled by mistake in Vanilla and is now enabled.
Report message to a moderator
|
|
|
|
|
|
|