- Lots of engine and script system work today. Cleaned up the entity system
internals and added some documentation so I don't forget how it works
- Fixed a few bugs in LispMax that made defining functions a pain. Also fixed
a bug where defining a listener would create a stack of script environments
instead of cleaning up after itself.
- Added a script interface for working with the map. Can get information about
the map and tileset, and also set individual tiles on the map.
- Exiting the current map now cleans data correctly, which means moving from
one place to another doesn't cause huge slowdowns.
- Added a few new console commands.
world for querying objects in the world
events for listing event listeners and
lisp for interacting
with the lisp script engine.
- Spent most of the day adding a script command to switch between
levels. Clearing entities and systems proved to be trickier, as some
entities are "global" (i.e. outlive the town/battle) and others
aren't. Thankfully the entity system supports grouping by name. Clearing out
orphaned components took some work too. It's been a while since I wrote the
entity system and it would definitely benefit from some cleanup.
- Likewise, clearing everything from the render system was a little more
involved than I originally thought. Again, allowing render requests to have
group names sped this up considerably.
- All that is left now is to clear out any dead script entities and make sure
there are no listeners hanging around.
- Added script functionality for adding and removing team members. Using
entity/components makes this quite simple to implement as the code only
needs to add or remove a "TeamMemberComponent" from the entity. Scripts can
also access this functionlity, so adding/removing team members via script is
simple too. The same setup is used for adding/removing inventory items, and
will also be used for magic, enemies and things like that.
- Fixed a couple of bugs with entity groups and cleaned up the entity system a
- Made some minor updates to the dev tools so they can be configured more
easily. It's now possible to specify build targets and file name patterns
that must be passed. For example, the target "build-images" could be run
when the changed file name matches "*.png".
- Built some small tools to listen for file changes. When a file is changed
the resource files get rebuilt and a message is sent to any listening
clients. The main game client has also been updated so it will reload the
resource database when it receives a "file changed" message. Things like UI
definitions and sprites can now be edited and reloaded into the game without
any manual steps being taken. It's pretty neat.
- FINALLY finished rebuilding and re-organizing how the status screens
work. This has been a complete pain in the backside and taken far longer
than I would have liked. The main sticking point were:
- Making sure things got animated in the correct order
- Giving and taking input focus to the correct screens/panels when needed
- Added some helper methods for clearing graphics added with the UI Builder
- Added ability to call a service method via Lispmax. Really low-level and
will probably break a lot.
- Updated status screen to load UI definition from disk and automatically
rebuild when the resource database is reloaded. It actually works.
- Created a helper service (UiBuilderService) for setting up graphical
elements from a resource file. It's incredibly basic but means most of the
tedious UI setup can be done via file and tweaked at runtime.
- Finally got menus and sub-menus working (somewhat) correctly. It's now
possible to view the team overview and move to an individual character's
status section. File this under "things that took waaay too long to do"
- Spent a lot of time working on backend data – character classes, weapon
classes and some basic team setup stuff.
- List of characters now shows correct data for all characters
- Removed some legacy script functions and cleaned up a few services.
- More work on status screens and menus. Taking much longer than I would like,
but the various bits of character information are starting to come together.
- Added a one second delay to the start of loading which speeds up the whole
process considerably when running in debug mode. No idea why.
- Script functions can now check their argument types and throw exceptions
that contain useful debug info (for a change).
- Status screen can now display a list of characters, and will clip character
boxes and scroll between them. This was much easier to do than I originally
thought due to the animation/rendering system in place. So something I did
actually saved me time for once.
- Started working on the status menu. Split each panel into its own section to
prevent it getting too complex.
- Story levels can now specify a script file. They can also hook into the
start, end and on-loaded events.
- Added a bunch of low-level script functions for setting component values. It
uses reflection so isn't that fast, but it's probably fine for tasks that
don't need to be speedy. More of a building block for inventory tasks etc.
- Fixed how Sweeper systems work, so entities now get cleaned up correctly no
matter what order systems were added to the World.
- Fixed a couple of appearance bugs (and created some new ones).
- Fixed the debug console so that up/down keys can be used to navigate between
- Added a signpost outside the weapon seller. This is the first new thing I've
added to the level since scripting was implemented, and it worked
perfectly. The whole thing is done in-engine, so required no code
- Designed all of the status screens in preparation for building them.
- Status screen now fetches character data from the World. Also add a
highlight border for when character is selected.
- Stories can now specify a startup file containing all entities that should
be spawned when a new save is created. At the moment this is used to setup
character data and initial items. As usual it's a little verbose, but it
- Stories can now listen for initialization and creation events, which allows
them to spawn the default entities required (usually the team and their
initial items). Not particularly happy with how it works, and may change it
to something simpler, but for now it works.
- Added the ability for stories to contain their own custom script
libraries. These are loaded at the same time as the content db and resource
- Planned out some new startup changes. Stories will need a way to initialize
things when the player first starts (such as setting the initial inventory
and character roster).
- Cleaned up various bits and pieces (as always). Still not sure why the
when macro is so slow, but sped up the script internals slightly.
- Added some more options to the text box, so it can now be positioned to the
left/right/top/bottom of the screen without having specify exact pixel
- Rebuilt how event-based systems work, so events can send a "target"
entity. This can then be accessed in the scripting system, so it's now
possible to have a door that can teleport any entity that touches it. It's
also much, much more efficient.
- Spent about an hour trying to track down a bug I /thought/ was about how
scripts were inherited from templates. Turns out the template file was
Windows encoded, and the script parser was treating the Windows newline
character as part of the symbol name. This is why it showed up only in the
base template and not the level entities (which is Linux encoded).
- On the bright side, now that's fixed it means the whole event system is
working correctly and teleporters can be defined in a few lines.
- Cleaned up some other buggy bits of code and removed some bits that aren't
required any more.
- Added a couple of new script helpers for working with lists:
random-list-item. This is used for the new
display-random-textbox function, which is used to make NPC's say random
- Rebuilt the build script to pack stories and resources more
efficiently. Building a story now takes under a second, as opposed to 30
- Added new "Properties" component
- Added script function for getting an entity's property by name
- Found a couple of bugs relating to scripting environments. Partly fixed, but
%self% is still not working as well as it needs to.
- Update Pangolin.Events to allow object methods to be registered as event
listeners. This makes stopping and starting processes much easier.
- Added functionality for pausing and unpausing scripts.
- Added lisp helper functions for managing processes by ID. Might also allow
processes to be named, or maybe just store them as a global variable from
inside the script itself.
- Test run with one script suspending itself and then being resumed by another
- More work on getting the scripting system integrated.
- Split the script system into two parts – one for parsing and executing
scripts, and another for running background behaviours (such as making the
- The current plan is to have a few "top-level" script commands built into the
engine, and have the rest supplied through library functions. For example,
there are only two flag commands – one for getting and one for setting. The
rest is done using some helper functions (such as global-flag-equals? and
global-flag? for testing flag equivelance).
- Started work on getting new script system integrated with entities and
events. It's a little tricker than before, as scripts need to be parsed and
run in a script process.
- Started integration of new scripting engine.
- Added a really simple "shake" effect to shake the camera around. It actually
- Fixed a major bug with entity creation. All entities created in a stage
inherit from another object template, but because BlitzMax passes objects by
reference, building an object from a parent template would affect ALL
objects that inherit from it. In other words, if three treasure chests were
defined, they'd all be in the same position. Objects now clone their
parent's details so this no longer happens.
- Added really basic "speaking" effect to text in message boxes. The whole
thing needs rewriting, but it works for now.
- Fixed the teleport command to also move the camera
- Added a basic loading screen & progress bar.
- Changed story asset loader to use threads so the loading screen can work
in the background.
- Modified rectangles so the border can be rounded by a single pixel. Not
amazing, but makes the HP/MP bars look more Shining Forcey
- Fixed a movement bug that allowed the player to glitch through walls if they
pressed two directions together
- Automated animations working a little better. Not perfect (per-millisecond
animation not working yet), but can at least move things around the screen
without having to fuss around with state machines. Can either be done in
parallel or sequentially.
- Got a very basic team information screen up and running. Needs some
interaction and integration with the entity system, but it works.
- Cleaned up some of Pangolin's internal code
- Added a horrible fix for z-indexing bug. Player character now appears in
front of other entities instead of behind everything.
- Added some more information to the status screen – now displays the amount
of gold the player has (well, it will once that system is up and
running). Also displays a box for team status
- Started experimenting with automated ways to move ui-elements around on
screen (using "behaviours" / "robot functions"). Not working too great, but
- Added a new debug console command for listing all loaded resources
- Added more formatting options to Pangolin's text rendering – it now supports
wrapping and effects on the wrapped text.
- Added ability to load fonts as a resource, rather than hard-coding the
paths. Switched demo 5 to use fonts as a resource.
- Added a new "rectangle" request to renderer. Can now draw a rectangle with
an optional border.
- Started working on a new sub-screen for team management and statistics. It's
a little different from the standard Shining Force way of doing things, but
it gives a little more freedom and shows some previously hidden information.
- Updated bordered box to allow for custom background colour, opacity and
- Fixed bug with how sprite colours are set. This was supposed to allow any
sprite request to be tinted a certain colour, but wasn't setting the tint at
all. Correcting it surfaced another bug that tinted everything black.
- Cleaned up Pangolin's text rendering, so text can have shadows and be
aligned to the left, right or center.
- More code cleanup of systems. Cutting away unused & badly written
stuff. There's quite a lot.
- Modified scripting system so items can be put into a queue.
- Added a very basic text window that can appear and disappear.
- Cleaned entity systems to make use of Pangolin's newer features, such as
kernel awareness and automatic fetching of component type lookups
- Made a really simple teleporter gadget that can move the player from once
place to another.
- Found about half a dozen bugs, mostly involving the custom template system
or player movement.
- Modified camera behaviour class so it no longer uses hard-coded tile sizes
- Fixed trigger system to evaluate all triggers and then execute them. This
fixes a bug with treasure chests, where opening the chest would trigger the
"it's empty" message immediately afterwards
- Built a really simple tool for connecting to world servers and
sending/receiving test messages
- World Server no longer kicks a client after making a ping request
- Server listener now calls overridable methods when a client connects and
- Server listener can now accept handlers assigned at runtime instead of
having to use a giant select/case block
- Fixed bug in Pangolin engine that would crash app if no camera was
- Removed dependencies on X11 from world server, so it can now run on a plain
- Added a bunch of tests to the new gateway server, mostly checking that the
token and server registration system works
- Cleaned up gateway server and extracted a lot of controller/model code into
- Gateway server can now assign tokens to valid users, and check that tokens
- Gateway server can now listen for world server connections, ping the server
and added them to the server list
- Moved Gateway servering ping into a Gearman task, to prevent server getting
locked up when a new world server connects
- Moved a bunch of old world server code into services
- Converted main server listener to a service so it now works properly
- Removed some dead test rendering code from the offline town screen
- Added very basic tooltips to town menu
- Added really basic argument expansion in trigger evaluation, so keywords
like "self.name" can be returned as their live value – useful for storing
flags based on an entity's name
- Moved treasure chest entity code into a new template file, so it can be
re-used in other parts of the level
- Selecting the "inspect" icon on the menu now triggers an inspect event for
the correct location