Skip to content

Commit

Permalink
GOL bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
ewoudwijma committed May 17, 2024
1 parent e504c9d commit 940e91a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/App/LedEffects.h
Original file line number Diff line number Diff line change
Expand Up @@ -1391,8 +1391,8 @@ class GameOfLife: public Effect {
// }

#define FRAMETIME_FIXED 12 // or 12 or 24? tbd
if (*pauseFrames || now - *step < FRAMETIME_FIXED * (uint32_t)map(speed,0,255,64,2)) {
if(*pauseFrames) (*pauseFrames)--;
if ((*pauseFrames) || now - *step < FRAMETIME_FIXED * (uint32_t)map(speed,0,255,64,2)) {
if (*pauseFrames) (*pauseFrames)--;
return;// FRAMETIME; //skip if not enough time has passed
}
//Update Game of Life
Expand Down Expand Up @@ -1476,7 +1476,7 @@ class GameOfLife: public Effect {
if ((*generation) % 16 == 0) *oscillatorCRC = crc;
if ((*generation) % (*gliderLength) == 0) *spaceshipCRC = crc;

*generation++;
(*generation)++;
*step = now;
}

Expand Down

7 comments on commit 940e91a

@Brandon502
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another issue I noticed is when all colors is off and rainbow palette is selected all cells seemed to always be red.

Regarding 3D... Is it possible to loop through all real LEDs and get their position? Or loop through the 3D space and check whether they're a real led?

@ewowi
Copy link
Collaborator

@ewowi ewowi commented on 940e91a May 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah noticed that as well but the code says it takes a random8 within the palette so couldn’t understand why

well, never tried it as the goal was to be independent of real leds (leds.mappingtable does the physical mapping)
And the physical position is only looped through while defining the mapping table, after that it’s gone, but if there is a good usecase everything is possible 🙂
Why do you want it ?

@Brandon502
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is for converting gol to 3d so I may be misunderstanding it. For example having the the cube box or hsc fixture. When you loop through x,y,z and starting setting cells on and off I never want the inside of those setups to be alive since they're not actually real pixels.

@ewoudwijma
Copy link
Collaborator Author

@ewoudwijma ewoudwijma commented on 940e91a May 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can just use the (virtual) leds variable as it supports 3D already, no need to think about the physical fixture.
there are 2 3d effects already you can check

Will not work smoothly on big fixtures as for instance HSC is 20x20x20=8000 pixels (if massive). Maybe that will just work, but it’s challenging. I guess a cube of 10x10x10 will work though , don’t know if anybody made that yet 🙂

@ewowi
Copy link
Collaborator

@ewowi ewowi commented on 940e91a May 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah see your comment now about the inside of the cube. Yeah, good point! Would be nice for effects like this to progress on real pixels!
good idea to figure out how to do that!

StarLeds works with projections similar to a projector in a cinema projecting on a screen. Here the beginning of a description: https://ewowi.github.io/StarDocs/StarLeds/ProjectionsAndMappings/

The projections are still in its infancy. Don't know if we can think of a projection which 'folds' around a cube like fixture ... a solution could be that there is no projection (projection=None) and then the leds array can just address the pixel in the position they are physically. That would work but then the effect only works on that fixture ... just thinking out loud now...

@Brandon502
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah see your comment now about the inside of the cube. Yeah, good point! Would be nice for effects like this to progress on real pixels! good idea to figure out how to do that!

StarLeds works with projections similar to a projector in a cinema projecting on a screen. Here the beginning of a description: https://ewowi.github.io/StarDocs/StarLeds/ProjectionsAndMappings/

The projections are still in its infancy. Don't know if we can think of a projection which 'folds' around a cube like fixture ... a solution could be that there is no projection (projection=None) and then the leds array can just address the pixel in the position they are physically. That would work but then the effect only works on that fixture ... just thinking out loud now...

Yeah, I'm still trying to wrap my head around everything. I made a 3D version of GoL that I think may be working lol. I only know 2D so it's hard to tell. Would you want me to create a draft pull request so we can keep discussion in one place?

@ewowi
Copy link
Collaborator

@ewowi ewowi commented on 940e91a May 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes sure! Go ahead and I will try to help

Please sign in to comment.