Stream=TGameForm: Raíz=:TGameFormAnyway it compiles with a collection of warnings (Platformer.Painter.pp(xx,xx) Warning: Symbol "ScanLine" is not portable) and hints (Platformer.Window.pp(xx,zz) Hint: Parameter "XXXX" not used).
Error reading TGameForm.DoubleBuffered: Unknown property: "DoubleBuffered"
Posición del stream: 4096
(...) I really hate Git (I know, it is silly) (...)No, it isn't. I also don't like Git nor GitHub, I prefer SourceForge (the new owners improved a lot the platform). I don't understand the way Git(Hub) organizes the stuff, and don't know how to create a web page, where are the downloads, the bug tracker...
(...) I really hate Git (I know, it is silly) (...)No, it isn't. I also don't like Git nor GitHub, I prefer SourceForge (the new owners improved a lot the platform). I don't understand the way Git(Hub) organizes the stuff, and don't know how to create a web page, where are the downloads, the bug tracker...
Loading the project on Lazarus 1.8 on Xubuntu 18.04.2 LTS gives next error:QuoteStream=TGameForm: Raíz=:TGameForm
Error reading TGameForm.DoubleBuffered: Unknown property: "DoubleBuffered"
Posición del stream: 4096
Warning: Symbol "ScanLine" is not portable
Hint: Parameter "XXXX" not used
When running the compiled game, it just raises an exception: Unknown Property: "DoubleBuffered".
Thank you. Finally, someone else said this out loud.
That is why I am looking for people who would help me with the porting of the code. Of course, anyone who wants to, can download the source and test the game — on any platform, including Windows. I am interested in the following platforms:I not sure i help. i try game raspbian pi and get error. Graphic no good is ok but error no ok ?
@Thausand: the game code is not for Raspberry, I don't know if it should be, because I don't use this hardware. I am interested in platforms used on PC — I mentioned which ones.
Currently, the game code is adapted for Windows and works properly on XP and higher. It also has patches for Unix systems on which the game starts and works, but the screen is not rendered correctly. Other problems may also exist, but I do not have such information.Raspberry pi = pc = linux
That is why I am looking for people who would help me with the porting of the code. Of course, anyone who wants to, can download the source and test the game — on any platform, including Windows. I am interested in the following platforms:
- Windows
- Linux
- FreeBSD
- macOS/OSX
But still I don't understand what you're writing about.write you: "Other problems may also exist".
Try using a translator (e.g. from Google), instead of trying to write yourself. 8)Bing write:
Only differ processor. i386, x86-64, ARM, PPC. all PC. PC = Personal Computer. Not alone windows or i386 :)
Is ok if not want know but i think error bad. memory error.
I bad english. You make me more complicate when say Raspberry/Linux not peecee :POnly differ processor. i386, x86-64, ARM, PPC. all PC. PC = Personal Computer. Not alone windows or i386 :)
I did not mean such personal computers, but ok — if you want to test, go ahead. 8)
I not know if problem game or problem Lazarus/FPC.QuoteIs ok if not want know but i think error bad. memory error.Yep, memory leaks are a problem, but there are no leaks under Windows. All objects are properly released when they are no longer needed. I do not know why this is happening, I do not know Raspberry Pi, so I can only advise you to check the game under the debugger and find out where the problem is.
Marked memory at $75638640 invalidHeap dump ok if object not free. You not free object if exception. That ok. Not write exception handler can be if write good code.
Wrong signature $B209FCFE instead of 891743FD
$00052508
$000525CC
$00195644
$001955B8
$000406F0
$00196840
$00198CD4
$000406F0
$003D4704 line 1012 of Platformer.Renderers.pp
$003D7118 line 1518 of Platformer.Renderers.pp
$003D72EC line 1546 of Platformer.Renderers.pp
$003CADC8 line 641 of Platformer.Scenes.pp
$003CA3C8 line 470 of Platformer.Scenes.pp
$00076DD8 line 397 of Platformer.Game.pp
$0007811C line 614 of Platformer.Game.pp
$00075EF0 [TGtk2WidgetSet.Destroy] WARNING: There are 3 unreleased DCs, a detailed dump follows:
[TGtk2WidgetSet.Destroy] DCs: 7571F3E0 7571F060 7571F220
[TGtk2WidgetSet.Destroy] WARNING: There are 10 unreleased GDIObjects, a detailed dump follows:
[TGtk2WidgetSeline 80 of Platformer.Window.pp
$00060578
$0005F6AC
Heap dump by heaptrc unit
t seems you are using heaptrc. That is the error you get when doing a freemem with a pointer that was not obtained with getmem.
Perhaps one of the functions used in line 122 is not thread safe. For debugging purposes, put the whole block inside the critical section.
Yes I'm using HeapTrace from the compiler option. I removed that option and that exception disappeared.
Yes the exception has disappeared. But the error is still there.
Heaptrace simply increases the chance of catching the error. Without it you will have random other crashes.
Wrong signature $AAAAAAAA instead of 02202B3D
Most likely means that you accessed (written to ) memory that you already freed before.
Such memory will eventually be used for other objects, and then writing random data into it, will mean disaster.
This can be caused by missing thread synchronization. but it can also be happen without threads.
And unfortunately, it is one of the hardest to debug issues that there are....
I ask before if game have debug option for compile. I see not special care debug so i make me write.
read more thread if want.
If work Windows then think error is Freepascal or Lazarus ?
This thread will not help me at all, because the problems described in it do not apply to my code. In my game, all objects are properly released. The problems exists somewhere else.I think you not see. If exception then objects not release in code game. Code game not have exception handling.
I have been using the HeapTrc unit since the very beginning, so if at any moment I would forget to release s
I do not know — I have only various Windows systems for testing, and under Windows all is perfect.Link thread write can run perfect and no error. but error hide so you not see. That was why thread and read what mean "marked memory"-error.
Code game not have exception handling.
I fix error marked memory. change type pixel 3 packed UInt8.
That make new error. Graphic not fit width window game. 1/4 window game to right clear.
Maybe the 4-bit bitmap files (with RLE compression) are not fully supported under Unixes or the bitmap pixel components occupy more than one byte per channel?
pixelformat=6
Bitmap.Description
Format=ricfRGBA
HasPalette->False
HasMask->False
Depth=24
Width=224
Height=128
BitOrder=riboBitsInOrder
ByteOrder=riboLSBFirst
LineOrder=riloTopToBottom
LineEnd=rileDWordBoundary
BitsPerPixel=32
BytesPerLine->896
RedPrec=8 RedShift=16
GreenPrec=8 GreenShift=8
BluePrec=8 BlueShift=0
AlphaPrec=0 AlphaShift=0
~~~mask~~~
MaskBitsPerPixel=1
MaskShift=0
MaskLineEnd=rileByteBoundary
MaskBitOrder=riboBitsInOrder
MaskBytesPerLine->28
~~~palette~~~
PaletteColorCount=0
PaletteBitsPerIndex=0
PaletteShift=0
PaletteLineEnd=rileTight
PaletteBitOrder=riboBitsInOrder
PaletteByteOrder=riboLSBFirst
PaletteBytesPerLine->0
you right = 32 bit pixel :)Sprite "sprites/hero/regular/normal.sprite"
Sprite.Description Format=ricfRGBA HasPalette->False HasMask->False Depth=24 Width=14 Height=16 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=24 BytesPerLine->44 RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 AlphaPrec=0 AlphaShift=0 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileWordBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->2 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0=
Sprite "sprites/hero/regular/wink.sprite"
Sprite.Description Format=ricfRGBA HasPalette->False HasMask->False Depth=24 Width=14 Height=16 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=24 BytesPerLine->44 RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 AlphaPrec=0 AlphaShift=0 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileWordBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->2 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0=
Sprite "sprites/hero/regular/blind.sprite"
Sprite.Description Format=ricfRGBA HasPalette->False HasMask->False Depth=24 Width=14 Height=16 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=24 BytesPerLine->44 RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 AlphaPrec=0 AlphaShift=0 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileWordBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->2 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0=
Sprite "sprites/hero/special/normal.sprite"
Sprite.Description Format=ricfRGBA HasPalette->False HasMask->False Depth=24 Width=14 Height=16 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=24 BytesPerLine->44 RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 AlphaPrec=0 AlphaShift=0 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileWordBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->2 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0=
Sprite "sprites/hero/special/wink.sprite"
Sprite.Description Format=ricfRGBA HasPalette->False HasMask->False Depth=24 Width=14 Height=16 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=24 BytesPerLine->44 RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 AlphaPrec=0 AlphaShift=0 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileWordBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->2 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0=
Sprite "sprites/hero/special/blind.sprite"
Sprite.Description Format=ricfRGBA HasPalette->False HasMask->False Depth=24 Width=14 Height=16 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=24 BytesPerLine->44 RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 AlphaPrec=0 AlphaShift=0 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileWordBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->2 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0=
Sprite "sprites/firefly/regular/normal.sprite"
Sprite.Description Format=ricfRGBA HasPalette->False HasMask->False Depth=24 Width=8 Height=8 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=24 BytesPerLine->24 RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 AlphaPrec=0 AlphaShift=0 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileWordBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->2 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0=
Sprite "sprites/firefly/regular/flash.sprite"
Sprite.Description Format=ricfRGBA HasPalette->False HasMask->False Depth=24 Width=8 Height=8 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=24 BytesPerLine->24 RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 AlphaPrec=0 AlphaShift=0 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileWordBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->2 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0=
Sprite "sprites/firefly/regular/bulb.sprite"
Sprite.Description Format=ricfRGBA HasPalette->False HasMask->False Depth=24 Width=8 Height=8 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=24 BytesPerLine->24 RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 AlphaPrec=0 AlphaShift=0 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileWordBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->2 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0=
Sprite "sprites/firefly/special/normal.sprite"
Sprite.Description Format=ricfRGBA HasPalette->False HasMask->False Depth=24 Width=10 Height=10 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=24 BytesPerLine->32 RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 AlphaPrec=0 AlphaShift=0 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileWordBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->2 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0=
Sprite "sprites/firefly/special/flash.sprite"
Sprite.Description Format=ricfRGBA HasPalette->False HasMask->False Depth=24 Width=10 Height=10 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=24 BytesPerLine->32 RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 AlphaPrec=0 AlphaShift=0 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileWordBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->2 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0=
Sprite "sprites/firefly/special/bulb.sprite"
Sprite.Description Format=ricfRGBA HasPalette->False HasMask->False Depth=24 Width=10 Height=10 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=24 BytesPerLine->32 RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 AlphaPrec=0 AlphaShift=0 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileWordBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->2 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0=
@Thausand: thank you for confirmation.you no thank me. i more confirmation.
So, what is the problem if it is not the size of the pixel? Damn...I have test:
@Ñuño_Martínez: can you confirm or deny the existence of memory leaks under Xubuntu?It loads without errors. It compiles (same hints and warnings).
When running, it starts with glitched graphics (see attached screenshot) then freezes after the "presents" text disappears.I same error. If compile heaptrace and start terminal then maybe see error
Marked memory at $75638640 invalid... and many more error not release memory.
Wrong signature $B209FCFE instead of 891743FD
It loads without errors. It compiles (same hints and warnings).
When running, it starts with glitched graphics (see attached screenshot) then freezes after the "presents" text disappears.
I have test:
[…]
In simple is same method in use game ?
Maybe 28-bit wide pixel will work. 8);D
I will prepare a simple window application to test ScanLine and bitmaps that are used by the game, so that you can test copying images without having to debug the game. I will let you know when it will be ready.If write then i test for you and report. If take time maybe i have write test self before.
Game engine not difficult programming but difficult have many structure and inheritance :)
If write then i test for you and report. If take time maybe i have write test self before.
I doubt it. But I agree that's a problem with pixel format (both size and order).QuoteWhen running, it starts with glitched graphics (see attached screenshot) then freezes after the "presents" text disappears.
Yes, I know this problem. Earlier, we tried to fix it with @Handoko, but it failed — either the frame was too narrow (when the pixel was 24-bit wide) or the game was hanging on just after the intro (when the pixel was 32-bit wide).
Maybe 28-bit wide pixel will work. 8)
Anyway, this is a good example of why to use game frameworks (http://wiki.freepascal.org/Game_framework) and game engines (http://wiki.freepascal.org/Game_Engine) instead of trying to do it with plain LCL.
let's get back to the nature of the problem, that is, to incorrectly rendering bitmaps.
So you had the game finished?
So in fact you're the winner of the game contest, if my math is right... 6 months ago...
Is a good game you coded, This foreground-background I've seen in Sonic Mania I think has a part of a level like that. And in another sonic fan game had that too.
Please the next one use a library so it can run fullscreen, or even in android device :)
I have provided the latest sources (with improved rendering) in this post (https://forum.lazarus.freepascal.org/index.php/topic,44908.msg316803.html#msg316803), but no one has yet provided information about whether everything works on Unixes or whether there are any problems yet. At the moment I am only sure that the game works properly on different Windows systems (XP, 7, 10).
I've just downloaded and tested. So far everything seems to work correctly on Ubuntu 18.10 64-bit Lazarus 1.8.4 GTK2.
Here are the "results" on a Pentium 4 3Ghz 512Mb ATI Radeon 7000 with Ubuntu 12.04.
I couldn't pass the "deep abbyss" :-[
First game "meadow" ? not show any floor for can bump or fall ? Then is not easy game :-\
Can you describe the problem more accurately and show the screenshots?For me look like attach
The first level in the deep meadow world, just after showing up on the screen, should look like in the attached screenshot. As you can see, there are platforms in it.
@lucamar: I have a question for you (to others too).Screen grab program raspbian set option "hide cursor" if grab. If window game active then cursor = "crSizeAll". Click outside for grab then not game active = cursor change "normal"
The game in full-screen mode should hide the cursor, but in windowed mode, the cursor should be visible and have the form suitable for crSizeAll enum. However, on the screenshots you have given, the cursor is a normal arrow, which is incorrect. Is the cursor really an arrow in windowed mode?
Look at the screenshot from the attachment — this is what it looks like in my case (under Windows) and I would prefer it to look like on other platforms.
But can you reveal how big the load is during plaing on the level (or in the menu)? Just run the game with cheat on parameters pair and look at the counter placed in the lower left corner. It should be smaller than 100% for the game to run smoothly.
@lucamar: I have a question for you (to others too).
[...] on the screenshots you have given, the cursor is a normal arrow, which is incorrect. Is the cursor really an arrow in windowed mode?
I don't think the "problem" is that it is Linux […]
[…] but that this machine is (relatively) slow.
Meanwhile, here is the result of the frame tester:
And since that is how it looks, I will probably stop the porting the code. Honestly, I'm just wasting the time instead of focusing on content creation.
As for the problem, I would really love to see the results of the framerate-tester on other computers. Come on, linux-people, test a little! It's just 5 minutes tops.I make my test.
I think is no speed accelerate gtk and why not can make fast.
this test with laptop
cpu i7 2620M 2.7 GHhz
ram 8g
os win 7 64 bit
gpu Intel(R) HD Graphics 3000
Actually the problem is in my machinethis test with laptop
cpu i7 2620M 2.7 GHhz
ram 8g
os win 7 64 bit
gpu Intel(R) HD Graphics 3000
You know, one would expect a more pronounced difference between that machine and my ancient Pentium 4 3GHz, but it's just about 1.5 times faster ... curioseur and curioseur
No, please.Keep porting even if it'll be slow in Linux.
After all it's not slow enough as to be unplayable and, frankly, if you hadn't told us I wouldn't have noticed at all.
I would love to have this game/tech-demo available for Linux. Pretty please ... :-*
As for the problem, I would really love to see the results of the framerate-tester on other computers.
Stretchdraw memory bitmap 300x150 32bpp to 672x384 32bpp make high 42 fps.
That no good ... 75% cpu do nothing :)
I think is no speed accelerate gtk and why not can make fast.
other test
this test with laptop
cpu i7 2620M 2.7 GHhz
ram 8g
os win 7 64 bit
gpu Intel(R) HD Graphics 3000
25% time cpu is use StretchDraw. 75% time cpu do nothing (quad-core)Stretchdraw memory bitmap 300x150 32bpp to 672x384 32bpp make high 42 fps.
That no good ... 75% cpu do nothing :)
I do not understand this. Can you write more clearly what's going on, please?
I think you forget many windows gdi/gdi+ is hardware accelerate use driver. Then you game not say is accelerate. Windows and hardware say is accelerate or no :)QuoteI think is no speed accelerate gtk and why not can make fast.The game does not use hardware acceleration anyway.
The game is single-threaded, so any CPU is suitable. However, even on old computers it should run smoothly with 60fps (like on my 12-year-old grandpa), because it does not need a very powerful processor.My program test show 1/3 time use by Lazarus and 2/3 (some time more) use X-org. I think that is tell ;)
The game should work on a computer with 1GHz single-core CPU, when it comes to the default window size.
25% time cpu is use StretchDraw. 75% time cpu do nothing (quad-core)
I think X have make graphics draw separate thread but no do.
I think you forget many windows gdi/gdi+ is hardware accelerate use driver.
If no then windows use software render and slow.
My program test show 1/3 time use by Lazarus and 2/3 (some time more) use X-org. I think that is tell ;)
Many problem is no see meadow floor and bumps.
No no no — the game uses only one CPU core, because is single-threaded and the game process always eats all power of the one CPU core. If you have quad-core, then the overall usage of the CPU power will be about 25%. I have a dual-core CPU, so the overall usage is about 50%. On a single-core CPU will be about 100%.Yes. I understand and i know. Game program source not make thread :)
That's why the game has it's own counter (lower left corner, when cheat mode is enabled) which shows how much of 16.7ms (in percentage) is used to process bitmaps. When the load is equal 100%, then the bitmap processing for one frame takes exactly 16.7ms. If the percentage is smaller, then generating the frame takes less than 16.7ms. The fewer the better.Yes. Thanksy for write.
Bitmaps processing should not be separated, because this game is standard windowed application.I make sure i tell to write about OS/widget/driver not you game. For game not separate then is no good.
I should rather say that the game does not use a specific hardware acceleration, provided for example thanks to OpenGL or DirectX. 8)Ok. Then you right. I think maybe you forget (you ask why differ) so i write why can so many speed differ :)
You not need do any thing. Is not error you and is not error game. Make simple: "it is".QuoteMy program test show 1/3 time use by Lazarus and 2/3 (some time more) use X-org. I think that is tell ;)And what I need to do with it? I do not even know how Linux works.
Many time arm problem is when optimize so i turn off. Other problem arm is alignment. Arm have differ fpu and some time give error when use precision math. It can be any thing so that make difficult find error good :'(QuoteMany problem is no see meadow floor and bumps.This is a huge problem — level layers are not rendered properly on Rasbian. In this case, the more I do not know why this is happening.
Yes. I understand and i know. Game program source not make thread :)
If help i write load raspbian is ~350%/380% and (some time) top ~500%
I not want write is you error. If i make think you that then i sorry :-[
There can many mistake any were. Can be Lazarus, can be widget (gtk2), can be render widget engine, can be graphic driver. And maybe can no work accelerate any way.
User lucamar write it no important speed. If not say then not notice. I agree write lucamar.
I think game is good. It have friend hero and look dynamic. You write good story.
No waste time for find. I think better you make point of game. Can always see later and try find error.
You guys are crazy... speed is not important? Who like to play with lags...? :D
That's the thing: there are no lags. At least not with the code you posted.
Edit: this tester is not good, because on Windows Self.Update does not forces window to repaint. Thats why I got the ridiculously big framerate. If I change the code of the CountFrame and add the following lines:Yes i know. That why write:
I recorded the slow motion feature in this video — Deep Platformer – jumping test.webm (from 20th second). If the framerate drops, then the game should work like on the recording, instead of running smoothly.Yes game for me similar (little more fast) like video. That no lag if not know. Is just play more slow.
Yes i know. That why write:for windows i think better write:
Self.Update; // Self.Canvas.StretchDraw(Self.ClientRect, view);
{$IFDEF WINDOWS} Self.Canvas.StretchDraw(Self.ClientRect, view); {$ELSE} Self.Update; // is have overhead LCL (re)paint {$ENDIF}
Yes game for me similar (little more fast) like video. That no lag if not know. Is just play more slow.
If too many speed calc then have no good fps then see lag.
Or can use double/triple buffer.
This does not help, because canvas is updated, but window surface on the screen not. If I used Invalidate or other method, then nothing happen – still huge, imposible
framerate.
That's why I used ProcessMessages in your tester to process message queue and repaint the window on the screen (and thanks to this, the framerate is actual). The game work in the same way, just look at this code:
So, on Windows the ProcessMessages is just mandatory.Thanks explain. I not know windows need ProcessMessages for show picture.
I am using internal bitmap to render frames, so the game is double buffered. And the game form (window) has DoubleBuffered property set to True. But it is still not enough for Linux. :DDouble buffer can work if try fix lag. Double buffer not fix slow. Double buffer then make game more slow :)
Double buffer can work if try fix lag. Double buffer not fix slow. Double buffer then make game more slow :)
No on Windows. 8)
If I disable the built-in double buffering for application:Lazarus write hint "Application.DoubleBuffered not portable" ....
then the window surface will be painted incorrectly, and the game itself works 5% slower the with extra buffering.Yes because draw is fast windows. If draw slow then 5% add slow is more slow :)
On my computer the glitch looks like the horizontal black bar (high at around 25% of the window height) moves slowly from top to bottom of the window, and so on and on. It looks very much like in this recording, except that the window does not blink — only the black bar moves on the screen.I not see black bar linux but that because slow. Windows fast and is problem draw more fast video monitor.
This glitch is related to the screen. On the laptop screen, such a bar moves slowly from top to the bottom of the window surface. But if I drag the window to the secondary screen (external monitor), then this bar does not move, but it is still visible.
If you want, just disable double buffering and test the performance on Linux. I'm curious what will happen.No thing change. All number and graphic look same :(
Lazarus write hint "Application.DoubleBuffered not portable" ....
There are many interesting things can be learn from the code. :)
Wow, I made a typo... fixed.Is not problem make typo error. I make many error when i write english :-[
I need to add a comments to the sources, because I will not create documentation for this code.
If you can and want, test it on any other non-Windows system (Linux, FreeBSD, Solaris e.t.c.).
By the way — when I choose the MacOS operating system as target, then the code inside the {$IFDEF DARWIN} is disabled (will be skipped during compilation). It is enabled only if I choose Darwin as target OS.
So, what is the correct directive to detect macOS?
No need to add Application.Location to macos only. It will work for all OS since it's cross platform.
IIRC, the MACOS define was for MacOS 1..9, and DARWIN is for MacOS X and beyond (and iOS?).
[…]
ETA: More helpful - Platform defines (http://wiki.freepascal.org/Platform_defines)
Doesn't works with the default build mode, no window is shown.
Configured to 32 bit also doesn't works. Configured to 64 bit and the same, no window is shown.
It is a pity that the TForm class does not have an event performed after actually showing the window on the screen (eg OnAfterShow) — I would not have to do all this stuff...I already make show you :D
May be is many more solution....
All I need is one, that works on macOS. ;Dhehe :)
here find qeueasynccall example https://forum.lazarus.freepascal.org/index.php/topic,44908.msg317303.html#msg317303
I know how to use QueueAsyncCall, but I do not know if it can solve the problem on macOS. 8)Ok then wait macos and test see ...
MacOS 32 bit it loads but keyboard is not supported (see console errors).
BTW: can you test the game on Linux or other non-Windows system? 8)
Nice minimalistic style! Thanks for the source ... :)
// funny fps rate ... if I set the window to full screen, then the fps is going down ... ?