Go to file
2016-07-02 21:40:05 -07:00
Assets Deleting garbage files 2015-01-31 22:47:41 +09:00
Actor.cpp Initial commit 2014-10-21 13:54:42 +09:00
Actor.h Initial commit 2014-10-21 13:54:42 +09:00
ActorManager.cpp Initial commit 2014-10-21 13:54:42 +09:00
ActorManager.h Initial commit 2014-10-21 13:54:42 +09:00
ActorManifest.cpp Initial commit 2014-10-21 13:54:42 +09:00
ActorManifest.h Initial commit 2014-10-21 13:54:42 +09:00
ActorProperty.cpp Initial commit 2014-10-21 13:54:42 +09:00
ActorProperty.h Initial commit 2014-10-21 13:54:42 +09:00
ActorPropertyAnimation.cpp Initial commit 2014-10-21 13:54:42 +09:00
ActorPropertyAnimation.h Initial commit 2014-10-21 13:54:42 +09:00
ActorPropertyPhysics.cpp Initial commit 2014-10-21 13:54:42 +09:00
ActorPropertyPhysics.h Initial commit 2014-10-21 13:54:42 +09:00
ActorPropertyScript.cpp Initial commit 2014-10-21 13:54:42 +09:00
ActorPropertyScript.h Initial commit 2014-10-21 13:54:42 +09:00
ActorPropertySprite.cpp Initial commit 2014-10-21 13:54:42 +09:00
ActorPropertySprite.h Initial commit 2014-10-21 13:54:42 +09:00
ActorScript.cpp Initial commit 2014-10-21 13:54:42 +09:00
ActorScript.h Initial commit 2014-10-21 13:54:42 +09:00
Animation.cpp Initial commit 2014-10-21 13:54:42 +09:00
Animation.h Initial commit 2014-10-21 13:54:42 +09:00
AnimationManifest.cpp Initial commit 2014-10-21 13:54:42 +09:00
AnimationManifest.h Initial commit 2014-10-21 13:54:42 +09:00
AppMoonfall.cpp Initial commit 2014-10-21 13:54:42 +09:00
AppMoonfall.h Initial commit 2014-10-21 13:54:42 +09:00
AppMoonfallDev.cpp Initial commit 2014-10-21 13:54:42 +09:00
Assert.cpp Initial commit 2014-10-21 13:54:42 +09:00
Assert.h Initial commit 2014-10-21 13:54:42 +09:00
Assets.pak Initial commit 2014-10-21 13:54:42 +09:00
Buffer.cpp Initial commit 2014-10-21 13:54:42 +09:00
Buffer.h Initial commit 2014-10-21 13:54:42 +09:00
Camera.cpp Initial commit 2014-10-21 13:54:42 +09:00
Camera.h Initial commit 2014-10-21 13:54:42 +09:00
CameraTarget.cpp Initial commit 2014-10-21 13:54:42 +09:00
CameraTarget.h Initial commit 2014-10-21 13:54:42 +09:00
Color.h Initial commit 2014-10-21 13:54:42 +09:00
Compression.cpp Initial commit 2014-10-21 13:54:42 +09:00
Compression.h Initial commit 2014-10-21 13:54:42 +09:00
Define.h Initial commit 2014-10-21 13:54:42 +09:00
DialogAssetPackager.cpp Initial commit 2014-10-21 13:54:42 +09:00
DialogAssetPackager.h Initial commit 2014-10-21 13:54:42 +09:00
DialogueManifest.cpp Initial commit 2014-10-21 13:54:42 +09:00
DialogueManifest.h Initial commit 2014-10-21 13:54:42 +09:00
Driver.cpp Initial commit 2014-10-21 13:54:42 +09:00
Driver.h Initial commit 2014-10-21 13:54:42 +09:00
EngineCommon.h Initial commit 2014-10-21 13:54:42 +09:00
Environment.h Initial commit 2014-10-21 13:54:42 +09:00
EventManager.cpp Initial commit 2014-10-21 13:54:42 +09:00
EventManager.h Initial commit 2014-10-21 13:54:42 +09:00
FileManifest.cpp Initial commit 2014-10-21 13:54:42 +09:00
FileManifest.h Initial commit 2014-10-21 13:54:42 +09:00
Font.cpp Initial commit 2014-10-21 13:54:42 +09:00
Font.h Initial commit 2014-10-21 13:54:42 +09:00
FontManifest.cpp Initial commit 2014-10-21 13:54:42 +09:00
FontManifest.h Initial commit 2014-10-21 13:54:42 +09:00
FrameConsole.cpp Initial commit 2014-10-21 13:54:42 +09:00
FrameConsole.h Initial commit 2014-10-21 13:54:42 +09:00
FrameMapEditor.cpp Initial commit 2014-10-21 13:54:42 +09:00
FrameMapEditor.h Initial commit 2014-10-21 13:54:42 +09:00
FrameSpriteEditor.cpp Initial commit 2014-10-21 13:54:42 +09:00
FrameSpriteEditor.h Initial commit 2014-10-21 13:54:42 +09:00
GameCommon.h Initial commit 2014-10-21 13:54:42 +09:00
Grid.h Initial commit 2014-10-21 13:54:42 +09:00
Grid.inl Initial commit 2014-10-21 13:54:42 +09:00
HeapTracker.cpp Initial commit 2014-10-21 13:54:42 +09:00
HeapTracker.h Initial commit 2014-10-21 13:54:42 +09:00
ICameraTarget.h Initial commit 2014-10-21 13:54:42 +09:00
IEventHandler.h Initial commit 2014-10-21 13:54:42 +09:00
InputManager.cpp Initial commit 2014-10-21 13:54:42 +09:00
InputManager.h Initial commit 2014-10-21 13:54:42 +09:00
IWorldContext.h Initial commit 2014-10-21 13:54:42 +09:00
LuaBinding.cpp Initial commit 2014-10-21 13:54:42 +09:00
LuaBinding.h Initial commit 2014-10-21 13:54:42 +09:00
LuaBinding.inl Initial commit 2014-10-21 13:54:42 +09:00
LuaBindingActor.cpp Initial commit 2014-10-21 13:54:42 +09:00
LuaBindingActorAnimation.cpp Initial commit 2014-10-21 13:54:42 +09:00
LuaBindingActorPhysics.cpp Initial commit 2014-10-21 13:54:42 +09:00
LuaBindingActorScript.cpp Initial commit 2014-10-21 13:54:42 +09:00
LuaBindingActorSprite.cpp Initial commit 2014-10-21 13:54:42 +09:00
LuaBindingCamera.cpp Initial commit 2014-10-21 13:54:42 +09:00
LuaBindingExport.cpp Initial commit 2014-10-21 13:54:42 +09:00
LuaBindingInput.cpp Initial commit 2014-10-21 13:54:42 +09:00
LuaBindingUtil.cpp Initial commit 2014-10-21 13:54:42 +09:00
LuaBindingWorld.cpp Initial commit 2014-10-21 13:54:42 +09:00
Map.cpp Initial commit 2014-10-21 13:54:42 +09:00
Map.h Initial commit 2014-10-21 13:54:42 +09:00
Monostate.h Initial commit 2014-10-21 13:54:42 +09:00
Monostate.inl Initial commit 2014-10-21 13:54:42 +09:00
Moonfall.cbp More build fixes 2014-10-23 17:34:44 +09:00
Moonfall.fbp Initial commit 2014-10-21 13:54:42 +09:00
Moonfall.sln Initial commit 2014-10-21 13:54:42 +09:00
Moonfall.vcproj Initial commit 2014-10-21 13:54:42 +09:00
Moonfall.xrc Initial commit 2014-10-21 13:54:42 +09:00
Pch.h Initial commit 2014-10-21 13:54:42 +09:00
README.md Updating README.md 2016-07-02 21:31:06 -07:00
Rect.h Initial commit 2014-10-21 13:54:42 +09:00
Rect.inl Initial commit 2014-10-21 13:54:42 +09:00
RefCount.h Initial commit 2014-10-21 13:54:42 +09:00
RefCount.inl Initial commit 2014-10-21 13:54:42 +09:00
Script.cpp Initial commit 2014-10-21 13:54:42 +09:00
Script.h Initial commit 2014-10-21 13:54:42 +09:00
ScriptManifest.cpp Initial commit 2014-10-21 13:54:42 +09:00
ScriptManifest.h Initial commit 2014-10-21 13:54:42 +09:00
ScriptManifest.inl Initial commit 2014-10-21 13:54:42 +09:00
Serialization.cpp Initial commit 2014-10-21 13:54:42 +09:00
Serialization.h Initial commit 2014-10-21 13:54:42 +09:00
Serialization.inl Initial commit 2014-10-21 13:54:42 +09:00
Sprite.cpp Initial commit 2014-10-21 13:54:42 +09:00
Sprite.h Initial commit 2014-10-21 13:54:42 +09:00
SpriteManifest.cpp Initial commit 2014-10-21 13:54:42 +09:00
SpriteManifest.h Initial commit 2014-10-21 13:54:42 +09:00
Surface.cpp Initial commit 2014-10-21 13:54:42 +09:00
Surface.h Initial commit 2014-10-21 13:54:42 +09:00
SurfaceManager.cpp Initial commit 2014-10-21 13:54:42 +09:00
SurfaceManager.h Initial commit 2014-10-21 13:54:42 +09:00
System.cpp Initial commit 2014-10-21 13:54:42 +09:00
System.h Initial commit 2014-10-21 13:54:42 +09:00
tinystr.cpp Initial commit 2014-10-21 13:54:42 +09:00
tinystr.h Initial commit 2014-10-21 13:54:42 +09:00
tinyxml.cpp Initial commit 2014-10-21 13:54:42 +09:00
tinyxml.h Initial commit 2014-10-21 13:54:42 +09:00
tinyxmlerror.cpp Initial commit 2014-10-21 13:54:42 +09:00
tinyxmlparser.cpp Initial commit 2014-10-21 13:54:42 +09:00
Token.cpp Initial commit 2014-10-21 13:54:42 +09:00
Token.h Initial commit 2014-10-21 13:54:42 +09:00
Trace.cpp Initial commit 2014-10-21 13:54:42 +09:00
Trace.h Initial commit 2014-10-21 13:54:42 +09:00
Vector.h Initial commit 2014-10-21 13:54:42 +09:00
Vector.inl Initial commit 2014-10-21 13:54:42 +09:00
Window.cpp Initial commit 2014-10-21 13:54:42 +09:00
Window.h Initial commit 2014-10-21 13:54:42 +09:00
WindowDialogue.cpp Initial commit 2014-10-21 13:54:42 +09:00
WindowDialogue.h Initial commit 2014-10-21 13:54:42 +09:00
WindowDialoguePanel.cpp Initial commit 2014-10-21 13:54:42 +09:00
WindowDialoguePanel.h Initial commit 2014-10-21 13:54:42 +09:00
WindowMain.cpp Initial commit 2014-10-21 13:54:42 +09:00
WindowMain.h Initial commit 2014-10-21 13:54:42 +09:00
WindowManager.cpp Initial commit 2014-10-21 13:54:42 +09:00
WindowManager.h Initial commit 2014-10-21 13:54:42 +09:00
WindowText.cpp Initial commit 2014-10-21 13:54:42 +09:00
WindowText.h Initial commit 2014-10-21 13:54:42 +09:00
WindowWorld.cpp Initial commit 2014-10-21 13:54:42 +09:00
WindowWorld.h Initial commit 2014-10-21 13:54:42 +09:00
World.cpp Initial commit 2014-10-21 13:54:42 +09:00
World.h Initial commit 2014-10-21 13:54:42 +09:00
WorldManifest.cpp Initial commit 2014-10-21 13:54:42 +09:00
WorldManifest.h Initial commit 2014-10-21 13:54:42 +09:00
WorldScript.cpp Initial commit 2014-10-21 13:54:42 +09:00
WorldScript.h Initial commit 2014-10-21 13:54:42 +09:00
XrcResource.cpp Initial commit 2014-10-21 13:54:42 +09:00

Moonfall

Moonfall is the name of a game engine that I spent several months developing back in 2008. It leveraged SDL for graphics, Lua for in-game scripting, and wxWidgets for the built-in developer tools. The cross-platform engine was written using Code::Blocks IDE, but Visual Studio project files are also available.

The inspiration for the game came partially from the Harvest Moon video game for the Super Nintendo and from the When They Cry by 07th Expansion. The protagonist is a city dweller, who upon inheriting a small farm from a distant relative decides to try his hand in agriculture. He finds the residents of the nearby small town a friendly bunch, but something about them does not seem right. Everyone is appears to be hiding something from the player, who must uncover the truth to survive. In short, this is (as I have described it to my friends), "Harvest Moon with murder."

Technology

From a technical point of view, the game engine was an exercise in creating a completely data driven game. In retrospect, it was probably over-engineered, but in general it was flexible and I liked what I could do with it. At the core of the engine was the Actor class, the functionality of which could be expanded through add-on properties. The property definitions were specified in XML; for example, below is the definition for the playable character:

<Actor alias = "Player.01" dynamic = "1" layer = "4" thumbnail = "Player.01.Idle.S.01">
    <Properties>
        <Animation />
        <Script resource = "Player.01.Default" />
        <Physics />
    </Properties>
</Actor>

In addition to the self-explainable Animation and Physics properties, you can see a Script node which associates a Lua script with the actor. Scripts would get notifications about events such as OnActorUpdate, during which custom processing could take place:

function OnActorUpdate(elapsed)
    if InputIsKeyTriggered(META_KEY_USE) then
        DoActorUse()
        return
    elseif InputIsKeyPressed(META_KEY_UP) then
        DoActorWalk(DIRECTION_NORTH)
        return
    elseif InputIsKeyPressed(META_KEY_DOWN) then
        DoActorWalk(DIRECTION_SOUTH)
        return
    elseif InputIsKeyPressed(META_KEY_LEFT) then
        DoActorWalk(DIRECTION_WEST)
        return
    elseif InputIsKeyPressed(META_KEY_RIGHT) then
        DoActorWalk(DIRECTION_EAST)
        return
    end

    DoActorIdle(playerDirection)
end

Scripts can directly interact with properties on the parent Actor and can communicate with surrounding world via a messaging system. This made it possible to build any game object imaginable by editing a couple of XML files and some simple scripting.

function DoActorWalk(direction)
    if playerAction == ACTION_WALK and playerDirection == direction then
        return
    end

    ActorPhysicsSetVelocity(playerId, playerWalkVelocities[direction])
    ActorAnimationSet(playerId, playerWalkAnimations[direction])
    ActorAnimationPlay(playerId, true)

    playerDirection = direction
    playerAction = ACTION_WALK
end

function DoActorUse()
    actorsIds = ActorPhysicsQueryShapeCollisions(
        playerId,
        ACTOR_SHAPE_TYPE_COLLISION_INTERACT
    )

    for i, v in ipairs(actorsIds) do
        ActorScriptSendMessage(v, "interact", { user = playerId })
    end
end

I eventually stopped work on Moonfall due to a lack of time, combined with the fact that I am not an artist and could not author the assets required to develop this into a complete game.

Screenshots

Gameplay window Sprite editor Console window Asset editor Map editor

License

GPL