Attnam / ivan

Iter Vehemens ad Necem - a continuation of the graphical roguelike by members of http://attnam.com
GNU General Public License v2.0
303 stars 42 forks source link

(ready if working in all OSs) commands console & FeList Filter & Context Help F1 & improved dup player bug fix #458

Closed AquariusPower closed 6 years ago

AquariusPower commented 6 years ago

commands console (ready) uses the stringquestion as input and the history log as output :)

from it can be called the dup player bug fix now

I will move other advanced options to there that are too complex to keep using the user config menu.

to access it (it is "hard-coded" btw):

ctrl+`

EDIT: main reason is to help developers spend less time on debugger and debug messages, it is easily/highly extendable.

FeList filter

https://github.com/Attnam/ivan/pull/473#issuecomment-410432762 moved here to unify the Ctrl+ and F1-F12 implementation.

Context Help F1

on lists for now, big help texts can be added and will be nicely shrunk on the list but fully readable on the context help. Migrated the bloated one line list help appending into the context one.

Copy Ctrl+C DISABLED (needs a better and broader (all OSs) implementation)

current list entry for now

For now this is Linux only. TODO (can be other PR): could someone help with the Windows code/tests? I could drop some code there but cant test it... Also, will the linux code work on MACOSX? it uses a system app: xclip

dup player bug fix (twilight zone) continuation of: https://github.com/Attnam/ivan/pull/344 accessible thru a command in the console. is still not perfect and may not work in some cases. it is harmless and will just sit there until someone needs and activate it. testcases: https://github.com/Stihdjia/ivan/blob/master/Aenech_Enda.tar.gz https://github.com/Attnam/ivan/files/1934091/Save.CURRENT_TEST_CASE.zip (older game version may not load) EDIT: Obs.: this may never be completely ready, the best would be to find the cause of the duplicity.

glitch fix for Genetrix Vesana (can be enabled thru compile flag) https://github.com/Attnam/ivan/issues/457 added also a fix for this glitch, not sure if is the best option tho, so I may split it into other PR if it is better. The player will appear as near as possible to the entrance if there is something there that shouldnt be moved.

fixed old bug when praying to angry scabies and this happens: SchoolFood->EatEffect() catch thru (debugger) nemiver ./bin/ivan + autoplay wiz mode after some hours, the spawned is just schoolfood material and not the item, having no motherentity would crash. can become other PR also if it is better

AquariusPower commented 6 years ago

@Stihdjia continuing from https://github.com/Attnam/ivan/issues/453#issuecomment-407280513 it worked :), but is not perfect yet. From the commands console I called fixdupplayer the 1st time I saved it crashed. I loaded it again and used the fix again. Now it saved properly and I was able to enter the dungeon, it is saving correctly now.

But as I said, the fix should fix on the first call, not after crashes and 2 calls. I will take a look on it. If you dont manage to make it work, I can upload the fixed save if you prefer :)

AquariusPower commented 6 years ago

I will hold on this now, the biggest problem seems the many branches merge order, sometimes it may opt to use the old instead of the new code (possibly my fault?) but that is too complex to grant all new things were commited, I will just test them again now... so I will just increase my TODO list instead :)

AquariusPower commented 6 years ago

I clarified the flow about input controls at whandler.cpp, to make it easier to be maintained and so to add new functionalities easily. It worked on Linux, we need to be sure on MacOSX and Windows before this can be merged...

EDIT: I am quite satisfied with the improved usability. Also, the crafting branch is quite good already to me (but of course many minor changes would be still good, mainly to make it more difficult/lessCheapIfAtAll). If you believe any of these new things would better be isolated on a new PR to be further discussed/changed before merging, say so, I will see what can be done (about dependencies). I am seriously thinking on joining this into crafting PR so that compiles properly by travisci, if you are ok with it too, I will :) I am thinking on Ctrl+0to9 to assign quick equip/wield specific items, not sure yet tho.

jakwings commented 6 years ago

This has become a big patch... notify me when it is ready. ☕️

AquariusPower commented 6 years ago

@iology I think this is a useful skeleton that can be a base for further expansion/improvements/optimizations. I don't intend adding more features in these contexts right now, so it is ready to me. I've been using it w/o any new bugs/problems also, but... I think it is important to test it on MacOSX and Windows b4 merging.

AquariusPower commented 6 years ago

btw, my only concern is if the special keys activation flow is good, but I still see no much alternative:

btw, these special keys "request" (it is a simple single request indicator) are not buffered (shouldnt IMO), so non consumed will just be cleared when a consumer starts (ex.: felist just blindly clear the request when being started).

jakwings commented 6 years ago

The filter should be reset when closing or opening the dialog.

A weird behavior about the filter: open the inventory and filter "[", an then keep pressing the spacebar, it will show only one item at a time and finally come back to the first page.

And the annoying overlay:

ivan-felist
AquariusPower commented 6 years ago

The filter should be reset when closing or opening the dialog.

Actually it was like that on the beggining, but was too annoying to have to type the same thing again and again everytime I opened the same felist, so I left it filled. But, this could be an option! feel free to add it, something like "Clear list filter on closing".

PrepareToReturn(){
  ...
  if(ivanconfig::IsClearFilterOnClose())
    SetFilter("");
}

Or just use the Ctrl+DEL key to clear the filter, it is explained in the F1 help :)

keep pressing the spacebar

with a filter, was buggy, every list full loop would halve the pagelength and finally crash! fixed thx!

And the annoying overlay:

I am quite sure it is fixed already at my branch (as I talked to the blacksmith and had no problem) THE_MERGED_BRANCHES_I_AM_PLAYING, could you try it? it contains all my current PRs. If it still fails, I will need your cfg file to recreate the problem here :)

jakwings commented 6 years ago

Can also restore the last used filter when you press Ctrl-F, then you just need to press Enter again. Or use Ctrl-F to quickly toggle the filter list.

My config (haven't tried your branch because it takes times to pull the changes :p)
DefaultName = "You";
FantasyNamePattern = "!ss !sV";
DefaultPetName = "Moo";
AutoSaveInterval = 50;
AltAdentureInfo = 1;
BeNice = 1;
HoldPosMaxDist = 0;
MemorizeEquipmentMode = 2;
WarnAboutVeryDangerousMonsters = 1;
AutoDropLeftOvers = 0;
SmartOpenCloseApply = 1;
CenterOnPlayerAfterLook = 1;
ShowGodInfo = 1;
ShowMapAtDetectMaterial = 1;
GoOnStopMode = 0;
WaitNeutralsMoveAway = 0;
EnhancedLights = 1;
DistLimitMagicMushrooms = 0;
Contrast = 100;
WindowWidth = 800;
WindowHeight = 600;
GraphicsScale = 1;
FullScreenMode = 0;
ScalingQuality = 0;
LookZoom = 1;
XBRZScale = 0;
XBRZSquaresAroundPlayer = 3;
SilhouetteScale = 1;
AltSilhouette = 1;
AltSilhouettePreventColorGlitch = 1;
AltListItemPos = 2;
AltListItemWidth = 400;
StackListPageLength = 12;
DungeonGfxScale = 3;
FontGfx = 2;
OutlinedGfx = 0;
FrameSkip = 0;
ShowItemsAtPlayerSquare = 0;
RotateTimesPerSquare = 0;
HitIndicator = 4;
ShowMap = 2;
PlaySounds = 1;
Volume = 127;
MIDIOutputDevice = 1;
DirectionKeyMap = 2;
SaveGameSortMode = 0;
ShowTurn = 0;
ShowFullDungeonName = 1;
SelectedBkgColor = "8,8,8";
AllowMouseOnFelist = 0;
AllowImportOldSavegame = 0;
HideWeirdHitAnimationsThatLookLikeMiss = 1;
jakwings commented 6 years ago

The overlay issue remains in your branch.

AquariusPower commented 6 years ago

fixed! the problem was happening specifically when showing equipped broken items. It was not setting the alt list item properly (not disabling).

jakwings commented 6 years ago

fixed! the problem was happening specifically when showing equipped broken items. It was not setting the alt list item properly (not disabling).

Also after reading an enhancement scroll. Fixed.

AquariusPower commented 6 years ago

@andrewtweber (this PR is where I got it implemented)

about genetrix vesana glitch, I made it compile optional,

so, if later you think it should be fixed just add this compile flag: -DFIX_LARGECREATURE_TELEPORT_GLITCH I documented it at file INSTALL

btw, by luck I got a crash if that flag is not set:

area::GetSquare(v2) const //HERE V2 had invalid huge negative values for X and Y, I think it was integer limit
largecreature::PutTo(v2)
character::PutNear(v2) //TODO some complexer code could be implemented at this method
lsquare::KickAnyoneStandingHereAway()
game::EnterArea(std::vector<character*, std::allocator<character*> >&, int, int)+0x164)

but the condition for it to happen is quite extreme: the whole level almost filled with carnivorous plants and coming down from world map over genetrix vesana without using that compile flag. And it may even not crash some times.

EDIT: I couldnt figure a good ABORT() message to put at character::PutNear() yet, and what tests to perform (well, other than invalid dungeon square), but I think it should be added someday, and could point to that compile flag as a partial solution.

AquariusPower commented 6 years ago

at char.cpp, I forgot to grant the bodypart exists for the stethoscope material info, this is the fix, anyone feel free to apply thru another branch this same patch I did here

@@ -7159,9 +7159,10 @@
   for(int c = 0; c < BodyParts; ++c)
   {
     bodypart* BodyPart = GetBodyPart(c);
+    if(!BodyPart)continue;

     EntryBP.Empty();
-    if(BodyPart && BodyPart->GetMainMaterial()->GetConfig() == GetTorso()->GetMainMaterial()->GetConfig())
+    if(BodyPart->GetMainMaterial()->GetConfig() == GetTorso()->GetMainMaterial()->GetConfig())
     {
       BodyPart->GetMainMaterial()->AddName(EntryBP, UNARTICLED);
       EntryBP << " ";

btw, the "crash fix on death when polymorphed into ghost" is quite simple too and can be independent of this PR, feel free to copy too https://github.com/Attnam/ivan/pull/458/commits/cbe09f9386444a54cce81cc6ba4dd43bd27e1a12#diff-6f02e13d54bc160d836225fba439cbe0R2962

I can copy both to another branch if you prefer too :)

ryfactor commented 6 years ago

The glitch fix for Genetrix Vesana, can this please be made default? It seems like a better feature than the old behaviour. Everything compiles and runs on Windows, so I'd like to merge this PR.

AquariusPower commented 6 years ago

cool ok!

AquariusPower commented 6 years ago

I wonder if instead it could be just removed (the conditional) and related INSTALL info? for FIX_LARGECREATURE_TELEPORT_GLITCH in a sense that, if you all agree it is a glitch and therefore a bug and should not be optional?

btw, the easy change was just comment the #ifdef FIX_LARGECREATURE_TELEPORT_GLITCH and it's #endif for now, but complete removal would be better. Or it could be inverted allowing the (IMO) glitch as a feature later :>

ryfactor commented 6 years ago

Let's make the new behavior default and discard the ifdef. I think the old behavior was probably the quickest to implement at the time. Having Jenny immobile while teleporting the PC instead puts the risk/joke back on the player, which is good.