Me and a group of friends are developing a game and we've run into a road block. Before we describe that road block, here's a simplified explanation of our game:
The game will be able to take in a song in .wav
format, and from that song procedurally generate a "level" whose elements and features vary depending on the properties of the song.
Seems simple enough on the surface (aside from the massively understated complexity of the procedural generation algorithms), but there's a problem. We want to be able to store the procedurally generated content in some portable format, but we also want to be able to execute it very quickly.
Here's the deal. The procedurally generated objects all have procedurally generated behaviours. They each have an update
"method" that encapsulates this behaviour. The behaviour may be something like "if position is some position, do something" or "do this 10 times in a for loop", or something else (most likely only very simple code).
So I was thinking of using the bytecode pattern, and writing a very basic language in which we could encode the behaviour of each object. There's a problem with this though; there's a good chance it won't be fast enough.
On screen at once there will be thousands of these objects with procedurally generated behaviours. If the behaviours were coded in the native language (C# by the way), it would most likely be fast enough, but since we would be parsing and executing our own language bytecode in C# there would be a lot of added overhead that we think is enough to make our game unplayable.
Of course, we haven't tried implementing our own language to see if it actually would be fast enough, but we're kind of on a tight time constraint and don't want to take the risk of wasting time implementing something that won't work.
What should we do?