Hm, I'm not sure what could have gone wrong; but you can take a look at my code changes here.Norbert wrote:Okay. It doesn't work for me. Maybe because I compile/link it myself to be able to run it on Linux, that not all changes are in the source files?
SDLPoP; David's open-source port of PoP
Re: SDLPoP; David's open-source port of PoP (pre-release)
Re: SDLPoP; David's open-source port of PoP (pre-release)
I made a icon for SDLPoP. I got the image from this forum.
- Attachments
-
- pop.zip
- (472 Bytes) Downloaded 198 times
-- Michael, the boy who makes Shaw's Nightmare.
Visit here to download Shaw's Nightmare: http://shawsnightmare.ucoz.com
Visit here to download Shaw's Nightmare: http://shawsnightmare.ucoz.com
Re: SDLPoP; David's open-source port of PoP (pre-release)
Nice.David wrote:They accepted my patch.David wrote:I reported the bug in the SDL Bugzilla: https://bugzilla.libsdl.org/show_bug.cgi?id=2986
I also received a reply from Ryan. Apparently they're planning to release SDL 2.0.4 soon.
Re: SDLPoP; David's open-source port of PoP (pre-release)
There was a patch to fix it in the original game: viewtopic.php?p=13128#p13128Falcury wrote:I also found the cause of a bug where leveldoors continue to slide open indefinitely under some circumstances (multiple exit doors, visiting the shadow room in level 6, or anything else that sets leveldoor_open to something other than 0 or 2).
I see you added a new variable. It should be saved to/loaded from the quicksave file.Falcury wrote:I had a burst of madness and created a potion that temporarily changes the kid into the shadow.
But then the existing quicksave files become unusable.
Probably not, it makes no sense.Falcury wrote:- Should quicksaving be allowed after the kid has died? (I was unfortunate enough to do this by accident...)
Maybe the error message could say then "no quicksave now" or "here".
While entering an exit door: Again, it makes no sense, because then you already completed the level.Falcury wrote:Similar for quicksaving midjump/midfall/on a loose tile/while weightless/entering an exit door/drinking a potion
If you save while weightless, and then load it back, then the kid will not be weightless, because this relies on the music playing.
midjump, midfall, on a loose tile, drinking a potion: Why not?
Add this at the end of quick_load():Falcury wrote:- Quickloading while executing certain movements, such as running jumps, may cause the kid to start moving immediately after the quickload has completed. Can this be prevented?
Code: Select all
ctrl1_forward = 0;
ctrl1_backward = 0;
ctrl1_up = 0;
ctrl1_down = 0;
ctrl1_shift2 = 0;
I will try that.Norbert wrote:Okay. It doesn't work for me. Maybe because I compile/link it myself to be able to run it on Linux, that not all changes are in the source files?
However, under Windows, the special potion still works for me if I recompile from the sources.
(Also, "Levels.dat" should be renamed to "LEVELS.DAT"?)
Re: SDLPoP; David's open-source port of PoP (pre-release)
Ah, ok. Interesting, I hadn't realized that the prince could go through closed level doors.David wrote:There was a patch to fix it in the original game: viewtopic.php?p=13128#p13128
Do you know if there are other known bugs in the original game that we could fix?
I think Pop3D tends to regard such actions as "unsafe" for quicksaving, but I agree with you that there is no good reason for this!David wrote:midjump, midfall, on a loose tile, drinking a potion: Why not?

Yes, I suppose so! Although I only put my own mod in there for testing purposes.David wrote:(Also, "Levels.dat" should be renamed to "LEVELS.DAT"?)
Do we want to keep the shadow potion as a feature, though? I think I will at least keep it as an easter egg for my level set, but perhaps it is too "unauthentic" for the main release?
Re: SDLPoP; David's open-source port of PoP (pre-release)
[...]Norbert wrote:Are you sure?Falcury wrote:I added the potion to level 6. You can quickload to the relevant part of the level to see the potion in action.
When I use F9 to quickload the only potion nearby is a red one that doesn't seem to have any special effects.
I do see an unusual potion somewhere, but then you're really making us work for it...
Yes, that's the unusual potion I meant.Falcury wrote:Edit: the quicksave file attached takes you directly to the potion.
With this new quicksave you created it does work, thanks.
Re: SDLPoP; David's open-source port of PoP (pre-release)
Right, I tried it under Linux.
The shadow potion works fine.
(As Norbert wrote in the meantime...)
However the game is slow and it uses 90% of the CPU.
Maybe because of what you wrote here: https://github.com/Falcury/SDLPoP/commi ... 23150135da
The shadow potion works fine.
(As Norbert wrote in the meantime...)
However the game is slow and it uses 90% of the CPU.
Maybe because of what you wrote here: https://github.com/Falcury/SDLPoP/commi ... 23150135da
- Some inelegant workarounds, game runs quite inefficiently (lots of surface conversions); needs refactoring
Re: SDLPoP; David's open-source port of PoP (pre-release)
Cool potion, by the way. 

Re: SDLPoP; David's open-source port of PoP (pre-release)
Thank you!Norbert wrote:Cool potion, by the way.
I thought I had fixed this specific problem in a later commit... It really should perform at least on par with the SDL1 version. I don't have Linux set up so I can't really test it. On my laptop (from 2008), I get typical CPU usage of about 1-3% on Windows.David wrote:Right, I tried it under Linux.
The shadow potion works fine.
(As Norbert wrote in the meantime...)
However the game is slow and it uses 90% of the CPU.
Maybe because of what you wrote here: https://github.com/Falcury/SDLPoP/commi ... 23150135da- Some inelegant workarounds, game runs quite inefficiently (lots of surface conversions); needs refactoring
Does this problem apply to all versions since the SDL2 migration, or was there a regression somewhere since?
Perhaps passing different flags to SDL_CreateRenderer() in set_gr_mode() makes a difference?
Re: SDLPoP; David's open-source port of PoP (pre-release)
Does "lots of surface conversions" refer to surface->texture conversions? (In request_screen_update.)Falcury wrote: I thought I had fixed this specific problem in a later commit...
Because that is still there.
Norbert uses Linux, but he didn't write about this problem.Falcury wrote: I don't have Linux set up so I can't really test it.
I get the same under Windows. The game is slow only under Linux.Falcury wrote: On my laptop (from 2008), I get typical CPU usage of about 1-3% on Windows.
I tested only this latest version. But I will try others.Falcury wrote: Does this problem apply to all versions since the SDL2 migration, or was there a regression somewhere since?
I tried to remove SDL_RENDERER_ACCELERATED, but no difference.Falcury wrote: Perhaps passing different flags to SDL_CreateRenderer() in set_gr_mode() makes a difference?
I might try other flags.
Re: SDLPoP; David's open-source port of PoP (pre-release)
I have two computers, both Linux machines, and even on the slowest PC it uses only 2.3-2.7% of a single core.David wrote:I get the same under Windows. The game is slow only under Linux.Falcury wrote: On my laptop (from 2008), I get typical CPU usage of about 1-3% on Windows.
That's an old dual core 6600 @ 2.40GHz. So the game is slow only under your Linux.

Re: SDLPoP; David's open-source port of PoP (pre-release)
SDL_RENDERER_SOFTWARE makes it faster. (Uses 40-50% of the CPU)
Then I installed the newest video card driver (nVidia) and it solved the problem.
(Uses 1-2% of the CPU with SDL_RENDERER_ACCELERATED)
(So an improper hardware acceleration can be *slower* than a software renderer?)
Then I installed the newest video card driver (nVidia) and it solved the problem.

(Uses 1-2% of the CPU with SDL_RENDERER_ACCELERATED)
(So an improper hardware acceleration can be *slower* than a software renderer?)
Re: SDLPoP; David's open-source port of PoP (pre-release)
I found a funny bug:
If the screen is flipped (Shift-I, potion), and something flashes (Shift-T, Shift-W, potion), then the screen is redrawn incorrectly without flipping.
But then animated objects are drawn over that correctly.
It was probably around ever since flashing was implemented.
Fixed: https://github.com/NagyD/SDLPoP/commit/ ... 09325aee0b
If the screen is flipped (Shift-I, potion), and something flashes (Shift-T, Shift-W, potion), then the screen is redrawn incorrectly without flipping.
But then animated objects are drawn over that correctly.
It was probably around ever since flashing was implemented.
Fixed: https://github.com/NagyD/SDLPoP/commit/ ... 09325aee0b
Re: SDLPoP; David's open-source port of PoP (pre-release)
Hm, that bug is quite interesting
Now that I look at it, there seems to be a minor difference with flashes in the original game: in SDLPoP, the lower part of the screen does not participate in the flash, but it does when I play the original game using DOSBox.
I have added the fixes discussed earlier:
Clear movement controls when quickloading: https://github.com/Falcury/SDLPoP/commi ... 45c3ddcd18
Disable entering closed level doors: https://github.com/Falcury/SDLPoP/commi ... c9e03627f2
A new fix:
Fix level doors in the starting room displaying a blue area when they slide open: https://github.com/Falcury/SDLPoP/commi ... 5f77d794fb
As a new experimental feature, I have been trying to implement this:
https://github.com/Falcury/SDLPoP/commi ... 5b018dae3b
The idea is that special tiles can be used to trigger special events in a non-hardcoded way. Nonlinear gameplay also becomes possible: multiple start positions based on which exit door you took in the previous level, skipping levels or backtracking to previous levels, etc.
The number of "scriptable" events is small at the moment but can be expanded.

Now that I look at it, there seems to be a minor difference with flashes in the original game: in SDLPoP, the lower part of the screen does not participate in the flash, but it does when I play the original game using DOSBox.
I have added the fixes discussed earlier:
Clear movement controls when quickloading: https://github.com/Falcury/SDLPoP/commi ... 45c3ddcd18
Disable entering closed level doors: https://github.com/Falcury/SDLPoP/commi ... c9e03627f2
A new fix:
Fix level doors in the starting room displaying a blue area when they slide open: https://github.com/Falcury/SDLPoP/commi ... 5f77d794fb
As a new experimental feature, I have been trying to implement this:
https://github.com/Falcury/SDLPoP/commi ... 5b018dae3b
The idea is that special tiles can be used to trigger special events in a non-hardcoded way. Nonlinear gameplay also becomes possible: multiple start positions based on which exit door you took in the previous level, skipping levels or backtracking to previous levels, etc.
The number of "scriptable" events is small at the moment but can be expanded.