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)
1
17%
Hey, why haven't you implemented my favorite skill/talent/spell/ability yet? (specify below)
2
33%
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)
2
33%
Hey, that's a bug! Go fix that bug! (specify below)
1
17%
Hey, you didn't list what I want to see! (specify below)
0
No votes
 
Total votes: 6

Message
Author
darkgod
Master of Eyal
Posts: 10750
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: Porting ToME2 to the T4 engine

#226 Post by darkgod »

Take a look at mod.class.interface.PlayerDumpJSON in ToME (and how it's used in mod.class.Game)
This is responsible for making a JSON dump that can be uploaded :)
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

Zizzo
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

#227 Post by Zizzo »

Crim, The Red Thunder wrote: Wasn't there some dungeon guide parchment that listed dungeons and threat levels for them?
(notably the 'depth' they equated to)
[sound F/X: source diving] There's a page in the in-game help menu with that information, in the 'Spoilers' subsection; no in-game parchment.
Crim, The Red Thunder wrote:And I woudn't be amiss with adding some guidance. Guiding to BD, OF, Mordor wouldn't hurt as a baseline, though doing Mordor right after OF is often a risky proposition.
*blink* Do... you mean Mirkwood instead of Old Forest? Because yeah, jumping nine levels of dungeon depth between the bottom of Old Forest and the top of Mordor would be pretty risky. :o :?

Assuming you do mean Mirkwood, yeah, I almost always do at least one of Moria and Land of Mountans before Mordor.
Crim, The Red Thunder wrote:One way to enforce 'completion' would be to set random qeusts from 0-98 to 3-98, and do a forced one at the bottom of each. Of course, this'd screw up mods that do special things at the bottom of BD like Theme.
Hmm. Tricky. At the risk of asking, how tacky would it be to actually add boss monsters to the mainline dungeons?
Crim, The Red Thunder wrote:Side quests are just that, side. And not so much quest as a way to get something more in the exp and loot departments then just farming the same level endlessly.
True, but as you say, some of the side dungeons are quite usefully done between some of the mainline dungeons. I'm just thinking ahead to trying to facilitate the player exploring those options.
Crim, The Red Thunder wrote:and complete and TOTAL lack of illusory castle, EVER because it's stupidly suicidal and offers a bad reward. (Well, maybe slightly better for AM, but still bad.)
Heh. :wink: My Archer actually caught a Thunderlord down to the bottom of Illusory Castle to pick up the Helm of Knowledge to cover his identifying needs. But yeah, actually walking it? Not happening.
Crim, The Red Thunder wrote:I'm pretty sure you get threat value messages on dungeon entrance (floor entrance, actually), unless zizzo doesn't have that coded in. That's a loose thing to go by.
Level feelings are implemented, but I'm not sure how useful they are as a danger guide:
  • They reflect both dangerous monsters and valuable treasure on the level, so there's noise in the signal from the start.
  • "You have a superb feeling about this level" isn't particularly going to dissuade a player that doesn't know what it means.
  • They don't scale with player level, so even a level-50 player wandering around in lower Moria, for instance, would still get a string of "superb" levels.
Crim, The Red Thunder wrote:Also, a thought on persistence and preserve mode arises re: long standing mount doom bug, where you could end up with no generating sauron or ring because shenanigans. What can be done to best address this?
You mean Sauron being generated on Mount Doom and thereby marked as having already been created, so that he never shows up on Ang99? Hmm, in extremis, we could have some sort of leave-level hook on MDm99 to remove Sauron if he's present. Although there's always the 'force_unique' parameter of Zone:makeEntityByName()... :twisted:
Crim, The Red Thunder wrote:(Also, bonus achievement. Sacrifice the ring on mount doom without ever entering angband first. 'Just like Frodo' (or something like that). Nonsense diving into the greatest evil just to go across the world again. Not quite 'never look back and there again' but it's something for challenge-gamers.)
Challenge? Isn't that pretty much SOP if you can get one of the alternate Ring-droppers to cough up? That's what I've always done, at least. But sure, I think I can make an achievement like that work.
darkgod wrote:Take a look at mod.class.interface.PlayerDumpJSON in ToME (and how it's used in mod.class.Game)
This is responsible for making a JSON dump that can be uploaded :)
[sound F/X: source diving] So it looks like it basically involves calling player:getUUID() during character creation, calling :saveUUID() in a couple places like :saveGame() and character death, and overriding :dumpToJSON() to build a JSON-flavored data structure representing the character sheet. Is there a guide on the wiki or somewhere for how the JSON data needs to be arranged?
"Blessed are the yeeks, for they shall inherit Arda..."

HousePet
Perspiring Physicist
Posts: 6215
Joined: Sun Sep 09, 2012 7:43 am

Re: Porting ToME2 to the T4 engine

#228 Post by HousePet »

Last time I tried modifying the JSON data sent to the server it just decided the info was invalid. That might have just been due to me stuffing up or a badly coded hook.
But anyway, I don't think there is any documentation.
My feedback meter decays into coding. Give me feedback and I make mods.

Crim, The Red Thunder
Sher'Tul Godslayer
Posts: 2000
Joined: Fri May 07, 2004 8:26 pm
Location: Nahgharash

Re: Porting ToME2 to the T4 engine

#229 Post by Crim, The Red Thunder »

Challenge? Isn't that pretty much SOP if you can get one of the alternate Ring-droppers to cough up? That's what I've always done, at least. But sure, I think I can make an achievement like that work.
Other things ever drop the ring? I have literally never seen this happen on any number of characters. I think I'd actually forgotten it could, and everyone had to dive angband for it. Nevermind then.
Currently playing under the name Aura of the Dawn 4 down, 227 to go!
Proud author of Orc Pit Restoration Project, Faction Allies, Dwarven Adventurer addons
SadistSquirrel wrote:DarkGod has two arms, one with an opened hand, one with a closed fist. You got the fist.

Zizzo
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

#230 Post by Zizzo »

HousePet wrote:Last time I tried modifying the JSON data sent to the server it just decided the info was invalid. That might have just been due to me stuffing up or a badly coded hook.
But anyway, I don't think there is any documentation.
My current working hypothesis is that there's a server-side data structure definition file of some sort that the server uses to transform the JSON data into web-viewable character sheets on the fly. Which would mean that I'll probably need DarkGod's cooperation to install a suitable definition file for T2 character sheets.
Crim, The Red Thunder wrote:Other things ever drop the ring? I have literally never seen this happen on any number of characters. I think I'd actually forgotten it could, and everyone had to dive angband for it. Nevermind then.
It's not something you'll stumble across if you're not specifically looking for it. The alternate Ring-droppers are all boss monsters of side dungeons that most people probably don't bother doing (even I just Thunderlord to the bottom for most of them), and they only have a 10% chance of dropping the Ring (assuming you don't unknowingly kill them before getting the destroy-the-ring quest). It's only panned out for a few of my characters, notably Lisa.

"I still say that has to have been your fault somehow."

*sigh* I promise you, Trilogy, if there were anything at all I could have done to increase your odds of getting the Ring from alternate Ring-droppers, I would have done it.

"Uh-huh."

You see what I have to put up with. :wink:
"Blessed are the yeeks, for they shall inherit Arda..."

darkgod
Master of Eyal
Posts: 10750
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: Porting ToME2 to the T4 engine

#231 Post by darkgod »

Docs ? lol that's not my type ! :)

And yes the JSON data has a version marker, currently "tome-json-char-1" for tome.
It then calls a bit of php code that knows how to display that specific version.

But my idea was more for the long term to let you use them as you want, te4.org exposes a web API to query the vault: http://zigur.te4.org/
So you could use it to read the vault, get the json and display it in whatever way you wish :)
I could host it on te4.org but I'm not sure I want to as it's tolkien stuff and that brings back memories of C&D letters and all that; it's probably way safer to display it on your side.
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

Crim, The Red Thunder
Sher'Tul Godslayer
Posts: 2000
Joined: Fri May 07, 2004 8:26 pm
Location: Nahgharash

Re: Porting ToME2 to the T4 engine

#232 Post by Crim, The Red Thunder »

As a fanwork, not sold for profit, and properly credited, I fail to see how a C&D would have any legal basis. He's not selling or asking for money (and neither are you), so unless the module was somehow tied to donating, wouldn't you have a firm legal footing?

Pretty sure there are even some legal rulings relating to fanworks being protected as fair use, to provide precedent.
Currently playing under the name Aura of the Dawn 4 down, 227 to go!
Proud author of Orc Pit Restoration Project, Faction Allies, Dwarven Adventurer addons
SadistSquirrel wrote:DarkGod has two arms, one with an opened hand, one with a closed fist. You got the fist.

darkgod
Master of Eyal
Posts: 10750
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: Porting ToME2 to the T4 engine

#233 Post by darkgod »

So was Pernangband though :/
The Tolkien family and while they are rather nice people regarding rights they are not the only ones with the rights, namely the Warner does too and those are well .. less nice people ;)

So I'm happy to help with all the technical stuff I can because T2 on T4 is something I want to see working dearly I really can't take any risks with visible hosting; even if far fetched.
Also I know zizzo, he is way more than capable of calling a simple API and displaying a JSON ;)
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

Zizzo
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

#234 Post by Zizzo »

darkgod wrote:I could host it on te4.org but I'm not sure I want to as it's tolkien stuff and that brings back memories of C&D letters and all that; it's probably way safer to display it on your side.
No worries. :wink: Though it sounds like without someplace to host it (and I kind of doubt my ISP would let me get away with that on my tiny little vanity site :oops: ), the effort wouldn't really buy me much.
"Blessed are the yeeks, for they shall inherit Arda..."

Jaylow7
Wayist
Posts: 16
Joined: Wed Aug 12, 2015 2:48 pm

Re: Porting ToME2 to the T4 engine

#235 Post by Jaylow7 »

Zizzo wrote: On the subject of a "winnable" game:

* How attached are people to Sauron's habit of only dropping the One Ring 30% of the time, leading to potentially having to kill him multiple times to get the Ring? I always found that vaguely annoying and pointless.
Is there a way you could make it conditional?

I'm thinking something along the lines of:
The alternate bearers have their standard (10% I think it is?) chance to drop the Ring.
If all alternate carriers are dead, give Sauron 100% chance to drop the Ring, 30% otherwise.

(This is motivated by a recent ToME 2 playthrough, which died to Sauron after failing to get the ring from any alternate bearers as well as TWELVE other Sauron kills.)
Zizzo wrote:So, a playable/winnable game. For that, of course we'll need the Ring plot. Now, T2 pretty much skips straight ahead to the Necromancer step of the plot, expecting the player to know what to do and where to go until they're strong enough to hit Dol Guldur. This is in contrast with, for instance, T4, which guides the player along starting right from the T1 zones. We could conceivably do something like that here, but I'm not sure what it would look like.

That, then, is the question: T2 way or T4 way? If we change this, it'll probably be the first significant deviation from T2 "canon", so I'll want some thoughts and feedback on how to proceed.
DEFINITELY something more guided than the way T2 did it. I lost many early characters to not knowing where to go and attempting to do the trolls/wight quests or Maze way before my character could handle it.

Jaylow7
Wayist
Posts: 16
Joined: Wed Aug 12, 2015 2:48 pm

Re: Porting ToME2 to the T4 engine

#236 Post by Jaylow7 »

And another bug:

Code: Select all

error = "Lua Error: /mod/class/Game.lua:869: attempt to index field 'level' (a nil value)\
  At [C]:-1 __index\
  At /mod/class/Game.lua:869 \
  At /engine/KeyBind.lua:241 "
What I did:
Launch T4
Select New Game
Go through the steps of character creation
Upon clicking "Create character" the main game screen has not changed in any way. Stats are all still 10, nothing else in the stats display has changed, and no map on screen.
Hitting Escape>"Exit Game">"Abandon character and go to main menu" brings up the error dialog.

Repeating these steps, after fully closing and relaunching the game, I got a second error:

Code: Select all

error = "Lua Error: /data/zones/town-bree/zone.lua:55: attempt to index field 'Quest' (a nil value)\
  At [C]:-1 __index\
  At /data/zones/town-bree/zone.lua:55 f\
  At /engine/Zone.lua:739 load\
  At /engine/Zone.lua:113 init\
  At /engine/class.lua:104 new\
  At /mod/class/Game.lua:359 changeLevel\
  At /mod/class/Game.lua:174 at_end\
  At /mod/dialogs/Birther.lua:382 callback\
  At /mod/dialogs/Birther.lua:343 checkNew\
  At /mod/dialogs/Birther.lua:384 atEnd\
  At /mod/dialogs/Birther.lua:123 fct\
  At /engine/ui/Button.lua:62 fct\
  At /engine/Mouse.lua:56 receiveMouse\
  At /engine/Mouse.lua:94 delegate\
  At /engine/ui/Dialog.lua:602 mouseEvent\
  At /engine/ui/Dialog.lua:343 fct\
  At /engine/Mouse.lua:56 "

Zizzo
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

#237 Post by Zizzo »

Jaylow7 wrote:And another bug:

Code: Select all

error = "Lua Error: /mod/class/Game.lua:869: attempt to index field 'level' (a nil value)\
  At [C]:-1 __index\
  At /mod/class/Game.lua:869 \
  At /engine/KeyBind.lua:241 "
What I did:
Launch T4
Select New Game
Go through the steps of character creation
Upon clicking "Create character" the main game screen has not changed in any way. Stats are all still 10, nothing else in the stats display has changed, and no map on screen.
Hitting Escape>"Exit Game">"Abandon character and go to main menu" brings up the error dialog.
...Well, that error would be consistent with the game being unable to generate the Bree level.
Jaylow7 wrote:Repeating these steps, after fully closing and relaunching the game, I got a second error:

Code: Select all

error = "Lua Error: /data/zones/town-bree/zone.lua:55: attempt to index field 'Quest' (a nil value)\
  At [C]:-1 __index\
  At /data/zones/town-bree/zone.lua:55 f\
  At /engine/Zone.lua:739 load\
  At /engine/Zone.lua:113 init\
  At /engine/class.lua:104 new\
  At /mod/class/Game.lua:359 changeLevel\
  At /mod/class/Game.lua:174 at_end\
  At /mod/dialogs/Birther.lua:382 callback\
  At /mod/dialogs/Birther.lua:343 checkNew\
  At /mod/dialogs/Birther.lua:384 atEnd\
  At /mod/dialogs/Birther.lua:123 fct\
  At /engine/ui/Button.lua:62 fct\
  At /engine/Mouse.lua:56 receiveMouse\
  At /engine/Mouse.lua:94 delegate\
  At /engine/ui/Dialog.lua:602 mouseEvent\
  At /engine/ui/Dialog.lua:343 fct\
  At /engine/Mouse.lua:56 "
[sound F/X: source diving] ...huh? Why would referencing engine.Quest PENDING work everywhere else but not here? I swear this worked in testing... Okay, pushed out an updated module that should fix this. We Apologize for the Inconvenience.™

Jaylow7 wrote:Is there a way you could make it conditional?

I'm thinking something along the lines of:
The alternate bearers have their standard (10% I think it is?) chance to drop the Ring.
If all alternate carriers are dead, give Sauron 100% chance to drop the Ring, 30% otherwise.
Now, that's an interesting angle. It would definitely work out well for me, since I always go for the alternate Ring-droppers first. Let's see, I'm already handling the actual dropping of the Ring in an actor callback in the quest data; it would be pretty easy to keep a record there of which of the alternate Ring-droppers had been killed. Done and done.
Jaylow7 wrote:(This is motivated by a recent ToME 2 playthrough, which died to Sauron after failing to get the ring from any alternate bearers as well as TWELVE other Sauron kills.)
[sound F/X: calculator] :shock: ...Have you looked into buying a lottery ticket? Because if I'm calculating this right, what you describe here has a less then 1% chance of happening.
Jaylow7 wrote:DEFINITELY something more guided than the way T2 did it. I lost many early characters to not knowing where to go and attempting to do the trolls/wight quests or Maze way before my character could handle it.
Hmm, in T2, quests like this have a "danger level" annotation in their description, which looks like it roughly corresponds to the equivalent depth of the quest zone. Would that be a useful thing to have?
"Blessed are the yeeks, for they shall inherit Arda..."

HousePet
Perspiring Physicist
Posts: 6215
Joined: Sun Sep 09, 2012 7:43 am

Re: Porting ToME2 to the T4 engine

#238 Post by HousePet »

The Danger Level is sort of useful, but I don't recall it ever being stated as to what it even meant.
My feedback meter decays into coding. Give me feedback and I make mods.

Crim, The Red Thunder
Sher'Tul Godslayer
Posts: 2000
Joined: Fri May 07, 2004 8:26 pm
Location: Nahgharash

Re: Porting ToME2 to the T4 engine

#239 Post by Crim, The Red Thunder »

Zizzo wrote:
Jaylow7 wrote:(This is motivated by a recent ToME 2 playthrough, which died to Sauron after failing to get the ring from any alternate bearers as well as TWELVE other Sauron kills.)
[sound F/X: calculator] :shock: ...Have you looked into buying a lottery ticket? Because if I'm calculating this right, what you describe here has a less then 1% chance of happening.
Except that as any statistics armchair theorist will tell you, it's actually only a 30% chance of happening... no matter what the subjective view is.

Now a thought on this. This means we till get to hunt sauron at 30% chances, rather then being FORCED to take on Ar-Pharazon, right?
Currently playing under the name Aura of the Dawn 4 down, 227 to go!
Proud author of Orc Pit Restoration Project, Faction Allies, Dwarven Adventurer addons
SadistSquirrel wrote:DarkGod has two arms, one with an opened hand, one with a closed fist. You got the fist.

Jaylow7
Wayist
Posts: 16
Joined: Wed Aug 12, 2015 2:48 pm

Re: Porting ToME2 to the T4 engine

#240 Post by Jaylow7 »

Crim, The Red Thunder wrote: Now a thought on this. This means we till get to hunt sauron at 30% chances, rather then being FORCED to take on Ar-Pharazon, right?
Yes, with my proposed method of handling things there's nothing saying you can't just go straight from DG to Angband and scum level 99 for Sauron at the reduced drop rate.

Post Reply