Author Topic: My CPCRetroDev 2017 entry  (Read 3043 times)

0 Members and 1 Guest are viewing this topic.

Offline ervin

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.130
  • Country: au
    • index.php?action=treasury
  • Liked: 763
Re: My CPCRetroDev 2017 entry
« Reply #30 on: 08:57, 31 August 17 »
Hi folks.

I've managed to make my tile engine a little faster, thanks to some sneaky stack abuse.
*Really* happy with how it is running now, even when there are large objects scrolling around.

However, I've been stuck on getting graphics into my program.  :(

I had some great suggestions from a few generous folks about how I could do it, but the tools that were suggested create a tile array containing pointers to the tile data, rather than indexes describing which tile data array to refer to (if that makes sense!).

The reason I need tile indexes rather than pointers is because I am comparing 8-bit values, to determine which tiles change each screen refresh. Having pointers would cause me to change a bunch of code to use 16-bit values, which would slow things down, and also mess up my fast loops by taking registers away.

So, I've been trying to figure out how to convert a windows BMP to amstrad pixels.
After much banging-my-head-against-a-brick-wall, I think I've finally figured it out.

It actually seems really simple. I've never understood the relationship between INKs and the screen, but I think I get it now.
Well, at least I hope I'm right, otherwise the tool I'm writing (in Blitz Basic!) will be a waste of time!

[EDIT] YES IT WORKS!  ;D
The correct byte values are being returned by my conversion program.
Now I'll make this program create the tile and object data, based on an image (much like a sprite sheet).
« Last Edit: 10:36, 31 August 17 by ervin »
My entry for the CPCRetroDev 2017 Competition http://www.cpcwiki.eu/forum/programming/my-cpcretrodev-2017-entry/
FAST line drawing in CPCtelera http://www.cpcwiki.eu/forum/programming/drawing-lines-with-cpctelera-sdcc/
RUNCPC My entry for the CPCRetroDev 2015 Competition http://www.pouet.net/prod.php?which=66566

Offline ervin

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.130
  • Country: au
    • index.php?action=treasury
  • Liked: 763
Re: My CPCRetroDev 2017 entry
« Reply #31 on: 18:46, 05 September 17 »
Aaaaand finally the graphics conversion program is done!
It was pretty difficult to put in all the things I need, and I tripped over lots of mistakes, but here we are at last!

I'm still using placeholder graphics, but here is an idea of what my project looks like with actual graphics in it.
(Note that this is indeed full-screen mode 0 - I'm just using big chunky pixels).

https://dl.dropbox.com/s/q6ped7boenqo4ze/cpc2.gif
« Last Edit: 18:48, 05 September 17 by ervin »
My entry for the CPCRetroDev 2017 Competition http://www.cpcwiki.eu/forum/programming/my-cpcretrodev-2017-entry/
FAST line drawing in CPCtelera http://www.cpcwiki.eu/forum/programming/drawing-lines-with-cpctelera-sdcc/
RUNCPC My entry for the CPCRetroDev 2015 Competition http://www.pouet.net/prod.php?which=66566

Offline Arnaud

  • Supporter
  • 464 Plus
  • *
  • Posts: 372
  • Country: fr
  • Liked: 258
Re: My CPCRetroDev 2017 entry
« Reply #32 on: 20:12, 05 September 17 »
Really good ! Always real speed ?

I'm really worried when i compare your game engine with mine  ;)

« Last Edit: 22:12, 05 September 17 by Arnaud »

Offline ervin

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.130
  • Country: au
    • index.php?action=treasury
  • Liked: 763
Re: My CPCRetroDev 2017 entry
« Reply #33 on: 01:34, 06 September 17 »
Really good ! Always real speed ?

I'm really worried when i compare your game engine with mine  ;)

Yes, that's the real speed.

You don't need to worry - I don't have an actual game yet, just an engine.
 :P
« Last Edit: 04:18, 06 September 17 by ervin »
My entry for the CPCRetroDev 2017 Competition http://www.cpcwiki.eu/forum/programming/my-cpcretrodev-2017-entry/
FAST line drawing in CPCtelera http://www.cpcwiki.eu/forum/programming/drawing-lines-with-cpctelera-sdcc/
RUNCPC My entry for the CPCRetroDev 2015 Competition http://www.pouet.net/prod.php?which=66566

Offline Arnaud

  • Supporter
  • 464 Plus
  • *
  • Posts: 372
  • Country: fr
  • Liked: 258
Re: My CPCRetroDev 2017 entry
« Reply #34 on: 20:36, 06 September 17 »
You don't need to worry - I don't have an actual game yet, just an engine.
 :P

I hope to see your finished game to be in competition with my game at cpcretrodev  :)
« Last Edit: 23:37, 06 September 17 by Arnaud »

Offline ervin

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.130
  • Country: au
    • index.php?action=treasury
  • Liked: 763
Re: My CPCRetroDev 2017 entry
« Reply #35 on: 17:47, 08 September 17 »
Well, the last 2 nights of development were an absolute nightmare!
I actually thought my project was in jeopardy!

I ended up needing to implement multiple tilesets.
I thought it would be easy, perhaps just needing some offsets or something simple like that.
How wrong I was!

It turned into a total disaster, completely breaking my display routines and causing terrible graphics corruption.
It took *hours* to figure it out; it was so frustrating.

But, finally, it is in.
The feeling of success when it worked was tremendous!

There is a slight speed hit, unfortunately, but I'm working on improving that.
It still runs at a great speed regardless.

One advantage of the slightly slower speed is that screen tearing is less obvious, as objects stay in one spot a tiny bit longer (during scrolling) than before.
 :P
« Last Edit: 17:48, 08 September 17 by ervin »
My entry for the CPCRetroDev 2017 Competition http://www.cpcwiki.eu/forum/programming/my-cpcretrodev-2017-entry/
FAST line drawing in CPCtelera http://www.cpcwiki.eu/forum/programming/drawing-lines-with-cpctelera-sdcc/
RUNCPC My entry for the CPCRetroDev 2015 Competition http://www.pouet.net/prod.php?which=66566

Offline ervin

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.130
  • Country: au
    • index.php?action=treasury
  • Liked: 763
Re: My CPCRetroDev 2017 entry
« Reply #36 on: 16:21, 13 September 17 »
Hi folks.

After a couple of frustrating nights of not-much-progress, I've managed to get collision detection working with platforms.
Jumping isn't in yet, but I'll be starting that next.
However, gravity has been implemented.

My game is now checking for collisions to the left/right of the player, and under the player.
Also, when the player walks toward a platform that is exactly one tile higher than the current position, the player will automatically step up onto it and keep walking.

https://dl.dropbox.com/s/xrg0krzwf7pz3nl/cpc3.gif

Offline Skunkfish

  • Supporter
  • 464 Plus
  • *
  • Posts: 368
  • Country: gb
    • Colour Personal Computing - The CPC Fanzine
  • Liked: 263
Re: My CPCRetroDev 2017 entry
« Reply #37 on: 15:42, 01 February 18 »
Is this game still being worked on?

Offline ervin

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.130
  • Country: au
    • index.php?action=treasury
  • Liked: 763
Re: My CPCRetroDev 2017 entry
« Reply #38 on: 13:26, 02 February 18 »
Unfortunately the project is on ice for now. Maybe I'll pick it up one day if I find enough spare time.
« Last Edit: 14:05, 02 February 18 by ervin »
My entry for the CPCRetroDev 2017 Competition http://www.cpcwiki.eu/forum/programming/my-cpcretrodev-2017-entry/
FAST line drawing in CPCtelera http://www.cpcwiki.eu/forum/programming/drawing-lines-with-cpctelera-sdcc/
RUNCPC My entry for the CPCRetroDev 2015 Competition http://www.pouet.net/prod.php?which=66566