Page 2 of 3

New demo uploaded: Pirate Kingdoms

Posted: Tue Jul 13, 2021 5:44 pm
by rje

My first steps will be careful ones.... I've never done sprite programming using CC65.

 


New demo uploaded: Pirate Kingdoms

Posted: Wed Oct 20, 2021 5:49 pm
by rje

Updated with some more vision statementy things.

 


I. A PRETTY MAP



  • Rounded coastlines, no overlapping sprites.




II. AN ECOLOGY



  • (1602) Terrain squares have their own characteristics, which define what can be grown on them.


  • (1602, 7 Cities of Gold) Settlements produce people, supplies, ships, trade goods.  Some are better at self-defense.  They can be owned, and can rebel.





  • (7 Cities of Gold) A "soft empire" model, based on relationships between settlements.


  • (1602, 7 Cities of Gold) Establish and dismantle settlements.


  • (Pirates, 7 Cities of Gold) Barter with or plunder settlements.


  • (7 Cities of Gold) Explore.


 


New demo uploaded: Pirate Kingdoms

Posted: Wed Jan 26, 2022 3:32 pm
by rje

OK, replaced the BASIC version with the C version.  It's more responsive, but the scrolling is terrible.  Also I don't like the way I did the map.  I have to rethink things and use fewer sprites if possible.

 

For example, I use sprites to tile the ocean.  I shouldn't have to do that -- surely I can just use characters to represent the ocean.  Like a reverse period, or something. 

Then, the land sprites themselves are memory hungry.  Each one is 64 x 64 and 8 bit pixels -- 4K!  Oink!  

I think I need to go back to using "coastline" sprites for the edges.  8 x 64 and 64 x 8 sprites.  We'll see.

 

And even after all that, there does appear to be an obvious redraw going on when the ship moves: the sprites appear to stagger.  In other words, C is not fast enough.


New demo uploaded: Pirate Kingdoms

Posted: Wed Jan 26, 2022 3:36 pm
by SlithyMatt

Mainly, you need to make sure you are doing the scrolling during VBLANK by putting it at the beginning of your VSYNC interrupt routine. That should clean it up a lot.


New demo uploaded: Pirate Kingdoms

Posted: Wed Jan 26, 2022 7:08 pm
by rje


On 1/26/2022 at 9:36 AM, SlithyMatt said:




Mainly, you need to make sure you are doing the scrolling during VBLANK by putting it at the beginning of your VSYNC interrupt routine. That should clean it up a lot.



You can do that in C?


New demo uploaded: Pirate Kingdoms

Posted: Wed Jan 26, 2022 7:29 pm
by SlithyMatt


On 1/26/2022 at 2:08 PM, rje said:




You can do that in C?



I should hope so! You may just need some inline assembly to overwrite the IRQ vector with a function address, but you may be able to do that in pure C. 


New demo uploaded: Pirate Kingdoms

Posted: Fri Jan 28, 2022 10:21 pm
by pzembrod

You could also develop this in the direction of the Flying Spaghetti Monster game - fsmgame.com


New demo uploaded: Pirate Kingdoms

Posted: Sat Jan 29, 2022 4:10 am
by ZeroByte

I forget exactly every step I did in Flappy Bird, but it does IRQ handling in C.

Basically, I made a #define that makes the IRQ vector in RAM ($030-something)  so it looks like a variable, and then I did an inline assembly to SEI, then IRQ_VECTOR = &irq_handler;

Something akin to that.


New demo uploaded: Pirate Kingdoms

Posted: Sat Jan 29, 2022 10:09 am
by svenvandevelde

Very nice demo. Curious how you created the dynamic tile algorithm.


New demo uploaded: Pirate Kingdoms

Posted: Fri Feb 25, 2022 4:50 am
by rje


On 1/29/2022 at 4:09 AM, svenvandevelde said:




Very nice demo. Curious how you created the dynamic tile algorithm.



I overlapped the sprites significantly -- 8 pixels on every edge I think.  

The result was absolutely horrible refresh.

 

Today I got rid of the overlap and reverted to plain square sprites instead of ones with contoured shorelines.  It looks uglier but moves MUCH MUCH smoother.

The current view is only a bit more than 5 x 6 "squares".  I also added a regional map view -- typing 'm' draws a 50 x 50 PETSCII map.  That helps get my bearings, so to speak.  I might instead just have a 20 x 20 mini-map on a corner of the normal view.