<commit_before># Phantasma

A remake of Domark's Freescape engine, allowing games created with the 3d Construction Set to run on modern computers.

WARNING: this code is half a decade old and predates my switch to computer science as a career. It wears its juvenilia visibly. 

I'm hoping to address that.

## Build Requirements

SDL, SDL_mixer, SDL_image, Freetype.

## Outstanding Issues

From memory:
* the collision model is slightly wrong; it takes you to be a hovering cube which attempts to remain a certain distance from the floor (hence the smoothed motion up stairs, etc) but that allows you to do such feats as walking straight over the final barrier in the 8-bit demo game; and
* rendering uses a depth buffer for order determination; the original doesn't so despite some attempted patches via the polygon offset extension (yes, extension — this is olden timesy OpenGL 1.x code) drawing order is not always identical.

## Things I'd Like To Do

1. remove the SDL and Freetype dependencies in favour of direct ties to the host OS; it's very slightly more code to maintain but makes the whole thing so much nicer to use;
2. rewrite the scene drawer not to use a depth buffer, adjust the collision model as per comments above; and
3. probably shift the main part of the code to vanilla C as I was never very good at C++ and am certainly not now.

## Specific Recollections
### FCL Runner
The FCL runner runs Freescape Command Language scripts (called variously 'conditions' or 'animators' in Freescape, depending on what they do). Despite references to compilation in the comments and the method names, it does this by tokenising the scripts, building a (fairly trivial, due to the language — I don't specifically recall whether it is even technically a tree rather than being all but a straight tokenised stream) syntax tree by recursive descent and subsequently by interpreting that. I think this is the correct way to proceed as it keeps the code simple and the processing disparity between machines now and machines then means that interpreting is never going to be a performance problem in practice.

The 8-bit version of the 3d Construction Kit uses a byte-code rather than textual scripts. Its functionality is a subset of the 16-bit language. In this code, 8-bit codes are converted into textual scripts then supplied to the FCL runner.<commit_msg>Added a quick note to explain what's going on over on development.<commit_after># Phantasma

A remake of Domark's Freescape engine, allowing games created with the 3d Construction Set to run on modern computers.

WARNING: this code is half a decade old and predates my switch to computer science as a career. It wears its juvenilia visibly. 

I'm hoping to address that.

## Ongoing Work

See the development branch. In that branch I’m cleaning, commenting, refactoring and removing dependencies. It’s work in progress and will return to master when it’s playable.

## Build Requirements

SDL, SDL_mixer, SDL_image, Freetype.

## Outstanding Issues

From memory:
* the collision model is slightly wrong; it takes you to be a hovering cube which attempts to remain a certain distance from the floor (hence the smoothed motion up stairs, etc) but that allows you to do such feats as walking straight over the final barrier in the 8-bit demo game; and
* rendering uses a depth buffer for order determination; the original doesn't so despite some attempted patches via the polygon offset extension (yes, extension — this is olden timesy OpenGL 1.x code) drawing order is not always identical.

## Things I'd Like To Do

1. remove the SDL and Freetype dependencies in favour of direct ties to the host OS; it's very slightly more code to maintain but makes the whole thing so much nicer to use;
2. rewrite the scene drawer not to use a depth buffer, adjust the collision model as per comments above; and
3. probably shift the main part of the code to vanilla C as I was never very good at C++ and am certainly not now.

## Specific Recollections
### FCL Runner
The FCL runner runs Freescape Command Language scripts (called variously 'conditions' or 'animators' in Freescape, depending on what they do). Despite references to compilation in the comments and the method names, it does this by tokenising the scripts, building a (fairly trivial, due to the language — I don't specifically recall whether it is even technically a tree rather than being all but a straight tokenised stream) syntax tree by recursive descent and subsequently by interpreting that. I think this is the correct way to proceed as it keeps the code simple and the processing disparity between machines now and machines then means that interpreting is never going to be a performance problem in practice.

The 8-bit version of the 3d Construction Kit uses a byte-code rather than textual scripts. Its functionality is a subset of the 16-bit language. In this code, 8-bit codes are converted into textual scripts then supplied to the FCL runner.
{'fraction_non_alphanumeric': 0.03496081977094635, 'fraction_numerical': 0.004420333534257585, 'mean_word_length': 4.488423373759647, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1286836', 'n_tokens_mistral': 1218, 'n_tokens_neox': 1145, 'n_words': 818}