Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Game submission: Larceny #26

Open
wants to merge 48 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
dc62a98
Basic game files added and checking player 1 controller inputs for qu…
RiPpErTheGreyFox Nov 6, 2024
d5d97d1
Added console outputs that will show controller inputs
RiPpErTheGreyFox Nov 6, 2024
5fea2fe
Added 3d rendering of map model borrowed from snake3d game, blender e…
RiPpErTheGreyFox Nov 6, 2024
ca24fce
Fixed memory leak regarding sounds not being freed
RiPpErTheGreyFox Nov 6, 2024
f4e12c8
Added basic player init (using model from snake3d, needs to be replaced)
RiPpErTheGreyFox Nov 6, 2024
d827da0
missed the blender file of the borrowed map asset
RiPpErTheGreyFox Nov 6, 2024
294c93d
Added own assets built from scratch in blender (map and test actor)
RiPpErTheGreyFox Nov 10, 2024
fd4d6ab
Updated some comments in the code
RiPpErTheGreyFox Nov 10, 2024
7140013
Added player colour rendering
RiPpErTheGreyFox Nov 10, 2024
1858f33
Added team definitions to players, added some basic AI to be replaced…
RiPpErTheGreyFox Nov 13, 2024
bca506e
Added collision system, including a basic mesh to display for debug p…
RiPpErTheGreyFox Nov 14, 2024
ccf0756
Added stun and ability timers to players (including testing via self …
RiPpErTheGreyFox Nov 14, 2024
9042708
Updated most comments
RiPpErTheGreyFox Nov 14, 2024
277288c
Thieves are able to be stunned by player guards (AI doesn't attempt i…
RiPpErTheGreyFox Nov 14, 2024
3f6d61d
Added more collision zones for performance testing
RiPpErTheGreyFox Nov 14, 2024
cdbf9a1
Added a countdown timer to the game
RiPpErTheGreyFox Nov 17, 2024
a0c392d
Added basic effect pool and using it for the basic ability effects (n…
RiPpErTheGreyFox Nov 17, 2024
87bc9c7
Added basic sound effect code, need to get some real sound effects
RiPpErTheGreyFox Dec 1, 2024
1638e27
Lowered resolution to 320x240 for now, aiming for 60fps above all, ad…
RiPpErTheGreyFox Dec 4, 2024
a3380a6
Broke AI out into it's own file, AI is now running on a finite state …
RiPpErTheGreyFox Dec 5, 2024
bde0ecb
Added debug info for player speed and AI statuses
RiPpErTheGreyFox Dec 10, 2024
cf47bbc
New models for the guards and thieves, including animations and basic…
RiPpErTheGreyFox Dec 12, 2024
2dac22a
Renamed all files with new game name
RiPpErTheGreyFox Dec 12, 2024
168a99f
source files updated to reflect new file names
RiPpErTheGreyFox Dec 12, 2024
688451c
Add a new model for the objectives
RiPpErTheGreyFox Dec 13, 2024
672cb00
AI updated to be more aware of other players
RiPpErTheGreyFox Dec 13, 2024
984cc40
Merge remote-tracking branch 'upstream/main'
RiPpErTheGreyFox Dec 13, 2024
ded1f06
Updated comments above function definitions
RiPpErTheGreyFox Dec 13, 2024
390c948
Added more sound slots, adjusted the channels on some of the sound ef…
RiPpErTheGreyFox Dec 13, 2024
9716e20
Put in some debug stuff to be toggled on/off
RiPpErTheGreyFox Dec 13, 2024
3ef379a
New sound effects added to assets and code changed to reflect it
RiPpErTheGreyFox Dec 13, 2024
b6fe96c
Updated code to use new sound effecs and adjust volumes
RiPpErTheGreyFox Dec 13, 2024
dfea08f
Updated the map, model, textures and collision zones
RiPpErTheGreyFox Dec 13, 2024
618acf5
updated thief ability range and stride, changed the default backgroun…
RiPpErTheGreyFox Dec 13, 2024
3219d92
removed test and unneeded files from the asset list to lower the ROM …
RiPpErTheGreyFox Dec 13, 2024
15a4033
Map updated and camera moved
RiPpErTheGreyFox Dec 13, 2024
59380a7
IPK objective model updated as environment mapping breaks when it's t…
RiPpErTheGreyFox Dec 13, 2024
c959230
used rdpq_debug to try and find weird states in memory and only found…
RiPpErTheGreyFox Dec 13, 2024
9cd9358
Moved directional light code to try and fix an edge case crash
RiPpErTheGreyFox Dec 14, 2024
01b317d
fixed the thief not being able to jump through the middle at all
RiPpErTheGreyFox Dec 14, 2024
f218485
added an animated camera system for intro and outro
RiPpErTheGreyFox Dec 14, 2024
92c81d2
Added a HUD safe area define, removed oboselete resolution defines
RiPpErTheGreyFox Dec 14, 2024
956e743
Added per player rotation in player_init
RiPpErTheGreyFox Dec 14, 2024
d6c6203
Added new camera outro with bettering timing
RiPpErTheGreyFox Dec 14, 2024
4ff2384
Set text styles on the non-player HUD text, now has a black instead o…
RiPpErTheGreyFox Dec 14, 2024
310b1d8
increased the HUD safety area just in case
RiPpErTheGreyFox Dec 14, 2024
5205547
Fix for guard animation not working on players
RiPpErTheGreyFox Dec 14, 2024
b732cb5
Anim blend fix
RiPpErTheGreyFox Dec 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added assets/larcenygame/collisionSquare.blend
Binary file not shown.
Binary file added assets/larcenygame/collisionSquare.glb
Binary file not shown.
Binary file added assets/larcenygame/diamondObjective.blend
Binary file not shown.
Binary file added assets/larcenygame/diamondObjective.glb
Binary file not shown.
Binary file added assets/larcenygame/dogGuard.blend
Binary file not shown.
Binary file added assets/larcenygame/dogGuard.glb
Binary file not shown.
Binary file added assets/larcenygame/drozerix-poppy_flower_girls.xm
Binary file not shown.
Binary file added assets/larcenygame/dustEffect.blend
Binary file not shown.
Binary file added assets/larcenygame/dustEffect.glb
Binary file not shown.
Binary file added assets/larcenygame/firstObjective.blend
Binary file not shown.
Binary file added assets/larcenygame/firstObjective.glb
Binary file not shown.
Binary file added assets/larcenygame/floorTest.ci4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/larcenygame/foxThief.blend
Binary file not shown.
Binary file added assets/larcenygame/foxThief.glb
Binary file not shown.
Binary file added assets/larcenygame/guardStunHit.mp3
Binary file not shown.
Binary file added assets/larcenygame/guardSwing.mp3
Binary file not shown.
Binary file added assets/larcenygame/map.blend
Binary file not shown.
Binary file added assets/larcenygame/map.glb
Binary file not shown.
Binary file added assets/larcenygame/objectiveGradient.ia8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/larcenygame/objectiveTouch.mp3
Binary file not shown.
Binary file added assets/larcenygame/ringObjective.blend
Binary file not shown.
Binary file added assets/larcenygame/ringObjective.glb
Binary file not shown.
Binary file added assets/larcenygame/sand12.ci4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/larcenygame/stone.ci4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/larcenygame/test32.ci4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/larcenygame/test32Inverted.ci4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/larcenygame/testActor.blend
Binary file not shown.
Binary file added assets/larcenygame/testActor.glb
Binary file not shown.
Binary file added assets/larcenygame/testActorGuard.glb
Binary file not shown.
Binary file added assets/larcenygame/testObjective.blend
Binary file not shown.
Binary file added assets/larcenygame/testObjective.glb
Binary file not shown.
Binary file added assets/larcenygame/theKilogramObjective.blend
Binary file not shown.
Binary file added assets/larcenygame/theKilogramObjective.glb
Binary file not shown.
Binary file added assets/larcenygame/thiefCaught.mp3
Binary file not shown.
Binary file added assets/larcenygame/thiefEye.ci4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/larcenygame/thiefJump.mp3
Binary file not shown.
Binary file added assets/larcenygame/wallTest.ci4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,962 changes: 1,962 additions & 0 deletions code/larcenygame/larcenygame.c

Large diffs are not rendered by default.

127 changes: 127 additions & 0 deletions code/larcenygame/larcenygame.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
#ifndef GAMEJAM2024_LARCENYGAME_H
#define GAMEJAM2024_LARCENYGAME_H

#include <t3d/t3d.h>
#include <t3d/t3dmodel.h>
#include <t3d/t3dskeleton.h>
#include <t3d/t3danim.h>

/*********************************
Structs for the project
*********************************/

// Enumerator for teams
typedef enum
{
teamThief,
teamGuard
} player_team;

// Enumerator for collision channels
typedef enum
{
collisionAll,
collisionGuardOnly
} collision_type;

// The player struct, all info needed by guards and thieves go in here
typedef struct
{
bool isActive;
int playerNumber;
player_team playerTeam;
T3DMat4FP* modelMatFP;
T3DModel* model;
T3DAnim animAbility;
bool animAbilityPlaying;
T3DAnim animWalk;
T3DAnim animIdle;
T3DSkeleton skelBlend;
T3DSkeleton skel;
rspq_block_t* dplPlayer;
T3DVec3 moveDir;
T3DVec3 playerPos;
float rotY;
float currSpeed;
float animBlend;
bool isAi;
int aiIndex; // index of the AI controller, passed to all AI commands
float stunTimer; // stunTimer stops players from taking action while count is != 0
float abilityTimer; // cooldown timer for abilities
} player_data;

typedef struct
{
T3DMat4FP* modelMatFP;
T3DModel* model; // do not load models into this struct as they won't be tracked and free'd only pass copies of pointers
T3DVec3 effectPos;
bool isActive;
float remainingTimer; // self removing timer
float effectRotationY;
float effectSize;
} effect_data;

typedef struct
{
bool isActive;
T3DMat4FP* modelMatFP;
T3DModel* objectiveModel;
T3DModel* ringModel;
float objectiveRotationY;
rspq_block_t* dplObjective;
T3DVec3 objectivePos;
} objective_data;

typedef struct
{
T3DMat4FP* modelMatFP;
rspq_block_t* dplCollision;
T3DVec3 collisionCentrePos;
collision_type collisionType;
int sizeX;
int sizeZ;
} collisionobject_data;

typedef struct
{
bool didCollide;
collision_type collisionType;
int indexOfCollidedObject;
T3DVec3 intersectionPoint;
} collisionresult_data;

typedef struct
{
T3DVec3 camStartPos;
T3DVec3 camEndPos;
T3DVec3 lookAtStart;
T3DVec3 lookAtEnd;
float timeUntilNextKeyframe;
} cameraanimation_data;

typedef struct
{
cameraanimation_data* currentAnimation;
int currentAnimationLength;
int currentAnimationKeyframe;
float currentAnimationTime;
bool currentlyPlaying;
} animatedcameraobject_data;

/*********************************
Functions
*********************************/

// forward declarations
void player_guardAbility(float deltaTime, int playerNumber);
void player_theifAbility(float deltaTime, int playerNumber);

// returns the index of the first unused effect, returns 0 (overwrites the first one) if none free
int effect_getNextEmptyIndex();

void larcenygame_init();
void larcenygame_fixedloop(float deltatime);
void larcenygame_loop(float deltatime);
void larcenygame_cleanup();

#endif
20 changes: 20 additions & 0 deletions code/larcenygame/larcenygame.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

ASSETS_LIST += \
filesystem/larcenygame/map.t3dm \
filesystem/larcenygame/collisionSquare.t3dm \
filesystem/larcenygame/foxThief.t3dm \
filesystem/larcenygame/dogGuard.t3dm \
filesystem/larcenygame/dustEffect.t3dm \
filesystem/larcenygame/ringObjective.t3dm \
filesystem/larcenygame/diamondObjective.t3dm \
filesystem/larcenygame/theKilogramObjective.t3dm \
filesystem/larcenygame/guardStunHit.wav64 \
filesystem/larcenygame/guardSwing.wav64 \
filesystem/larcenygame/thiefCaught.wav64 \
filesystem/larcenygame/thiefJump.wav64 \
filesystem/larcenygame/objectiveTouch.wav64 \
filesystem/larcenygame/objectiveGradient.ia8.sprite \
filesystem/larcenygame/thiefEye.ci4.sprite \
filesystem/larcenygame/floorTest.ci4.sprite \
filesystem/larcenygame/wallTest.ci4.sprite \
filesystem/larcenygame/drozerix-poppy_flower_girls.xm64
Loading