I've been trying to generate gameplay (that's ideally fun) procedurally.
An initial idea was to set up an NP hard problem or two around the player (i.e. the knapsack problem and the travelling salesman problem) albeit within the context of the game's theme and then leave them to solve it in any one of many ways. On completion then I was thinking about simply ranking their solution according to some metrics (fuel expended, time taken, enemies destroyed, game people saved etc) on a leader board, but then I got distracted...
Whilst setting up the systems for the above I started experimenting with a couple of simple ideas. Let's call them "Gameplay Layers" and "Gameplay Cycles":
Gameplay Layer: A Gameplay layer is an approximately 200 lines of code that adds to the game some system or mechanic i.e. time of day, weather, defensive tower, refuelling rings, enemy waves etc
Gameplay Cycle: This is simply a timer that activates periodically (configurable), lasts for a configurable amount of time and then pauses for a configurable amount of time until the cycle then repeats.
A Gameplay Layer is activated and deactivated according to a Gameplay Cycle.
With these two simple ideas I seem to be able to generate interesting events as the gameplay layers run out of phase with each other the resulting behaviour of which I haven't had to code explicitly.
For example, the time of day system is running out of phase with respect to the weather system so you can have a quiet foggy morning, or a lightning storm during the day or fog at night whilst being overrun by a wave of enemies or a clear night etc.
Fun for free?
Here's a short video:
[previewyoutube=vd32GcHYk1Q;leftthumb][/previewyoutube] [ 2025-01-07 20:20:46 CET ][ Original post ]