Skip to content

Release 0.1.0

Latest
Compare
Choose a tag to compare
@niss36 niss36 released this 30 Jan 16:13

Release 0.1.0

This first official release is intended to be a new starting point for the project. It comprises a large amount of new features, refactorings and bug fixes.

My intention is to enforce the Github Flow for future work, to regularly use Issues, and eventually set up a wiki.

This list is in no way exhaustive; a lot of minor changes, optimizations and bug fixes are omitted (mostly for clarity's sake, but also because there are so many that keeping track of them all was too much work). This is obviously something I want to make easier by adopting a more efficient, cleaner workflow.

Changes summary

Modularisation

The project has been divided into 8 modules (from most abstract to most concrete) :

  • The Core module : defines abstract superclasses, interfaces and utility classes, to be used throughout the whole project.
  • The Script module : defines a scripting language, to be used for custom interactions in Levels.
  • The Animations module : defines classes that manage visuals (Animations and Sprite Sheets) and related file operations. (Depends on Core)
  • The GUI module : defines a basic framework for Java FX user interface controllers. (Depends on Core)
  • The Game module : defines all of the basic behaviour necessary to the game. This includes Levels, Entities, Blocks, and so much more. (Depends on Core, Script and Animations)
  • The Level Editor module : an integrated Level Editor, bundled with the game executable. (Depends on Core, GUI and Game)
  • The Animations Editor module : a standalone program used to edit and view animations. (Depends on Core)
  • The Alientome module (the default one) : holds all default implementations, the default GUI and everything related to or needed by these. (Depends on Core, Script, Animations, GUI, Game and Level Editor)

GUI

Transitioned to Java FX (instead of Swing).
The game window now has a fixed size (720x480), to allow for better control over UI and game mecanics in general : the screen size is no longer a factor.

All displayed scenes are created with the Java FX Scene Builder, and there is a custom controller for each one. Cohesion is assured through a basic custom framework, relying on the StageManager class. It is responsible for ensuring scenes are displayed to the user, and can keep track of nested scenes by using a Stack.

This has many advantages compared to Swing, but at the cost of visual customisation, which seems quite complicated at the moment but will be taken care of in the future.

See commit 920aa37

Scripts

A custom scripting language, intended to provide interactivity to Levels.

The syntax is loosely inspired from C-like languages. However, the functionalities are very limited, with no support for variables, loops or conditionals. Their implementation is not planned at the moment : the current usage, allowing only built-in functions, is sufficient as it stands. This does not exclude expansion in the future.

See commits c216e0c, ebc738c and 28012b8 for more details

New file formats

Custom file formats for levels and animations.

The level format is actually a disguised .zip archive, containing XML files and other supporting files (such as background images). See class CompoundLevelSource for details.

Animations are encoded as a data stream, in a specific order. See class AnimationReader for details.

Gameplay

Multiple gameplay changes, including changes to blocks, collisions and abilities.

Changed the way block collisions are handled, to account for :

  • Internal edges : when a collision was detected with the corner of a block in a way that pushed the entity on the horizontal axis, without considering if there was a solid block in this direction. This is now fixed, without altering other behaviour.

  • Custom block collisions, allowing, for example, slopes and one-way platforms

More generic handling of abilities, for both enemies and the player.
Allows for custom actions and visuals to be synchronised, and includes options for cast or cooldown times.

New abilities for the player :

  • A quick, melee attack using retractable phantom claws, that deals moderate damage and slightly knocks back enemies. Assigned to the "special1" control. Can be used continuously (cast repeatedly, without interruption) by keeping the key pressed. It is still possible to move during the cast time

  • A dash used by double-pressing either movement key. It makes the player accelerate more than he normally would, and makes it immune to gravity for a short period of time, during which its direction is locked. Has a 33 game ticks (1 second) cooldown after the dash is completed.

  • The original, ghost ball-throwing ability is kept along with its charge mechanic. Instead of the original animation, the player will now generate particles in a small circle, that move towards its head's center when charging, and away from it when fully charged. The cooldown is kept at 33 game ticks (meaning about a second), and a status bar representing this cooldown value hovers above the health bar.

Projectiles now (more or less violently) knock away the Entity they collide with.

Added spikes blocks, that instantly kill any Entity falling (or stepping) on top of them.

Ghost balls explode on impact, leaving a burst of (harmless) particles.
The Wizard's healing spell now leaves more visual feedback to the player, by generating green cross-shaped particles on healed entities.

Level Editor

A fully-integrated level editing interface.

Key features :

  • Creating, loading and saving levels.
  • 3 tools :
    • The mouse, to select Entities or Script Objects and edit individual properties (More on that later).
    • The pencil, to 'draw' using Blocks or Entities, according to which tab is selected.
    • The eraser, to delete Blocks or Entities, according to which tab is selected.
  • The latter two support rectangular selection, by pressing Shift while dragging the cursor. This may or may not be appropriate for Entities (Produces quite ridiculous results)
  • Only one Player may exist in the level at any time. It represents the starting position in the level.
  • Trying to add another player deletes the last one.
  • Support for Entity Tags, which can specify a bunch of parameters for Entities. Currently supported :
    • Starting Orientation (Left or Right)
    • Pixel-wise starting offsets (Offset from the position that puts the Entity at the center of its block)
    • Starting health and maximum health : 'health' and 'maxHealth'
    • A custom name, used when the Entity is referred to through Commands. (May or may not be used for in-game display in the future) : 'name'
    • AI-Specific parameters, such as 'followRange', 'fleeRange', 'shootRange', and many others. Those are not used by all Entities; an exhaustive list may or may not appear in the wiki at some point.
  • Support for Script Objects and their properties :
    • A Unique ID (To enable and disable other scripts with their ID)
    • Bounds (The trigger area, in which Entities activate the script)
    • An affected class (The type of Entities that may activate the script)
    • The content (Meaning the actual script code, in the custom language)
    • Whether the script starts as enabled or not (Disabled scripts can't be activated)
  • Support for the level background :
    • Allows for an arbitrary number of layers
      • Each layer is composed of one image, has a name, and two coefficients.
      • These coefficients determine how sensitive to movement the layer is, in each axis (x and y)
      • This allows for parallax effects, simulating a sense of depth.
    • Two global parameters (that apply to all layers) : Scale and Y Offset
    • Scale is self-explanatory : a positive integer that can be used to upscale the image, for a more pixelly-look.
    • Y Offset is more obscure. This parameter has to be guessed from trial and error; it is used to ensure the background is properly located on the Y axis, instead of being way too high or low.
    • An animated preview is available. It shows all layers, scaled at (scale/2) and can be used to determine if relative movement between layers, on the X axis, seems right. It is obviously also necessary to try it out in the game, as the speeds are not the same.

When the level is ready to be played, it can be done immediately by pressing the Level/Play menu item (Or pressing Ctrl+P). This does not require having saved the level anywhere to work. The level will be transferred to the main window, and will be playable from there, as any regular level would.

Commands

Commands are back, and while the GUI for them currently is atrocious, they work quite well.

Selectors

Selectors are a type of command argument that specifies an Entity, or a set thereof. At the moment, their options are limited. However, it is planned for them to be able to select entities based on their type or other parameters.
Currently, their syntax is the following :
The 'at' symbol (@) followed by one of the letters ('p', 'c', 'a'). These stand for Player, Controlled and All. The @p selector will always return the player; similarly, the @c always returns the currently controlled entity; finally, the @a selector refers to all of the level's entities.
Optional arguments, enclosed in square brackets ('[' and ']') may follow. These contain a comma-separated list of key-value pairs. Currently, the only supported argument is the entity index in the level's list. A short-hand syntax is provided : as first argument, the 'index=' part may be omitted.

Available commands :

  • /tp : teleports an Entity (by default, the command's sender) to either a set of coordinates, or another Entity.
  • /fly <on|off> : toggles 'fly mode' : in this mode, the Entity is not affected by gravity and can freely move up. However, as there is no 'move down' control yet, it cannot go down. (...)
  • /setCamera : sets the level's camera to that of an Entity (specified by a Selector).
  • /setControlled : same as setCamera, to set the level's controlled Entity.
  • /heal : heals selected Entity/Entities by a specified amount. If no Entity is specified, the command's sender is healed.
  • /damage : same syntax as heal, does the opposite effect.
  • /kill : same syntax, you guessed the effect.