The last inventories thing I needed for 0.3.3: adaptive formatting (an extreme example). Each inventory item is assigned a group (left, middle, right), and it does its best to figure out how to format everything in a sensible way that doesn't jump around too much and doesn't overlap. I had to be careful not to end up with a 1996 html table renderer!
It's possible with the new inventory system to display the capacity of an item (e.g. empty slots for up to 5 potions), to draw different icons for wielded or carried, and to draw different icons depending on how much ammo each one has.
To handle 1p vs multiplayer inventories, you can tag animations with context information -- how many players should exist for them to be displayed and with which attributes. For example, a single player inventory might show a row of potions, but when playing multiplayer it might be displayed as a single icon with a number to save space.
There's not long to go before 0.3.3 -- just a few microscripting details and converting legacy cartridges over to the new system on load. 0.3.4 will be a smaller follow-up, so let me know if there's something you're hanging out for, and I'll see if I can bump it up, or make sure it will be possible with Lua scripting later on. Things that were recently mentioned and are already confirmed:
- pico-8 music tracker and music triggering (and some new music!)
- custom inventories with selection and/or button bindings
- inventory microscripting (check for number of arrows in a quiver etc.)
- items that share the same ammo (e.g. all spells cost MP)
- id duplication and aliasing bugs after copy/paste
- fixed density allowing actors to sink in liquid
- scroll-wheel zoom, mb3 camera movement , alt-click mb2 emulation
- fixed total playtime bug for speedruns, made restarts faster
There are a few things that are wishlisted, but might be better suited to Lua scripting later on:
- player selection menu
- separate inventory menu
- assigning chase targets to monsters (for waypoints or making snakey monsters)
- arcade style lives
The general strategy for developing Voxatron's toolset is to provide specialized features (modifiers, microscripting, physics properties etc) that capture 90% of a typical designer's requirements, and then leave the rest to Lua scripting. Lua will be kind of like a glue that that holds the engine together and fills in the gaps of functionality.
Working on custom player inventories and menus that have a plethora of possible requirements, I feel I've hit that 90% boundary. The engine is now complete enough that it is possible to create a Lua API that is grounded in something stable and maintainable. For this purpose, I've created a text editor that can be used within Designer, and a custom version of Lua designed to work efficiently with Voxatron (both of which you can see in action in PICO-8). It's time to (carefully) plug everything in and see what happens!
It will also be possible to write cartridges from scratch in Lua, of course. This would be handy for making games that need their own style of physics, or things like RTS, sim or puzzle games that deviate a lot from typical Voxatron shooty-runny things. The purest cartridge can contain simply one Lua script, and no rooms or object definitions.
If all goes well, I'll start to roll out a minimal API later next month for anyone to experiment with. It is a typical object-wise callback scheme, where things happening in the world/engine call Lua functions that the cart designer provides.
Here's a simple example:
This is a regular twirly gun using emitters to shoot out the bullets. I've attached a script to each bullet (it's just a SCRIPT item that sits anywhere in the bullet's resource tree) that looks like this:
local a = new_bullet()
a.col = 12
local x,y,z = a:xyz()
Every time a bullet is created, the new() function is called (if one exists), and some Lua data (a table, to be precise) is attached to that object. Now, any time something happens to the bullet -- it's moved or drawn or collides -- a corresponding function is called. Here I've only provided a single function that is called by the engine each time the bullet is drawn which grabs the bullet's world position and draws a line straight up.
If you're new to programming and want to get a head-start, I would suggest playing around with PICO-8, which is free for all existing Voxatron alpha users (including the earlier Humble Bundles). Have a look at the Updates Page for download instructions.
Incidentally, I am relatively new to Lua scripting myself! So if you have any feedback or questions about Voxatron scripting, feel free to post here.
Note that PICO-8 is available to all Voxatron alpha users (including bundle customers). You may need to activate your account, or log in via email if you don't have a username/password already set up.
I'm doing things a little out of order here.. a full introductory post to PICO-8 will follow in a bit for those who haven't been around lately, but for now here's a rundown of new stuff in 0.1.1..
1. Gif saving! Press F9 to save the last 8 seconds (or F8 to set a starting point if you wish)
2. Token counting.
Instead of limiting cartridges to ~15k of ascii text, the primary limit is now 8192 tokens. I say primary limit, because the character count still stands, but is now 32k -- in practice the token limit is almost always reached first. There is actually also a third limit when saving cartridges -- the code must compress to the original 15k allocation. Exceeding this is extremely rare and you can probably ignore it! To get the status of your program, use the new INFO() command.
There aren't currently any cartridges that I know of that go over 8k tokens, and in general this change will give you around 20~30% more space.
3. Freeform sprite and map editing
You can now zoom out with the mousewheel and pan around using space. There is also a more traditional selection tool (you can use cursors to move the selection around). See the manual for more details.
4. New api functions
By popular demand, sqrt(), atan2() and sub() have been added.
atan2() follows the convention set by cos() and sin() of flipping y so that angles increase anti-clockwise in screenspace and reach a full circle at 1.0. So atan2(0,-1) is 0.25
To grab the length of a string, you can use the now-fixed # operator (#s) and grab individual characters with sub(s,pos,pos)
5. More palette control
Palette mapping now applies to all draw operations (note: there is a tiny bit of palette weirdness for existing carts because of this)
Also, you can specify which colours spr(), sspr() and map() should treat as transparent using palt()
palt(1, true) -- don't draw any dark blue pixels
6. Better saving, loading and re-loading
You can now quick-save with CTRL-S. Saving over files, or quitting without saving causes a backup to be saved in [pico-8 home]/backup.
When loading a .png, you can now omit the ".p8.png" and pico-8 will check for it.
Using CTRL-R will automatically reload the cartridge if no changes have been made (making it easier to work with external editors for heretics).
Thanks so much to everyone who has given suggestions and shaped the direction of this project. I'm really happy with the way token counting in particular has worked out, but the proof will be in the pudding! Let me know if there are any show-stopping problems that should be nipped in the bud, and I'll include them in a bug-fixing update next week (that will also hopefully include keyboard mapping & broken Yosemite mouse fixes).
Added: Token-based code limiting (8192 tokens, 32k ascii text)
Added: Freeform move, pan and selection in sprite and map editors
Added: Flood-fill tool (sprite and map)
Added: .GIF saver
Added: CTRL-Stamp to stamp with transparency
Added: Single-step undo for map and sprites
Added: 2x2 brush
Added: sqrt(), atan2()
Added: CTRL-S to quick-save
Added: CTRL-R reloads .p8 file and runs (useful for external text editing)
Added: Automatic backups on overwriting or quitting without saving
Added: Scroll wheel zooms in sprite editor
Added: Customisable resolution //  e.g. pico8 -width 580
Added: Strings highlighted as green
Added: ALT-click can optionally simulate right click (see config.txt)
Added: palt() to control transparency for spr(), sspr()
Changed: load() tries adding .p8.png, .png if file doesn't exist
Changed: Draw operations apply only to selection when active
Changed: Move operations (cursors) apply to selection if present
Changed: Removed time()
Changed: Random seed is random on cart startup
Changed: api functions never read directly from cart rom
Changed: sspr() can take negative values for dw, dh
Fixed: Sparse table indexing with integers fails
Fixed: Assignment operators and shortform if-then-else failing
Fixed: sspr() failed when w0 == 128
Fixed: Circle drawing broken when camera not (0,0)
Fixed: CPU hogging
Fixed: Noise instrument clobbers rnd() sequence
Fixed: Audio system not resetting on program reset
Fixed: % operator sometimes wrong for negative values
Fixed: Length operator (#)
Fixed: Power operator (^)
Fixed: Line clipping bug on right and bottom edges
Fixed: print() precision for whole numbers
Fixed: print() broken for negative y values
Fixed: tokenization and keyword highlighting
Fixed: sprite properties not copied/pasted
Fixed: Only sfx 0..32 could be used as music patterns
Fixed: Saving and loading a .p8 file adds newline to end of code
Fixed: Drag selection to left margin in code editor -> selects all
So you may be wondering what I've been up to for the last 4 months or so, and I'll post all about that very soon! v0.3.3 has required a lot of general housekeeping work including improving the player inventory system to function nicely with world state saving, scripting and controls. As a result, it became a good opportunity to also squeeze in weapon switching and custom HUDs.
Here's the design I have -- please feel free to comment and criticize -- especially if it looks like it won't carry ideas for carts you'd like to make soonish.
Here's an example HUD that shows a single player carrying more than one weapon (switchable with Q/E or shoulder buttons):
The basic idea is to add an animation to INV_ITEM similar to the ones that exist now for arcade weapons, but to allow adding *any* inventory item to the hud, including things like potions that are activated with an alternative button, or temporary pickups like the score multiplier.
The items only have limited information about how they are to be displayed up top -- the layout happens mostly automatically. But certain common item meanings (score, life, player head) are tagged as such to help make a sensible layout.
The layout is performed in single player by separating elements into up to 3 groups and aligning then left, then right then center. Multiplayer layout is similar, but elements are squashed together and layed out per-player.
The goal here is to provide a simple way to make inventories for common genres, without requiring lua scripting or a lot of work doing layouts that work both in 1P & 2P. Later on, fancy HUD requirements can be taken care of in Lua scripts (more on that shortly!).
So, the steps to make a custom HUD will be:
1. Add (or alias) any inventory items (INV ITEM) that the player should start with. // e.g. start with a bow and 8 arrows
2. Add animations to inventory items that should be shown in the HUD
3. Tag some inventory items as having a special meaning: score, lives
It will still be possible to use the old arcade HUD that you're all familiar with, but not to mix-and-match the two systems.
So, here's the question -- are there any simple HUDS you'd like to use that don't seem to work with a scheme like this?
Here are some examples that I think will be ok:
Doom: Score, life, current weapon & ammo
Bomberman, Bloot: Player heads with points won in a single row
RPG: armour & weapon, MP, HP, Gold
Adventure: List of collected objects
Scrolly Shooter: lives, score, panic bombs // lives logic not yet implemented
Voxatron 0.3.2 is now up on your games page or Humble download page (check the version number on the file). This is another bug fixing update, recommended in particular to Windows users as the 0.3.1 package was broken and still included 0.3.0's save game bug o( _ _ )o.
Added: Monsters to default resource tree
Fixed: (Windows) save games broken
Fixed: WORLD:RANDOM not selectable trigger
Fixed: Can not deselect aliased objects by clicking
Fixed: Favourites sometimes not saved
Fixed: Custom pickup score does not respect bonus multiplier
Voxatron 0.3.1 is now up on your games page or Humble download page (check the version number on the file). This is just a quick bug-fixing update, but is highly recommended as game progress saving is broken in 0.3.0.
Fixed: Save games / checkpoints broken when Voxatron is clean installed o_O
Fixed: Sticky joystick buttons and sticks making menu navigation impossible
Fixed: Object references break when loading .vob.png
Fixed: Able to edit internal items from toolbar object button
Fixed: SYSTEM:BUTTON doesn't work when player 1 doesn't exist
Fixed: Bullet life shown even though meaningless (use DURATION instead)
Fixed: Corrupt internal music item at end of list
Fixed: 2d png importer crashes for files larger than 128x128
Fixed: Default pickup sound plays even when default_sound flag is 0
Fixed: Pickups can not respond to life <= 0 event
Fixed: HURT event triggered when player life increases
Fixed: Monster entry stops after P1 dies in 2-player arena
Fixed: Grenades damage indestructible walls
Fixed: Placing room objects resets properties each time
Fixed: 2-way doors facing in the same direction causes crash
Fixed: Bullets hurt player even when hurt_same_team flag is 0
Voxatron 0.3.0 is now available! You can grab it from your games page or Humble download page. The largest changes you'll notice are a 2P arena cart, a whole new cart called Bloot (4-player!) and a sound designer that you can see a glimpse of in the trailer (it's shared with my other fantasy console, PICO-8, which is a kind of subset of Voxatron). Try Bloot to see what kind of sounds you can make with it.
On the more technical side, there is now support for aliased objects, which means you can make references to objects from different folders. This is useful for things like making shared properties between actors or dropping random loot. Tutorials on how to use this are on their way :)
If you'd like to try making a multiplayer cartridge, just plonk more than one player into a room and they will automatically be assigned controls to a human player in order (P1, P2..). Note that you'll need to set up controls in the options menu for each player, which can currently be keyboard, keyboard+mouse, and up to 4 joysticks. Note that each player needs to have a separate definition (you can't currently two DJ Beeps for example).
Finally, as some of you have discovered already, it is now possible to freely play any BBS cart right in your browser. This means that cart designers can share their games with people who don't own Voxatron, and gives a handy way to preview carts without leaving the forum. I'm hoping that this will encourage users to post and share more stuff, and will serve as a way to introduce more people to Voxatron.
Check out the Development Map to see how all these features are going to fit together. Coming up next is switchable inventory items, making RPGs and Doom-style inventories possible.
If you find any bugs, feel free to post them in the comments. I saw the save game issue and the sticky 'up' button bug preventing menu use (*ugh*), and will make another small update soon to address these.
Thanks for playing, and I'll catch you in the forums!
Update: I uploaded some fixed .deb installers for Linux that are also live on Humble for anyone who had trouble with this.
Update 2: There's a nasty bug that prevents saving if you clean installed Voxatron. I'll patch it soon, but until then here's a workaround.
Added: Pico-8 sound editor
Added: Item aliasing
Added: Random alias selection (for loot dropping etc.)
Added: Low camera angle
Added: M-STATE:C-CRASH event caused by actors colliding at high speed
Added: Bullet flag collide_with_sender
Added: 2d png importer
Changed: Debris and snow no longer settles underneath actors
Changed: Friction applies to objects bouncing in z
Fixed: Tiling actors in editor use incorrect spacing
Fixed: Life less than zero trigger not activating before actor does not exist
Fixed: Actors with negatiec gravity do not lift off the ground
Fixed: Item id corruption after pasting from another file
Fixed: Cart profile saving (favourites, game_in_progress)
Voxatron 0.2.13 builds are now up, and will shortly be up on Humble Store (check the version number in the filename). If you don't have a lexaloffle account (Games > My Games) and would like one, you can activate it from your humble store page (see this thread). To update from a Humble Store account, search your email for the download page link, or request a new one here.
The main two changes in 0.2.13 are much more flexible player control options, and moving to SDL2.
The default player control style is now analogue, which means that you can run and shoot in any direction! This will eventually be an optional property of players, but for now I decided it doesn't badly break the design of any existing cartridges so set it as default. This means the mouse control style can be more natural -- using ASDW + the cursor as an absolute point to shoot at.
Many users asked for this early on, but I stubbornly held out with a more minimal 8-way control set, wanting to keep the controls across games more simple, genre-agnostic, retro-feeling and unified. I was really, really wrong about that! -- it doesn't hurt to have analogue control in the vast majority of cases (even though existing carts weren't design for it), and it of course makes hardcore arena shooting much more fun.
It's also possible to assign buttons to various actions in the player designer, but more on that soon. (For a preview, check out the list of button actions in the player controls setup menu).
SDL is the core library that Voxatron uses to do operating system-level things like window management and to talk to hardware (controllers, sound and video). SDL2 provides better controller configuration, multi-monitor support and doesn't crash on startup under recent versions of OSX (!) It also means I've had to change quite a lot of historically stable code, so there might be a few small glitches in this department for the next couple of updates.
SDL2 has quite a nice controller configuration scheme, where many common controller layouts are automatically detected on startup and a best guess at the layout is made from a database supplied from other users (including a large number of Steam users). It's possible to add extra controllers or alternative mappings using the standard SDL2 layout syntax by adding a line sdl_controllers.txt (see vox.txt for details), rather than using the in-game config in earlier versions. This might cause some disruption for a few users, but should make controller setup much easier and more consistent in the long run.
** Linux users: The linux installer doesn't give you SDL2 automatically, so please either manually install SDL2 (http://www.libsdl.org) or wait for a follow-up update next week that will hopefully fix this.
Added: Analogue player movement and facing control
Added: Custom control mappings per player
Added: Inventory items assigned a useage button
Added: Transparent voxel rendering in Designer
Added: Cartridge metadata section with 2d 60x32 label
Added: Capture cartridge preview image in-game (F7)
Added: default_sounds flag for actors
Added: car-style control (turn left, right, accelerate)
Added: Low air friction flag in actor properties (on by default)
Changed: Moved to SDL2: better multiple monitor support, controller support and fixes OSX startup crash
Changed: Game controllers now customisable sdl's scheme (~/.lexaloffle/Voxatron/sdl_controllers.txt)
Changed: Control configuration format and default config values // camera is now O, P
Changed: Any actor now has low air friction after being thrown
Changed: Mouse control now uses absolute cursor position to determine player facing
Changed: Players have warp-in flag
Changed: Better 2d drawing for depth==1 props
Fixed: Duplicate object instance ids when dragging to draw multiple objects or stamping
Fixed: Internal pickup friction and mass
Fixed: Loading and saving a cartridge clobbers existing preview image
Fixed: Throwing using directional controls
Fixed: Import .xm file now fails gracefully for unsupported files (> 128k or > 8 channels)
Fixed: Jumping twice quickly causing annoying jump sound retrigger
Fixed: Actors not observing warp-in property at t=0
Fixed: Legacy default player starting position sometimes not at center of room
Voxatron 0.2.12 builds are now up, and will shortly be up on Humble Store (check the version number in the filename). If you don't have a lexaloffle account (Games > My Games) and would like one, you can activate it from your humble store page (see this thread). To update from a Humble Store account, search your email for the download page link, or request a new one here.
Another update for folks designing stuff.. doors, Designer performance, .qb file importing, object instance browsing and title screen support. As usual earlier carts should still function roughly the same, but let me know if you notice any breakage. If there aren't any show-stopping bugs, I'm going to work on getting the manual up to date and posting some tutorials, but for now here's a quick intro to new features..