Commit Graph

39 Commits

Author SHA1 Message Date
42ba86f05a Add ability to shoot and delete entities 2016-11-24 18:57:44 +11:00
614fa53487 Fix broken t-strip rendering logic
Triangle strips were originally by chance were rendering correct for most cases
until collision detection was implemented. Incorrect assumptions about
specifying triangle strip winding order meant that on occasion the last triangle
in a polygon would not be rendered.

This has been amended by strictly ensuring that on rendering of polygon the
order is correct from the vertices that are passed in.
2016-11-23 23:47:23 +11:00
064d17d34c Asteroid data merged to entity and display
Asteroids move and are a part of the entity sytem. Added some debug markers for
memory usage and fixed a bug in logic causing degenerate triangles to show up
depending on the angle of approach towards the origin.
2016-11-17 18:15:36 +11:00
21bf650298 Fix triangle rendering and wireframe 2016-11-16 13:00:59 +11:00
981d87a2d7 Add proper wireframe mode, rotation to triangle 2016-11-12 00:22:09 +11:00
4795fe1cb1 Switch developing game to asteroids, start project
Switch to something of smaller scope in aim to be able to finish a project from
start to finish. Also allow refreshed eyes to review the existing API and see
what can be improved on after taking a short break from the project.
2016-11-09 22:36:41 +11:00
332888f3b5 Switch mem allocation to custom memory block
No longer repeatedly invoke malloc for retrieving memory. Some operations still
leak memory (notably audio streaming). We introduce notion of Transient and
Permanent storage. Transient memory is used for data in memory that is
temporarily allocated (i.e. graphics for that frame's output), and permanent as
more like game state storage.

We now give out pointers from a pre-allocated block of memory, so we have no
allocation cost and benefits of reduced memory leaks. The transient block gets
reset every frame. Any memory allocated within is cleared at no cost simply by
rearranging the base pointer of the memory block.
2016-09-24 14:43:59 +10:00
85b757aaa7 Update debug display for render groups 2016-09-23 21:15:22 +10:00
7cb13b3cf8 Add additional entity struct data
Attempting to add child weapon data to an entity has revealed the need for an
entity origin to which children start transformations from. Worth exploring
scene graphs in the future.
2016-09-15 03:20:13 +10:00
5c4f493979 Add support for more attack-animations
Exploratory code to determine how to architect the engine for increasing
requirements in game play.
2016-09-14 01:34:57 +10:00
c93e6ca37c Pull out xml loading to assetmanager code 2016-08-30 00:11:00 +10:00
aa8590d585 Clean up memory usage of XML loading 2016-08-26 02:59:28 +10:00
cc874888cc Add spacing in debug display stack, center all button text 2016-08-20 14:24:42 +10:00
801107908a Add toggle debug display button and config entry 2016-08-20 14:18:05 +10:00
90068d2c64 Add string length in pixel func, add button label 2016-08-19 00:25:43 +10:00
5cd7239c8a Switch rendering to xy bottom left, zw top right 2016-08-17 17:35:31 +10:00
db1eb7b9f3 Switch over to rect vs v4 where appropriate
Main change is switching the camera to use a rectangle. There is no rect
change in renderer for grouping size and position together. Due to
noticing the use case of rendering- where it's convenient to be able to
offset the rectangle from the position value when passed into the
function explicitly without having to re-create offset Rectangle structs
to pass in.
2016-08-04 22:17:14 +10:00
eb1962e05e IMGUI use data from Gamestate, fix pointInRect bug
Wrong if logic causing point-in-rect to be valid if only x or y is
valid, where correct logic is both x and y need to be within the rect.
2016-08-04 21:17:16 +10:00
aa505ed0b3 Remove input dependency on GLFW in game code
Create own platform abstraction for keyboard input for use in game code.
2016-08-04 18:19:02 +10:00
1900de6a92 Create event queue and start sorting entity list
Use event queue to decouple audio playback from the battle system. Switch
back to using begin and end attack within the entity update loop for
conciseness.
2016-08-03 23:20:03 +10:00
190822c1f6 Add entity attack audio cue 2016-07-28 22:17:32 +10:00
85becdfd6c Merge the game to dengine, reduce header coupling
Until engine architecture can clearly be separated from the game, i.e.
notion of entity storage belonging to game and concept of entity belonging
to engine, worlds/scenes belonging to game or engine- the project will
only refer to Dengine.
2016-07-28 15:19:23 +10:00
1427ee3fde Add draft audio change concept on mob proximity 2016-07-28 13:36:16 +10:00
9c3df0c488 Fix console rendering old strings, refactor audio
Removed duplication of audio buffering code in audio update and streaming
vorbis.
2016-07-27 01:40:22 +10:00
a43102ee26 Rotate targetting reticule to mob. Add pivot point
Notion of pivot point now for rotating, i.e. the anchor point at which
rotations are applied. Rotating the reticule is done by using inverse
trigonometry, namely atan2f.
2016-07-23 21:26:15 +10:00
358f850a2c Fixed wrong cross referencing attack to anim data 2016-07-22 19:29:12 +10:00
7b13615614 More corner case checks for battle interaction 2016-07-21 02:04:17 +10:00
2707c46df1 Add better support for multi-entity battles 2016-07-20 21:42:45 +10:00
3aaad2fba3 Add basic entity death code for singular entity 2016-07-20 02:23:11 +10:00
fd94eb5afd Mobs battle with hero, engine architect. changes
Mobs battle in real-time with the hero when in range. Start encapsulating
logic into entityStateSwitch() to organise entity properties changing
between different states.

Introduce basic concept of memory management in MemoryArena. Begin passing
around a memory object to track memory usage and eventually delegate
memory allocations through. Remove the old memory tracker in the debug
object and incorporate into engine primarily.

Add a debug console for logging information and events to the screen in
a console-like fashion. Debug is now initialised after the game, this is
so that you can pass the game's memory arena and font file to the debug
services. Debug services now properly initialise debug element positions
from this information and not through the update routine.
2016-07-19 21:19:26 +10:00
5fc58ca643 Create notion of state switching for entities
Encapsulate the process required to switch an entity from state to state
using a state switching function. Add extra minor debug markers.
2016-07-19 15:19:08 +10:00
fff9e6e5b2 Implement battle time bar attacking within range
The main debug drawing elements have been moved to debug.c to avoid
cluttering up the main game file. The downside is that thus far the debug
values only track values post-update.

We have a notion of begin attack and end attack to allow code to drive the
animation system and apply effects after an attack animation has
completed.
2016-07-18 22:02:47 +10:00
c52d872058 Basic attack queue implemented for hero 2016-07-18 20:16:29 +10:00
a426461dad Fix up include headers, try to reduce dependencies
Ensure that all headers are self-sufficient instead of relying on included
headers to include headers for execution.
2016-07-16 23:27:52 +10:00
86b4d1e206 Add distance to battle range metric in pixels 2016-07-16 02:34:44 +10:00
b1875077b7 Additional debug string rendering infrastructure
Separate notion of rendering a static string, i.e. for debug display that
is absolutely positioned, and rendering of a regular string that moves
with the game camera.
2016-07-12 18:11:31 +10:00
d82afe49d0 Add memory allocation tracking data to debug state 2016-07-09 21:42:36 +10:00
54ecddad2f Add function call counting to debug infrastructure 2016-07-09 20:59:54 +10:00
1f364f7024 Update debug data architecture and methods 2016-07-09 20:46:04 +10:00