AGS engine PSP port

Started by JJS, Fri 15/07/2011 16:27:57

Previous topic - Next topic

JJS

Yes, I found three problematic instances in runtimscriptvalue.cpp. All of them write/read int32 to/from global data. I added a new #define that enables the memcpy() procedure since it is not necessary on x86 and - by the looks of it - ARM.

But there is still something wrong. I get a very bad crash that unfortunately takes out the whole system including the debugger. It shows the same exception address in all games I tried but it doesn't point into the text segment. It might be wrong though, or there is a jump to the same invalid address somehow. Edit: Yeah, that would be the other crash lestat666 mentioned.
Ask me about AGS on PSP, Android and iOS! Source, Daily builds

lestat666

Wow, this is the most traffic this thread has had in months.
Well, other than what I posted  :tongue:

That maniac mansion bug that existed previously, is it related to any of these current ones or is it completely unrelated?  That bug i mentioned months ago doesn't generate a crash, but it is essentially failing to launch a scripted sequence.

Are these other major bugs only present in the PSP port?

Thanks for all your efforts.

JJS

Maniac Mansion bug is a general backward compatibility problem.

The two latest bugs were indeed only present on the PSP. The "red screen" crash was due to a too small stack size on the audio thread, the other one unaligned data (see previous post).
They should both be fixed now.
Ask me about AGS on PSP, Android and iOS! Source, Daily builds

lestat666

The general backward compatibility problem with maniac mansion.

Is it even fixable?


Crimson Wizard

Quote from: lestat666 on Sun 16/12/2012 21:45:56
The general backward compatibility problem with maniac mansion.

Is it even fixable?
Do you mean loading olde savegames? There were some changes made in the past to how they are saved. Atm we aim at savedgames compatibility with AGS 3.2.1.1115 (latest official release) (but I think some of the earlier 3.+ versions should load fine too).
Which build did you use to save the game with?

JJS

No, it is about this bug (quote from a few pages back):
QuoteLastly, there is a scripting problem at the end of the game.  If I use Dave, the main character, to beat the game, when the ending shows, it freezes at a certain point and the mansion blows up.  Basically what happens is when you enter the lab, a timer starts ticking and you have to do certain actions before it runs out or the mansion blows up.  Even when I complete the said actions, it just freezes at a certain point until this timer, which is supposed to stop, runs out and shows what would have happened had I not completed what I was supposed to in time.  I hope this makes sense.  Now this does not happen if I beat the game with one of the other 2 kids.  I think it is because Dave appears in the ending, and if he is used to beat the game, it activates this glitch...  If you use another kid, he is available to show up in the ending.

I think it is fixable, but as of yet the reason for the bug is not known. It might be because a change in room switching logic maybe.
Ask me about AGS on PSP, Android and iOS! Source, Daily builds

lestat666

Found more bugs in the latest daily.

Resonance loads ok... didn't have any save games to test since it is unplayable due to slowness on the psp.

Gemini Rue
Start a new game, and it works ok in the little intro, but once the title is shown and the game starts if I hit the start button which is mapped to bring up the menu (ie escape key), the game freezes.  This only happens if I try to do it before the cinematic is done... if I wait until it is done and the cursor comes up, it works fine.  This button is used to also skip cinematics, so it can could cause a potential problem.  Although, it seems to work fine in the intro part because it is not gearing up to start a playable section of the game.  When hit during the intro, it is skipping to another cinematic... hope this makes sense.

Second bug in Gemini Rue.
Trying to load any saved game at any time gives an error.  The menu comes up, but when you pick your game to load and hit load, you get this message.
Black screen,
An error has occured. Please contact the game author for support, as this is likely to be a scripting error and not a bug in AGS.  ACI version 3.21.1115

Error: Restore_Game: Game has changed (audio types), unable to restore.

Maniac Mansion Bug.
When trying to load some save games, not all, I get the blue screen of death.

Exception details:

Exception - Address load/inst fetch
EPC       - 08895C58 / gro Application.text + 00091C58
Cause     - 10000010
Status    - 60008613
BadVAddr  - 00000017
zr:00000000 at:DEADBEEF v0:FFFFFFFF v1:08B30000
a0:00004BE4 a1:00004BE4 a2:0BABFC80 a3:00000000
t0:0BABFC80 t1:08AA0000 t2:00000000 t3:00000001
t4:08A70000 t5:0000030C t6:DEADBEEF t7:DEADBEEF
s0:08B299DC s1:08B20000 s2:08AA5638 s3:00000000
s4:00000000 s5:00000000 s6:DEADBEEF s7:DEADBEEF
t8:DEADBEEF t9:088BB674 k0:0BABFF00 k1:00000000
gp:08A84A50 sp:0BABFD18 fp:0BABFE40 ra:08895E68

Not exactly sure why I get this with only some of the save games.

As far as the other general backwards compatibility bug, I am just waiting on getting that fixed so I can play through the first maniac mansion on the psp with the other characters.  I don't have much time to play through it on my computer and it looks much better on the psp due the smaller screen. 

Thanks again for all your hard work.

Crimson Wizard

There was one change in save game routine lately, which actually fixed incompatibility with 3.21.1115. There is a range of builds between when the mistake was first introduced and when it was fixed, and savegames made with any of that builds are now incompatible.
"Game has changed (audio types)" message is directly related to this. Not sure about MM's BSD.

If you really need those savegames (like to test particular moments) I think we may make a simple utility that converts savegames to 3.21.1115-compatible format. It would also help if you can remember which build did you use to play games when you made those saves (like which date, approximately, that was).

JJS

QuoteWhen trying to load some save games, not all, I get the blue screen of death.
This crash happens in the audio code, not sure why yet.

QuoteAs far as the other general backwards compatibility bug, I am just waiting on getting that fixed so I can play through the first maniac mansion on the psp with the other characters.  I don't have much time to play through it on my computer and it looks much better on the psp due the smaller screen.
Should be fixed in the newest build.

The problem was that SetPlayerCharacter() behaved differently on 2.61 and lower. It would set the new character and change to its room regardless of whether that character was already the player. Newer versions of the engine just ignore the command if the new character is the same as the current player character. Interestingly the documentation to SetPlayerCharacter() does not mention this.
Because of this behaviour, the end scene never triggers as it runs in the room where "Dave" is. But if "Dave" is already the player, the room switch never happens.
Ask me about AGS on PSP, Android and iOS! Source, Daily builds

lestat666

QuoteIf you really need those savegames (like to test particular moments) I think we may make a simple utility that converts savegames to 3.21.1115-compatible format. It would also help if you can remember which build did you use to play games when you made those saves (like which date, approximately, that was).

As for when I played it....  I don't remember the exact build.
I know for a fact it was in May sometime, but I had been using the same build since March maybe?

What I can tell you for sure is the last build that the save games worked.
I know this for a fact that they worked with this one 2012-08-27 12.41.46.
This was the last one they loaded properly with.  So if they can be converted to this one, they should work.

Hope this helps.


QuoteShould be fixed in the newest build.

The problem was that SetPlayerCharacter() behaved differently on 2.61 and lower. It would set the new character and change to its room regardless of whether that character was already the player. Newer versions of the engine just ignore the command if the new character is the same as the current player character. Interestingly the documentation to SetPlayerCharacter() does not mention this.
Because of this behaviour, the end scene never triggers as it runs in the room where "Dave" is. But if "Dave" is already the player, the room switch never happens.

No time to test it right now, but I will let you know when I get a chance.


QuoteThis crash happens in the audio code, not sure why yet.

Looks like this is the last thing to make it completely playable.
I might not be able to test the compatibility fix until this is fixed.

Thanks again.
You guys are great.




JJS

QuoteLooks like this is the last thing to make it completely playable.
I might not be able to test the compatibility fix until this is fixed.
Can you easily reproduce that crash? If so, I would be interested in save games that crash like this. The one savegame you provided loads fine for me.
Ask me about AGS on PSP, Android and iOS! Source, Daily builds

Crimson Wizard

#171
Quote from: lestat666 on Tue 18/12/2012 10:42:07
What I can tell you for sure is the last build that the save games worked.
I know this for a fact that they worked with this one 2012-08-27 12.41.46.
This was the last one they loaded properly with.  So if they can be converted to this one, they should work.
Can you upload these saved games somewhere?

lestat666

QuoteCan you easily reproduce that crash? If so, I would be interested in save games that crash like this. The one savegame you provided loads fine for me.

I know of one savegame that does it for sure.  Some worked and some crashed, so I will have to go through them.
I will specify which ones worked and which ones crashed.  You want them just sent to your email again?
I may not be able to do this until tomorrow.  Should be able to get it done for sure by the weekend.

QuoteCan you upload these saved games somewhere?
Where did you want me to send these?  I usually just emailed them to JJS.
I can send all of them as there are only 6 max I think.

QuoteStart a new game, and it works ok in the little intro, but once the title is shown and the game starts if I hit the start button which is mapped to bring up the menu (ie escape key), the game freezes.  This only happens if I try to do it before the cinematic is done... if I wait until it is done and the cursor comes up, it works fine.  This button is used to also skip cinematics, so it can could cause a potential problem.  Although, it seems to work fine in the intro part because it is not gearing up to start a playable section of the game.  When hit during the intro, it is skipping to another cinematic... hope this makes sense.

What about this bug in Gemini Rue?  Was this one fixed in that build?  This is kind of a strange one as it never happened before.  This is when starting a new game too... not just when loading a save game, which currently doesn't work at all.

JJS

Quote from: lestat666 on Tue 18/12/2012 20:57:31What about this bug in Gemini Rue?  Was this one fixed in that build?  This is kind of a strange one as it never happened before.  This is when starting a new game too... not just when loading a save game, which currently doesn't work at all.
I have a hard time reproducing this. The game never "freezes" for me when skipping cutscenes, but it takes a long time to get to the next playable section. What I mean is that when I skip the "operation scene" it takes about 20 seconds, then skipping the next scene (which ends with "MH, where are you?") takes more than 40 seconds. These times might well we longer now than in previous versions because the script interpreter lost a bit of speed.

QuoteWhere did you want me to send these?  I usually just emailed them to JJS.
I can send all of them as there are only 6 max I think.
You could use some file hoster like rapidshare or megaupload. Or mail them to me, I will host them on my server.
Ask me about AGS on PSP, Android and iOS! Source, Daily builds

lestat666

#174
Sorry for the Novel.  Did lots of testing.

QuoteI have a hard time reproducing this. The game never "freezes" for me when skipping cutscenes, but it takes a long time to get to the next playable section. What I mean is that when I skip the "operation scene" it takes about 20 seconds, then skipping the next scene (which ends with "MH, where are you?") takes more than 40 seconds. These times might well we longer now than in previous versions because the script interpreter lost a bit of speed.

K, tried and see what you mean.  I thought it froze but it just takes forever.  As far as the loss of speed of the script interpreter... it makes the game a bit painful to play.  It is quite choppy now. Not unplayable, but it is fairly noticeable.  Especially when you are outside and it is raining.  It depends on the size of the room too.  First screen is not to bad but the one to the right of that is.  Skipping when you walk across the screen takes a bit of time too depending on how far you told him to walk.  It is the same kind of thing that plagued the shooting sequences, but not as bad as that, although I am afraid to see what one of those shooting sequences is like now... I don't have a save game at one to test it.  Plus the save games aren't loadable yet. What ended up causing this?  Can it be fixed?

I noticed you fixed the sleep mode bug.  Before, when you would put the psp in sleep mode, it would come back to the blue screen with an error... now it comes back.  This is really nice.

(Update)
Found another bug, realized the sleep mode bug is not fixed.  It is just delayed due to the script interpreter slow down.  Instead of coming back to a blue screen, you can play for a couple mins and then it comes up.
Here is the exception log.  It might change every time though.

Exception details:

Exception - Bus error (data)
EPC       - 08844DB8 / gro Application.text + 00040DB8
Cause     - 1000001C
Status    - 40008613
BadVAddr  - 03140D04
zr:00000000 at:DEADBEEF v0:00000000 v1:00000406
a0:0904D458 a1:FFFFFFFF a2:00000000 a3:0904C5D0
t0:09048550 t1:0904A590 t2:DEADBEEF t3:DEADBEEF
t4:DEADBEEF t5:DEADBEEF t6:DEADBEEF t7:DEADBEEF
s0:08B30000 s1:08AA5658 s2:08AA0000 s3:000003A2
s4:08E8AEAC s5:00000001 s6:000000A4 s7:00000402
t8:DEADBEEF t9:DEADBEEF k0:0BABFF00 k1:00000000
gp:08A84A70 sp:0BABFC50 fp:00000064 ra:08844DB8

Happens in Maniac Mansion too.

Exception details:

Exception - Address load/inst fetch
EPC       - 089B1814 / gro Application.text + 001AD814
Cause     - 10000010
Status    - 60008613
BadVAddr  - 89209016
zr:00000000 at:DEADBEEF v0:89209016 v1:00000002
a0:0BABFA80 a1:00000000 a2:0BABFA80 a3:89209016
t0:00000000 t1:00000002 t2:89209016 t3:0BABFA80
t4:DEADBEEF t5:DEADBEEF t6:DEADBEEF t7:DEADBEEF
s0:7FCD924A s1:00000002 s2:08BA12EC s3:0BABFA80
s4:08B40000 s5:08A7A8E8 s6:00000002 s7:09063450
t8:DEADBEEF t9:088C70C4 k0:0BABFF00 k1:00000000
gp:08A84A70 sp:0BABFA50 fp:00000002 ra:089AF5B8


QuoteThis crash happens in the audio code, not sure why yet.
Concerning the saves causing this.
For Mansion Save Slot 1, 3 & 7 cause the blue screen crash.
2, 4, 5, 6, 8, 9, 10, & 11 load fine.
I emailed you the saves.

QuoteHad another bug in Gemini, but I think it was fluke related to sleep mode as it only happened once.
Black screen, something about not being able to draw some sprite.
There was one change in save game routine lately, which actually fixed incompatibility with 3.21.1115. There is a range of builds between when the mistake was first introduced and when it was fixed, and savegames made with any of that builds are now incompatible.
"Game has changed (audio types)" message is directly related to this. Not sure about MM's BSD.

I also emailed you the Gemini Rue Saves.  Can you make sure Crimson Wizard get's these if he wants them? or maybe you can work with them in the same way he wanted, to make a converter.  You know what would be really neat is a converter that can convert the saves from pc to psp and vice versa as well as a converter that can convert between AGS versions

QuoteThe problem was that SetPlayerCharacter() behaved differently on 2.61 and lower. It would set the new character and change to its room regardless of whether that character was already the player. Newer versions of the engine just ignore the command if the new character is the same as the current player character. Interestingly the documentation to SetPlayerCharacter() does not mention this.
Because of this behaviour, the end scene never triggers as it runs in the room where "Dave" is. But if "Dave" is already the player, the room switch never happens.

Other Maniac Mansion bug at the end is fixed.  Thanks.

Crimson Wizard

Script speed issue is something I feared... I know few things that could be changed right away to improve this. Unfortunately, I do not have PSP, so I won't be able to see the impact myself.

JJS

#176
I will look at the crashes. And I didn't do anything about possible standby problems but this is always a problem on the PSP. Usually I have the extra memory enabled in the config file and therefore I cannot use suspend mode anyway :-)

I uploaded the Gemini Rue saves here: http://jjs.at/temp/grsaves.zip Since they are from the PSP version, I am not sure if they will restore correctly in the Windows build because it uses different save data for the snow/rain plugin. But I tried and they show the "audio types" error before that becomes a problem.

Did you already send me the MMD saves?
Ask me about AGS on PSP, Android and iOS! Source, Daily builds

lestat666

#177
I tried to send them, but I got a post master delivery error due to exceeding your email space.

After zipping them, they are only 1.8 Megs, so they should be fine now to be emailed.  I guess I should have thought of that previously.   :-[  I emailed them to you now.

Hopefully the speed issues could be fixed. On the August 29th build, Gemini is working.  It does take a bit to skip the scene that ends with "MH Where are you", but overall the rest of the scenes skip good with only a slight delay, and it is not choppy during the actual playing of the game except the gun fights (although it was always choppy here)  This build may be slightly slower than previous builds... can't tell as I no longer have them, but it is so slight the game is still very playable.

It could give you a starting point with seeing what was changed.

Crimson Wizard

Quote from: lestat666 on Mon 24/12/2012 16:26:41
It could give you a starting point with seeing what was changed.

The whole script interpreter changed  (wtf)

JJS

Updated the port with a suspend fix. It should now be pretty stable. The crashes are not really occuring later because of the changed script interpreter though. Problem is that files which are open while suspending don't normally get reopened and repositioned after resuming. So the next time a resource is loaded (a sprite, music, new room) the game crashed with a blue screen or showed an engine error about corrupted sprites etc.

Also added another fix for multithreaded audio. This does not help with the crashing MMD savegames but it is related to the same problem. So hopefully it doesn't occur in the future.

The PSP is not very fast to begin with (333 Mhz MIPS with small caches) so it could never run script heavy games at full speed (not even close). As an example, the main menu of Beacon has a water effect on it that causes now 4 fps max while with the old script interpreter it was about 7 fps. Gemini Rue is another problem because it plays a lot of sound effects in the shooting scenes combined with scripting. Since the PSP is very slow while reading from the memory stick this is of course problematic.
Ask me about AGS on PSP, Android and iOS! Source, Daily builds

SMF spam blocked by CleanTalk