Author Topic: Chunky Pixel Curator - WIP  (Read 9565 times)

0 Members and 1 Guest are viewing this topic.

Offline ervin

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.443
  • Country: au
    • index.php?action=treasury
  • Liked: 1139
  • Likes Given: 1359
Chunky Pixel Curator - WIP
« on: 17:17, 15 November 14 »
Hi everyone.

After a heck of a long time, I am finally able to show you all what I've been working on.
I'm *really* excited about other people trying it and giving me feedback (good, bad or indifferent - it's all ok)!
(I've been working on this since the end of 2010, although it has changed form a few times).

It's not a game as such, and I'm sure that some people may not enjoy my program, but that's cool.
It means a *lot* to me, and I'm very proud of what I have achieved thus far.
 8)

Now, it is important to note that, whilst feature-complete, it isn't ANYWHERE NEAR content complete yet.
The final version will have up to 250 rooms, while this teaser only contains the first 2 rooms.
However, I have written tools to create the necessary data files for the other rooms, so content should be added at a fairly decent pace.

When you run CPC.BAS, and after it has loaded, please follow the information on-screen to find out what to do.
 ;)

Some technical info:
- written in CCZ80 and assembly
- only the first 64KB is used
- I've used a double-buffered 32x32 char screen
- compressed data (via Exomizer) is used extensively, and loaded from disc as needed (i.e. when changing rooms)
- the stack is abused on an extremely frequent basis
- the amount of self-modifying-code is truly terrifying!
- the program would run a little faster if I didn't wait for VBL, but that would introduce a bit of flickering

All of the following features occur in real-time:
- the position of each chunky sprite (which can be full-screen) is calculated in 3D space
- sprites are clipped to the left/right edges of the screen as necessary
- sprites can be flipped horizontally
- sprites can be animated
- sprites are scaled depending on distance from the camera
- room walls and doors are calculated in 3D space and drawn using a variety of line techniques

I hope you enjoy my little tribute to the CPC.
Please remember that this is only a tiny teaser - there is lots more to come!
« Last Edit: 14:43, 24 January 15 by ervin »

Offline McKlain

  • 6128 Plus
  • ******
  • Posts: 867
  • Country: es
  • Programmable Sound Generator
    • www.mcklain.com
  • Liked: 339
  • Likes Given: 950
Re: Chunky Pixel Curator - TEASER
« Reply #1 on: 17:38, 15 November 14 »
Awesome! It made me smile  :D

Offline Morri

  • CPC6128
  • ****
  • Posts: 284
  • Country: nz
  • Liked: 237
  • Likes Given: 216
Re: Chunky Pixel Curator - TEASER
« Reply #2 on: 19:46, 15 November 14 »
Amazing, can't wait to see this develop. I'm guessing this is going to be "tour" of sorts through the history of the CPC (am I right?)
Roland working that pole (er, I mean rope :laugh: ) cracked me up.

Keeping it Kiwi since 1977

Offline CraigsBar

  • Supporter
  • 6128 Plus
  • *
  • Posts: 3.343
  • Country: ie
  • The party ain't over yet
    • index.php?action=treasury
  • Liked: 1197
  • Likes Given: 90
Re: Chunky Pixel Curator - TEASER
« Reply #3 on: 00:51, 16 November 14 »
Boooo!


It crashes using Arnold on OSX. will have to wait until I get home tomorrow to test it on a real CPC
IRC:  #Retro4All on Freenode

Offline Optimus

  • 464 Plus
  • *****
  • Posts: 366
  • Country: gr
  • Liked: 193
  • Likes Given: 147
Re: Chunky Pixel Curator - TEASER
« Reply #4 on: 01:29, 16 November 14 »
Wow! That's another cool way to make a 3d game on CPC. I really liked that!

Offline ervin

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.443
  • Country: au
    • index.php?action=treasury
  • Liked: 1139
  • Likes Given: 1359
Chunky Pixel Curator - TEASER
« Reply #5 on: 01:53, 16 November 14 »
Thanks everyone for your kind words - I'm glad others are enjoying this crazy idea of mine. [emoji4]

@CraigsBar - I'm not sure but my program may not work on a 464. Which CPC model do you have Arnold set to?

I haven't used any fancy hardware tricks (except for the 32x32 char screen, and the double-buffering), primarily because I don't know how to. [emoji41]
« Last Edit: 01:56, 16 November 14 by ervin »

Offline TFM

  • Visit the mysteries of the CPC at www.futureos.de
  • Supporter
  • 6128 Plus
  • *
  • Posts: 9.899
  • Country: aq
  • Space Chicken for FutureOS is free!
    • index.php?action=treasury
    • FutureOS - The revolution on CPC!
  • Liked: 1985
  • Likes Given: 4650
Re: Chunky Pixel Curator - TEASER
« Reply #6 on: 02:23, 16 November 14 »
Oh WoW! Great work! You got half the castle wolfenstein engine!


Such a Gallery is really funny. And from the technical aspect ... Kudos!


Maybe the Sound can be adapted to the walking speed. So when walking quick (5) then the sound could be more quick than when walking with low speed (1).


It runs fine with WinApe, not with WinCPC. But that's a problem of the emulator developers.


Keep the great work going Ervin!!!  :) :) :)
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

Offline ervin

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.443
  • Country: au
    • index.php?action=treasury
  • Liked: 1139
  • Likes Given: 1359
Chunky Pixel Curator - TEASER
« Reply #7 on: 03:10, 16 November 14 »
Wow, I've just had lunch at my parents' house, and we were showing my daughters some photos of when I was a boy. And guess what we found? Photos of me in front of my cpc464, working on a type-in from ACU! It was a wonderful reminder of why I am writing this program... Priceless memories.

Offline Axelay

  • 6128 Plus
  • ******
  • Posts: 594
  • Country: au
  • Liked: 394
  • Likes Given: 89
Re: Chunky Pixel Curator - TEASER
« Reply #8 on: 05:26, 16 November 14 »

@CraigsBar - I'm not sure but my program may not work on a 464. Which CPC model do you have Arnold set to?
 
If you're only using 64K, why wouldn't it work on a 464, unless you're using something specific to firmware 1.1?
 

I haven't used any fancy hardware tricks (except for the 32x32 char screen, and the double-buffering), primarily because I don't know how to.

Oh, well I think there's a good chance that's more fancy hardware trickery than a majority of commercial era software.  ;)

Offline ervin

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.443
  • Country: au
    • index.php?action=treasury
  • Liked: 1139
  • Likes Given: 1359
Re: Chunky Pixel Curator - TEASER
« Reply #9 on: 05:58, 16 November 14 »
If you're only using 64K, why wouldn't it work on a 464, unless you're using something specific to firmware 1.1?

Hmmm, sounds like I may need to do some testing and research!
(But first I'll try it on WinAPE in 464 mode).

Offline CraigsBar

  • Supporter
  • 6128 Plus
  • *
  • Posts: 3.343
  • Country: ie
  • The party ain't over yet
    • index.php?action=treasury
  • Liked: 1197
  • Likes Given: 90
Re: Chunky Pixel Curator - TEASER
« Reply #10 on: 10:29, 16 November 14 »
Thanks everyone for your kind words - I'm glad others are enjoying this crazy idea of mine. [emoji4]

@CraigsBar - I'm not sure but my program may not work on a 464. Which CPC model do you have Arnold set to?

I haven't used any fancy hardware tricks (except for the 32x32 char screen, and the double-buffering), primarily because I don't know how to. [emoji41]
Hi ervin,

It more likely an osx Arnold bug. The port looks very polished but it has some issues and seems to have been abandoned (it was not done by @arnoldemu). I am sure an official Arnold port for osx will not have these issues.

Craig
« Last Edit: 00:51, 18 November 14 by CraigsBar »
IRC:  #Retro4All on Freenode

Offline ervin

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.443
  • Country: au
    • index.php?action=treasury
  • Liked: 1139
  • Likes Given: 1359
Re: Chunky Pixel Curator - TEASER
« Reply #11 on: 11:23, 16 November 14 »
Hmmm, interesting.

Regardless, it turns out I do indeed use a call to a non-464 function. Oops. I'll sort it out and upload a new version shortly.
« Last Edit: 14:43, 16 November 14 by ervin »

Offline ervin

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.443
  • Country: au
    • index.php?action=treasury
  • Liked: 1139
  • Likes Given: 1359
Re: Chunky Pixel Curator - WIP
« Reply #12 on: 15:18, 16 November 14 »
Alrighty, I was using the CCZ80 FRAME() function, which of course refers to the 6128 rom.
I've replaced it with a call to MC WAIT FLYBACK, and things now work in WinAPE when I set the roms to OS464 and BASIC1-0.
I also fixed a silly bit of flicker that could happen when changing rooms.
I've updated the DSK file attached to the first post in this thread.

However, WinCPC crashes hard when I walk into the Roland room.
I don't know if this is because my program is broken, or doing something incompatible with my setup in WinCPC (it's a clean install, I've just changed the CPC model).

I'd like to ask a favour (actually 3) from anyone that can help.
- can someone please try this new version on a real 464 with disc drive?
- a real 664
- a real 6128

Thanks.
 :)
« Last Edit: 15:25, 16 November 14 by ervin »

Offline ervin

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.443
  • Country: au
    • index.php?action=treasury
  • Liked: 1139
  • Likes Given: 1359
Re: Chunky Pixel Curator - WIP
« Reply #13 on: 15:32, 16 November 14 »
Oh WoW! Great work! You got half the castle wolfenstein engine!

Such a Gallery is really funny. And from the technical aspect ... Kudos!

Maybe the Sound can be adapted to the walking speed. So when walking quick (5) then the sound could be more quick than when walking with low speed (1).

It runs fine with WinApe, not with WinCPC. But that's a problem of the emulator developers.

Keep the great work going Ervin!!!  :) :) :)

Thanks for the kind words TFM.
I'm especially happy with the technical aspects - my z80 has improved a heck of a lot in the last few years!

I'm afraid I can't change the way the sound is done.  :(
Not because it isn't possible, but because it wouldn't suit my plans for each room.
Have a listen to the "music" that plays when you walk around the Roland room. Do you recognise it?  8)
« Last Edit: 00:36, 17 November 14 by ervin »

Offline ervin

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.443
  • Country: au
    • index.php?action=treasury
  • Liked: 1139
  • Likes Given: 1359
Re: Chunky Pixel Curator - WIP
« Reply #14 on: 15:41, 16 November 14 »
Amazing, can't wait to see this develop. I'm guessing this is going to be "tour" of sorts through the history of the CPC (am I right?)
Roland working that pole (er, I mean rope :laugh: ) cracked me up.

Yes indeed - it will be a gallery!
The comedy associated with Roland climbing the rope was unintentional, but too funny to remove! So it stays.  :laugh:
« Last Edit: 15:49, 16 November 14 by ervin »

Offline CraigsBar

  • Supporter
  • 6128 Plus
  • *
  • Posts: 3.343
  • Country: ie
  • The party ain't over yet
    • index.php?action=treasury
  • Liked: 1197
  • Likes Given: 90
Re: Chunky Pixel Curator - WIP
« Reply #15 on: 01:45, 17 November 14 »
However, WinCPC crashes hard when I walk into the Roland room.


That is EXACTLY where OSX Arnold also crashes.


Testing on my 4128plus right now....

The same crash on my 4128plus


Oh, AND on my CPC 6128 machine :(
Time for Winape methinks.
« Last Edit: 01:53, 17 November 14 by CraigsBar »
IRC:  #Retro4All on Freenode

Offline ervin

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.443
  • Country: au
    • index.php?action=treasury
  • Liked: 1139
  • Likes Given: 1359
Re: Chunky Pixel Curator - WIP
« Reply #16 on: 03:10, 17 November 14 »

That is EXACTLY where OSX Arnold also crashes.

Testing on my 4128plus right now....

The same crash on my 4128plus

Oh, AND on my CPC 6128 machine :(
Time for Winape methinks.

Thanks for the info... hmmm, this is gonna be tricky to fix.

I have absolutely no idea what could be causing the crash... the things that happen on a room transition (which is where the crash would be) happen when the empty start room (the foyer) is loaded, so I don't know why the Roland room would cause a crash, as the same code is being run.

Time to bust out the debugging stick!
 
« Last Edit: 04:11, 17 November 14 by ervin »

Offline Gryzor

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 16.885
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
  • Liked: 4009
  • Likes Given: 7215
Re: Chunky Pixel Curator - WIP
« Reply #17 on: 16:46, 17 November 14 »
This is very, very original and very pleasant... Can't wait to see more!

Won't you implement turning instead of only strafing?

@erving , any chance for a scan of those photos? :)

Offline ervin

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.443
  • Country: au
    • index.php?action=treasury
  • Liked: 1139
  • Likes Given: 1359
Re: Chunky Pixel Curator - WIP
« Reply #18 on: 00:12, 18 November 14 »
This is very, very original and very pleasant... Can't wait to see more!

Won't you implement turning instead of only strafing?

@erving , any chance for a scan of those photos? :)

Thanks Gryzor.

I had toyed with the idea of turning (months ago), but in the end went with simple strafe movement, as it simplified a lot of things (line routines, 3d calculations, collision detection etc.), and that means SPEED!  8)
(I've been expecting that exact question, actually).

Yep, I'll upload those photos soon (even though they are rather embarrassing).

Offline ervin

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.443
  • Country: au
    • index.php?action=treasury
  • Liked: 1139
  • Likes Given: 1359
Re: Chunky Pixel Curator - WIP
« Reply #19 on: 00:39, 18 November 14 »
Alrighty, I've found the section that is causing WinCPC (and presumably a real CPC) to crash.
Dunno why though...

Strange that it works fine in WinAPE.  :o

Offline AMSDOS

  • Supporter
  • 6128 Plus
  • *
  • Posts: 3.939
  • Country: au
    • index.php?action=treasury
    • Programs for Turbo Pascal 3
  • Liked: 1159
  • Likes Given: 1931
Re: Chunky Pixel Curator - WIP
« Reply #20 on: 00:54, 18 November 14 »
Alrighty, I've found the section that is causing WinCPC (and presumably a real CPC) to crash.
Dunno why though...

Strange that it works fine in WinAPE.  :o


It was working fine for me in WinCPC until I went to the next room. I've got WinCPC setup as a 464 though.


What was the bug?
* Using the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

Offline ervin

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.443
  • Country: au
    • index.php?action=treasury
  • Liked: 1139
  • Likes Given: 1359
Re: Chunky Pixel Curator - WIP
« Reply #21 on: 01:16, 18 November 14 »

It was working fine for me in WinCPC until I went to the next room. I've got WinCPC setup as a 464 though.

What was the bug?

The bug occurs when the code returns from my room-building routine.
I don't know the fix yet - I only know where it happens.
I don't understand why it's happening though.   :'(

Offline AMSDOS

  • Supporter
  • 6128 Plus
  • *
  • Posts: 3.939
  • Country: au
    • index.php?action=treasury
    • Programs for Turbo Pascal 3
  • Liked: 1159
  • Likes Given: 1931
Re: Chunky Pixel Curator - WIP
« Reply #22 on: 06:27, 18 November 14 »
The bug occurs when the code returns from my room-building routine.
I don't know the fix yet - I only know where it happens.
I don't understand why it's happening though.   :'(


Sorry I ask stupid questions  :D 


I thought that if you eliminate the room-building routine and look at the code for the sprite animation, there maybe a problem there, but if you know where the error is, you know where it's crashing, unless it's crashing because of something else making it crash.
Perhaps something is happening with the Stack, but would of thought Winape would return that as well. So I'm not really sure.


EDIT:I had another play around with it in WinCPC and got this funny result you can see in the screenshot. This is what I got after loading CPC.BAS and specified a lower memory address:


Code: [Select]
openout"d":memory &2ff
load"cpc.bin",&3700
call &3880


At the top it's got Overflow, followed by Syntax Error and it returned me to BASIC - without Crashing the System. So I don't know if that's anything go to by with what maybe happening.
« Last Edit: 08:33, 18 November 14 by AMSDOS »
* Using the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

Offline ervin

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.443
  • Country: au
    • index.php?action=treasury
  • Liked: 1139
  • Likes Given: 1359
Re: Chunky Pixel Curator - WIP
« Reply #23 on: 11:26, 18 November 14 »
Hmmm, interesting.
(By the way, thanks for looking into this, I appreciate any help I receive).

I've been working on further narrowing it down.
The crash appears to be in the sprite routine, not the room transition code.

I've put a bunch of PRINTs in, and it appears that memory gets corrupted somewhere in there.
Gonna be tricky to fix...

(Still stumped as to why it works perfectly in WinAPE though!)

Offline ervin

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.443
  • Country: au
    • index.php?action=treasury
  • Liked: 1139
  • Likes Given: 1359
Re: Chunky Pixel Curator - WIP
« Reply #24 on: 15:41, 18 November 14 »
SOLVED IT!!!  ;D ;D ;D

I now have it working in WinCPC, as well as Arnold on OSX!
I'm soooo chuffed!

I've updated the DSK file in the original post.

For those interested, it was in this little block of code:

Code: [Select]
di
ld (SAVE_SP_MODE_0+1),sp

exx
ld hl,#1c12
ld de,#1d12
exx

ld bc,#1c1c
push bc

ld hl,_1b+2
ld de,11
ld a,(_spriteWidth)
ld b,a
pop ix

MODE_0_RESET_CODE:
ld sp,hl
push ix
exx
push de
push hl
exx
add hl,de
djnz MODE_0_RESET_CODE

SAVE_SP_MODE_0:
ld sp,#ffff
ei

In that code is a POP IX and a PUSH IX.
It used to be POP AF and PUSH AF.
I can see why it caused a crash - the ADD HL,DE was changing flags and therefore corrupting the AF that I had stored.

However, that worked in WinAPE, which leads me to wonder if WinAPE isn't treating the flags properly in such a case...

Just wondering, is someone able to try the latest version on a real CPC?
I'd love to see a vid of it in action.
I'll get my own CPC out of the cupboard shortly to try it, but in the meantime, it'd be wonderful if one of you excellent folks could let me know if the program now works.
« Last Edit: 16:37, 18 November 14 by ervin »