7DRL – RogueAgent Day 6

Alas, due to my late start in the 7DRL, today was the last day of the challenge. But nuts to that! I’m gonna keep going!

Here’s a shiny gif of the new system. Notice the neat FPS tracker in the lower-right. It’s usually 90 FPS but recording out screens drops the framerate significantly, so don’t think I’m already in dire straits.

Click to view the 8.6Mb GIF

Today I implemented the event system. Previously if a person was going to walk into a wall, they have to know about the wall, so they need to know the game map, so they need to know the world, so they need to keep a handle on it. In short, each object ends up too intertwined with the rest of the world. The event system lets things declare their intentions or what just happened, throw those into the air and whoever wants to catch them can.

I did a bunch of refactoring to get all the objects and subsystems to stop being in each others’ pockets, but still couple loosely. What’s great now is that I can quickly iterate, adding objects and interactions.

I haven’t got the most flexible and powerful event system possible because I’ll build it in if I need it. For example, events can’t be cancelled or gobbled up by a single person. The event queue can be prioritised, but I don’t do that yet.

I had to increase the number of game simulation ticks to 10 per second to make input feel good. But that means NPCs run around like crazy. I don’t know if that means I need to have a speed/energy system (so fast guys get more game ticks than slow ones). That’s a problem for Future Brett.

If I add in some senses and intelligence to the NPCs, I almost have a game right there. Sneak around guards, hit a button to set the self-destruction button, and run out.

I think my plan now is to keep adding to the game, even though 7DRL is over. The concentrated effort was great, but now that the main systems are starting to come together, I can relax and do game design. And you know, the other things in my life. I’ve learned a huge amount this week – especially in writing code for what I need and nothing more, in refactoring, and incremental progress. I’ll split my time between RogueAgent and The Day After.

If you’re interested in playtesting RogueAgent in a few weeks, let me know.


## [0.0.6] - 2017-03-13

### Added

- The mighty Event system!
- Pulsing button with good/bad states.
- Dev Window showing FPS and recording state.
- Object collision.

### Changed

- Input now goes through the Event system.
- Moved the rats nest of references to engine components to game.py
- Objects are handled by the World. This allows non-map objects like spectators.
- GameMap is much leaner and has a generate procedure.
- Buttons now react to being bumped.

## [0.0.5] - 2017-03-12

### Added

- Scrolling maps!
- Objects have a render order so we can have objects above/below each other.
- Double the ways to quit the game
- "Video" recording. Basically queues up for every frame to be screenshot.

### Changed

- Rendering is now done differently. Instead of layers, objects need to draw directly onto the viewport.
- Ticker now welcomes "RogueAgent"

### Removed

- No need for object render maps now.
- Some chroma key code.

### Fixed

- BUG #2 "Rendering overlays are weird"
    - Fixed by the render process. Alpha is only during writing. Chroma keys are only for blitting whole characters.
- BUG #5 "Ticker screen doesn't render"
    - Fixed by the render process.
- BUG #6 "Character input keys not working"
- Unnoticed bug with regards to viewport extents (height was width)
- BUG #7 "console_print won't work if you ask for a point outside the console"
    - Just need to truncate explicitly

## [0.0.4] - 2017-03-11

The huge graphical update! Lots of rewriting of almost everything

### Added

- Primitive Windowing system

### Changed

- The entire graphical stack.
    - Slipped in a GUI layer
    - Objects manage their own little render maps
    - Scope for a lighting layer

## [0.0.3] - 2017-03-11

### Added

- Keybindings interface.
- BUGS list
- Engine configuration file

### Changed

- Game loop is now real-time, 2 updates per second, and 60 FPS rendering.
    - GameObjects are given timestamps to adjust rendering.
- Engine controls screenshots.

### Fixed

- Screenshot key now works.

## [0.0.2] - 2017-03-09

### Added

- Generic GameMap code
- `maps/` now contains different maps.
- Filled rectangles utility code
- HQ Map
- Take screenshots with PrintScreen
- Nifty scrolling ticker screen

### Changed

- Maps and GameObjects now render themselves onto a console. This
  allows them to be multi-tile and do things like (fake) glow.
- Tiles now store their own colour
- Test map code moved to its own GameMap
- Player and NPC are now Human objects
- GameObject is very lean

## [0.0.1] - 2017-03-08

### Added

- Core TCOD engine
    - Game loop
    - Clean exit on ESC or Ctrl-C
- Base World functionality (stores a map, a PC and a list of NPCs)
- Base Viewport functionality
    - Walls and floor
    - PCs and NPCs
- Base Object functionality
    - Movement
    - Wall blocking movement
    - Rendering
- Base Map functionality
    - Custom map with some walls
- Utilities
    - Box-drawing (AABB, origin+(width,height), centered)