Page 3 of 3

Vertical smooth scrolling with generated tiles ...

Posted: Fri Mar 19, 2021 7:27 am
by svenvandevelde

The fun part of all this tiling is exactly the internal mechanisms:


  • How to identify the possible tiles that glue to a combination of already placed tiles on the canvas.


  • How to randomly select from these possible tiles one tile that will be glued.


  • How to selectively randomly select that tile, meaning, with weighting factors.


Trying to figure out the most CPU cost effective way to get the job done.

Right now, the whole thing works with arrays, which is good, but it involves linear searching.

And multiple loops are involved to find the collection of tiles that can be glued.

The advantage of using arrays is that the random selection process becomes very easy.

Using lists or tree structures would make this process much harder, but on the other side,

using structures would make the process of searching for the viable tiles the fastest as is possible.

I'm thinking of another way of doing it, by using bit-wise selection criteria, for each direction, that would allow me to kind of

"mathematically" calculate the right tiles that can be glued, so no tree structures would be required.

But then still, this would involve building a collection of possible tiles through loops ...

I hope you get my above points.

To show you what i mean with the above forum question, have a read through this, which are articles about "bitmasking":

Any ideas here in the community? You can have a look at my code here:

X16_Code/tileengine.c at main · FlightControl-User/X16_Code (github.com)

If you want to compile it, ensure you are using the kickc derived version (helping Jesper on that) here:

Files · CX16_VERA · Sven Van de Velde / kickc · GitLab

 

Sven


Vertical smooth scrolling with generated tiles ...

Posted: Fri Mar 19, 2021 7:53 am
by Jeffrey


24 minutes ago, svenvandevelde said:




The fun part of all this tiling is exactly the internal mechanisms:




  • How to identify the possible tiles that glue to a combination of already placed tiles on the canvas.


  • How to randomly select from these possible tiles one tile that will be glued.


  • How to selectively randomly select that tile, meaning, with weighting factors.




Trying to figure out the most CPU cost effective way to get the job done.

Right now, the whole thing works with arrays, which is good, but it involves linear searching.

And multiple loops are involved to find the collection of tiles that can be glued.



The advantage of using arrays is that the random selection process becomes very easy.

Using lists or tree structures would make this process much harder, but on the other side,

using structures would make the process of searching for the viable tiles the fastest as is possible.



I'm thinking of another way of doing it, by using bit-wise selection criteria, for each direction, that would allow me to kind of

"mathematically" calculate the right tiles that can be glued, so no tree structures would be required.

But then still, this would involve building a collection of possible tiles through loops ...



I hope you get my above points.



To show you what i mean with the above forum question, have a read through this, which are articles about "bitmasking":





Any ideas here in the community? You can have a look at my code here:



X16_Code/tileengine.c at main · FlightControl-User/X16_Code (github.com)



If you want to compile it, ensure you are using the kickc derived version (helping Jesper on that) here:



Files · CX16_VERA · Sven Van de Velde / kickc · GitLab

 



Sven



Fascinating stuff. I would like to dive a little deeper into this when I have some time.

It must be an interesting experience, this project right?


Vertical smooth scrolling with generated tiles ...

Posted: Fri Mar 19, 2021 11:50 am
by svenvandevelde


3 hours ago, Jeffrey said:




Fascinating stuff. I would like to dive a little deeper into this when I have some time.



It must be an interesting experience, this project right?



It is @Jeffrey, these are long gone game concept differentiators during the 8 bit era. This game is only scratching the surface. Remember racing destruction set? Isomorphic... and not only tiles but sprites also ...