summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/dbg-maps.cc
Commit message (Collapse)AuthorAgeFilesLines
* allow iterating over branches in a non-enum order (8742)Jesse Luehrs2014-08-021-11/+9
| | | | | | | | | | | | This allows us to have a consistent and logical ordering of branches without requiring the branch enum itself to be reordered (which could have save compatibility implications). The new ordering of branches just moves Depths to the place in the ordering that it already is planned to go on the next major save compat bump, but other changes are possible, if desired. All places in the code that iterate over branches have been updated to use the new iterator except for code dealing with save files, which still uses enum order, so that we can change the display ordering without affecting saves.
* Remove stuffNicholas Feinberg2014-07-291-0/+1
| | | | | | | .cc, moving its contents into the new stepdown.cc and strings.cc. (The latter also got many donations from libutil.h.) Down with stuff! Up the new flesh!
* Fix mapstat status outputgammafunk2014-07-151-0/+1
|
* Clean up the failure handling of mapstat and objstatgammafunk2014-07-151-14/+16
|
* Add min, max, and standard deviation to objstat number fieldsgammafunk2014-07-151-0/+2
| | | | | For the basic counting field of each item and monster type, find the minimum, maximum, and sample standard deviation over the iterations.
* Record objects for objstat after the level builder has completedgammafunk2014-07-121-3/+22
| | | | | | | | Previously we were recording during the monster and item creation functions, but this resulted in some excess counting, due to (probably) objects placed in vaults on levels that were eventually rejected. We now iterate over objects after the level generation is complete.
* Include veto reasons in mapstat.log.Neil Moore2014-07-011-1/+18
|
* Properly handle map build failures in objstatgammafunk2014-06-251-1/+12
| | | | | | | | | Previously an additional check on a level that builder() had accepted could cause both mapstat and objstat to abort. We now only abort mapstat in this case, because these failures aren't very relevant to objstat. We also fail in objstat if builder() fails, since such levels might be very problematic for object statistics, but continue on with mapstat in this case.
* Fix objstats for rods, misc. items, corpseless monsters, and mimicsgammafunk2014-06-251-0/+3
| | | | | | | Display the correct properties for the first two, and report 0 chunks/nutrition for monsters that don't leave a corpse. Mimics are now revealed after the level is generated so that the mimic monster is created, and we don't count the mimic items towards item statistics.
* objstat: Item and monster generation statisticsgammafunk2014-06-251-31/+32
| | | | | | | | The -objstat command-line option will generate iterations of the given levels, compiling stats on every item and monster generated, and average the results over the iterations. It's only available in debug builds and uses the same map specification format as -mapstat. The default number of iterations is 100.
* Print some informative messages when running -mapstatgammafunk2014-06-251-9/+20
| | | | | Print the numbers of levels, iterations, and branches, as well as the output file.
* Some cleanups to mapstat codegammafunk2014-06-251-73/+67
| | | | | Remove an unnecessary loop and properly prefix some static functions and variables.
* Clean up the mapstat function names and variablesgammafunk2014-06-241-77/+77
| | | | | | The command-line option is -mapstat, so the non-static functions use the prefix mapstat_ instead of mapgen_ now for consistency. The static functions and variables have had their mg_ prefixes removed.
* Rename 'mesclr()' to 'clear_messages()'reaverb2014-06-221-4/+4
|
* Don't crash when mapstat vault statistics generation is slow.Neil Moore2014-04-041-0/+3
| | | | | | | We turn on the watchdog during mapstat generation, but writing the log could take some time because of the calls to mg_find_random_vaults selecting 10000 random maps per level. Now we pet the watchdog before writing each level's stats.
* Purge some references to Forest.Shmuale Mark2014-03-031-0/+2
| | | | In particular, ctrl-O should no longer mention the branch.
* Revert "Replace `mprf(ch, s)` with `mpr(s, ch)`"Adam Borowski2013-11-291-1/+1
| | | | | | | | It trades readability and consistency for an utterly negligible bit of speed. With the amount of further processing mpr() does, a single sprintf is nothing. This reverts commit d9dfa8fc9755fb0a4e8954c7eb94f32fe97b82e0.
* Replace `mprf(ch, s)` with `mpr(s, ch)`Chris Oelmueller2013-11-281-1/+1
| | | | Scripted, then manually reviewed.
* Replace `mprf(s)` with `mpr(s)`Chris Oelmueller2013-11-281-1/+1
| | | | Scripted, then manually reviewed.
* Don't allocate pointless iterators.Adam Borowski2013-11-151-2/+2
| | | | | map or set.count() can test the presence of a given key and return 0 or 1 outright.
* Shorten branch enums.Adam Borowski2013-11-031-2/+2
| | | | | Seriously, even preparing this commit gave me a pain in the triangle between the thumb and index finger's bases and the wrist.
* Store the entry level for every branch (rather than just depth).Adam Borowski2013-11-021-1/+1
| | | | | | | | This allows moving branches around without breaking save compat or at least serious hacks. The portal stack can be probably dropped now: two copies of the same level can't exist anyway.
* A new build flag: COLOURED_DUMPS.Adam Borowski2013-10-031-1/+1
| | | | | | If set, maps will be colour-coded to show what vaults were placed, and where. Such dumps are fit for viewing on a terminal (via cat or less -R), but not with GUI text viewers. For HTML, you probably want ansi2html.
* Don't waste electricity for mapstat infinite loops.Adam Borowski2013-10-031-0/+3
| | | | A hard limit of 60 seconds of CPU time per level.
* A too ugly to live hack for a mapstat failure.Adam Borowski2013-09-031-0/+8
| | | | | | | A real fix would be to skip disabled roulette branches, but I think a full coverage in a single iteration might be worth such a workaround. There's just one vault with this problem, as far as I know.
* Re-roll active Lair/Vaults sub-branches after every mapstat iteration.Adam Borowski2013-09-031-0/+1
| | | | All branches are checked anyway, but some vaults check branch state.
* Use FixedBitArray instead of large arrays of bools.Adam Borowski2013-04-091-1/+1
| | | | | The only cost is having assignments be a function, as you can't overload operator[] to have separate bits be lvalues.
* Clear lua dgn.persist between mapstat iterations.Adam Borowski2013-03-271-0/+1
| | | | | | In the default mode, each iteration generates maps for all possible levels, so an iteration is equivalent to a full game. No state should survive between one and another.
* Allow running --mapstat on only a selection of levels.Adam Borowski2013-03-111-2/+12
|
* Dump a bad map first, then print a message with MSGCH_ERROR.Adam Borowski2012-10-151-4/+6
| | | | Also, close the file afterwards, abort() doesn't flush libc buffers.
* Hush a couple of errors in --mapstat.Adam Borowski2012-10-151-0/+1
| | | | | | | | | | | | | | | | | | Since mapstat doesn't handle overflow temples, there's no much point in handling Temple maps exactly as in real games, at least as far as altar substitution is concerned. Also, fixed uniques need to be cleared when their vaults are cleared. I think this makes remaining errors that pop up on --mapstat real bugs; there's depressingly many of them: * layout_roguey special rooms getting overwritten by other vaults * grunt_rogues_gallery running out of subvaults (usually on encompass levels) * No vault found for tag 'laboratory_2' * Lua error: »…«/dat/des/traps/grate.des:87: attempt to index global 'e' (a nil value) * Bad (disconnected) level on XXX (vault1, vault2) • this tends to be a vault with bad substitutions, like current zaba_anthell * invalid zombie size: small zombie for moth of suppression
* Initialize item desc table in --mapstat.Adam Borowski2012-10-151-0/+1
| | | | | Errors thrown (and blindly silenced) due to bad item names are benign, but crowd out real errors.
* Typo fix.Adam Borowski2012-09-031-1/+1
|
* Merge branch 'master' into glasnostAdam Borowski2012-08-311-41/+42
|\ | | | | | | Yay for conflicts galore (wax removal, std:: purge, tileidx changes).
| * Use std namespace.Raphael Langella2012-08-261-41/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | I had to rename distance() (in coord.h) to distance2() because it conflicts with the STL function to compare 2 iterators. Not a bad change given how it returns the square of the distance anyway. I also had to rename the message global variable (in message.cc) to buffer. I tried to fix and improve the coding style has much as I could, but I probably missed a few given how huge and tedious it is. I also didn't touch crawl-gdb.py, and the stuff in prebuilt, rltiles/tool and util/levcomp.*, because I have no clue about those.
| * Massive style fix (braces, indentation, etc.)Neil Moore2012-08-011-0/+4
| |
* | Runed doors.Adam Borowski2012-08-311-0/+13
| | | | | | | | | | | | They're meant to stop autoexplore, and maybe request a confirmation for being opened. This is not yet implemented, but we can use them for converting secret doors that were used for marking a place as interesting.
* | Drop the code for displaying/handling/etc secret doors.Adam Borowski2012-07-111-14/+0
|/
* Drop parentheses around scalar values in "return".Adam Borowski2012-07-051-7/+7
|
* Fix a --mapstat crash on "acquire foo".Adam Borowski2012-06-071-0/+2
|
* Fix a --mapstat crash with > 8 octorings.Adam Borowski2012-06-071-0/+4
| | | | | Data such as uniques or artefacts generated is cleared between generator runs, and there is enough runs for oddities like this.
* Unbreak --mapstat.Adam Borowski2012-06-071-0/+2
|
* Remove a good deal of header inclusion.Adam Borowski2012-05-231-2/+0
| | | | | | | | | These accumulate but never get removed; no wonder compilation times keep rising. The includes.sh script has lots of false negatives (and positives...), and can't check .h files which cause the biggest slowdown, it'd be nice to run multidelta on those somehow.
* Use branch depth rather than absolute depth as the authoritative one.Adam Borowski2012-01-031-1/+1
|
* Don't explicitely pass absdepth:branch in the dungeon builder.Adam Borowski2012-01-031-1/+1
| | | | | There's no support for producing maps for a level you're not on, around half of functions assumed this.
* Split the branch data into read-only and mutable parts.Adam Borowski2011-11-041-4/+4
| | | | | | | | As a side effect, branches can now be shortened without breaking major save compat. This commit itself doesn't preserve compat though, even though it'd be easy -- other parts are too nasty already.
* Get rid of level_type, unify BRANCH_*, LEVEL_* and portal vaults.Adam Borowski2011-11-041-16/+2
|
* Fix format string warnings.Adam Borowski2011-07-061-6/+8
| | | | | Most are annoying STL types (which can still cause crashes on exotic platforms), but there's a number of actual bugs as well.
* Give magic mapping an uniform shape.Adam Borowski2011-04-141-1/+1
| | | | | | | | | For the scroll, it makes no sense to not affect the whole map when you happen to stand just near an edge. Ashenzari and the mutation were fine. For decks and the ball, it makes no sense to see further diagonally.
* Merge branch 'unicode'.Adam Borowski2011-04-011-2/+2
|\ | | | | | | | | There are some issues left, like incorrect wrapping in some cases, but we can fix them later.