Porting ToME2 to the T4 engine

If you have a module that you'd like comments on or would like to know how to create your very own module, post here

Moderator: Moderator

What do you want to see in the next release?

Hey, why haven't you implemented my favorite race/subrace/class yet? (specify below)
0
No votes
Hey, why haven't you implemented my favorite skill/talent/spell/ability yet? (specify below)
2
50%
Hey, why haven't you implemented my favorite scroll/potion/wand/staff/rod/other object yet? (specify below)
0
No votes
Hey, why haven't you implemented my favorite store/quest/event yet? (specify below)
0
No votes
Hey, that's not what that dungeon's supposed to look like! (specify below)
0
No votes
Hey, why haven't you implemented my favorite game mechanic/UI feature yet? (specify below)
1
25%
Hey, that's a bug! Go fix that bug! (specify below)
1
25%
Hey, you didn't list what I want to see! (specify below)
0
No votes
 
Total votes: 4

Message
Author
Thorondor
Halfling
Posts: 105
Joined: Wed Apr 15, 2015 11:59 am

Re: Porting ToME2 to the T4 engine

#676 Post by Thorondor »

Cheers for the latest release. :)
The wierd thing with the summoned elemental vs kobold i mentioned i think linked to the elemental trying to push past some creatures temporarily seems to occupy the same square as the monster.
that meant that it looked like the large kobold was killed but then reappeared.
The princess quest that was unconnected to the map via a path was the circular one with 5 monsters.

of interest one of the orc cave levels had 2 completely separate sections that without teleport wouldn't be possible to fully explore.

A crash on changing level to get to deathwatch; - tried a second time and same crash happened. Log below.

[LOG] Resting starts...
[LOG] Rested for 32 turns (stop reason: all resources and life at maximum).
[LOG] #YELLOW_GREEN#There is a down staircase here.#LAST#
table: 0x09145a60 normal
Using cached font /data/font/Salsa-Mono.ttf 14
[USE ITEM] name='K) Destroy' action=destroy talent=nil
[PLAYER] recalcEverything(0)
[PLAYER] recalcEverything: done
[LOG] You have no more Drum (+0).
[LOG] You destroy a Drum (+0).
[USE ITEM] name='K) Destroy' action=destroy talent=nil
[PLAYER] recalcEverything(0)
[PLAYER] recalcEverything: done
[LOG] You have no more Ring of Cold Resistance.
[LOG] You destroy a Ring of Cold Resistance.
Creating level orc-cave 12
[Zone:newLevel] orc-cave beginning level generation, count: 1
Static generator using file /data/maps/zones/deathwatch.lua
[STATIC MAP] size 127 52 rotate: default
Added unique mod.class.NPC/GRISHNAKH_THE_HILL_ORC :: 1
Added unique mod.class.Object/OF_MAEDHROS :: 1
Added unique mod.class.NPC/GOLFIMBUL_THE_HILL_ORC_CHIEF :: 1
Added unique mod.class.Object/CAMMITHRIM :: 1
Added unique mod.class.NPC/LAGDUF_THE_SNAGA :: 1
Added unique mod.class.Object/THALKETTOTH :: 1
[DEBUG] zones/deathwatch
Loading tile terrain/floor.png
Loading tile npc/half_orc.png
Loading tile npc/ogrillon.png
Loading tile npc/grishnakh_the_hill_orc.png
Loading tile object/main_gauche.png
Loading tile npc/golfimbul_the_hill_orc_chief.png
Loading tile object/set_of_leather_gloves.png
Loading tile npc/snaga.png
Loading tile npc/cave_orc.png
Loading tile npc/lagduf_the_snaga.png
Loading tile object/leather_scale_mail.png


ERROR:
Game version: tome2-0.8.3
Addons: gond_book-0.3.0, gervais_tiles-0.5.2, town_neutral-0.3.0

Lua Error: /mod/class/generator/actor/T2LevelFilteredActors.lua:378: attempt to perform arithmetic on local 'max' (a table value)
At [C]:-1 __mul
At /mod/class/generator/actor/T2LevelFilteredActors.lua:378 regenFrom
At /engine/generator/actor/Random.lua:49 generate
At /mod/class/generator/actor/T2LevelFilteredActors.lua:86 generate
At /engine/Zone.lua:1143 newLevel
At /engine/Zone.lua:999 getLevel
At /mod/class/Game.lua:564 changeLevel
At /mod/class/Game.lua:1273
At /engine/KeyBind.lua:243


Edit
went back to town and after recalling to L20 was able to enter Deathwatch, a couple of errors on casting thaumaturgy bolt spells or maybe on uruks firing arrows (I'm wearing a shield of reflection)

error = "Game version: tome2-0.8.3\
Addons: gond_book-0.3.0, gervais_tiles-0.5.2, town_neutral-0.3.0\
\
Lua Error: /engine/interface/ActorTalents.lua:351: /engine/interface/ActorTalents.lua:324: /engine/interface/ActorTalents.lua:190: /data/damage_types.lua:360: attempt to index local 'x' (a number value)\
stack traceback:\
\9/data/damage_types.lua:360: in function 'projector'\
\9/engine/interface/ActorProject.lua:259: in function 'project'\
\9/mod/class/interface/ActorProject.lua:38: in function 'project'\
\9/mod/project-util.lua:130: in function </mod/project-util.lua:114>\
\9[C]: in function 'xpcall'\
\9/engine/interface/ActorTalents.lua:186: in function </engine/interface/ActorTalents.lua:173>\
At [C]:-1 \
At [C]:-1 error\
At /engine/interface/ActorTalents.lua:351 useTalent\
At /mod/class/NPC.lua:614 useTalent\
At /engine/ai//talented.lua:68 runAI\
At /engine/ai//talented.lua:123 doAI\
At /mod/class/NPC.lua:104 act\
At /engine/GameEnergyBased.lua:129 tickLevel\
At /mod/class/GameEnergyBasedEvilHack.lua:32 tick\
At /engine/GameTurnBased.lua:51 tick\
At /mod/class/Game.lua:746 "
seen = true
reported = false

further edit / error log - quest vs dark elven lord; - ? blindness spell triggering this

error = "Game version: tome2-0.8.3\
Addons: gond_book-0.3.0, gervais_tiles-0.5.2, town_neutral-0.3.0\
\
Lua Error: /engine/interface/ActorTalents.lua:351: /engine/interface/ActorTalents.lua:324: /engine/interface/ActorTalents.lua:190: /data/damage_types.lua:360: attempt to index local 'x' (a number value)\
stack traceback:\
\9/data/damage_types.lua:360: in function 'projector'\
\9/engine/interface/ActorProject.lua:259: in function 'project'\
\9/mod/class/interface/ActorProject.lua:38: in function 'project'\
\9/mod/project-util.lua:130: in function </mod/project-util.lua:114>\
\9[C]: in function 'xpcall'\
\9/engine/interface/ActorTalents.lua:186: in function </engine/interface/ActorTalents.lua:173>\
At [C]:-1 \
At [C]:-1 error\
At /engine/interface/ActorTalents.lua:351 useTalent\
At /mod/class/NPC.lua:614 useTalent\
At /engine/ai//talented.lua:68 runAI\
At /engine/ai//talented.lua:123 doAI\
At /mod/class/NPC.lua:104 act\
At /engine/GameEnergyBased.lua:129 tickLevel\
At /mod/class/GameEnergyBasedEvilHack.lua:32 tick\
At /engine/GameTurnBased.lua:51 tick\
At /mod/class/Game.lua:746 "
seen = true
reported = false

Zizzo
Sher'Tul Godslayer
Posts: 2506
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

Re: Porting ToME2 to the T4 engine

#677 Post by Zizzo »

Thorondor wrote: Sun Jan 28, 2024 8:01 pm The wierd thing with the summoned elemental vs kobold i mentioned i think linked to the elemental trying to push past some creatures temporarily seems to occupy the same square as the monster.
that meant that it looked like the large kobold was killed but then reappeared.
Hmm, maybe something wrong in the pushing-past code? [sound F/X: source diving] Ooh, Fire elementals have the KILL_BODY flag, so they're supposed to be able to crush weaker creatures; I bet that handling is buggy.
Thorondor wrote: Sun Jan 28, 2024 8:01 pm The princess quest that was unconnected to the map via a path was the circular one with 5 monsters.
[sound F/X: source diving] Alas, that doesn't help as much as I was hoping it would. Fortunately, all the debug logging for level generation is still turned on, but it would mean that when you see a level like this:
Thorondor wrote: Sun Jan 28, 2024 8:01 pm of interest one of the orc cave levels had 2 completely separate sections that without teleport wouldn't be possible to fully explore.
you'd need to zip up the entire log file and attach it to a comment for me to dig through.
Thorondor wrote: Sun Jan 28, 2024 8:01 pm A crash on changing level to get to deathwatch; - tried a second time and same crash happened. Log below.
[…]
Lua Error: /mod/class/generator/actor/T2LevelFilteredActors.lua:378: attempt to perform arithmetic on local 'max' (a table value)
[sound F/X: source diving] …wait, didn't we fix this before? [sound F/X: repo diving] Right, back in 0.7.4. What is it doing this time? I think I can at least patch over that for next release.
Thorondor wrote: Sun Jan 28, 2024 8:01 pm went back to town and after recalling to L20 was able to enter Deathwatch, a couple of errors on casting thaumaturgy bolt spells or maybe on uruks firing arrows (I'm wearing a shield of reflection)

[…]
Lua Error: /engine/interface/ActorTalents.lua:351: /engine/interface/ActorTalents.lua:324: /engine/interface/ActorTalents.lua:190: /data/damage_types.lua:360: attempt to index local 'x' (a number value)\
[sound F/X: source diving][sound F/X: forehead repeatedly striking desk] Fixed for next release. :oops:

And I think I'm going to go with an emergency bugfix release for these:

Release 0.8.4 "Found: One (1) Hobbit"

A few bugfixes for this release:
  • Yet Another Stupid Typo™ in the reflection code. [sound F/X: forehead repeatedly striking desk]
  • I swear, I don't know what Zone:getLevelData() is doing to muck up the level data merges for special levels like Deathwatch. I've added a few more checks in an attempt to catch whatever fever dream it's on this time. :roll:
  • Spectral NPCs are supposed to have fewer hit dice than their regular form, but Spectral Jackals aren't supposed to have 0d4 HP. :? We now constrain certain NPC ego modifications to a minimum of 1.
  • Small bug in generating the 'maze_vault' random vault type.
  • The Mindcraft power Psychic Drain uses the damage dealt to increase the caster's mana. Psi Drain Traps, which use the same damage type under the hood, don't have mana, so we probably shouldn't try to increase it. :oops:
  • Not really sure how to handle the level generation wierdness. I've put in a few more breadcrumbs in the log files to try to help track it down.
Known bugs that are still under investigation include:
  • Ring of Stupidity appearing in store stock.
  • Level generation weirdness.
  • Possible problems with NPC push-past/crush code.
And because that just wasn't enough, I whipped up a couple extra features: :wink:
  • Finally finished implementing the Lost Hobbit quest. We Apologize for the Delay.™ Note that as per the original T2 quest logic, Melinda Proudfoot won't appear in Bree until ten game days have passed.
  • In a tangentially related feature, the T2 port of my Go to Landmark addon gets an upgrade to 1.0.2, as noted below. I couldn't figure for the life of me why the landmark dialog wasn't working — until I realized that I hadn't ported over the keybinding that I added to the main addon. :oops: :wink: Both addons share the same keybinding, so if you've changed it in T4, that change should automatically get picked up in the T2 module.
As I expected, I'm probably going to be spending the next few patch releases fixing all the bugs I inevitably introduced with v0.8's bigger changes. :oops: As always, here is a good place to report said bugs.

And as always, the .team file for the release is available from my site, along with the Subversion repo and SVN::Web front-end thereto. And for those of you following along on SVN, the 0.8.4 release branch will get bug fixes for all the aforementioned inevitable bugs.

And since having them scattered throughout the thread is sort of useless, here's a reference list of all the T2 addons I've released:
  • Alchemic Arcanorum (current release 1.0.0): Starts Alchemist characters with an Alchemic Arcanorum object from my old ToME:Arcanorum T2 module, which can be used to store and extract essences.
  • Gender Parity (current release 1.0.1): Modifies assorted NPCs that don't particularly have to be male or female so that they can be either randomly.
  • Go to Landmark (new release 1.0.2): A quickie port of my T4 addon of the same name; allows you to auto-travel to various landmarks like stores or up/down stairs via the "Show known landmarks" action on the <Esc> menu or the <Alt-Shift-> keybinding (or whatever you change it to, of course).
  • Neutral Townsfolk (current release 1.0.0): As requested by Thorondor. :wink: Modifies a few of the more harmless town denizens into the "Neutral" faction so they don't pester you.
  • ZAngband Monsters (current release 1.0.1): Adds ZAngband monsters (hence the name). Untested.
  • Gondolin Book Store (current release 1.0.0): Also as requested by Thorondor. :wink: Adds a book store to Gondolin (hence the name…).
  • Gervais Tiles for ToME Classic (current release 1.0.1): Repurposes David Gervais' TomeTik tiles (reused here pursuant to the Creative Commons CC-BY-3.0 license) for use with our T2 module.
In the meantime, testing and debugging of dungeon towns has been going about as well as you'd expect. :roll: Still taking requests, of course.
"Blessed are the yeeks, for they shall inherit Arda..."

Zizzo
Sher'Tul Godslayer
Posts: 2506
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

Re: Porting ToME2 to the T4 engine

#678 Post by Zizzo »

Okay, I've been sitting on this for too long. One last test pass to flush out the worst of the bugs (he said, knowing better…), and it's time for:

Release 0.9.0 "Strip Mall"
(Backpatch release 0.8.5 "You Feel the a Previous Version is Average")

The big feature for this release, as requested, is dungeon towns. These can appear in Orc Cave, Old Forest, Moria, Land of Rhun, Sacred Land of Mountains, Illusory Castle, the Halls of Mandos, and Neather Realm, and can have stores in them that don't appear in regular towns, like the Expensive Black Market or the Forbidden Library. Some notes on dungeon towns:
  • This required a surprising amount of reworking of trap definitions. See, like T4, we implement stores on the map as a Trap entity that references a Store entity, so that we can overlay it on top of a wall grid on the map. A lot of my store and store-trap work happened very early on and was pretty ad hoc — notably, I never actually defined store traps for the stores that appear in dungeon towns. Long story sort, I ended up renormalizing how all that's handled, which mean some of the stores in regular towns may have been accidentally broken in the process; let me know if anything breaks.
  • Also of note: like T4, our store traps have custom .block_move() methods that actually pop up the store dialog, and return true so that the store grid can't be entered. The "hidden" type of dungeon town, however, has stores on random floor grids that should be passable (and would probably cause problems if they weren't); that took a bit of cleverness to implement.
  • As in T2, dungeon town levels are persistent, meaning they're saved to disk and will be exactly the same when you return to them, unlike most zones and levels. The T-Engine supports this, fortunately; I just had to do it the right way (about which more below :oops: ).
  • Unlike T2, dungeon towns don't have hidden homes in them, which means they won't screw up the Rod Tip of Home Summoning. Not that I've actually tested said Rod Tip yet, :oops: but it does use its own tracking mechanism completely separate from dungeon towns, so I can say with confidence that this particular problem at least won't happen. :wink:
  • Long-time T2 players will know that while the basic non-"hidden" type of dungeon towns with the pavilion in the center is supposed to have eight stores, sometimes they will have fewer if not enough stores pass their "rarity" check while setting up the level. As a courtesy to the player, :wink: we make more of an effort to go back and fill out all eight stores.
And one non-dungeon-town-related change that isn't backpatched into 0.8.x because it involves a backward-incompatible data change:
  • Because I'm a notorious over-engineer, :oops: :wink: this release makes some changes in how we record where an object was found and how we got it. Mostly this was just code cleanup and should work the same as before (knock on wood…), but we also add support for flagging an item as found in a wilderness zone. We even describe its location relative to the nearest town, like "in a shallow water area south of Bree". :mrgreen:
Surprisingly few bugfixes for this release:
  • Just noticed the pseudo-ID message "You feel the a Grey Speckled Potion in your pack is terrible..." :roll: Fixed to remove the extra 'a'.
  • Remember back when the Spellbinder dialog wasn't appearing, and I couldn't figure out why it wasn't popping up an error dialog? Well, I found it. :oops: See, my workaround for that weird targeting bug Thorondor was having a while back involved in part wrapping the engine's :useTalent() method in a pcall() and doing some stuff before and after; in the process, I was blindly throwing away any errors the talent might have had. :oops: I've worked out how to catch that error and bring up the appropriate error dialog, so now I expect I'll be getting lots more error reports. :? :wink:
  • Small typo that I think would have screwed up the check that's supposed to prevent us from trying to make a randart out of an unsuitable base object like an Iron Spike.
  • Apparently no one has gotten through Mount Doom yet? :oops: Like dungeon town levels, the last level of the Mount Doom zone is persistent. Turns out I was specifying that in the wrong part of the zone data, though, as I discovered while testing persistent dungeon town levels.
I've probably missed some reported bugs in the above; We Apologize for the Inconvenience.™ :oops: (Just report them again. :wink: ) Known bugs that are still under investigation include:
  • Ring of Stupidity appearing in store stock.
  • Level generation weirdness.
Also one unrelated small feature:
  • I can't believe I never added menu keys to the <Esc> game menu, after going to the trouble of writing an addon to add those to the main game. That's controlled by new game option "UI | Show menu keys on game menu", enabled by default.
And a few changes in T2 addon world:
  • Gender Parity gets a bump to release 1.0.2 to fix a small bug. See, when a Lizard king (for instance) is created, its inventory is populated and each object tagged with "You found it in the remains of" information before this addon can get in and see whether this Lizard king might actually be a Lizard queen instead. So we have to sweep the inventory and clean that up as part of the change. (There are still a few places that don't work right, like corpses and Summoner totems, but those would be a lot harder to fix…)
  • And speaking of menu keys, Go to Landmark gets upgraded to 1.0.3, adding a menu key to its "Show known Landmarks" game menu entry.
Now, while dungeon towns aren't nearly as messy under the hood as puppeting from 0.8.0 was, it still reaches its tendrils into level generation and trap handling, so I've almost certainly introduced some new bugs, to go with any bugs that haven't been found yet (and any that have and I've forgotten about… :oops:). And since this is a minor point release instead of a bugfix release, there's always the possibility that some bugfixes or game behavior changes that were applied in one of the previous minor-point release branches failed to get merged back to trunk. As always, here is a good place to report said bugs.

And as always, the .team files for the release and the backpatch release are available from my site, along with the Subversion repo and SVN::Web front-end thereto. And for those of you following along on SVN, the 0.9.0 and 0.8.5 release branches will get bug fixes for all the aforementioned inevitable bugs.

And since having them scattered throughout the thread is sort of useless, here's a reference list of all the T2 addons I've released:
  • Alchemic Arcanorum (current release 1.0.0): Starts Alchemist characters with an Alchemic Arcanorum object from my old ToME:Arcanorum T2 module, which can be used to store and extract essences.
  • Gender Parity (new release 1.0.2): Modifies assorted NPCs that don't particularly have to be male or female so that they can be either randomly.
  • Go to Landmark (new release 1.0.3): A quickie port of my T4 addon of the same name; allows you to auto-travel to various landmarks like stores or up/down stairs via the "Show known landmarks" action on the <Esc> menu, or via the <Alt-Shift-L> keybinding (or whatever you change it to, of course).
  • Neutral Townsfolk (current release 1.0.0): As requested by Thorondor. :wink: Modifies a few of the more harmless town denizens into the "Neutral" faction so they don't pester you.
  • ZAngband Monsters (current release 1.0.1): Adds ZAngband monsters (hence the name). Untested.
  • Gondolin Book Store (current release 1.0.0): Also as requested by Thorondor. :wink: Adds a book store to Gondolin (hence the name…).
  • Gervais Tiles for ToME Classic (current release 1.0.1): Repurposes David Gervais' TomeTik tiles (reused here pursuant to the Creative Commons CC-BY-3.0 license) for use with our T2 module.
And with all that off the table, I have no obvious next projects (although I strongly suspect most of my near-term work will be fixing all the bugs I just introduced and filling in all the parts of the new features that I missed… :oops: ) Any requests?
"Blessed are the yeeks, for they shall inherit Arda..."

Zizzo
Sher'Tul Godslayer
Posts: 2506
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

Re: Porting ToME2 to the T4 engine

#679 Post by Zizzo »

Working on the level generation problems, and a side issue occurs to me. See, lots of vaults in T2 are arranged kind of like this:

Code: Select all

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX%
%X,#,#,#,#,#,#,#,#*@@*#,#,#,#,#,#,#,#,X%
%X+XXXXXXXXXXXXXXXX##XXXXXXXXXXXXXXXX+X%
%X.,..,.X&.&.,*XX******XX*,.&.&X.,...,#%
%X..,.^^X....,XX***@@***XX,....X^^..,.#%
%XXXXXX+X^&.&XX***@##@***XX&.&^X+XXXXXX%
%X,.&.^^X+XXXX***@#XX#@***XXXX+X^^.,..X%
%X..,&,.X^^^@X**@#X88X#@**#@^^^X.,..&,X%
%X.,....X^^^@#**@#X88X#@**X@^^^X.&.,..X%
%X...,^^X+XXXX***@#XX#@***XXXX+X^^..,.X%
%XXXXXX+X^&.&XX***@##@***XX&.&^X+XXXXXX%
%#.,..^^X.....XX***@@***XX,....X^^.,..X%
%#...,..X&.&.,*XX******XX*,.&.&X..,..,X%
%X+XXXXXXXXXXXXXXXX##XXXXXXXXXXXXXXXX+X%
%X,#,#,#,#,#,#,#,#*@@*#,#,#,#,#,#,#,#,X%
%XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
The '%' characters represent "outer" walls (in Moria, for instance, these are regular stone walls), the 'X' characters represent permanent walls, and the '#' characters represent "inner" walls (in Moria, mountain chains [modified to be diggable for vault purposes]). This arrangement, with the perma-wall ring immediately inside the outer-wall ring, doesn't always play nicely with the lay-corridors-to-connect-rooms part of level generation, frequently requiring the player to tunnel laboriously around the edge of the vault until finding the one door or diggable spot in the outer vault perma-wall.

TL/DR: How much outrage would there be if I modified vaults like these to look more like this?:

Code: Select all

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%........................................%
%.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.%
%.X,#,#,#,#,#,#,#,#*@@*#,#,#,#,#,#,#,#,X.%
%.X+XXXXXXXXXXXXXXXX##XXXXXXXXXXXXXXXX+X.%
%.X.,..,.X&.&.,*XX******XX*,.&.&X.,...,#.%
%.X..,.^^X....,XX***@@***XX,....X^^..,.#.%
%.XXXXXX+X^&.&XX***@##@***XX&.&^X+XXXXXX.%
%.X,.&.^^X+XXXX***@#XX#@***XXXX+X^^.,..X.%
%.X..,&,.X^^^@X**@#X88X#@**#@^^^X.,..&,X.%
%.X.,....X^^^@#**@#X88X#@**X@^^^X.&.,..X.%
%.X...,^^X+XXXX***@#XX#@***XXXX+X^^..,.X.%
%.XXXXXX+X^&.&XX***@##@***XX&.&^X+XXXXXX.%
%.#.,..^^X.....XX***@@***XX,....X^^.,..X.%
%.#...,..X&.&.,*XX******XX*,.&.&X..,..,X.%
%.X+XXXXXXXXXXXXXXXX##XXXXXXXXXXXXXXXX+X.%
%.X,#,#,#,#,#,#,#,#*@@*#,#,#,#,#,#,#,#,X.%
%.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.%
%........................................%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
I may actually have to do something like this for the Between Vault to get it to work (the outer-wall ring, at least, possibly not also the extra ring of floor grids).
"Blessed are the yeeks, for they shall inherit Arda..."

Thorondor
Halfling
Posts: 105
Joined: Wed Apr 15, 2015 11:59 am

Re: Porting ToME2 to the T4 engine

#680 Post by Thorondor »

Amazing work on getting dungeon towns in, sorry i missed this update.
Looking forward to having a good crack at this :)

Feel free to modify anything as you see fit :D

Zizzo
Sher'Tul Godslayer
Posts: 2506
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

Re: Porting ToME2 to the T4 engine

#681 Post by Zizzo »

Okay, I've been sitting on this far too long, and I just tripped over a show-stopper bug in testing, so it's time to push out:

Release 0.9.1 "Connections"
(Backpatch release 0.8.6 "Room Around the Edges")

Some small bugs this time through, and a couple pretty big ones: :?
  • We forgot to mark summons from totems as having been summoned by the player. Which mainly would have meant you wouldn't gain experience from your summons' kills. :oops: We also add an explicit log message if your true totem is consumed on use.
  • Found a few more object activations that weren't defining damage types properly. I guess Blue Dragon Scale Mail isn't popular `round these parts? :wink: Also cleaned up the internal handling for how we set up artifacts that gain a random power or resist on creation, like Maedhros or Cubragol. (I may have missed some of those in the original pass, now that I look at it; if so, they should be fixed now. We Apologize for the Inconvenience.™)
  • Small tweak to the Use Thaumaturgy dialog to stop the letter character in the first column from ping-pong scrolling back and forth. :|
  • Turns out I haven't been implementing the NPC KILL_BODY and MOVE_BODY flags correctly. My original assumption was that it needed to live in Actor:block_move(), where melee attacking is done; apparently that's Wrong™. :oops: The way the T4 module does it, and the way the T-engine apparently is expecting, is to use NPC:aiCanPass() to determine that a creature can enter a grid if it can squish or displace the creature that's already there, and to do the actual squishing/displacing in mod.class.interface.Combat:bumpInto(). This seems to work under initial tests, but let me know if weird stuff happens.
  • Small typo that I think would have let you switch melee style from melee combat to unarmed combat while wielding cursed weapons.
  • Our new dungeon town handling checks for the RANDOM_TOWNS flag in the zone's defined map flags. Unfortunately, we were assuming that the zone actually did define map flags, and some quest zones don't. We're now more careful in that check. :oops:
  • Making a stab at the non-contiguous level problem. Turns out the T-Engine's map generation supports basically starting over for a level if it finds connectivity problems, and I've worked out a test to check that each room is connected to the next room in the order they were generated, which should be good enough for our purposes.
  • As I hinted at in an earlier comment, I've tweaked some of the vaults to add outer corridors, in hopes of making level layout less fraught. This also exposes some vault doors to the rest of the map, so as a precaution against vault leakage, we arrange that NPCs cannot open doors in a vault.
I've probably missed some reported bugs in the above; We Apologize for the Error.™ :oops: (Just report them again. :wink: ) Known bugs that are still under investigation include:
  • Ring of Stupidity appearing in store stock.
  • Level generation weirdness (which we hope this release will fix…).
Some new features:
  • Small Summoning-related tweak: the tooltip for a partial summon now mentions its mana cost per turn to maintain, and the Summon Maintenance effect lists the maintenance cost of each of your partial summons.
  • On a complete lark, I implemented the AI for Novice possessors (soul) and the like, which will now (in theory :? ) seek out nearby corpses to incarnate into, and will be deincarnated back out to try again when you re-kill their possessed body. :twisted:
  • Went back and implemented some of the unimplemented bits of the TY and DG curses. Like memory loss, cursing equipment, and replicating the DG curse to your other equipment‥ :twisted: :twisted:
  • And on the subject of funky artifact stuff, also implemented special handling for the Long Sword of the Dawn, including activation to summon a Warrior of the Dawn (which, when killed, has a 95% chance to summon another one), and occasionally cloning the monsters you hit with it. :twisted: :twisted: :twisted:
  • Interestingly, the infrastructure used under the hood for the Long Sword of the Dawn's cloning effect is exactly the same infrastructure that multiplying monsters use to multiply, so now that should happen too. (Why did no one tell me that White worm masses and Giant white lice weren't multiplying? :? )
  • Color icons! :shock: :mrgreen: I recently discovered that Game-icons.net, where I'm getting all of our talent icons, includes a built-in "studio" that lets you make simple alterations like color and size changes to an icon directly on its web page and save the results. That inspired me to start playing around with colorizing some of our talent icons. Of course, I made the mistake of trying to start with thaumaturgy spells, :? for which the online studio didn't help, because we need fully 28 variants of each thaumaturgy spell type for all the different possible damage types. Not to be dissuaded, though, :wink: with a bit of SVG editing, I successfully modified their basic SVG icon files into versions with the color regions split up where I wanted them, which could then be colorized in dozens of different ways with simple programmed text substitution:
    thaum-hotkeys.png
    thaum-hotkeys.png (19.41 KiB) Viewed 28193 times
    For reference, the spells shown here are, in order, a gravity bolt, a disenchantment bolt, a confusion view spell, and a create-wall blast spell. So far I've covered thaumaturgy spells and rune spells — which, ironically, were the easiest, since they could be automated. Our other three hundred or so talent icons, by contrast, will all have to be handled individually, so don't expect to see them all at once. :? [If there are any specific talent icons you're particularly hankering to see colorized, of course, I'm happy to take requests.]
  • Store improvements. T2 veterans will no doubt recall that the store interface allows you to switch between your inventory and equipment lists, allowing you to sell worn/wielded equipment directly without having to take it off first. It also allowed you to do simple things like wield or add an inscription to the thing you just bought without having to exit the store. Well, inspired by my work in the T4 Use Item Shortcuts addon, I've done some deep surgery on store and the store dialog. The new dialog allows you to switch between inventory and equipment in the store dialog, sell directly from either, and perform most of the actions that you would normally be able to do from an inventory dialog.
  • Something no one but me will see: small improvements to the "Summon Actor" function of the debug dialog, which now lets you choose the location of the summoned actor and optionally force it to be awake and/or target the
    player.
And a few changes in T2 addon world:
  • In v1.0.2 of the Gervais Tiles addon, we add a tile for the Warriors of the Dawn that we just added to the module.
  • The main module incorporates a couple ZAngband monsters out of necessity: Snaga sappers because they appear in the Invasion of Gondolin quests, and (now) Warriors of the Dawn to be summoned by the associated Long Sword. They're flagged in the main module not to appear randomly; in our ZAngband Monsters addon, we wouldn't want to miss them, so in v1.0.2 we define special versions of them that appear at their usual rate. :twisted: [DISCLAIMER: The ZAngband Monsters addon still isn't tested, but I did update it to track our latest monster generation handling.]
The bit that worries me about this release is the level generation changes; I'm kind of concerned that I'm just papering over the discontiguity problem rather than actually fixing it. Also, the KILL_BODY/MOVE_BODY change for actors has the possibility of causing weirdness. Let me know here if you see anything odd in either case (or any other bugs, of course).

And as always, the .team file for the release is available from my site, along with the Subversion repo and SVN::Web front-end thereto. And for those of you following along on SVN, the 0.9.1 release branch will get bug fixes for all the aforementioned inevitable bugs.

And since having them scattered throughout the thread is sort of useless, here's a reference list of all the T2 addons I've released:
  • Alchemic Arcanorum (current release 1.0.0): Starts Alchemist characters with an Alchemic Arcanorum object from my old ToME:Arcanorum T2 module, which can be used to store and extract essences.
  • Gender Parity (current release 1.0.2): Modifies assorted NPCs that don't particularly have to be male or female so that they can be either randomly.
  • Go to Landmark (current release 1.0.3): A quickie port of my T4 addon of the same name; allows you to auto-travel to various landmarks like stores or up/down stairs via the "Show known landmarks" action on the <Esc> menu, or via the <Alt-Shift-L> keybinding (or whatever you change it to, of course).
  • Neutral Townsfolk (current release 1.0.0): As requested by Thorondor. :wink: Modifies a few of the more harmless town denizens into the "Neutral" faction so they don't pester you.
  • ZAngband Monsters (new release 1.0.2): Adds ZAngband monsters (hence the name). Untested.
  • Gondolin Book Store (current release 1.0.0): Also as requested by Thorondor. :wink: Adds a book store to Gondolin (hence the name…).
  • Gervais Tiles for ToME Classic (new release 1.0.2): Repurposes David Gervais' TomeTik tiles (reused here pursuant to the Creative Commons CC-BY-3.0 license) for use with our T2 module.
And with all that off the table, I have no obvious next projects (although I strongly suspect most of my near-term work will be fixing all the bugs I just introduced and filling in all the parts of the new features that I missed… :oops: ) Any requests?
"Blessed are the yeeks, for they shall inherit Arda..."

Zizzo
Sher'Tul Godslayer
Posts: 2506
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

Re: Porting ToME2 to the T4 engine

#682 Post by Zizzo »

Been a while, and I think I've accumulated enough bugfixes to justify a bugfix release:

Release 0.9.2 "Dig Dug"
(Backpatch release 0.8.7 "With the Current Version Your Head is Safe!")

An eclectic assortment of bugs this time out:
  • It turns out that certain symbiotes are supposed to provide extra flags when you wear them, which we weren't implementing (We Apologize for the Inconvenience™):
    • Invisibility if it's invisible (power 20, half of a Ring of Invisibility).
    • Reflection if it has it.
    • Levitation if it can fly.
    • Water breathing if it's aquatic.
    Granted, I think the only reflecting or aquatic never-moving creatures in the game are from ZAngband or JokeAngband, which we don't have, but still. :wink: If you have any existing symbiotes, you'll probably need to release and re-hypnotize them to get these flags.
  • I was also screwing up talents conferred by symbiotes. I guess no one has been playing any Symbiant characters? :oops: Again, you'll probably need to release and re-hypnotize any existing symbiotes to get their provided powers properly set up.
  • Continuing along those lines, the "Browse spells" action for a symbiote was missing some information for the symbiote's provided talents, like mana cost and the required skill (in this case Symbiosis) and skill level.
  • In fact, generally lots of errors in the Use Talents dialog, notably doing a very bad job of determining whether the player should be allowed to use a particular talent from the dialog.
  • Also, some mistakes with various talent icons:
    • The icon filename for the NPC Paralyse talent was misspelled. :oops:
    • The NPC spells Nether Ball, Cold Ball and Mana Ball were for some reason using the same icons as their corresponding Bolt spells.
    • My programmatic method for building talents for Mimicry cloaks was botching the talent icon name for Elder Ent form.
  • So when we added support for shortcut keys to the use-item dialog back in 0.8.0, we missed some places where we needed to define them, notably in talents and objects (like symbiotes :wink: ) that provided actions to the dialog.
  • For those using T2-style monster learning via the "Gameplay | Learn monster information", we were failing to learn some NPC flags:
    • Random-movement flags if the player sees the NPC moving randomly.
    • Various can-pass-through-terrain flags if the player sees the NPC moving through the corresponding grid type.
    • Resist teleportation if the player tries to teleport an NPC or sees another NPC do so.
    • The NO_CUT flag if the player sees an NPC not bleed because of it.
    • The ORC flag for orcs detected by Orchast's detect-orc activation.
  • Small bug that may not actually ever have been tripped: Some grids (like walls) aren't suitable for dropping things in/on, and if you're on such a grid when you drop something, the game instead drops them at a random nearby suitable location. Other grids (like the Great Fire in Mount Doom) have special handling when you drop an object on them — and we were checking for that at the player's location, when we should have been checking for them at the drop location, which, as noted above, might be different.
  • Some of the NPC teleport spells weren't checking for no-teleport level flags or, for teleport-to or teleport-away, the target's teleport resistance.
  • Turns out I'd already set up the infrastructure for tunneling NPCs with the KILL_WALL flag like Umber hulks to actually dig through walls; I just wasn't telling those NPCs to use it… :oops:
  • We weren't consistently applying the NO_CUT flag for players or NPCs; in particular, we were missing cuts as a side effect of shards breath and similar.
  • Lebohaum was broken. :shock: :cry: The power conferred by wearing Lebohaum is apparently named "Artifact Lebauhaum" in T2's internal data files, and my various conversion scripts caught that in some but not all of the places they needed to. (And because the necessary change was in the talent definition rather than the object definition, any Lebohaum you've found in your current games will now be fixed. :mrgreen: )
  • Apparently the NPC AI can be called before the player is even on the map, which works about as well as you'd expect. We check for that case now.
  • Picked up a few changes to the engine's chat infrastructure that we hadn't added to our own chat wrapper for compatibility with :talentDialog(). For all you addon developers out there who were lamenting the absence of the engine's Chat:invoke hook. :wink:
  • And on the subject of compatibility with :talentDialog(), some of the other workarounds I previously needed to use the engine's various yes/no dialogs and text-entry dialogs with talents are no longer necessary with more recent engine changes, so I'm starting the process of backing them out. (Can't remove them completely until 0.10.0, because some of them are embedded in object activation methods and the like.) Should be no visible change in functionality (I hope… :? ), except that in the process, I also accidentally fixed the previously broken ask-before-wearing, ask-before-using and ask-before-dropping object configuration options. :wink: :wink:
I've probably missed some reported bugs in the above; We Apologize for the Error.™ :oops: (Just report them again. :wink: ) Known bugs that are still under investigation include:
  • Ring of Stupidity appearing in store stock.
  • Level generation weirdness (which we hope we fixed back in 0.9.0…).
And a handful of new features:
  • More talent icons colorized:
    • Talents conferred by wearing Mimicry cloaks and/or adopting one of the mimicry forms.
    • Talents conferred by the Symbiosis skill.
    • NPC breath talents. Fortunately that was another case that could be automated like runespells and thaumaturgy spells, since there were 22 of them… :o
    • The various pray-to-your-Valar talents. I went with the colors of their corresponding relic pieces in the Gervais tile set.
    • Floor inscription talents.
    I'm mostly picking off the low-hanging fruit first, but I'm certainly open to requests if anyone wants to see any particular talent icons in color.
  • And speaking of floor inscriptions, on a lark, we add the translations of all the phrases to their talent tooltips. So you can cry out, "Axes of the Dwarves! The Dwarves are upon you!" at the appropriate moment. :mrgreen:
  • The engine's custom targeting functionality that we use in my Target Filtering addon is also available here, and we should really be using it. :wink: In this first pass, we arrange for the Symbiosis talent Hypnotize to target only never-moving pets.
The bit that worries me this time around is that bit about the :talentDialog() compatibility changes. I've spot-tested the changes and they appear to work, but Murphy's Law says I missed the one that I got wrong. :? Let me know if you see anything odd related to dialogs shown while you're using a talent (or any other bugs, of course).

And as always, the .team file for the release is available from my site, along with the Subversion repo and SVN::Web front-end thereto. And for those of you following along on SVN, the 0.9.2 release branch will get bug fixes for all the aforementioned inevitable bugs.

And since having them scattered throughout the thread is sort of useless, here's a reference list of all the T2 addons I've released:
  • Alchemic Arcanorum (current release 1.0.0): Starts Alchemist characters with an Alchemic Arcanorum object from my old ToME:Arcanorum T2 module, which can be used to store and extract essences.
  • Gender Parity (current release 1.0.2): Modifies assorted NPCs that don't particularly have to be male or female so that they can be either randomly.
  • Go to Landmark (current release 1.0.3): A quickie port of my T4 addon of the same name; allows you to auto-travel to various landmarks like stores or up/down stairs via the "Show known landmarks" action on the <Esc> menu, or via the <Alt-Shift-L> keybinding (or whatever you change it to, of course).
  • Neutral Townsfolk (current release 1.0.0): As requested by Thorondor. :wink: Modifies a few of the more harmless town denizens into the "Neutral" faction so they don't pester you.
  • ZAngband Monsters (current release 1.0.2): Adds ZAngband monsters (hence the name). Untested.
  • Gondolin Book Store (current release 1.0.0): Also as requested by Thorondor. :wink: Adds a book store to Gondolin (hence the name…).
  • Gervais Tiles for ToME Classic (current release 1.0.2): Repurposes David Gervais' TomeTik tiles (reused here pursuant to the Creative Commons CC-BY-3.0 license) for use with our T2 module.
And Eru help me, I've actually started dabbling in Possession for the next minor point release. :shock: :? I can set that aside for a while, though, if there are requests for other features?
"Blessed are the yeeks, for they shall inherit Arda..."

Post Reply