Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411512 Posts in 69376 Topics- by 58430 Members - Latest Member: Jesse Webb

April 26, 2024, 06:00:29 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityDevLogsVeins of the Earth [RPG, roguelike, isometric pixel art] dev log & feedback
Pages: 1 2 [3] 4
Print
Author Topic: Veins of the Earth [RPG, roguelike, isometric pixel art] dev log & feedback  (Read 9993 times)
Zireael
Level 4
****


View Profile
« Reply #40 on: July 01, 2017, 02:40:23 AM »

Pardon the radio silence, but I got the job!

This means I'm learning Python on the double by making the Python iteration of Veins.

The changelog for this week:

    new: item picking up and dropping
    new: inventory screen (just a text list)
    new: equip/unequip items
    new: random damage dice; weapon dice supersedes actor dice
    new: load monster data from JSON
    new: separate most drawing stuff to renderer module
    fix: NPCs now roll proper dice for damage
    new: move object class (and the components) to a separate module
    new: basic inventory slots code
    new: add tiles for dagger and longsword
    new: load item data from JSON, generate items
    new: implement actor stats and stat arrays, add character sheet screen
    new: add stats to monsters
    fix: unbreak click to move
    add: goblin and drow tiles
    new: load correct tiles for NPCs; test spawning them

So yeah, it's rolling ahead fairly fast. The screens (inventory, character screen) are simpler now than what they were in Java and the hit splashes are missing but we're at 80% or even 90% of what was done in Java.
Logged
Zireael
Level 4
****


View Profile
« Reply #41 on: July 07, 2017, 11:08:42 PM »

Learning Python and Vim on the double because of the job.

Changelog for this week:

    New: specified monster rarities in JSON
    New: generate a table from said rarities, roll d100, use bisect() to pick the correct monster
    Basic item rarity code, use rarities indicated in comments in Incursion (5% mundane, 30% magic, 20% good, 15% rare, 10% excellent, 10% great, 5% unique)
    New: spawn a chainmail item
    New: JSON files for armor and weapon bonuses (e.g. +1), materials (e.g. mithril) and properties (eg. of fire resistance)
    New: random item generator now rolls for armor material and weapon bonus, if applicable
    move JSON loading and generators to separate module
    fix spawning NPCs
    new: NPC factions code (only attack enemies, etc.)
    new: draw unit markers
    new: if NPC is neutral, he'll say a one-liner in message log (provided he has one defined)
Logged
Zireael
Level 4
****


View Profile
« Reply #42 on: July 14, 2017, 11:05:58 PM »

Changelog for this week:

* new: implement a camera that limits what gets drawn
* new: move() returns a boolean that says whether the move actually happened
* new: the camera now follows the player
* fix: deduplicate a function (by using from x import function)
* new: prepare for other map generators
* new: implement a BSP map generator
* new: generate monsters and items on random free spots ^Note: I make a list of all free tiles and pick randomly from this list, this way I don't have to retry
* fix: error on rolling a 100, add function to fudge a roll (ie. force a result of x)
* fix: repeat the fix for other d100 tables
* fix: abort the bsp tunneling if it tries to go off-map (I only caught this one when I wanted to debug something else and it would stop earlier - it didn't cause any issues live but it made debugging impossible)
* set up [Landscape](https://landscape.io/), a code quality tool for Python
* fix: avoid using an empty list as a default argument
* fix: player is now centered on screen
* fix: a couple code smells removed
* fix: fix several redefinitions (they snuck in from the Roguebasin tutorial)
* new: implement debug mode (only see full map for now) - ^Note: I need this one because the BSP sometimes generates orphan rooms

I'll probably be silent for the next two weeks because holidays.
Logged
Zireael
Level 4
****


View Profile
« Reply #43 on: July 31, 2017, 03:22:07 AM »

Holidays are over. Landscape was very helpful in bringing the two functions I wrote via Github's web interface to working state.

Changelog:
* copy and paste a* from Roguebasin
* write a function that prints the level to console (# are walls and . are floors)

Yesterday I sat down and squeezed some more optimizations into my map rendering code. Vprof as well as cProfile + pyprof2calltree + QCallgrind were very helpful in eking out some more fps.
Logged
Zireael
Level 4
****


View Profile
« Reply #44 on: August 04, 2017, 11:34:28 PM »

Changelog for this week:

In a rough order of importance:

    Fix: no more orphaned rooms in BSP generator
    New: thanks to having separate modules, I can just run bsp_map.py for it to generate several maps and print them to console
    Implement saving/loading (I used jsonpickle)

    New: detect clicks on message log. If you click on a line that contains the word damage, a function extracts the damage number and shows you a separate window (later I'll expand on it so that it shows you how exactly we arrived at that number, but I needed to get the window to pop up first)

    Some style fixes

    Optimization: camera dimensions specified in tiles, not pixels (to avoid converting from tiles to isometric coordinates)

    Optimized main map drawing: only do the isometric conversion if the tile is actually within camera limits; specify the color as number to avoid having to look up name->color within BearLibTerminal

    Fix: map is no longer black on turn 1

    Fix: don't tunnel through the walls around the bsp map

    Make classes new-style in preparation for saving

    Factor out new game stuff to new function

    Fix: mouse picking happens after everything is drawn

    Fix: use layers to ensure message log and debug messages are always on top of map

    Factor out mouse tile picking to separate function

    Fix: clicking outside map bounds is ignored
Logged
Zireael
Level 4
****


View Profile
« Reply #45 on: August 18, 2017, 11:03:59 PM »

Changelog for the last two weeks:


    fix player saving/loading (I was using a bad assumption)
    camera placement no longer gets funny when loading the game
    implement message log history window (doesn't scroll yet)
    shuffled stuff out of main.py
    player can now die
    AI got smarter when it's has the player in vision range
    implement game states (based on /u/Daealis's code) to prevent moving once the player's dead
    add a hp bar (based on Grey Sentinel's dev-along)
    implemented skill tests (d100 roll under)
    implement melee and dodge
    show them in character sheet
    basics of advance by use system (note: needs a cooldown to avoid grinding)
    implemented stairs and more dungeon levels
Logged
Zireael
Level 4
****


View Profile
« Reply #46 on: August 25, 2017, 11:21:03 PM »

Changelog:

    fix: only test skill improvements for the player
    new: implement a scrolling log menu (note: that was a PITA, took me half a day because the menu kept closing)
    new: rework the way map tiles are handled - decreases save file size and makes some functions cleaner (this is based on Naburimannu's code)
    fix: figure out how to use 'throwaway variables' to avoid 'unused variable warning' in pylint (it brought my code quality meter in Landscape up to an all time high of 95%)
    fix: pad out the NPC rarities a bit
    fix: no more messages for events outside of player FOV (and I even managed to do it in a way that avoided doing yet another libtcod.map_is_in_fov call)
Logged
Zireael
Level 4
****


View Profile
« Reply #47 on: September 01, 2017, 11:44:58 PM »

Changelog:

    new: make a simple city generator based on BSP (no walls yet). I've been calling this 'encampment' in my notes because of the lack of walls Tongue
    moved the simple (floor with wall around) map generator to a separate file. I'm calling this one 'arena' Note: the reason I'm moving the individual map gens to separate files is because I can then run them separately to just output the map to console as a string of characters and therefore test the quality of the maps without running the game itself
    new: attempt a cave generator based on /u/AtTheMatinee's (this one produces duds - roughly one in 5 maps is just filled up with walls, so I'll have to slap a map validation step somewhere before enabling it in the game)
    new: add gray floor gfx (more suitable for caves/underground)
    new: the initial map is now an encampment, see the first bullet point of the week
    new: basic tile/room descriptions


Tile descriptions
Logged
Zireael
Level 4
****


View Profile
« Reply #48 on: September 16, 2017, 12:29:53 AM »


Samildanach on Roguetemple made my day when he posted to the original Veins of the Earth thread - a year after I stopped updating it because that was when I stopped working on the T-Engine version - saying that he enjoyed the game and was still playing it and wishing it'd pop up less errors in engine.

This week's changelog:
    fix: delete save game when player dies
    fix: gracefully exit on main menu
    new: add background to main menu
    new: options to remove border and set positions of a window; center main menu text
    new: draw special effects (I figured out how to do it based on ArmCom2); blood splash and shield effects depending on hit/miss. Note: not sure what is causing the intermittent 'black patch' effect


Showcasing the effects
Logged
Zireael
Level 4
****


View Profile
« Reply #49 on: September 22, 2017, 11:35:18 PM »

Changelog:

    new: floating text which looks like it's typed letter by letter
    new: floating text which draws all at once
    fix: non-hostile NPC do not beeline for you anymore
    new: graphical inventory instead of a simple list
    new: usable items and healing
    new: healing potion item
    fix: actually load the damage and defense values from item's JSON definitions
    new: defense value now protects you from damage
    new: killed enemies now drop an item
    new: JSON dialogue file, parse and load
    fix: text is now displayed regardless of whether you or NPC initiated the movement


"Typed" floating text


Graphical inventory
Logged
Zireael
Level 4
****


View Profile
« Reply #50 on: September 30, 2017, 08:37:36 AM »

Changelog:


    new: horizontal/vertical walls are now differentiated in the BSP map
    new: basic dialogue screen
    new: level object that stores tiles, explored info and all the NPCs
    fix: levels other than the first one now have objects and NPCs
    new: check if there is an creature in x,y tile - if yes, spawn within a range of z tiles
    new: NPCs now have inventory and drop it on death
    new: player can have starting inventory
    fix: no more crashes when pressing g on a tile which has no items
    new: print a message on screen when the player is killed



Horizontal/vertical walls



Basic dialogue screen
Logged
Zireael
Level 4
****


View Profile
« Reply #51 on: October 28, 2017, 12:40:49 AM »

Job was busy, so I only poked a bit about the map generation. Individual levels can now use discreet map generators and I made it possible to have walls around the "city".

Logged
Zireael
Level 4
****


View Profile
« Reply #52 on: November 18, 2017, 12:15:05 AM »

Job still keeps me busy...


Mousing over an NPC now shows you more information
Logged
Zireael
Level 4
****


View Profile
« Reply #53 on: December 17, 2017, 04:04:47 AM »

Posts likely to be sporadic as I'm contemplating yet another side project as a way to level up my programming skills.

Anyway, job let up a bit so I worked on character creation screen:

« Last Edit: January 13, 2018, 05:13:07 AM by Zireael » Logged
Zireael
Level 4
****


View Profile
« Reply #54 on: January 13, 2018, 05:13:50 AM »

Made many improvements to the inventory screen:

Logged
Zireael
Level 4
****


View Profile
« Reply #55 on: February 24, 2018, 12:20:28 AM »

Lots of progress this week:


    fix: picking/dropping an item now uses up your turn
    fix: center camera after level change
    fix: kill off some global variables
    separate main menu file (one function still remains in main.py, though)
    fix: multicolumn menu now specifies column width and number of keys it is waiting for
    fix: ensure walls enclose the BSP dungeon

    new: function to pause during mapgen and see the map (the function is tied to a new debug switch which is on for now)
    new: implement (very basic) autoexplore
    new: give the player some money and show it in character sheet
    new: seed support for BSP mapgen
    new: seed input before character creation
    new: shop GUI and basic functionality (you can buy but not sell, also it doesn't affect your money yet)
    new: seed support for the other BSP map and cave map
    new: place some crates indoors


Showing off
Logged
Zireael
Level 4
****


View Profile
« Reply #56 on: March 17, 2018, 07:13:47 AM »


    new: added a hooker, who has a slightly different dialogue
    new: implement item prices specified in item JSON
    new: show item prices in shop screen
    new: add/remove player's money
    new: implement selling your items
    new: add some paperdoll tiles from DCSS (CC0)
    new: specify paperdoll tile in item JSON
    new: display paperdoll tiles, if any, on top of player



Showing off paperdolled player
Logged
Zireael
Level 4
****


View Profile
« Reply #57 on: March 24, 2018, 05:47:45 AM »

So this week was mostly refactoring...

* new: strength affects damage
* new: additional info may be stored along with the message string itself
* new: use said info to store damage breakdown which is displayed on clicking in log
* fix: fix displaying damage breakdown by flattening the list before displaying
* fix: move item uses to separate file

* fix: remove reliance on GAME object for log messages by using observer pattern/events
* fix: renderer doesn't need GAME anymore
* fix: extend event system to toggling player turn

* fix: rewrite the way we're storing game variables - clearer, avoids passing around a GAME object ^Note: so I figured, if I can't avoid a singleton, let's stop pretending we don't have one. And the easiest way to have a singleton in Python is to have a separate file with top-level variables (and/or functions). I couldn't get the functions to work in the same file as the variables, so I left them where they were (in the GAME object). This has an added advantage because it ensures that the GAME object is the only thing that can modify the global state so I should be fine in terms of not having weirdness due to several things trying to modify the same global.
* fix: yank reliance on GAME altogether from 6 files (!) and massively reduce it for the other two (components and input handling)
* fix: rewrite saving/loading for new game variables storage ^Note: so here was the downside of storing the separate variables instead of one object, I had to add several lines to ensure all the necessary vars got stored (I could discount fov_maps since they are regenerated on load either way)
* fix: mark GAME object's functions as static (the object lost all the variables, so the functions didn't use self in any way)
* fix: some warnings in cave map gen
* fix: some cleanup and fixing unused variable warnings
* fix: move render_positions out of level ^Note: the commit message says it's to slim down saves (from 150+ kB to 20 kB) - the positions were tuples so took quite a lot of space - but since the positions now live in constants, I can probably get rid of passing them around and instead pull straight from constants when I need them, so yet another advantage
Logged
Zireael
Level 4
****


View Profile
« Reply #58 on: April 08, 2018, 07:23:15 AM »

Veins of the Earth

    new: wielding a torch increases your sight radius from 1 to 4; list sight radius on character sheet
    new: implement a (mostly) square FOV (Bjorn Bergstroem's recursive shadowcasting described on RogueBasin). Note: all libtcod algorithms except permissive with a high permissivity, which was punitive on the FPS, gave me circular FOV and as I said once on a FAQ thread, I wanted square (Chebyshev).
    new: implement Cogmind-style labels (press Tab to toggle)
    new: implement fbm noise based map generator
    bundle libtcod's Python bindings and dll's with the game source instead of looking for them system-wide...
    ... since I have several mapgens, move them to a folder. Note: this is why I bundled libtcod, after moving them to a subfolder ('subpackage' in Python parlance), they suddenly weren't able to find libtcod and/or it's DLLs
    new: implement floodfill (copied from a cave mapgen, which came from a git repo) and scanline fill (my own implementation) in the noise-based map

    fix: draw shield effect in proper spot (I mixed up self and target, oops)
    fix: speed up light gradient effect by precalculating the colors
    fix: wielding items passes a turn
    fix: log history cutting off first and/or last line


Showing off

I also started working on a continuous map (CDDA style). Since I want it to be continuous no matter what size of sectors/chunks I pick, I went with the noise-based map as the base.

I then decided that I need to find rectangles of empty space on said map (so that I can place some stuff there). Google searches led me to an interview problem of 'biggest rectangle of 1s in a matrix'. Most explanations were very convoluted, but I was able to find one that's understandable to a layman. The latter part of the solution usually involves another interview problem 'maximize rectangle under histogram' and luckily, I found a working Python solution to that.

Even though the solution I used was copy-pasted and tried, I was getting nonsense results (going out of map bounds). Turned out that the input to that last part of the algorithm was... garbage (I think it fed the data by columns instead of rows, lol). After I fixed this issue, I got this:

Code:
Largest: index: 33 x 0,y 22 to x: 40,y: 33
........................................0
........................................1
..#######...............................2
.##########.............................3
###############.........................4
#################.......................5
#################.......................6
################........................7
.###############......#.................8
.##...##########.....####....#..........9
.##.....######.#.#.#############........10
..#.........#.....###############.......11
....................############........12
.......................########.........13
........................######..........14
.......................########.........15
........................######..........16
........................######..........17
........................#####...........18
........................####............19
........................##.............#20
......................................##21
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&22
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&23
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&24
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&25
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&26
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&27
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&28
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&29
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&30
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&31
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&32
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&33
.............#####......................34
.............#####......................35
............#######.....................36
............########....................37
............########....................38
............#######.....................39

The only reason it's not committed is, there are lurking off-by-one errors (the rectangle should be smaller, line 33 had some rock in it, and I think so did 22)
Logged
Zireael
Level 4
****


View Profile
« Reply #59 on: April 16, 2018, 04:08:33 AM »



Encampment inserted in a bigger map




Changelog:
    fix: many places where I apparently forgot that I index tiles in x[y] order
    fix: unhardcode waaay too many places which relied on hardcoded map dimensions (player and AI fov, pathing, camera, debug prints, iso rendering positions, explored tiles, mouseover drawing, find grid in range, ) Note: this unharcoding allowed me to have non-square maps, which was step one for being able to insert a map in a map, see below. For performance reasons, I use libtcod's BASIC fov for AI while for the player, I use the shadowcasting written in Python
    fix: ability to load a level which does not have a JSON definition
    fix: in continuous map, keep map descriptions from inner map
    fix: some more crash prevention in square fov code
    fix: mapgen specifies start position as tuple (Note: it's just to make code clearer)
    fix: if a map is loaded not from JSON, enable the 'starting map' bool (doesn't place player on stairs)
    fix: continuous map keeps player start from inner map (so effectively guarantees you start in the most interesting part Tongue)
    fix: AI no longer wastes moves by moving into walls/trying to go out of map Note: so this built on the directions I added, I basically cribbed more of Incursion's approach. For every one of 8 directions, the AI has a short listing of directions it will attempt to go to. If the tile is blocked/out of map, it picks the next one. E.g. if it wants to go east, but it's blocked, it will try southeast, then northeast. Further directions are a bit more obscure and I basically copied them from Incursion, so I am not clear why they go in the order they do.
    fix: draw AI in reveal map mode (basically to be able to watch the AI path from far away Tongue)
    fix: code cleanup
    fix: deduplicate some stuff, such as drawing window borders, inventory screen cleanup
    fix: look up level type and arguments in a dict instead of an if-else Note: so this was the ugly unmaintainable if-else I was bemoaning yesterday. My first attempt to fix it ran into a Python 2.7 syntax limitation, so I used kwargs instead - the dictionary gets a lot more wordy, but it's a small price to pay for the increased flexibility and maintainability. Plus I think it's the first time I used kwargs consciously instead of just aping someone's approach at work.
    fix: cleanup movement key handling (basically: got rid of if-else chain by using a dictionary)

    fix: mouse move not working on large maps (one more place where map dimensions were hardcoded)

    new: wrote some code to spit out continuous maps for 20 seeds in a row

    new: ability to insert a map in a rectangle in a continuous map

    new: implement AI points of interest on a map Note: so I spent Monday reading up on Dijkstra maps (you all know the Roguebasin article and I was familiar with the Lua implementation in RotLove), and then looked at Incursion by Julian [since he has a Dijkstra on/off switch, I was curious to see how he pulled that off, and turns off the AI indeed doesn't do Dijkstra at all when it's off, not even A*], so wow, I thought, why go through the trouble of coding Dijkstra maps and updating them when I can go about it a different way?

    new: expand Direction constants to cover all possible move directions Note: so the way Incursion's AI works is basically by having a mapping of possible moves, e.g. EAST or NORTHWEST or CENTER (aka don't move) and since I love human-readable directions anyway, I cribbed this approach

    new: neutral AIs head towards map POI, if stuck (tried to move the exact way they came from) they will use A* to path to target
Logged
Pages: 1 2 [3] 4
Print
Jump to:  

Theme orange-lt created by panic