If one interval were completely contained within another then the logic would
not correctly identify the overlap. Instead check the length of the intervals
and ensure the smaller interval of the two is compared against the larger one.
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.
We need to generate interim vertex points during the collision detection loop
that includes rotation to check for collision. During collision detection,
vertex points are rotated and positioned in placed for checking.
We also re-create this vertex list in the renderer suggesting that we could
cache the list in the entity or look at coupling rendering and collision
detection.
Fundamental mismatch between rotation and offset of polygons. Polygons can be arbitrarily ordered in terms of vertices as long as they are in a CCW order.
However there should be no restriction on the starting vertex position.
Since this is the case, the entity offset for a polygon should offset from the
starting vertex to the perceived "entity origin". This entity origin is where
collision detection, rotation and movement is based off.
Occasionally with the right orientation, degenerate triangles will appear as
they are no longer zero-area triangles which OGL can cull during rendering. The
issue comes from having to manually ensure each primitive in the rendering
pipeline sent to the render groups were correctly marked with degenerate
vertexes.
Instead, we can now just pass the vertex points straight through, using
a begin() and end() structure which will append the start and ending degenerate
vertexes for us.
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.
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.
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.
Premultiply transformation matrix onto vertices before sending onto GPU to
preserve transformation properties of entities before being batched into
a general group. This removes the model matrix from the shader pipeline- instead
in rendering code we deal in world space (which works out to be more intuitive).
Only in the last step in GLSL we convert back to normalised coordinates.
Incorrect assumption that strings only needed degenerate vertexes at the start
and end of each string instead of characters causing render "wings" between
separate strings.
Fix render-group not switching to next group if current group is full.
Degenerate triangles allows a single triangle strip call to be called on
multiple independent triangles without "connecting" strips inbetween the
triangles.
Render all entities with the same texture in one call. Currently only
implemented for humanoid entities. Since we are rendering using triangle strips,
between entities there is invalid rastered data between entities. Using
degenerate triangles this may be mitigated, by indicating to OGL which triangles
it can skip in the rendering process.
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.
Parse input was computing irrelevant data. The function has been inlined
and extraneous computations in the function has been moved to the
appropriate locations.
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.
Begin switching over to using Rect instead of V4s for rectangle operations
for added semantics of pos and size, instead of 2 coordinate points. There
are more meaningful rectangle operations based on its position and
size. By providing that upfront it's more intuitive and convenient
than deducing size from subtracting two vector elements.
An attack spec will be used to hold the stats of both the attacker and
defender, grouping the data necessary to determine how much damage the
defender takes and other statuses caused by the attack.
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.
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.
On intermittent stop of OpenAL playback deleting the buffers without
unqueuing the current buffers is an invalid operation, causing invalid
audio states on alGetSource().
Audio can be played with 1 call, audio_beginVorbisStream which
encapsulates the initialisation of the renderer and release on finish.
OpenAL is quoted to have a limitation of around 32 sources. Audio
renderers hence acquire a source slot on playback and immediately release
on finish. This ensures that sources are held optimally and minimises the
possibility of saturating the available sources.
Renderers hold an index to the source list, which the index reveals the
source ID for their use.
Remove the use of beginAttack and endAttack in the entity update loop and
delegate all changes to entity through state switching. This
consolidates the flow of data in the loop more consistently by going
through one master function. This also minimises the number of
entry-points to functions that will update an entity states- for ease of
comprehension.
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.