Certainly. I am developing a puzzle game. It has four Euclidean spatial dimensions. Game play is based around a unique set of rules I developed. It is a somewhat unique version of the Constraint Satisfaction Problem. See Constraint satisfaction problem - Wikipedia.
The problem I am attempting to resolve is a fear that procedural creation of a puzzle is unrealistic on lower performance systems (such as the iPhone, my original target market). I unfortunately do not have access to an iPhone, and have tenuous (at best) access to Unity itself. Therefor I have not yet run benchmarks.
What I feel I need to most focus on optimizing are these problems:
Given an input bitstring, and a blank bitstring (all bits are FALSE), place one random bit form the input bitstring into the blank bitstring.
Puzzle pieces are a hypercube of one unit magnitude. They are arranged in a regular and compact manner. Create a list of all of the values along one surface or hypersurface.
I am already aware of Hamming distance function and will be employing it. Notes on its usage would be appreciated.
Many of these calculations will need to be either performed repeatedly or stored by the individual game pieces.
I couldn’t sleep last night, so I worked on the logic used to set the puzzle. I believe I have it so that I can attempt a nearly entirely systematic (instead of probalistic) approach to setting the puzzle, and that this should scale better as the magnitude of dimensions increases.
However, I believe it may be necessary to update a large number of abstract, behind-the-scenes sets of bitstrings in order to access them readily and consider if the constraints are being met. Each of these bitstrings represent the puzzle pieces along a hypersurface of game pieces, though this hypersurface may only be 1 unit thick (in up to 3 dimensions. ie, a line).
I am looking at up to ~1000 such structures. ~90% of these will contain only 10 puzzle pieces, and the remainder would contain about 50 puzzle pieces. There are a total of ~750 such puzzle pieces, and each structure would have to be updated when one of its member pieces was updated. Puzzle piece representation in structures should be not-quite but nearly uniform.
[[ Those numbers are only nearly correct if I can trust myself to think in four dimensions with a cold… ]]
I am not yet certain if iterating over the puzzle pieces each time they need to be checked for constraint satisfaction is superior to trying to ‘remember’ them (and needing to update all the memories during each state change).
Forgive me for remaining somewhat opaque, but the rest of my development team (who are all MIA in regards to actual development) would shit bricks if they found out I shared the specific game play idea I have come up with. I will gladly answer any questions as best as I can.
Also, if I seem to have any gaps in my knowledge, please enlighten me. I have no formal training in programming and precious little in mathematics (all of what they taught me in school is useless here, lol).
Kind regards,
Chris P.
PS: I can use up to 32 bits when using bitwise operators, correct? What if I program for a 64 bit architecture in mind? I have no idea how that side of programming works, please let me know if/how its possible to expand beyond the 32 bit limitation of bitwise operators.