MP
Member
Posts: 150
|
Post by MP on Apr 26, 2018 13:51:08 GMT
Given that you're breaking down the district walls, have you given any thought to extending the city beyond the standard 5x5 districts? I've always been intrigued by the thought of a huge city, so that the player really felt like they were exploring an urban jungle.
|
|
|
Post by zaimoni on Apr 26, 2018 16:15:03 GMT
Well...the scale isn't Los Angeles or Chicago (at standard space-time scale 30 steps is 1 hour walking distance), but it's clearly a relatively small section as we don't have any subway junctions where multiple rail lines would meet.
I've been building out the self-orders both to get a feel for how to implement AI orders to AI, and to deal with the fact the maps are "large" relative to what's interesting in them. (The district size difficulty figures are clearly out of whack. If i had per-unit scores, I could use the score distribution to estimate the difficulty curve.) I don't see trying to go beyond the current map until CPU loading is somewhat better on the development machine, etc.
I specifically want, outside of city limits: * a national guard base, with a helicopter launch pad. (I also want in-game helicopters for both National Guard and Those Guys....that actually take shots at targets out in the open.) * a gas station. If this falls to z, no more bikers or gangsters because *their* vehicles use gas or diesel.
Inside city limits, I'd like to be large enough to have a credible subway network, not just a single line.
|
|
MP
Member
Posts: 150
|
Post by MP on Apr 26, 2018 22:13:48 GMT
I'm with you on the helicopters. The army would certainly be using them, so their absence isn't right.
Perhaps you could place a limit on the range of tiles that each AI can consider per turn, to ease the CPU burden. And then like Alpha9, if they have no priority tasks and nothing of interest nearby, they could just wander. Or perhaps have simple, high level orders first, then more detailed. For example, if hungry & actor+followers have no food, simply head to the next shopping district. If in a shopping district, then the detailed priorities come into play; exploring with a priority for food (searching, breaking down doors, threatening others who have food, etc). I've not loked at your implementation, so if that's not relevant then disregard.
|
|
|
Post by zaimoni on Apr 27, 2018 4:15:47 GMT
Well, the thing is profiling/timing is very paradoxical. It is true that the Dijkstra pathing can degenerate pretty badly in the worst case, but so far other problems have caused the severe pessimizations. Currently there's already sort-of-a-range limit (police do their current map before longer-range threat-hunting and tourism behaviors) but the current implementation is hard to correctly extend to long-range recharging flashlights, and picking a good location to sleep.
When the profiler hit the no-valid-locations infinite loop, it reported that 14% of the time RS Revived was on one single line: the RNG usage that pre-screened whether to even consider placing a sewer exit (before attempting to validate the location). I ended up reversing the tests (first collating all valid positions, then using the RNG to consider those candidates).
Note that currently Dijkstra pathing (the FloodFillPathfinder class, I didn't realize it wad Dijkstra search at the time of implementation) is mostly used by police, the long-range following leader behavior, and the new-ish recheck out-of-sight stacks behavior. Minimum processing time for CivilianAI on the development system is about 20 milliseconds -- and that is dominated by inventory normalization, etc (time cost is incurred by deciding what the correct item for the left hand is, before even checking whether enemies are in LoS).
|
|
MP
Member
Posts: 150
|
Post by MP on Apr 27, 2018 5:03:31 GMT
Out of curiosity; are you using the VS profiler or a third party?
|
|
|
Post by zaimoni on Apr 27, 2018 16:00:03 GMT
I have both used the VS profiler, and have put in a define that controls attempts to time both overall AI response time and CivilianAI specifically using library classes.
I'm pretty sure a third-party profiler would be more useful, but there is no way I can responsibly budget for one.
|
|
|
Post by zaimoni on May 7, 2018 19:13:41 GMT
Just to be clear what is going on: I have constructed a localhost Mercurial repository in order to enable reviewing the entire difference file of source code changes between RS Alpha 9 and RS Alpha 10. The rate of grinding that difference file has gone done substantially so I cannot give an ETA for when I will have completely merged relevant RS Alpha 9 to 10 changes into RS Revived. (Not everything will go in, but most of it will).
It started at about 15,900 lines and is down to ~11,600 lines as of May 6 2018. I do not recommend this process for anyone without lots of time unusable for more critical things.
|
|
rustk
New Member
Posts: 1
|
Post by rustk on Jun 9, 2018 4:28:37 GMT
Just to be clear what is going on: I have constructed a localhost Mercurial repository in order to enable reviewing the entire difference file of source code changes between RS Alpha 9 and RS Alpha 10. The rate of grinding that difference file has gone done substantially so I cannot give an ETA for when I will have completely merged relevant RS Alpha 9 to 10 changes into RS Revived. (Not everything will go in, but most of it will). It started at about 15,900 lines and is down to ~11,600 lines as of May 6 2018. I do not recommend this process for anyone without lots of time unusable for more critical things.
Hey there Zaimoni - sent you a private message, not sure if you've seen it. Cheers.
|
|
|
Post by zaimoni on Jun 25, 2018 6:38:13 GMT
Easy 50% of the RS9-R10 change review done (line count slightly above 50%, but some things just won't fit cleanly). I was able to push commits to the public repository for a few days, but work loading is going up again.
Process works like this: since Mercurial only tracks files when requested to, the following works:
c:\Private.app\RSRevive.Hg .... Rogue-Survivor-Alpha-9-master Rogue-Survivor-Alpha-10-master RS9.10.Hg RSRevive.Hg is the Mercurial repository that is used to push to the public repository on BitBucket. The master directories are verbatim decompressed copies of the relevant versions.
The workhorse for the change review is RS9.10.Hg .
hg init RS9.10.Hg # copy the entire source code directory of the alpha 9 master into RS9.10.Hg cd RS9.10.Hg # hg add .... -- do entire directories at once, etc. hg commit -m "RS Alpha 9 baseline" # copy the entire source code directory of the alpha 10 master into RS9.10.Hg hg diff -w > RS9.10.diff The line count of the difference file, RS9.10.diff , is the measure of how many changes have not been inspected, evaluated for inclusion/rejection from RS Revived, and action taken. As action is taken, the corresponding changes are manually applied to each source code file in the RS9.10.Hg directory system.
cd # relevant directory containing the target file, if needed bash # if not already in that *NIX command line shell hg revert ___.cs # at this point, the current reference copy is in __.cs and the RS Alpha 10 version is in __.cs.orig . Open these in a programming editor and apply the indicated change # in RS9.10.diff from the RS Alpha 10 version to the reference copy. I also apply the matching change to RS Revived, if it is to be applied. hg commit ___.cs -m "merged into RS Revived" # alternate message: noise suppression, or statement of policy for final rejection for F in ___.cs; do mv $F.orig $F.cs; done # syntax requires *NIX command line shell and mv utility for renaming files. ___.cs is overwritten with the RS Alpha 10 version exit # if next file is not in the current directory RS9.10.diff started at ~15,700 lines. It's currently at ~8,100 lines. I'm calling it 50% done as it's pretty clear the precise item handling AI will not verbatim copy, even though I do plan to check it for bug fixes (like the bug fixes to indirect enemy identification that are landed in RS Revived.)
Note: the surface background music is in the next no-ETA-available unstable release. There are other planned adjustments changes to image and CSV files.
|
|
|
Post by zaimoni on Jul 7, 2018 20:25:23 GMT
Ok...getting ready to shift gears to actually playing test games (almost all of the RS Alpha 10 changes that don't actively interact with core RS Revived changes are in; public repository is a day or so lagged relative to my local repository). I was desk-checking how subway entrances are generated as part of determining how much time cost was involved in a proper subway network. (This involves messing with BaseTownGenerator::QuadSplit, to be able to force subway entrances to exist and immediately know whether said forcing is possible.) Visual is a wheel. For a 3x3 district city, the result would be: -+- / | \ | | | |--+--| | | | \ | / -+-
I inherit from RS Alpha the East-West subway lines. To make this work, I also need: North-south, the four T-interchanges, and a 4-way interchange (at the central i.e. default-starting district). And diagonal lines linking the east-west and north-south tracks. To fully exercise the subway generation requires a 5x5 district city. Most of this is an attention-to-detail task. Turns out it is impossible to generate subway entrances with a size-30 district
|
|
|
Post by zaimoni on Jul 13, 2018 20:21:44 GMT
The next unstable release (ETA unknown, not in a good position to initiate the required test game) will have support for non-destructive mods (that is, the ability to use mod game files without overwriting the base game files). The extent of said support is not clear (have taken a look at DeonApocalypse as an example of what is needed). Next push to the public repository will have untested support for non-destructive mods of game images.
General idea is that RS Revived will treat subdirectories of the optional Mods directory as having optionally-existing files in positions corresponding to the base game. So a port of DeonApocalypse would be a folder DeonApocalypse containing only files that should override those in the RSRevived base game.
The questions of "disable installed mods" and "control the priority order of multiple mods" have not been designed yet. I'll be using OpenXCOM and StarSector as case studies (both have good mod support with glaring capability gaps).
|
|
|
Post by zaimoni on Aug 6, 2018 20:38:46 GMT
Trunk now has an early draft of the intra-city subway network. Subway trains are blocked by the total inability of AI to defend objectives, so shall remain vaporware. I have verified that it is possible to force a subway station to spawn. Intent is that subway trains actually can travel where the tracks are electrified. (Remember, those emplaced backup generators do not need fuel. CHAR re-implemented Nikolai Tesla's magnetosphere-tap electric generator. [That 191? patent based on a prototype that accidentally vaporized a 1" diameter copper wire when turned on]. The same event that blew out the city's broadcast power, also threw all those generators into safe mode.)
Intent is that a subway station generators can electrify the tracks not only for its district, but for a one-district range from it. I'll consider the subway layout finalized when map generation guarantees that all subway tracks can be electrified.
Note that between this and a false-failure Djikstra pathfinding bugfix (the issue is in the latest unstable release, but was exposed by the RS Alpha 10 AI enhancements as a precondition violation in BehaviorFightOrFlee), per-turn times for trunk on the development system are reaching 10-ish seconds at Day 0 Hour 2 on 5x5 50x50 Classic.
|
|
|
Post by zaimoni on Aug 9, 2018 3:32:59 GMT
The subway changes had an unplanned side effect: it turns out that subways and sewers both "nuke" whatever was before them -- including NPCs (their default creation time is after NPCs have been assigned). Now that RS Revived's trunk has the ability to force subway stations, it also acquired highly populated subway stations.
Too populated. Especially in park districts. And as long as I'm having to adjust the civilian distribution, I should be considering things like "which shops would be expected to have shopkeepers, and which would have properly evacuated for the curfew".
|
|
|
Post by zaimoni on Aug 11, 2018 8:53:28 GMT
As mentioned elsewhere, RS Revived had come down with a free-attack bug (this is a crasher in debug builds). The following patches eliminated the failure for same-map attacks: lock down ActionPoints to allow use of Interlocked.Add and eliminate CheckNextActorIndex in favor of its backing private field. That leaves cross-district melee attacks (unique to RS Revived) in the simulation thread as a trigger. I don't have a visual on how to fix this (in a release build, this would simply be a sudden-death for the NPC; it's always a shambler doing the cross-district attack). AP before: 50 Melee attack function runs: predicted AP -50 actual AP: 50: throw Note that since energy recovery for a shambler is 50, even if we had a total failure of both the scheduler and the lock() primitive, running RogueGame::NextMapTurn would only recharge the shambler to 0 and that won't cause a thrown exception. The 100 AP cost of the attack is simply not being recorded. I checked that the volatile keyword, and Interlocked.MemoryBarrier(), both did not fix this. [RS Revived uses the UI thread to run NPC districts until a district containing a PC is available.] EDIT Above behavior was from z level-up.
|
|
|
Post by zaimoni on Aug 16, 2018 23:17:39 GMT
I'm technically close to pushing out an unstable release; no firm ETA yet. (There are some pathfinding weirdnesses that are exposed by the new run/walk subcommands of the far-look command; trunk pathing is not reticent enough about jumping.) The release needs to be cut before I attempt some high-risk changes to more effectively use the less extravagant pathfinding methods (RS Alpha 10 RouteFinder and RS Revived's minimum step pathfinder).
|
|