Author Topic: LOSE [2017 - 7drl - 04 Mar to 12 Mar] - Finished!  (Read 10416 times)

bix

  • Newcomer
  • Posts: 10
  • Karma: +0/-0
    • View Profile
LOSE [2017 - 7drl - 04 Mar to 12 Mar] - Finished!
« on: March 04, 2017, 12:57:25 AM »
Land of Software Engineering

Armed with only a pocket protector and a single punch card, your character finds itself within its own software and must eventually merge with the machine or die trying.  The Manager might stalk you, and the newbie might slow you down, but beware of the gamer in disguised dressed as a programmer giving false advice!  The acolytes of software languages will attempt to convert your character to follow the one true software paradigm.  There are spaces and tabs and missing semi-colons.  Coffee is the one true weapon (outside of the mountainous dew) for avoiding meetings, infinite recursion and race conditions.

Itch.io
« Last Edit: March 12, 2017, 06:01:55 PM by bix »

bix

  • Newcomer
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: LOSE [2017 - 7drl - 04 Mar to 12 Mar]
« Reply #1 on: March 04, 2017, 07:17:56 PM »
This is my first 7drl and I've never fully built a roguelike or a game, but I have about 20 years of experience developing software in a professional capacity.

Goals to call this a successful 7drl:

  • Build a top gameplay menu, basic play window/game map, death screen, inventory screen
  • Build and utilize dijkstra maps for AI
  • Something that can be played even if it's only one level
  • A procedurally generated map
  • A basic framework that makes it relatively simple to add new monsters, items, etc.

-= Tech Stack =-

  • Python 3.6
  • Libtcod (built from scons)
« Last Edit: March 05, 2017, 04:10:38 PM by bix »

bix

  • Newcomer
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: LOSE [2017 - 7drl - 04 Mar to 12 Mar]
« Reply #2 on: March 05, 2017, 01:58:32 PM »
Day 0 (Saturday):  Pre-planning
Given that we technically have 8 days, and I'm not going to spend more than 2 hours a day on this game because of other commitments (Family, Work, etc.), I'm going to call today a pre-planning day.   I've spent some mental planning for this as well to partially flesh out some of my ideas.

I'll be developing on a mac, but I have VM's for windows and linux to test run these and package them up.  Besides setting up the project, today's other major task will be to setup the framework for creating a distribution for each of the major operating systems:  mac, linux and windows.

My plan is to push the code out to github.

-= Goals =-

-= Stretch Goals =-
  •   [   ] - Build a full pipeline for application bundling on mac, win and linux

--= Post mortem =--
Application bundling for various OS's is a more lengthy endeavor than I was prepared to do and I currently do not have that piece automated, which means I will only be able to provide code updates and not playable binaries for this 7drl.  It may be something I'll need to wait on until after the 7drl.

Additionally, I was a little frustrated attempting to find a decent event-based library.  And while I could easily build a simple implementation using a dictionary, I don't have any time to make this polished and I'll probably hit some performance or technical issues due to that problem.

Time was also a factor.  I knew 2 hours would be pretty ballsy going in, but it's all I can allot in a day.

bix

  • Newcomer
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: LOSE [2017 - 7drl - 04 Mar to 12 Mar]
« Reply #3 on: March 05, 2017, 01:59:12 PM »
Day 1 (Sunday):  Making a very basic intro game menu screen

-= Goals =-
  •   [ x ] - Create a simple window
  •   [ x ] - Add text to that window
  •   [ x ] - Keyboard handling

-= Stretch Goals =-
  •   [   ] - Add mouse handling
  •   [ x ] - Add submenu with option updates saved to human updatable files
  •   [   ] - Create "profiles" for various keyboard bindings (e.g. Brogue keybindings vs Angband vs custom)

I wanted to start with a menu because having a menu in my back pocket will make other types of screens easier to build later.  I think it would be really convenient to have a way of looking at the key bindings in the game and updating them with either a preferred custom layout or a profile from a well known game.  It might also be great to have the capability to bring up an options menu in-game to view or review these keybindings...not just at the start of the game.

-= Screenshot =-
Imgur link: http://imgur.com/GuoQ9FS


I'm not entirely sure how to post with a picture given that it appears I need to include a link vs an img.

-= Post Mortem =-

I struggled a bit with the libtcod mindset;  I feel a strong desire to add wrapper code around the libtcod code so that I can make it more pythonic, which would only take away from my basic time to build something.  Libtcod is fantastic, but I feel that the API makes writing the game in python a little verbose.  That said, I'm really happy with how this is turning out so far even though I'm still not hitting stretch goals.

The submenu right now isn't really worth having since I haven't created nor hooked up the options handling.  Also, it needs better polish since it doesn't hide/replace the top level menu.
« Last Edit: March 06, 2017, 03:27:57 PM by bix »

bix

  • Newcomer
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: LOSE [2017 - 7drl - 04 Mar to 12 Mar]
« Reply #4 on: March 06, 2017, 03:26:30 PM »
Day 2 (Monday):  Create a basic game screen

-= Goals =-
  •   [   ] - Add a map from a file
  •   [   ] - Add a character
  •   [   ] - Add keyboard controls for movement

-= Stretch Goals =-
  •   [   ] - Add collision detection
  •   [   ] - Add lighting
  •   [   ] - Add a mob

Today is a work day, and often a long one.  And today's task list at work is a big one.  Hopefully, I can carve out the required time for the 7drl. 

-= Post Mortem =-

I never had a chance to put some time in.  Will move this day's work to Tuesday.
« Last Edit: March 07, 2017, 03:17:23 PM by bix »

bix

  • Newcomer
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: LOSE [2017 - 7drl - 04 Mar to 12 Mar]
« Reply #5 on: March 07, 2017, 03:18:28 PM »
Day 3 (Tuesday):  Create a basic game screen

-= Goals =-
  •   [ x ] - Add a map from a file
  •   [ x ] - Add a character
  •   [ x ] - Add keyboard controls for movement

-= Stretch Goals =-
  •   [ x ] - Add collision detection
  •   [ x ] - Add lighting
  •   [   ] - Add a mob

Given I didn't have a moment to spare yesterday, I'll carve out a nice chunk of time for this today.  Should be fun to get something running on a screen. 

-= Screenshots =-
The screenshots are in reverse chronological order

http://imgur.com/a/eOEnK


-= Post Mortem =-

I added lighting, but it looks like my FOV setup isn't quite right yet.  And while I have some collision detection logic, our main character can walk through walls.  So we'll need to clean that up next time.

Thanks for following!!
« Last Edit: March 08, 2017, 05:57:03 AM by bix »

bix

  • Newcomer
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: LOSE [2017 - 7drl - 04 Mar to 12 Mar]
« Reply #6 on: March 08, 2017, 02:13:32 PM »
Day 4 (Wednesday):  Add item related screens/logic

-= Goals =-
  •   [ x ] - Add an inventory screen
  •   [   ] - Add a character screen
  •   [ x ] - Add several items

-= Stretch Goals =-
  •   [   ] - Fix collision detection
  •   [   ] - Fix torch/light/visibility
  •   [   ] - Add mouse-over descriptions
  •   [   ] - Add items to level procedurally

Yesterday I added a level and randomly placed the character on an open square in that level.  Today I want to begin populating that level with items.  My plan is to build out a few items in my yaml files and then to randomly place some within the level on an open square.  The items are going to be central to game play:  they will provide basic abilities.  A character with a specific set of items might fit into a very specific type of role.  As an example, in a traditional game, there may be a fighter role.  This fighter role would likely need heavy armor and a melee weapon because they will be hit hard and often.  An alternative role might be the equivalent of a rogue - still melee but very stealthy and avoidance is the most important aspect of a rogue's role.  In my game, those roles are decided entirely by the choice of items a character has equipped.  This makes the roles a little more fluid and allows a player to choose a new role with a different set of items if they find the old role doesn't suit them.

For some basic mechanics, I've decided to make this relatively easy:  If you walk over an item, you'll automatically pick that item up provided you have inventory space.  Additionally, items can stack on a square, so if you want to drop a bunch of things into one spot, you can.

-= Screenshots =-
http://imgur.com/a/Mtn6F


-= Post Mortem =-

I managed to add some items and an inventory screen that pops up as expected.  But I still need a sub menu to make the inventory useful:  drop, equip, etc.  Additionally, I didn't have a moment to put together a character screen, so that will be next.  I also ended up doing some refactor work (which slowed me down) because I realized I wanted mouse input.  I can now obtain both keyboard and mouse input, though I'm not using the mouse just yet.  While I have the mouse hooked up, I do not have it actively being used.

Something to think about for today:  Refactoring will suck away my time.  I should really try to avoid it for this week.
« Last Edit: March 09, 2017, 07:37:54 PM by bix »

bix

  • Newcomer
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: LOSE [2017 - 7drl - 04 Mar to 12 Mar]
« Reply #7 on: March 10, 2017, 05:16:35 AM »
Day 5 (Thursday):  Generate items and mobs

-= Goals =-
  •   [ x ] - Procedurally create items
  •   [ x ] - Procedurally create mobs
  •   [ x ] - Pick up items into inventory

-= Stretch Goals =-
  •   [ x ] - Fix collision detection
  •   [ x ] - Fix lighting
  •   [ x ] - Refactor maps
  •   [   ] - Add dijkstra maps
  •   [   ] - Animate mobs


-= Screenshots =-
http://imgur.com/a/8qdM8





-= Post Mortem =-

Happy with the progress today.  Being able to pick things up and see them show up in the inventory is fantastic.  Still need to create and hook up an action screen for inventory items (e.g. drop/equip/unequip/use) and also need to add mouse-over and messages so that we have a better idea of what's actually on the screen.  The flavor text will really add to the game.

I became a bit more familiar with libtcod's library, so that's helping make the game feel a bit more polished.  I initially went with POD structures (mostly maps and lists) and this so far has not really impeded me.  That said, I decided not to go with an entity component system and I can see how that might be helpful in the near future.  I'm sure I'll add that post 7drl, but right now, I am not finding that in the initial build phase that ecs is really all that beneficial just yet.  The simple functions with POD structures is easy enough to grok that I am still progressing without much abstraction.  That said, I do have some small optimizations for querying and lookup of the data.  Also one more point:  all of my items/mobs/skills/abilities/tiles data currently resides in yaml files and for the maps I have just a text file.  I'd really like to get to the point where I can procedurally generate maps, but I don't want to slow down the basic framework features to get a procedural map code running.  So for now, I'm still hand drawing (which means I get some nice create freedom).

At the moment, I've not noticed any performance issues, so that's also fantastic.  I don't have many entities, though, and I've not built out any AI just yet.  I expect to see some slowdown there.  Additionally, my map size is currently a small 72 x 42.  So that means I really only have about 3k squares to deal with.

Last couple of days left, and still quite a few things to do to make this game playable.  Hoping to make that happen.

bix

  • Newcomer
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: LOSE [2017 - 7drl - 04 Mar to 12 Mar]
« Reply #8 on: March 10, 2017, 05:47:03 PM »
Day 6 (Friday):  Start to hit AI - Dijkstra maps

-= Goals =-
  •   [ x ] - Implement a usable Dijkstra map algorithm
  •   [   ] - Create a movement behavior for mobs

-= Stretch Goals =-
  •   [   ] - Generate some abilities and skills
  •   [   ] - Add abilities and skills to mobs
  •   [   ] - Create a combat system


-= Screenshots =-
Dijkstra maps

-= Post Mortem =-

Dijkstra maps - fun to see their output.  I implemented three different distance functions:  euclidean, manhattan and octagonal (see: http://www.flipcode.com/archives/Fast_Approximate_Distance_Functions.shtml).  I also added a dijkstra function and I'm trying to determine if I should modify that function further to take advantage of preferred pathing (e.g. a bridge vs water, an open corridor vs a closed door) or if I should do that outside of the algorithm and keep the algorithm pure.  It seems like the former would scale a little better later, but the latter would let me proceed right now.  I seem to have a bunch of these little trade-offs.

Added a logarithmic distance function to help create a sense of "I don't care" if the target is simply too far away, but still give a haphazard I kinda care if within a specific range.  I haven't noticed any calculation/performance problems just yet, but we'll see.

Added a default health and attack for mobs.  Going to go with just a simple attack value exchange for now.  I have a set of really interesting ideas specifically related to character knowledge and programming skillset.  For example, pythonistas and ruby developers might have rapid prototyping.  Java and Scala practitioners might have access to the JVM.  Lua developers would have access to the JIT.  The point is that each skill tree will confer really cool abilities and combat isn't going to be hack and slash.  However, I don't really have time to develop that system in the next day... SOO... I'm going with hack and slash for this round.

« Last Edit: March 11, 2017, 01:21:06 AM by bix »

bix

  • Newcomer
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: LOSE [2017 - 7drl - 04 Mar to 12 Mar]
« Reply #9 on: March 12, 2017, 03:21:49 AM »
Day 7 (Saturday):  Combat and more Dijkstra Mapping

-= Goals =-
  •   [ X ] - Finish my original goals
  •   [ X ] - Add rudimentary combat

-= Stretch Goals =-
  •   [   ] - Add UI elements which actually give the player status information


-= Screenshots =-
http://imgur.com/a/SbGXY


-= Post Mortem =-

So this was my original set of goals:

  • [ x ] - Build a top gameplay menu, basic play window/game map, death screen, inventory screen
  • [ x ] - Build and utilize dijkstra maps for AI
  • [ x ] - Something that can be played even if it's only one level
  • [   ] - A procedurally generated map
  • [ x ] - A basic framework that makes it relatively simple to add new monsters, items, etc.

The only thing I really punted on was the procedurally generated maps.  I'm okay with that, but I'd love to hit that harder.  Additionally, I didn't actually implement the death screen.  The game just dies.  If you have the logger running, you'll know why.

What I don't have setup correctly right now, and I should have included it in my original goals, is the UI elements that actually make this game worth playing.  Things I didn't get a chance to do include a message section for things like combat logs and a mouse over interface, which would actually display the flavor text I created.  This game would be far more entertaining if I could get the flavor text and messaging going.  So those will be the next things I do after 7drl.

From a higher level, I wanted to just talk about my 2-3 hours a day requirement.  For the most part, I adhered to this plan.  So this game is probably the equivalent of about 15 hours worth of actual work.  Given that small amount of time, I think what I did is pretty awesome.  That said, I'm pretty sure what I have to show will be vastly under representative of the general 7drl games that do finish.  I'm also elated that I completed a working game and a roguelike at that.  I think if I had had about 4-6 hours a day, I'm not sure I'd have significantly more than what I have right now, but what I do have would be better polished and designed.  And I think that's an interesting statement all by itself.

Also, just wanted to say thanks for everyone that followed this.

-= Code =-
You can find the code here
« Last Edit: March 12, 2017, 03:28:27 AM by bix »