WIP Air Hockey (need help)
- omundodogabriel
- Posts: 33
- Joined: Mon Mar 18, 2013 9:07 pm
- Location: Brazil
- Contact:
WIP Air Hockey (need help)
This is my second try at the Pong source. This time i decided to modify the engine a bit and make a air hockey game. Remember the table Air Hockey games? Yeah, now you can play on the Uzebox too...
This is the first Beta, i have some problems with the game right now, and need some help to fix.
First, the game have slowdowns during gameplay, and sometimes de sprites flicker too. I think is a kernel related problem, anyone know how to fix? Or maybe Uzebox is too weak to handle this?
Controls:
Start - Will start the game
Select - Go back to menu when is ingame
B - Move fast
The first player to score 7 points win!
Like always, sorry for my bad english...
DOWNLOAD Beta 1 and sources
- Attachments
-
- Air Hockey_src.zip
- (128.85 KiB) Downloaded 466 times
-
- AirHockey.hex
- (72.31 KiB) Downloaded 508 times
Re: WIP Air Hockey (need help)
Nice, Air Hockey!
Hmmm...you have no WaitVsync(1); in you main loop and code run way too often and, ironically, this will slowdown the game. There's is no point in running the main loop more than 60hz, the screen refresh rate. So fix this with:
As for the flickers this is caused by not having allocated enough ramtiles. Your sprites are 2x2 which means at most 9 ramtiles are required depending of the x/y offset of the sprite. 9 ramtiles x 3 moving objects means you need 27 ramtiles to avoid flickers.
Here's a hex with the fixes: Looking forward the final release!
Hmmm...you have no WaitVsync(1); in you main loop and code run way too often and, ironically, this will slowdown the game. There's is no point in running the main loop more than 60hz, the screen refresh rate. So fix this with:
Code: Select all
}else{
WaitVsync(1);
ProcessScore();
ProcessControls();
ProcessPaddles();
ProcessBall();
MoveSprites();
}
Here's a hex with the fixes: Looking forward the final release!
Re: WIP Air Hockey (need help)
wow, nice!!! Air Hockey!
I guess it's for two players, right?
I guess it's for two players, right?
The last digit of Pi is 7! I calculated this, as I counted to infinity yesterday!
- omundodogabriel
- Posts: 33
- Joined: Mon Mar 18, 2013 9:07 pm
- Location: Brazil
- Contact:
Re: WIP Air Hockey (need help)
uze, the hex you provided is running smooth thanks....
But i'm having problems trying to implement the changes you say, i changed de -DRAM_TILES_COUNT on kernel flags to 27, and added the WaitVsync(1); to the main loop, but now the game is crashing every time, and random bugs like color changes and duplicated sprites is ocurring
I attached the hex that I compiled with these changes ...
Can you upload your modified code please?
But i'm having problems trying to implement the changes you say, i changed de -DRAM_TILES_COUNT on kernel flags to 27, and added the WaitVsync(1); to the main loop, but now the game is crashing every time, and random bugs like color changes and duplicated sprites is ocurring
I attached the hex that I compiled with these changes ...
Can you upload your modified code please?
- Attachments
-
- AirHockey_bug.hex
- (72.32 KiB) Downloaded 468 times
Re: WIP Air Hockey (need help)
Weird, those issues are typical when you use too much ram. I'll send the code tonight. In the mean time, can't you post your platform and gcc version. Also if you can post a dump of the build log, specially the part about memory use, that would help.
- omundodogabriel
- Posts: 33
- Joined: Mon Mar 18, 2013 9:07 pm
- Location: Brazil
- Contact:
Re: WIP Air Hockey (need help)
Okeyuze6666 wrote:Weird, those issues are typical when you use too much ram. I'll send the code tonight. In the mean time, can't you post your platform and gcc version. Also if you can post a dump of the build log, specially the part about memory use, that would help.
Memory usage:
Code: Select all
AVR Memory Usage
----------------
Device: atmega644
Program: 26324 bytes (40.2% Full)
(.text + .data + .bootloader)
Data: 3783 bytes (92.4% Full)
(.data + .bss + .noinit)
uzem v1.15
The memory usage is almost full, the extra ramtiles made RAM overflow?
Re: WIP Air Hockey (need help)
Here's the project.
Interestingly, the memory stats are different on my side, and I use more RAM! Same WinAVR version.
Interestingly, the memory stats are different on my side, and I use more RAM! Same WinAVR version.
Code: Select all
AVR Memory Usage
----------------
Device: atmega644
Program: 25010 bytes (38.2% Full)
(.text + .data + .bootloader)
Data: 3944 bytes (96.3% Full)
(.data + .bss + .noinit)
- Attachments
-
- AirHockey.zip
- (216.8 KiB) Downloaded 468 times
- omundodogabriel
- Posts: 33
- Joined: Mon Mar 18, 2013 9:07 pm
- Location: Brazil
- Contact:
Re: WIP Air Hockey (need help)
Compiled the sources with your modifications, i just modified the kernel path, and still with the bug But i think i found the bug, you changed the kernel path, your kernel is probably another version? I will try with the original kernel and see what happens...
Edit: Just used the old kernel from the pong sources and the game worked just fine The problem was the last kernel i updated...
Edit: Just used the old kernel from the pong sources and the game worked just fine The problem was the last kernel i updated...
Re: WIP Air Hockey (need help)
Oh yes, kernel version..should have asked. I used the latest version from the trunk. It is very stable and the most optimized so far, I'd recommend you use this one if it doesn't cause problems.
- omundodogabriel
- Posts: 33
- Joined: Mon Mar 18, 2013 9:07 pm
- Location: Brazil
- Contact:
Re: WIP Air Hockey (need help)
I thought the version that was in "uzebox_src_3.3" was the last, but I found that not. I downloaded the latest SVN version and is working perfectly. I even recovered a lot of ram! Thanks Uze! Tomorrow I'll continue working on AI and improving the title screen.uze6666 wrote:Oh yes, kernel version..should have asked. I used the latest version from the trunk. It is very stable and the most optimized so far, I'd recommend you use this one if it doesn't cause problems.
look the new memory usage:
Code: Select all
AVR Memory Usage
----------------
Device: atmega644
Program: 25928 bytes (39.6% Full)
(.text + .data + .bootloader)
Data: 3234 bytes (79.0% Full)
(.data + .bss + .noinit)