Author Topic: Nicky Boom for CPC ?  (Read 3175 times)

0 Members and 1 Guest are viewing this topic.

Offline LTronic

  • CPC464
  • **
  • Posts: 43
  • Country: fr
  • Liked: 43
  • Likes Given: 17
Re: Nicky Boom for CPC ?
« Reply #50 on: 12:09, 22 August 19 »
I have both game rendering and partial game logic working right now but it needs some debug (buggy character / tilemap collision right now).Hopefully next step should be the demo map playable with main character but no enemies.


I need to refactor / shrink the data structures of the game which are the main culprit.
Each object is 39 bytes in memory, up to 453 of them.Each animation is 43 bytes in memory, up to 282 of them.


I will probably need to decimate maximum amount of animations to 256 so I can use 8-bit index instead of 16-bit index or pointer to save memory on these "live" structures.
This would also help optimize the code making far too much use of 16-bit and pointer calculation leading to huge generate code size, even if I mitigated in a lot meanwhile).
I think I will need to write an animation editor in order to do this and "relink" each animation frame properly (Original game use kind of linked list).

So I'm working on the codebase and tools for conversion :
=> Tool to batch process and shrink all the original data (called convcpc) including tileset, tilemap, tile flags, monster data, various helper data
=> Tool to dump all sprites and automatically resize and convert to CPC format


« Last Edit: 12:17, 22 August 19 by Gryzor »

Offline Gryzor

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 15.167
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
  • Liked: 3006
  • Likes Given: 5332
Re: Nicky Boom for CPC ?
« Reply #51 on: 12:17, 22 August 19 »
(removed formatting to make it more readable and get rid of some text tags)

Offline LTronic

  • CPC464
  • **
  • Posts: 43
  • Country: fr
  • Liked: 43
  • Likes Given: 17
Re: Nicky Boom for CPC ?
« Reply #52 on: 23:59, 23 August 19 »
Hello,


I have converted all the original Amiga MODs using Arkos Tracker 2, my basic knowledge of soundtracking software and well... trial and error.
I'm no musician sadly, so I am a bit stuck.
The current result is sometimes good, sometimes ugly.

I am 200% sure it could be waaaay better even if I understand the 3 channels limit and the AY chip is nothing compared to Amiga sample playback capabilities.
All the original MODs share the same 15 instruments so I think it's basically finding / building the right ones and adjusting (I transposed everything by -24 so 2 octaves down if I am right and it seems to sound not too bad most of the time).

If anyone is willing to have a look at it, I have attached my current AKS file (AT2 latest build) and original MOD files.
Of course any people helping on this will be credited properly.


Thank you for any good will :)


Offline LTronic

  • CPC464
  • **
  • Posts: 43
  • Country: fr
  • Liked: 43
  • Likes Given: 17
Re: Nicky Boom for CPC ?
« Reply #53 on: 00:33, 29 August 19 »
Sorry, but I need help again.
I got the whole game code fitting, I have a small kernel and the game code splitted into two 32KB banks with a system of trampolines for calling routines between modules.
I am relinking the 3 modules with a little bash magic by parsing the symbols table / map table files and generating header files with addresses.


It seems to work fine but my efforts are plagued by some bug in iDSK tool.


I tried iDSK-013 from CPCTelera 1.4.2, I tried latest GitHub iDSK from cpcsdk GitHub compiled from source, but the behaviour of it is not consistent, it seems to randomly fail to add a file to DSK (I can see the error message Cannot open nicky.dsk) and/or to provide corrupt DSK files.

Has anyone encountered the issue ?
I already had the issue on Windows 10 with Cygwin64, switched to an Ubuntu 18.04 x64 VM, same issue...
Any other tool to circumvent the issue ?


Also I'm having hard time debugging the code (I have some random crashes at game startup, hard to reproduce). I am using RetroVM but is there any better option to debug a SDCC / CPCTelera project ?


I am considering opening my GitHub private repo as soon as I have something stable.
I can provide source code meanwhile if you want to have a look it's fairly documented and easy to build.


PS : Anyone interested for help on the music side ? I would not also mind some graphic help at a later stage.

Offline Targhan

  • Supporter
  • 6128 Plus
  • *
  • Posts: 959
  • Country: fr
  • Liked: 919
  • Likes Given: 141
Re: Nicky Boom for CPC ?
« Reply #54 on: 00:54, 29 August 19 »
I don't have time to help on the music side (but I can help on the use of AT2), sorry.
However, my advice is to convert the music from scratch, don't try to use/emulate the original sound, it is only a loss of time in my opinion, and the result will not be optimum for the PSG. Any good musician can convert the song from ear or from the original music on the side, and will create the right sounds directly in AT2 (for example). If the musician can not... Then don't bother with him, and ask for another one :).
Targhan/Arkos

Arkos Tracker 2 - alpha 7 now released! - Follow the news on Twitter!
Disark A cross-platform Z80 disassembler/source converter

Imperial Mahjong
Orion Prime

Offline LTronic

  • CPC464
  • **
  • Posts: 43
  • Country: fr
  • Liked: 43
  • Likes Given: 17
Re: Nicky Boom for CPC ?
« Reply #55 on: 06:46, 29 August 19 »
I don't have time to help on the music side (but I can help on the use of AT2), sorry.
However, my advice is to convert the music from scratch, don't try to use/emulate the original sound, it is only a loss of time in my opinion, and the result will not be optimum for the PSG. Any good musician can convert the song from ear or from the original music on the side, and will create the right sounds directly in AT2 (for example). If the musician can not... Then don't bother with him, and ask for another one :) .


No problem and thanks for your help. I know some pro chiptuners (so they would probably charge) but no one with AT2/AY experience so I will try to sort that later.

Offline TotO

  • 6128 Plus
  • ******
  • Posts: 3.463
  • Country: fr
    • ?area=showdonations;u=4
  • Liked: 2635
  • Likes Given: 1565
Re: Nicky Boom for CPC ?
« Reply #56 on: 11:02, 29 August 19 »
I have voted for "Plus machines on a 512K cart" because you have a PLUS, so do for your computer first.
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

Offline LTronic

  • CPC464
  • **
  • Posts: 43
  • Country: fr
  • Liked: 43
  • Likes Given: 17
Re: Nicky Boom for CPC ?
« Reply #57 on: 23:34, 01 September 19 »
Hello,

Here is attached a current DSK of the project.
Please bear the pink background and intentional "crash" if going far right of the map limit (40x50, I have space to extend to 50x50 easily, maybe 80x50).


I have some issues using transparency sprites with cpctelera cpct_drawSpriteMaskedAlignedTable, I don't know why, my table alignment is correct (checked map file) and I tried every pen possible.


I am happy to give access to my GitHub to anyone interested in, just drop me a PM.


Any feedback welcome as usual ;)

Offline Arnaud

  • Supporter
  • 6128 Plus
  • *
  • Posts: 543
  • Country: fr
  • Liked: 456
  • Likes Given: 880
Re: Nicky Boom for CPC ?
« Reply #58 on: 20:04, 02 September 19 »
Hi,
nice to see your project process but i wasn't able to run your game.

I use winape (with cpc+ configuration) and run"nicky"

For cpct_drawSpriteMaskedAlignedTable the transparency colour must be only 0

Offline LTronic

  • CPC464
  • **
  • Posts: 43
  • Country: fr
  • Liked: 43
  • Likes Given: 17
Re: Nicky Boom for CPC ?
« Reply #59 on: 20:12, 02 September 19 »
Hi,
nice to see your project process but i wasn't able to run your game.

I use winape (with cpc+ configuration) and run"nicky"

For cpct_drawSpriteMaskedAlignedTable the transparency colour must be only 0


Oh.. I will try tonight on WinAPE to fix it.


So if only transparence color 0 why can we generate tables for every pen ?

Offline Xifos

  • CPC6128
  • ****
  • Posts: 176
  • Country: fr
  • Liked: 233
  • Likes Given: 230
Re: Nicky Boom for CPC ?
« Reply #60 on: 20:19, 02 September 19 »
Hello Ltronic,
Can you tell how you are performing the scrolling ?
Are you drawing each background tiles at every frame ?
And then drawing the sprite without saving/restoring background ?
 :) 

Offline Arnaud

  • Supporter
  • 6128 Plus
  • *
  • Posts: 543
  • Country: fr
  • Liked: 456
  • Likes Given: 880
Re: Nicky Boom for CPC ?
« Reply #61 on: 20:21, 02 September 19 »
So if only transparence color 0 why can we generate tables for every pen ?

If you create your own transparency tables for another color it should work.
The tables provided by cpctelera are done for only color 0.

Offline LTronic

  • CPC464
  • **
  • Posts: 43
  • Country: fr
  • Liked: 43
  • Likes Given: 17
Re: Nicky Boom for CPC ?
« Reply #62 on: 22:54, 02 September 19 »
If you create your own transparency tables for another color it should work.
The tables provided by cpctelera are done for only color 0.


I don't really got it I think.
For me color 0 = pen 0 and is the same as palette index 0, am I wrong ?


Regarding the DSK it's working for me on WinAPE 2.0b2 (using wine on OS X but should not matter).
There's a long back screen at startup doing multi load then a second big loading sequence at game startup.

Offline LTronic

  • CPC464
  • **
  • Posts: 43
  • Country: fr
  • Liked: 43
  • Likes Given: 17
Re: Nicky Boom for CPC ?
« Reply #63 on: 22:58, 02 September 19 »
Hello Ltronic,
Can you tell how you are performing the scrolling ?
Are you drawing each background tiles at every frame ?
And then drawing the sprite without saving/restoring background ?
 :)


Hello Xifos,
It's really barebones so far, and yes I am re-rendering the whole tilemap (each tile) at each frame because I am too short on memory to do some double buffering. And there's no real "scrolling" now I don't have into account X/Y scrolling [0-15] values the game passes back to the CPC engine (kernel) and just take into account the origin X/Y tile offsets.


I am aware of both soft scroll and hard scroll (video memory offset) methods but so far my tries were plagued :)


Any tip is welcome as I'm still learning.

Offline Arnaud

  • Supporter
  • 6128 Plus
  • *
  • Posts: 543
  • Country: fr
  • Liked: 456
  • Likes Given: 880
Re: Nicky Boom for CPC ?
« Reply #64 on: 23:02, 02 September 19 »
I don't really got it I think.
For me color 0 = pen 0 and is the same as palette index 0, am I wrong ?
Yes, it's right

Regarding the DSK it's working for me on WinAPE 2.0b2 (using wine on OS X but should not matter).
There's a long back screen at startup doing multi load then a second big loading sequence at game startup.
Just tried again, i have got Microid logo, i wait then either reboot or stuck.




Offline Xifos

  • CPC6128
  • ****
  • Posts: 176
  • Country: fr
  • Liked: 233
  • Likes Given: 230
Re: Nicky Boom for CPC ?
« Reply #65 on: 00:13, 03 September 19 »

Hello Xifos,
It's really barebones so far, and yes I am re-rendering the whole tilemap (each tile) at each frame because I am too short on memory to do some double buffering. And there's no real "scrolling" now I don't have into account X/Y scrolling [0-15] values the game passes back to the CPC engine (kernel) and just take into account the origin X/Y tile offsets.


I am aware of both soft scroll and hard scroll (video memory offset) methods but so far my tries were plagued :)


Any tip is welcome as I'm still learning.
On cpc old (i mean not the plus), that is not easy to answer.
 :(
Hardware scrolling for a game like nicky boom would be at best like the one in prehistorik 2 and super cauldron (it is very hard to do, drawing sprite becomes complicated, you have to do split screen, use crtc register 5, crtc register 3...).
Software scrolling would be like the ones in batman the movie, robocop, stormlord.
But very hard to have such frame rates with software scrolling (i never understood how they could do such good software scrollings in these games).
But it is more like what you are doing : draw background tiles (with a byte offset for horizontal scrolling), and sprites.
And they managed to have double buffer (even with 64 k), which is hard to avoid in this situation...

Offline LTronic

  • CPC464
  • **
  • Posts: 43
  • Country: fr
  • Liked: 43
  • Likes Given: 17
Re: Nicky Boom for CPC ?
« Reply #66 on: 00:39, 03 September 19 »
Just tried again, i have got Microid logo, i wait then either reboot or stuck.


Wow that's strange. Can you share more information your your WinAPE version ?
I am using 2.0b2 with default configuration (Plus and ParaDOS right ?)

Offline Arnaud

  • Supporter
  • 6128 Plus
  • *
  • Posts: 543
  • Country: fr
  • Liked: 456
  • Likes Given: 880
Re: Nicky Boom for CPC ?
« Reply #67 on: 20:11, 03 September 19 »
Wow that's strange. Can you share more information your your WinAPE version ?
I am using 2.0b2 with default configuration (Plus and ParaDOS right ?)
It works ! I don't why my winape was configured with 64k.

Offline LTronic

  • CPC464
  • **
  • Posts: 43
  • Country: fr
  • Liked: 43
  • Likes Given: 17
Re: Nicky Boom for CPC ?
« Reply #68 on: 21:36, 03 September 19 »
It works ! I don't why my winape was configured with 64k.


Great :)
I reworked my tile and sprite data to make sure they share the same palette with pen 0 (ugly pink) as transparent color (palette index 0), still transparency does not work.
Really weird I traced the assembly code with RetroVM + breakpoint and I can't find the issue.
Using cpctelera 1.5.
The example provided works fine still...

I also reworked the tilemap rendering to redo the job only when necessary, big speed boost :)

Offline Arnaud

  • Supporter
  • 6128 Plus
  • *
  • Posts: 543
  • Country: fr
  • Liked: 456
  • Likes Given: 880
Re: Nicky Boom for CPC ?
« Reply #69 on: 21:51, 03 September 19 »
I reworked my tile and sprite data to make sure they share the same palette with pen 0 (ugly pink) as transparent color (palette index 0), still transparency does not work.
Really weird I traced the assembly code with RetroVM + breakpoint and I can't find the issue.
Using cpctelera 1.5.
The example provided works fine still...
Take one of your sprites generated and use it in the cpctelera example. You'll see if it's your sprites or your code who is causing the problem.

I also reworked the tilemap rendering to redo the job only when necessary, big speed boost :)
:)

Offline LTronic

  • CPC464
  • **
  • Posts: 43
  • Country: fr
  • Liked: 43
  • Likes Given: 17
Re: Nicky Boom for CPC ?
« Reply #70 on: 00:28, 04 September 19 »
Take one of your sprites generated and use it in the cpctelera example. You'll see if it's your sprites or your code who is causing the problem.
 :)


It works. Turned out I was corrupting the mask table by a stupid memset..
Implemented preliminary dirty rect system, updated demo attached.


Thanks for your help again :)

Offline Arnaud

  • Supporter
  • 6128 Plus
  • *
  • Posts: 543
  • Country: fr
  • Liked: 456
  • Likes Given: 880
Re: Nicky Boom for CPC ?
« Reply #71 on: 19:56, 04 September 19 »
It really better, the game is playable at this speed and Nicky is recognizable.

Offline LTronic

  • CPC464
  • **
  • Posts: 43
  • Country: fr
  • Liked: 43
  • Likes Given: 17
Re: Nicky Boom for CPC ?
« Reply #72 on: 20:31, 04 September 19 »
It really better, the game is playable at this speed and Nicky is recognizable.


Thanks a lot !
Any advice for crunching tiles and sprites ? I am planning on using LZ48.
Also a lot of sprites in original game are duplicated because flipped horizontally, I was thinking of remapping them and use cpctelera 1.5 drawHFlipSprite functions right or would it be too slow ?


Offline Arnaud

  • Supporter
  • 6128 Plus
  • *
  • Posts: 543
  • Country: fr
  • Liked: 456
  • Likes Given: 880
Re: Nicky Boom for CPC ?
« Reply #73 on: 21:15, 04 September 19 »
Thanks a lot !
Any advice for crunching tiles and sprites ? I am planning on using LZ48.
LZ48 is really faster than ZX7 and was coded for this kind of purpose.

Also a lot of sprites in original game are duplicated because flipped horizontally, I was thinking of remapping them and use cpctelera 1.5 drawHFlipSprite functions right or would it be too slow ?
No it works very well, i flipped all player sprites when changing direction to reduce the feel of slow down.

Offline LTronic

  • CPC464
  • **
  • Posts: 43
  • Country: fr
  • Liked: 43
  • Likes Given: 17
Re: Nicky Boom for CPC ?
« Reply #74 on: 12:03, 29 September 19 »
Quick update :
Project is not dead, far from it.
I managed to fit 90% of the data into the 6128 "old" RAM, currently fighting with the game objects logic code debugging which is thougher than expected.


SuTeKH/Epyteor offered help making some awesome musics, I hope to be able to make another playable build in the forthcoming weeks/days.