Porting ToME2 to the T4 engine
Moderator: Moderator
-
- Archmage
- Posts: 362
- Joined: Tue Nov 09, 2010 7:43 pm
Re: Porting ToME2 to the T4 engine
Any chance you will import some of the old graphical tilesets for 2.x tome2 and Implement runecasting (since it says it unimplemented when I made a runecaster character).
-
- Sher'Tul Godslayer
- Posts: 2512
- Joined: Thu Jan 23, 2003 8:13 pm
- Location: A shallow water area south of Bree
- Contact:
Re: Porting ToME2 to the T4 engine
(shrug) I'd need sources for those tilesets. And it would depend on whether the tileset's license allowed that sort of reuse.Hellcommander wrote: ↑Sat Apr 23, 2022 9:33 am Any chance you will import some of the old graphical tilesets for 2.x tome2
Hmm, that would be interesting. The internal handling would probably be a lot like the thaumaturgy spell infrastructure. Would need to brainstorm a UI for specifying runespells, though. [sound F/X: source diving] And there's a bit of oddness in the T2 implementation I'd want to double-check first.Hellcommander wrote: ↑Sat Apr 23, 2022 9:33 am and Implement runecasting (since it says it unimplemented when I made a runecaster character).
"Blessed are the yeeks, for they shall inherit Arda..."
-
- Archmage
- Posts: 362
- Joined: Tue Nov 09, 2010 7:43 pm
Re: Porting ToME2 to the T4 engine
is it possible to make a mod where things like mobs that exist in current tome replace the tileset images for monsters of the same name and replacing stuff like walls with walls from current ToMe (maybe as a addon?).
Re: Porting ToME2 to the T4 engine
Shouldn't there be instadeath protection on zone entry? I'm sure that was a thing in the original T2. Also, I'm not 100% certain, but I think there was an inviolable 2 or 3 tile radius around the @ in which enemies couldn't spawn.
I can't have my nostalgic experience of edge scumming the mountains for dragonflies if I get a flock of crebain spawning next to me and getting to move first.
Also, a "restart same character" option at the death screen would be really handy.
EDIT: Came back a bit later to try to play normally. Maybe higher priority than indulging my urge to start scumming should be finishing Mindcraft. Priests kind of don't work without it and neural blast at least isn't working unless I downloaded an old version somehow.
I can't have my nostalgic experience of edge scumming the mountains for dragonflies if I get a flock of crebain spawning next to me and getting to move first.
Also, a "restart same character" option at the death screen would be really handy.
EDIT: Came back a bit later to try to play normally. Maybe higher priority than indulging my urge to start scumming should be finishing Mindcraft. Priests kind of don't work without it and neural blast at least isn't working unless I downloaded an old version somehow.
Digitochracy
n. 1. technocracy. 2. government by the numbers. 3. rule by people with the longest fingers.
n. 1. technocracy. 2. government by the numbers. 3. rule by people with the longest fingers.
Re: Porting ToME2 to the T4 engine
Hi
An unusual bug; - manathrust seemed to just want to lock on to a particular grid tile. I exited game, reloaded, tried to drop and then pick up the spellbook and this error report appeared.
error = "Game version: tome2-0.5.7\
Addons: gond_book-0.3.0, landmark-0.2.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: /engine/interface/ActorTalents.lua:158: attempt to index upvalue 'force_target' (a nil value)\
stack traceback:\
\9/engine/interface/ActorTalents.lua:158: in function 'getTarget'\
\9/mod/spell-util.lua
in function 'bolt_spell'\
\9/data/talents/spell/mana.lua:70: in function </data/talents/spell/mana.lua:69>\
\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/Player.lua:746 useTalent\
At /engine/interface/PlayerHotkeys.lua:179 \
At /engine/interface/PlayerHotkeys.lua:162 activateHotkey\
At /mod/class/Game.lua:1408 fct\
At /engine/interface/PlayerHotkeys.lua:326 \
At /engine/KeyBind.lua:231 "
seen = true
reported = false
An unusual bug; - manathrust seemed to just want to lock on to a particular grid tile. I exited game, reloaded, tried to drop and then pick up the spellbook and this error report appeared.
error = "Game version: tome2-0.5.7\
Addons: gond_book-0.3.0, landmark-0.2.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: /engine/interface/ActorTalents.lua:158: attempt to index upvalue 'force_target' (a nil value)\
stack traceback:\
\9/engine/interface/ActorTalents.lua:158: in function 'getTarget'\
\9/mod/spell-util.lua
\9/data/talents/spell/mana.lua:70: in function </data/talents/spell/mana.lua:69>\
\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/Player.lua:746 useTalent\
At /engine/interface/PlayerHotkeys.lua:179 \
At /engine/interface/PlayerHotkeys.lua:162 activateHotkey\
At /mod/class/Game.lua:1408 fct\
At /engine/interface/PlayerHotkeys.lua:326 \
At /engine/KeyBind.lua:231 "
seen = true
reported = false
-
- Sher'Tul Godslayer
- Posts: 2512
- Joined: Thu Jan 23, 2003 8:13 pm
- Location: A shallow water area south of Bree
- Contact:
Re: Porting ToME2 to the T4 engine
I have no idea whether it's possible to have one tileset "default" to another for tiles it doesn't have, if that's what you mean. I do get asked this general question a lot, though; what I'd need is a mapping from T2 actors/objects/map features to T4 tiles (I don't think T4 has anything like a Quylthulg, for instance). And, as above, it would depend on what license T4's tileset is distributed under.Hellcommander wrote: ↑Fri Apr 29, 2022 5:50 pm is it possible to make a mod where things like mobs that exist in current tome replace the tileset images for monsters of the same name and replacing stuff like walls with walls from current ToMe (maybe as a addon?).
Hmm, changing zones (which is what this amounts to) is not supposed to take energy. I would not be at all surprised to learn that I'm not handling that right for map-level wilderness zone transfer, though. I think I know where to look for that.Atarlost wrote: ↑Sat Apr 30, 2022 2:58 am Shouldn't there be instadeath protection on zone entry? I'm sure that was a thing in the original T2. Also, I'm not 100% certain, but I think there was an inviolable 2 or 3 tile radius around the @ in which enemies couldn't spawn.
I can't have my nostalgic experience of edge scumming the mountains for dragonflies if I get a flock of crebain spawning next to me and getting to move first.
As for monster placement, that might be tricky; I don't remember whether the level generator has worked out yet where the player is going to be on the map when it starts populating it with monsters. I'll have to dig a bit further for that.
Hadn't thought of that. I'll have to go see how the T4 module does that.
[checks notes] No, that's not implemented yet. Should be mostly feasible, I think. I'll work on that next.Atarlost wrote: ↑Sat Apr 30, 2022 2:58 am EDIT: Came back a bit later to try to play normally. Maybe higher priority than indulging my urge to start scumming should be finishing Mindcraft. Priests kind of don't work without it and neural blast at least isn't working unless I downloaded an old version somehow.
[sound F/X: source diving] … *blink* …Thorondor wrote: ↑Mon May 02, 2022 4:45 pm Hi
An unusual bug; - manathrust seemed to just want to lock on to a particular grid tile. I exited game, reloaded, tried to drop and then pick up the spellbook and this error report appeared.
error = "Game version: tome2-0.5.7\
Addons: gond_book-0.3.0, landmark-0.2.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: /engine/interface/ActorTalents.lua:158: attempt to index upvalue 'force_target' (a nil value)\
[…]






"Blessed are the yeeks, for they shall inherit Arda..."
-
- Graphical God
- Posts: 482
- Joined: Wed Jan 05, 2011 8:05 am
- Location: There and Back again
Re: Porting ToME2 to the T4 engine
Actually, you can make use freely of Shockbolt's Angband tileset, as long "your game/project is non-commercial/doesn't aim to profit from sales/ads"Zizzo wrote: ↑Fri May 06, 2022 1:13 am
I have no idea whether it's possible to have one tileset "default" to another for tiles it doesn't have, if that's what you mean. I do get asked this general question a lot, though; what I'd need is a mapping from T2 actors/objects/map features to T4 tiles (I don't think T4 has anything like a Quylthulg, for instance). And, as above, it would depend on what license T4's tileset is distributed under.

Further details can be found in the rather long thread here: http://angband.oook.cz/forum/showthread.php?t=4012. You will have to find the relevant tile mapping in Angband's code probably, but I assume that won't be much of a problem

~ [ RexOrcorum, a.k.a "rexo": Official Visual Magus, Addon Beautifier, Achiever, Knight of the 561 Trees, Dark Interfacer ] ~
darkgod wrote:~ [ DarkGod whips rexorcorum with Suslik (& many others as well) ] ~
Re: Porting ToME2 to the T4 engine
Yes it did actually. Fighting a griffon (quest monster). Tried to target it with a manathrust, and the spell stopped targetting the monster and continued to target one particular square; - when I moved the target square remained the same, and it wasn't possible to change the target.[sound F/X: source diving] … *blink* …![]()
![]()
![]()
![]()
![]()
I… think that's an engine bug. ActorTalents:useTalent(), it turns out, does some really hinky stuff under the hood, like temporarily replacing the Actor:getTalent() method when it needs a talent to target a particular spot. It looks like one of those temporary swap-ins didn't get cleaned up properly and got "stuck". I don't think any of the module code could have caused that, but I'll check. Did you see any odd symptoms or errors just before your targeting got stuck?
I dropped the spellbook, tried picking it up again, and then error messages. This also applied to other bolt spells I had, caused the error report. Quit and reloaded, and the same error arose, without any ability to fire a targeted spell
-
- Sher'Tul Godslayer
- Posts: 2512
- Joined: Thu Jan 23, 2003 8:13 pm
- Location: A shallow water area south of Bree
- Contact:
Re: Porting ToME2 to the T4 engine
Ooh, interesting. Wait, that sounds Angband-specific, though; that would likely mean it wouldn't have tiles for T2-specific monsters like Thunderlords.rexorcorum wrote: ↑Fri May 06, 2022 7:25 am Actually, you can make use freely of Shockbolt's Angband tileset, as long "your game/project is non-commercial/doesn't aim to profit from sales/ads"
That sounds like the moment when the :getTarget() method got stuck. What I was hoping for was something immediately before that, something that might give some hint of how or why that method got stuck. Maybe the quest monster bit? I'll check.Thorondor wrote: ↑Fri May 06, 2022 10:09 pm Yes it did actually. Fighting a griffon (quest monster). Tried to target it with a manathrust, and the spell stopped targetting the monster and continued to target one particular square; - when I moved the target square remained the same, and it wasn't possible to change the target.
I dropped the spellbook, tried picking it up again, and then error messages. This also applied to other bolt spells I had, caused the error report. Quit and reloaded, and the same error arose, without any ability to fire a targeted spell
"Blessed are the yeeks, for they shall inherit Arda..."
-
- Graphical God
- Posts: 482
- Joined: Wed Jan 05, 2011 8:05 am
- Location: There and Back again
Re: Porting ToME2 to the T4 engine
Yes, it's vanilla Angband only. I've played far more ToME2 than Angband back in the day and can't remember what and how many ToME2-specific npc's & monsters there are. If they aren't too many, maybe I'll be able to do something about it, at a slower pace.

~ [ RexOrcorum, a.k.a "rexo": Official Visual Magus, Addon Beautifier, Achiever, Knight of the 561 Trees, Dark Interfacer ] ~
darkgod wrote:~ [ DarkGod whips rexorcorum with Suslik (& many others as well) ] ~
Re: Porting ToME2 to the T4 engine
Sorry I can't remember exactly what happened immediately beforehand; I was part way through the quest when it went awry.That sounds like the moment when the :getTarget() method got stuck. What I was hoping for was something immediately before that, something that might give some hint of how or why that method got stuck. Maybe the quest monster bit? I'll check.
Finished the quest, recalled, and the error remains so it's not resolved by quest completion. Interesting

-
- Sher'Tul Godslayer
- Posts: 2512
- Joined: Thu Jan 23, 2003 8:13 pm
- Location: A shallow water area south of Bree
- Contact:
Re: Porting ToME2 to the T4 engine
[sound F/X: source diving] …is it possible you were digging in a wall and the griffon interrupted you? That appears to be the only place in the code where we use the 'force_target' argument of :useTalent(), and both :useTalent() and the player resting infrastructure (which we hijack for digging with shovels) fiddle with coroutines, so it's well within the realm of plausibility that they're tripping over each other.Thorondor wrote: ↑Fri May 06, 2022 10:09 pm Fighting a griffon (quest monster). Tried to target it with a manathrust, and the spell stopped targetting the monster and continued to target one particular square; - when I moved the target square remained the same, and it wasn't possible to change the target.
In the meantime, some of these new features involve backward-incompatible object changes, so I think it's time to bump up to:
Release 0.6.0 "A Mind is a Terrible Rune to Summon"
This is mostly a feature release:
- Runecraft! Usable via the new Cast Runespell talent or the new Use Runespells dialog (bound to <Ctrl-R> by default), or with Runestones. It's probably not an exact reproduction of T2's Runecraft; I didn't try to exactly reproduce T2's integer approximation of square roots used in damage dice computation, and the modifier runes depend very heavily on the vagaries of T2's project() method, which I didn't try too hard to reproduce exactly, and I'm really not sure I'm computing the failure chance right. Let me know if there are any glaring divergences and I"ll try to straighten them out.
- Mindcraft! This turned out to be harder than I was expecting (famous last words…
), because most of the actual work of some of the talents is done in some complex special-case damage types like psi-drain and domination, which I hadn't implemented yet. (This, frankly, is where I'm expecting most of my newly introduced bugs and mis-implementations to be…)
- Summoning! I'm probably missing stuff here, but we handle partial and true totems, companions that follow you across levels, and some basic giving of commands to pets by right-clicking on them. I'm really not sure I've got the mana cost for partial summons right, though…
- Speaking of complex Mindcraft effects, since the Dominate power can induce fear in its target, I had to implement various things related to NPC fear, like the AI running away when afraid, and reducing fear when taking damage. Also the Backstab skill's damage multiplier for asleep or fleeing targets.
- Since we now have various convenient ways of applying status effects to NPCs, we list them in their tooltip description for convenience.
- On a similar note, we now include distance from player in grid tooltips, as I've found it useful in T4.
- And speaking of useful things from T4, you know how you can target an NPC in T4 via the 'look around' command and bring up a map menu on it by pressing <Enter>? I just noticed that we didn't support that. Past tense.
- New options on the death dialog: "Restart the same character" and "Restart with a new character".
- Among the pet commands in T2 are toggles for whether or not pets are allowed to pick up objects or open doors. Will we want/need those?
- The map menu work reminded me that T4's map menu also allows you to choose a talent to cast at the selected actor. Is that something we want? It would take a bit of work; I think the various spell/talents definitions would have to expose more targeting information for the map menu to use.
- The Use Thaumaturgy and Use Runespells dialogs probably shouldn't be accessible if the player doesn't have the corresponding skill. That's less of a problem for Thaumaturgy, since without the skill you'd have no spells, but you can create and cast new runespells from the Use Runespells dialog, which we wouldn't want to allow without the skill.
- I think I was computing failure chance wrong for spells, basing it on player level rather than skill level. Let me know if this comes out looking obviously wrong.
- Small bug that I think would prevented Geomancy's Dripping Tread spell from ever ending…
- In retrospect, we probably should have been doing the 25%/50%/75% random movement for NPCs in the AI all along; I think I've now got it right. We also handle random movement for confused NPCs in the same place.
- Crossing the edge from one wilderness zone to another should now take no game time. For all your border-juggling speed-run needs.
- Turns out Atarlost was right, at least for wilderness levels; if it's not an ambush, T2's level generator enforces monster placement at least three grids away from where the player enters. For our purposes, of course, this is absolutely the worst zone in which to try to reproduce that functionality, because the player's entry point normally isn't computed until the last minute, after all monsters have been placed, and depends on any number of things (movement in the worldmap, crossing edge borders from an adjacent wilderness level, coming up to the wilderness from some other dungeon or quest zone). Fortunately, it looks like we can pre-compute the relevant location early enough to apply our buffer zone. We Apologize for the Violation of Personal Space.™


- Travak appearing multiple times (and apparently other artifacts…).
- Randarts reporting *ID*'d info when just ID'd? Maybe some sloppiness in Object:getDesc().
- Maze edge walls not visible. (Actually, is this still a problem? My tests aren't reproducing it.)

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.6.0 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 (current release 1.0.1): 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.
- Neutral Townsfolk (current release 1.0.0): As requested by Thorondor.
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.
Adds a book store to Gondolin (hence the name…).

"Blessed are the yeeks, for they shall inherit Arda..."
Re: Porting ToME2 to the T4 engine
Thanks Zizzo
Awesome development list, though it didn't work correctly when i tried it.
I completed a thieves quest, but when I went up the stairs it sort of froze, with a black screen. It wasn't a hang that affected the computer.
Have tried to create a saved file with a brand new file, and the game exited.
think i'm on 1.74 of tome engine.
Awesome development list, though it didn't work correctly when i tried it.
I completed a thieves quest, but when I went up the stairs it sort of froze, with a black screen. It wasn't a hang that affected the computer.
Have tried to create a saved file with a brand new file, and the game exited.
think i'm on 1.74 of tome engine.
-
- Sher'Tul Godslayer
- Posts: 2512
- Joined: Thu Jan 23, 2003 8:13 pm
- Location: A shallow water area south of Bree
- Contact:
Re: Porting ToME2 to the T4 engine
Urk… black screen usually means a UI bug. Do you have a logfile?
Here again, a logfile would help. (I swear this stuff doesn't happen while I'm testing, folks…


"Blessed are the yeeks, for they shall inherit Arda..."
Re: Porting ToME2 to the T4 engine
ok...had a further look.
New character.
successfully completes the thieves quest and goes up the ladder.
The village doesn't appear, and when I try to cast a spell I get told I cannot see. all that is there is black background but the player stats / experience remain visible.
There's no log file generated at all as not an error.
I press the various shortcut keys and they highlight, and can press the "Gain" skills command. equipment and skills aren't accessible when I tried a second time
Tried to load the game (pre-entering the quest) and it loads fine.
Entered the thieves den, attempted a save and the game closed.
Tried something different: didn't do the thieves quest, but instead went to the barrow downs; - went down to level 1, completed princess quest, and recalled successfully. the game was able to save, and then reload from the menu.
Not sure if it's an issue with the thieves quest - leaving unique levels etc?
Hope that makes sense (and hopefully helps)
New character.
successfully completes the thieves quest and goes up the ladder.
The village doesn't appear, and when I try to cast a spell I get told I cannot see. all that is there is black background but the player stats / experience remain visible.
There's no log file generated at all as not an error.
I press the various shortcut keys and they highlight, and can press the "Gain" skills command. equipment and skills aren't accessible when I tried a second time
Tried to load the game (pre-entering the quest) and it loads fine.
Entered the thieves den, attempted a save and the game closed.
Tried something different: didn't do the thieves quest, but instead went to the barrow downs; - went down to level 1, completed princess quest, and recalled successfully. the game was able to save, and then reload from the menu.
Not sure if it's an issue with the thieves quest - leaving unique levels etc?
Hope that makes sense (and hopefully helps)