Gary the Gator is a highly moddable game about an alligator where you have many cutscenes and point and click adventures during the day, and have darker atmosphere & action based night-scenes.
The engine is written in C++ using SFML engine
I built the project together with my best friend who created lots of hand-drawn art. It’s based on her character Gary, and inspired by her first book . I did not continue the project after she has passed away during the first year of the project.
Here I share some ideas & what we built to hopefully inspire others.
Gameplay
Game has two different modes. First one is the day. During the day, Garry have a story.
The day
It always starts with a cutscene where Gary wakes up and comments about the night.
When he wakes up in his room. Objects are interactable. Clicking on object trigger sequences where Gary thinks about something or does something with the object.
Outside of his room, Gary can trigger two activities:
- Go to the candy shop to buy candies. Candies introduces different power-ups for the levels during the nights such as moving faster.
- Interacts with his father.
Interacting with his father simply triggers a visual novel such as:
The night
The second part of the game is the night. Garry sleeps after the story part is complete. And we get to play him in his dreams. His dreams are inspired by the things that happened to him during the day. There is a connection between the day and the night, Gary interacts with some people and objects in the story mode. The same intractable objects from the the day, are also part of the puzzles. For example, trees are moved here, there are mirrors, alarm clocks in the background. They are in more surreal/absurd/dreamy way.
Mechanics:
- The night part have two different realities, player needs to switch between realities to complete puzzles.
- Nightmares are more difficult than dreams and have darker art-style.
- The player must combine two realities to complete a night.
- The objects which have been moved in the darker reality, affects the objects in brighter reality.
- Example: you move a ”candle” in the nightmare world and when you come back to the normal world you see a ”rabbit” has changed a place.
Every night consists of:
- puzzles to be solved with moving objects
- timed challenges where candies from the day will boost your performance
- boss fight
- after beating the boss, new day begins
The engine
Gary’s engine is designed to support 3 different scene types to have in completed version:
- day-cutscenes (storyboard)
- day-scenes (point and click)
- night-scenes (2d platformer).
Engine uses XML scripting language that allows the entire game to be changed by just changing the script and content. The XML script files can be found at files/scenes.
Object management
All the scene-types (different mechanics) has their own scene-objects. Cutscene object in this version takes care of handling the story-showing.
Game Logic
Rendering
The game uses real-time rendering with the concept of double buffering.
Content management
The game has two namespaces for resource/asset management : spriteFactory
and textFactory
for keeping track of textures/texts to be drawn. The game uses a configuration file (config.xml
) that contains user settings (screen resolution, font etc.), and different scripts in files/scripts/scenes/..xml
Scripting manual
There three kinds of script files for scripts:
- Configuration file
- Cut-scene
- Scene
Each kind has different working principle with different variables/children. The engine reads and reacts to each kind differently. If there is an asterisk (*) near the variable name, it means that the relevant variable can’t be left and must be defined. The ones without asterisk can be left blank or without defining.
Location of different files must be given considering the location of main executable file. If the of an image is in sprites folder, than the location must be files/sprites/image.jpg
instead of image.jpg
or sprites/image.jpg
.
1. Configuration File
A special scripting file. It consists of bunch of variables for the game. It has to be named as config.xml
and must be located in files/
folder.
game
>title
: Title of the game. Shows up on windows caption.game
>version
: Version of the game. Shows up on windows caption and is used for version check with script files.game
>graphics
>resolution
>width*
andheight*
: Width and heights of the game resolution. All the position values in other script must be given for the game resolution.game
>graphics
>font
>path*
: Path of the font. The texts won’t show up without any font.game
>graphics
>FPS
>limit*
: Ticks per second for the game loop.game
>gameplay
>startScript
>path*
: The first scene file of the game. The game will start from this script. Game won’t start without any given first script path.game
>typewriter
>speed
: Speed is the amount of milliseconds to wait between letters during typewriting
2. Cut-scene
Cut-scene object is for slide-showing pictures with text. If there is no picture given, then the engine will only show the text, if there is no text then the engine will show only the picture. If both variables are given, the engine will show first the text, then the image.
scene
>time*
,type*
: These variables must be defined astime="day" type="cut-scene"
to define a scene.scene
>version*
: Version of the script. The engine logs an error message if the script version and game version don’t match.scene
>text-color
>red
,green
,blue
: They stand for the RGB colors of the texts. Default color is opaque black0, 0, 255
.scene
>slides
: This section holds all the slides in a cut-scene sequence. All the slides for a cut-scene sequence must be defined in this section (<slides>
and</slides>
). Every slide has to be added in new<slide>
and</slide>
tags. One cut-scene sequence must include at least one slide*. One slide must contain at least one image* or text content* value. The last slide must have agoto
value.scene
>slides
>slide
>image
: image is the path of the image file for the scene. The engine will automatically adjust the image to the games resolutionscene
>slides
>slide
>goto
:goto
is the path of the scene file the objects brings (like a door object, links 2 scenes).goto
must only be defined for the last scene of the cut-scene. It tells the engine that game is not over and what script to go next.scene
>slides
>slide
>text
>content
: The text which will be shown before the image. It’s going to be centered on the screen by engine. If there is no content value, then the engine skips the whole text section and shows only the image.scene
>slides
>slide
>text
>background
:background
is the location of the background sprite of image that will be shown with the text. The engine will automatically adjust the image to the games resolution.scene
>slides
>slide
>text
>typewriter
:typewriter
is a boolean for the typewriter effect. Can be eithertrue
orfalse
. The effect will be activated when it’strue
. Default (undefined): “false
”. Typewriter speed can be configured in the configuration file.
3. Scene
Scene is a room with intractable objects.
scene
>time*
,type*
: These variables must be defined astime="day" type="scene"
to define a scene.scene
>text-color
>red
,green
,blue
: They stand for the RGB colors of the texts. Default color is opaque black0, 0, 255
.scene
>background
>path
: Background art for the scene. It is not intractable. The engine will automatically stretch the image for the screen. The engine will work on a black background if no path to any image is given.scene
>objects
: This section holds all the objects in a scene. All the objects in the room/scene must be defined in this section(<objects>
and</objects>)
. Every object has to be added in new<objects>
and</objects>
tags. There has to be at least one link object with agoto
value for the game progression.scene
>objects
>object
>name*
: Name of the object must be special for its object. There can’t be two objects with the same name. Name doesn’t show up anywhere in the game but is needed for engine to know what object it is.scene
>objects
>object
>image
: Path of the sprite for the object. The object will be invisible but still interactive if no sprite path is given.scene
>objects
>object
>text
: A text to show up during mouse-over.scene
>objects
>object
>position
>x
,y
: X and Y coordinates of the object for the current resolution of the game.scene
>objects
>object
>size
>x
,y
: Rectangle size of the object. If this value is left undefined, then the engine gets the size value of the given sprite.scene
>objects
>object
>yesno
>text
: The question text of the yes/no dialogue.scene
>objects
>object
>yesno
>yes
,no
: The texts for the positive and negative answers.