{"author_link":"\/users\/dragonxvi","author_name":"dragonxvi","author_uid":"dragonxvi","comments":[],"epoch":1502481617,"event":"LD39","format":"md","ldjam_node_id":48747,"likes":16,"metadata":{"p_key":"100692","p_author":"dragonxvi","p_authorkey":"1013701","p_urlkey":"316402","p_title":"Charge! Devlog","p_cat":"LDJam ","p_event":"LD39","p_time":"1502481617","p_likes":"16","p_comments":"0","p_status":"WAYBACK","us_key":"1013701","us_name":"dragonxvi","us_username":"dragonxvi","event_start":"1501200000","event_key":"74","event_name":"LD 39"},"node":{"_collation":{"body_sanitizer":"TextUtils::SanitizeHTML via existing importer","event":"LD39","removed_author":false},"_superparent":32802,"_trust":3,"author":13701,"body":"![PICO-8_3b.gif](\/\/\/raw\/585\/3\/z\/8d91.gif)\n\nCharge! was my compo entry this LD39, and first go with an entry using PICO-8.  A sci-fi Roguelike where you scavenge derelict space stations for power, supplies and gear in order to warp towards your end goal.  It mostly worked quite well, with a few bugs and some slightly imbalanced combat.  Read on for some more look at how it was made!\n\nYou can play it here: https:\/\/ldjam.com\/events\/ludum-dare\/39\/charge\n\n---\n\n## Brainstorming (+ Sprites) ##\n\n![LD1.png](\/\/\/raw\/585\/3\/z\/8d92.png)\n\nFirst thing I tend to do start whipping up some graphics, usually some basic sprites + tiles.  During this time I'll also be fleshing out how the game will play.  Here you can see the basic player, map tiles, collectable items (including the eventually unused 'Oxygen' tank) and enemy design.  It's not much to start with, but it's enough to start working on the main game systems, which initially mostly involved procedural map generation...\n\n\n## Roguelike Map Generation ##\n\n![PICO-8_0.gif](\/\/\/raw\/585\/3\/z\/8d93.gif)\n\nAnyone familiar with http:\/\/www.roguebasin.com or even Roguelike map gen knows there's loads of ways to whip up a map depending on what you're after.  The method used in Charge! is fairly simple, and based off the one described here: http:\/\/www.roguebasin.com\/index.php?title=Dungeon-Building_Algorithm\n\nBasically the steps are:\n1. Start with a NxN sized room - check if isn't overlapping other rooms and if it is, bail and try again.\n2. Mark all the tiles with the NxN square as a floor, and the surrounding ones as walls.  Particularly, horizontal and vertical walls are named as 'Frontiers' - somewhere we could potentially add a connecting room. Also have a notion if which 'direction' this frontier is leaving the room from.\n3. Select a random frontier tile from our list - this is where our new room will start - and repeat step 1.  We'll also put a door at the frontier tile used, and remove it from the frontier list.\n\n![PICO-8_1.gif](\/\/\/raw\/585\/3\/z\/8d94.gif)\n\nBasically keep doing that till we have a bunch of rooms.  We can alternate what tiles to use depending on what type of room it is, and even the size - Charge! has a special 'Corridor' type which is just a long, thin room, and several main rooms which mostly just have different flavoured tiles.  Once we've got the requisite number of rooms (larger 'map types' have more rooms) we place the 'Hanger' room last, and then we populate the map with stuff.  This mostly involves picking floor tiles to drop enemies, crates and other random bits and pieces - most of which are determined by how far you've progressed through the game and what 'map type' you've specified (i.e. Habitats are large and the loot table prefers food, Military bases always have equipment etc.)\n\n\n## Field of View ##\n\nA lot of the tension of Roguelikes aside from everything trying to kill you, is that you can't always see what's around the corner that will try and kill you.  To implement this, we use a classic FoV technique where we take all the tiles around you within a set range (say, 5 tiles), and from the player we try and draw a line between that tile and the player.  If the line reaches the tile without hitting anything solid (or at least 'clear' so we can have solid walls that behave like windows), you can see the tile.  If not, it's obscured by something and we stop at the tile we hit.  This relies on a classic line algorithm called Bresenham's Line Algorithm, which you can read up on http:\/\/www.roguebasin.com\/index.php?title=Bresenham%27s_Line_Algorithm\n\n![PICO-8_2.gif](\/\/\/raw\/585\/3\/z\/8d95.gif)\n\nUsually, you also don't get a 'fog of war' version of the map until you uncover the tiles initially, but to keep the game a little more fair, you're given hints as to the general layout of the ship and the location of doors.\n\n\n## Enemies and Combat ##\n\n![PICO-8_3.gif](\/\/\/raw\/585\/3\/z\/8d96.gif)\n\nEnemy AI was fairly basic - I didn't get time to implement any pathfinding - so the basic AI for the 5 enemy types is as follows:\n- **Blobs**: Just bounce back and forth\n- **Hackwings**: Step to a random adjacent tile.\n- **Turret**: Stands completely still - only attacks if you're standing beside it.\n- **Zydd** and **Gizoid**: Wander like Hackwings unless the player can see them, then move towards the player.\n\nThe latter AI there attempts to do something a bit smarter, but 'Move towards the player'  just forces them to move as the crow flies, meaning they get confused by windows.\n\n![PICO-8_0b.gif](\/\/\/raw\/585\/3\/z\/8d98.gif)\n\nThe above was an early attempt at the 'Gizoid' enemy, which originally was stationary but would duplicate itself to surrounding tiles, spreading throughout the station.  This.... had some balance issues and ground the game to a crawl, so I quickly re-purposed them to something a little more basic :p\n\n![PICO-8_5.gif](\/\/\/raw\/585\/3\/z\/8d97.gif)\n\nCombat is fairly simple, and massively unbalanced.  As with standard Roguelikes, you take your turn - the enemies take theirs.  Combat is resolved by trying to move into a square something else is already on, and mostly involves some random rolls against a 'To Hit' chance, and then damage is inferred by Attack - Def.  It's basic, and it results in some \"You took 0 damage\" nonsense which I'd probably limit so 1HP is the minimum possible damage instead of 0, but it worked reasonably well.\n\n\n## And the rest ##\n\n![PICO-8_1b.gif](\/\/\/raw\/585\/3\/z\/8d99.gif)\n\nWith the set of gear, collectables to fill meters back up, and enemies, I had everything needed to start working on how the game would progress.  Ultimately there's an internal 'Level' that jumps up each time you change map, and this unlocks new enemy types as it increases.  Each map type also defines a set of rules as described above, and generally larger, more rewarding maps will cost more power - the resource that also counts down over type as you navigate.  There's also an incredibly unbalanced 'Loot Table' system that determines the contents of crates depending on the map type you're on which was quite fun, and pretty easy to implement (if a bit messy in code).\n\n\n## Post mortem ##\n\n![PICO-8_3b.gif](\/\/\/raw\/585\/3\/z\/8d91.gif)\n\n### What went well ###\n\n- A basic but functional game!\n- Map generator held up fairly well (most of the time...)\n- Pico-8 pretty fun to work in (in-built gif recorder certainly helped!)\n- Reasonable sense of progressing difficulty\n\n### What didn't really work ###\n\n- Game balance is a bit all over the shop:\n-- It's fairly easy to gather enough power to skip the last several maps if you stick to solar stations\n-- Certain gear is so massively overpowered (rifle, heavy armour) that if you're lucky enough to get it you've basically won\n- Didn't get to implement 'Tech' - special equipment which would consume Power to do cool stuff like Emergency Teleport To Hanger, Smart Bomb, Freeze Enemies, Minimap etc.\n- Map generation had a few bugs, notably it would occasionally build rooms right at the edge of the map and leave a big gap where a wall should be - letting you walk out into space (which I didn't get time to auto-kill the player when you did this :p )\n- Didn't get time for music - it's atmospheric enough without it, but I'm not used to using PICO-8's tracker at speed yet.  \n- The visuals were ok, but quite noisy for such a small resolution - map visuals could've been clearer at defining walls, doors, floors etc.\n\n## Next Time - The big 40! ##\n\nLiked PICO-8 - working with crazy limitations is great fun and I'd def do it again.  Will hopefully see ya'll again for another game!  \n\n'Till then, Stay Fresh! Or Off The Hook. Or whatever it is you do...\n\n\n- DXVI","comments":0,"created":"2017-08-11T19:06:28Z","files":[],"files-timestamp":0,"id":48747,"love":16,"love-timestamp":"2017-08-23T06:20:43Z","meta":[],"modified":"2017-08-23T06:20:43Z","name":"Charge! Devlog","node-timestamp":"2017-08-11T20:02:52Z","parent":42907,"parents":[1,5,9,32802,42907],"path":"\/events\/ludum-dare\/39\/charge\/charge-devlog","published":"2017-08-11T20:00:17Z","scope":"public","slug":"charge-devlog","subsubtype":"","subtype":"","type":"post","version":139314},"node_metadata":{"n_key":"48747","n_urlkey":"316402","n_parent":"42907","n_path":"\/events\/ludum-dare\/39\/charge\/charge-devlog","n_slug":"charge-devlog","n_type":"post","n_subtype":"","n_subsubtype":"","n_author":"13701","n_created":"1502478388","n_modified":"1503469243","n_version":"139314","n_status":"WAYBACK"},"source_url":"https:\/\/ldjam.com\/events\/ludum-dare\/39\/charge\/charge-devlog","text":"![PICO-8_3b.gif](\/\/\/raw\/585\/3\/z\/8d91.gif)\n\nCharge! was my compo entry this LD39, and first go with an entry using PICO-8.  A sci-fi Roguelike where you scavenge derelict space stations for power, supplies and gear in order to warp towards your end goal.  It mostly worked quite well, with a few bugs and some slightly imbalanced combat.  Read on for some more look at how it was made!\n\nYou can play it here: https:\/\/ldjam.com\/events\/ludum-dare\/39\/charge\n\n---\n\n## Brainstorming (+ Sprites) ##\n\n![LD1.png](\/\/\/raw\/585\/3\/z\/8d92.png)\n\nFirst thing I tend to do start whipping up some graphics, usually some basic sprites + tiles.  During this time I'll also be fleshing out how the game will play.  Here you can see the basic player, map tiles, collectable items (including the eventually unused 'Oxygen' tank) and enemy design.  It's not much to start with, but it's enough to start working on the main game systems, which initially mostly involved procedural map generation...\n\n\n## Roguelike Map Generation ##\n\n![PICO-8_0.gif](\/\/\/raw\/585\/3\/z\/8d93.gif)\n\nAnyone familiar with http:\/\/www.roguebasin.com or even Roguelike map gen knows there's loads of ways to whip up a map depending on what you're after.  The method used in Charge! is fairly simple, and based off the one described here: http:\/\/www.roguebasin.com\/index.php?title=Dungeon-Building_Algorithm\n\nBasically the steps are:\n1. Start with a NxN sized room - check if isn't overlapping other rooms and if it is, bail and try again.\n2. Mark all the tiles with the NxN square as a floor, and the surrounding ones as walls.  Particularly, horizontal and vertical walls are named as 'Frontiers' - somewhere we could potentially add a connecting room. Also have a notion if which 'direction' this frontier is leaving the room from.\n3. Select a random frontier tile from our list - this is where our new room will start - and repeat step 1.  We'll also put a door at the frontier tile used, and remove it from the frontier list.\n\n![PICO-8_1.gif](\/\/\/raw\/585\/3\/z\/8d94.gif)\n\nBasically keep doing that till we have a bunch of rooms.  We can alternate what tiles to use depending on what type of room it is, and even the size - Charge! has a special 'Corridor' type which is just a long, thin room, and several main rooms which mostly just have different flavoured tiles.  Once we've got the requisite number of rooms (larger 'map types' have more rooms) we place the 'Hanger' room last, and then we populate the map with stuff.  This mostly involves picking floor tiles to drop enemies, crates and other random bits and pieces - most of which are determined by how far you've progressed through the game and what 'map type' you've specified (i.e. Habitats are large and the loot table prefers food, Military bases always have equipment etc.)\n\n\n## Field of View ##\n\nA lot of the tension of Roguelikes aside from everything trying to kill you, is that you can't always see what's around the corner that will try and kill you.  To implement this, we use a classic FoV technique where we take all the tiles around you within a set range (say, 5 tiles), and from the player we try and draw a line between that tile and the player.  If the line reaches the tile without hitting anything solid (or at least 'clear' so we can have solid walls that behave like windows), you can see the tile.  If not, it's obscured by something and we stop at the tile we hit.  This relies on a classic line algorithm called Bresenham's Line Algorithm, which you can read up on http:\/\/www.roguebasin.com\/index.php?title=Bresenham%27s_Line_Algorithm\n\n![PICO-8_2.gif](\/\/\/raw\/585\/3\/z\/8d95.gif)\n\nUsually, you also don't get a 'fog of war' version of the map until you uncover the tiles initially, but to keep the game a little more fair, you're given hints as to the general layout of the ship and the location of doors.\n\n\n## Enemies and Combat ##\n\n![PICO-8_3.gif](\/\/\/raw\/585\/3\/z\/8d96.gif)\n\nEnemy AI was fairly basic - I didn't get time to implement any pathfinding - so the basic AI for the 5 enemy types is as follows:\n- **Blobs**: Just bounce back and forth\n- **Hackwings**: Step to a random adjacent tile.\n- **Turret**: Stands completely still - only attacks if you're standing beside it.\n- **Zydd** and **Gizoid**: Wander like Hackwings unless the player can see them, then move towards the player.\n\nThe latter AI there attempts to do something a bit smarter, but 'Move towards the player'  just forces them to move as the crow flies, meaning they get confused by windows.\n\n![PICO-8_0b.gif](\/\/\/raw\/585\/3\/z\/8d98.gif)\n\nThe above was an early attempt at the 'Gizoid' enemy, which originally was stationary but would duplicate itself to surrounding tiles, spreading throughout the station.  This.... had some balance issues and ground the game to a crawl, so I quickly re-purposed them to something a little more basic :p\n\n![PICO-8_5.gif](\/\/\/raw\/585\/3\/z\/8d97.gif)\n\nCombat is fairly simple, and massively unbalanced.  As with standard Roguelikes, you take your turn - the enemies take theirs.  Combat is resolved by trying to move into a square something else is already on, and mostly involves some random rolls against a 'To Hit' chance, and then damage is inferred by Attack - Def.  It's basic, and it results in some \"You took 0 damage\" nonsense which I'd probably limit so 1HP is the minimum possible damage instead of 0, but it worked reasonably well.\n\n\n## And the rest ##\n\n![PICO-8_1b.gif](\/\/\/raw\/585\/3\/z\/8d99.gif)\n\nWith the set of gear, collectables to fill meters back up, and enemies, I had everything needed to start working on how the game would progress.  Ultimately there's an internal 'Level' that jumps up each time you change map, and this unlocks new enemy types as it increases.  Each map type also defines a set of rules as described above, and generally larger, more rewarding maps will cost more power - the resource that also counts down over type as you navigate.  There's also an incredibly unbalanced 'Loot Table' system that determines the contents of crates depending on the map type you're on which was quite fun, and pretty easy to implement (if a bit messy in code).\n\n\n## Post mortem ##\n\n![PICO-8_3b.gif](\/\/\/raw\/585\/3\/z\/8d91.gif)\n\n### What went well ###\n\n- A basic but functional game!\n- Map generator held up fairly well (most of the time...)\n- Pico-8 pretty fun to work in (in-built gif recorder certainly helped!)\n- Reasonable sense of progressing difficulty\n\n### What didn't really work ###\n\n- Game balance is a bit all over the shop:\n-- It's fairly easy to gather enough power to skip the last several maps if you stick to solar stations\n-- Certain gear is so massively overpowered (rifle, heavy armour) that if you're lucky enough to get it you've basically won\n- Didn't get to implement 'Tech' - special equipment which would consume Power to do cool stuff like Emergency Teleport To Hanger, Smart Bomb, Freeze Enemies, Minimap etc.\n- Map generation had a few bugs, notably it would occasionally build rooms right at the edge of the map and leave a big gap where a wall should be - letting you walk out into space (which I didn't get time to auto-kill the player when you did this :p )\n- Didn't get time for music - it's atmospheric enough without it, but I'm not used to using PICO-8's tracker at speed yet.  \n- The visuals were ok, but quite noisy for such a small resolution - map visuals could've been clearer at defining walls, doors, floors etc.\n\n## Next Time - The big 40! ##\n\nLiked PICO-8 - working with crazy limitations is great fun and I'd def do it again.  Will hopefully see ya'll again for another game!  \n\n'Till then, Stay Fresh! Or Off The Hook. Or whatever it is you do...\n\n\n- DXVI","title":"Charge! Devlog","wayback_source":[]}