Trying to Remember What I’ve Done

After looking over the code where I left it a few months ago it’s not in a super horrible state. Much of what I’ve done to this point was getting a game mechanic to work and then quickly moving on to the next task. This left a lot of sloppy and hacked together code. In most other projects that is typically where I’ll leave it, but for this project I’d like to clean things up some. Especially where it will make life easier down the line.

Early on in the project I created a loose roadmap. Technically I think I’ve accomplished everything for this version… but I’d like to improve some of these bullet points. The way objects and actions are handled will be first up (as mentioned below). I’d also like to fix some path-finding bugs.

## 0.1.0
### basic playable poc

- game design (somewhat)
- struct design
- basic i/o
- basic level generation
- mob generation
- mobs with basic AI 
- basic melee combat
- basic fov
- item generation
- basic inventory management

Next Steps

I’ve made a snapshot of the code and called it release v0.0.1.

Moving forward, the first things I’d like to focus on are re-working how objects are stored in the code and interacted with. Items such as weapons, scrolls, or potions are especially unwieldy at the moment. I think what I’d like to do is make everything an action. So swinging a sword or casting a spell are generic actions. But each object will have an array of their own actions that will be called when equipped or used. Maybe each object will have a “actionUse” and “actionEquip” attribute, for example.

The end goal is to make the addition and tweaking of objects easier to manage. Currently each weapon has to be added to the following array, two “generic” functions, and then two item specific functions. This is not easily scalable.

itemName array - a list of every item
makeItem function - a function that encapsulates each separate make item function
useWeapon function - a function that encapsulates each separate use item function
makeWeaponName function - creates the object
useWeaponName function  - called when the object is used

Basically what I’d like to do is remove the need for the item specific functions. The same holds for spells, mobs, and other game mechanics. I think this seems like a worthwhile task to get back into the project.

Pre-prod Release Version 0.0.1

The public github repo has been created and is here: https://github.com/chadpierce/rescape

I tagged a v0.0.1 release to keep a snapshot of the game at this stage of development. I’ve included several binaries and the source code.

Release Notes

Rescape is in early design and development. This release is a mostly working POC with some poorly written code that will continue to evolve.

Version Notes:

  • You may need to resize your terminal and/or font to see the entire game field, status area, and messages (shown in screenshot below)
  • Vi keys along with arrow keys are supported for movement. Additional commands can be found here: https://raw.githubusercontent.com/chadpierce/rescape/main/docs/help.md
  • You currently start each floor with a test potion (MegaGood) that will make your character more powerful in most ways
  • You can move freely up and down stairs regardless of where you are on the floor (you don’t need to be standing on a staircase)
  • Enter a “ground floor” test level by entering “D” - here you’ll see a red dragon with bad pathing
  • Upon death you’ll still be able to move around
  • There is currently no game or objective. Combat is also not balanced.
  • Press ESC to exit the game
  • In MacOS, built-in antivirus measures may prevent the binary from running. The easiest way to workaround this is right click the file and launch it with the Terminal.app at first launch. You can then allow the binary to run. There’s likely an easier way to allow it to run.
  • In Windows, Defender may yell at you. You’ll need to bypass this protection as well.

Screenshot:

Rescape v0.0.1 Screenshot