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

#106 Post by darkgod »

Oh this has much advanced since last time :)

A few things:
- Upload releases to te4.org !
- Autoexplore, pleasssssseee ! :)
- Validating the levelup dialog is really not intuitive for those that do not read ;) a "Ok" / "Cancel" button pair would be neat ;)
- Make ASCII not transparent, at least as an option
- Enable ingame chat, it's most easy:

Code: Select all

Index: init.lua
===================================================================
--- init.lua	(revision 805)
+++ init.lua	(working copy)
@@ -29,6 +29,7 @@
 The original Tales of Middle Earth v2.3.9 (or a reasonable approximation thereof) ported to the TE4 engine.
 ]]
 starter = "mod.load"
+allow_userchat = true -- We can talk to the online community
 
 no_get_name = true	-- Handle name juggling ourself.
 
Index: class/Game.lua
===================================================================
--- class/Game.lua	(revision 805)
+++ class/Game.lua	(working copy)
@@ -103,6 +103,9 @@
       self.log(style, ...)
     end
   end
+  self.logChat = function(msg, ...)
+    self.log(msg, ...)
+  end
 
   self.log(self.flash.GOOD, "Welcome to #00FF00#Tales of Middle-Earth#LAST#!")
 
Some bugs:
- Pray to Tulkas skill gives a lua error for tooltip:

Code: Select all

Lua Error: /data/talents/player/pray.lua:131: attempt to index global 'src' (a nil value)
	At [C]:-1 __index
	At /data/talents/player/pray.lua:131 describe
	At /data/talents/player/pray.lua:112 info
	At /engine/interface/ActorTalents.lua:78 info
	At /mod/class/Actor.lua:410 getTalentFullDescription
	At /engine/HotkeysDisplay.lua:198 onMouse
	At /mod/class/Game.lua:664 fct
	At /engine/Mouse.lua:76 
- Tried to make a high elf sorceror and got:

Code: Select all

Lua Error: /mod/class/Player.lua:848: attempt to perform arithmetic on field 'luck' (a table value)
	At [C]:-1 __add
	At /mod/class/Player.lua:848 getLuck
	At /mod/class/Player.lua:852 getLuckScale
	At /mod/class/Object.lua:105 resolve
	At /engine/Zone.lua:455 finishEntity
	At /engine/Zone.lua:426 makeEntityByName
	At /mod/class/NPC.lua:167 populateInitialInventory
	At /mod/resolvers.lua:212 
	At /engine/Entity.lua:571 resolve
	At /engine/Zone.lua:455 finishEntity
	At /engine/Zone.lua:396 makeEntity
	At /engine/generator/actor/Random.lua:101 generateOne
	At /engine/generator/actor/Random.lua:118 regenFrom
	At /engine/generator/actor/Random.lua:47 generate
	At /engine/Zone.lua:909 newLevel
	At /engine/Zone.lua:804 getLevel
	At /mod/class/Game.lua:271 changeLevel
	At /mod/class/Game.lua:146 at_end
	At /mod/dialogs/Birther.lua:322 callback
	At /mod/dialogs/Birther.lua:293 checkNew
	At /mod/dialogs/Birther.lua:324 atEnd
	At /mod/dialogs/Birther.lua:114 fct
	At /engine/ui/Button.lua:64 fct
	At /engine/Mouse.lua:56 receiveMouse
	At /engine/Mouse.lua:94 delegate
	At /engine/ui/Dialog.lua:547 mouseEvent
	At /engine/ui/Dialog.lua:326 fct
	At /engine/Mouse.lua:56 
[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: 2517
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

Re: Porting ToME2 to the T4 engine

#107 Post by Zizzo »

darkgod wrote:- Upload releases to te4.org !
I can do that? I assumed I'd have to wait until I was much further along before I could do that. [...] Okay, I've uploaded a stab at it. Where do I get the module MD5 from, though? The log file reports a nil MD5 for the module, and a quick source dive through engine.Module:instanciate() suggests that it's printing the wrong thing anyway.
darkgod wrote:- Autoexplore, pleasssssseee ! :)
Okay, okay... :wink: Does the example module implement auto-explore, or am I going to have to decipher what the T4 module is doing?
darkgod wrote:- Validating the levelup dialog is really not intuitive for those that do not read ;) a "Ok" / "Cancel" button pair would be neat ;)
Done in SVN.
darkgod wrote:- Make ASCII not transparent, at least as an option
How do I do that? That's actually been bugging me for a while.
darkgod wrote:- Enable ingame chat, it's most easy:
Done in SVN.
darkgod wrote:Some bugs:
- Pray to Tulkas skill gives a lua error for tooltip:
[sound F/X: forehead repeatedly striking desk] Fixed in SVN.
darkgod wrote:- Tried to make a high elf sorceror and got:
[sound F/X: source diving] Hmm. Player luck hasn't been resolve()'d yet at that point. I hadn't tripped over that before, because all my test characters used races or classes with luck modifiers, which concealed the problem. Papered over for now in SVN. For reference, is there a particular reason that Game:newGame() needs to call Game:changeLevel() before resolve()'ing the player? That's copied from the example module, and appears to be the way the T4 module does it, but it would work better for my case to do it the other way around.

Oh, and fair warning: spells aren't implemented yet, so your Sorceror wasn't going to get far anyway. I can work on that for the next release, unless anyone wants me to give higher priority to something else.
"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

#108 Post by darkgod »

MD5 should compute right in 1.2.0, just grab the latest test version.

For non-transparent ASCII, just add:

Code: Select all

Map.tiles.force_back_color = {r=0, g=0, b=0, a=255}
T4's autoexplore does many things, I suggest you instead look at engine.interface.PlayerExplore

No reason for resolving after, except that in T4 some resolvers need a level; if yours dont then no problem.

Spells would be neat, but you seem to be doing fine on your own deciding what to do so it's just a suggestion :)
I have no idea how much is done vs. not done so .. :)
[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

#109 Post by Crim, The Red Thunder »

Just dropping words of encouragement, and watching this for the day I can joyously experience a modern ToME2. (Or Classic Tome, or whatever variation one wants to call it.)

I won't even complain about wanting to have my beloved thaumaturges back yet. No really, I won't complain at all. Lovely Lovely meteor strikes.

Can't wait for this to become the next big thing!

Also, will it be possible to import the T2 graphic tileset, and upscale the tiles if necessary, or are they protected source material or something?
Last edited by Crim, The Red Thunder on Sun May 18, 2014 4:47 pm, edited 1 time in total.
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.

jenx
Sher'Tul Godslayer
Posts: 2263
Joined: Mon Feb 14, 2011 11:16 pm

Re: Porting ToME2 to the T4 engine

#110 Post by jenx »

pleeeeeaaaaasssssseeeeee do this!
MADNESS rocks

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

Re: Porting ToME2 to the T4 engine

#111 Post by darkgod »

Most certainly possible possible to use the tiles yes; let's trike a deal here zizzo, I allow you to use tome2 tiles in your tome2 rewrite provided that you whip yoruself and make the said tome2 rewrite working :>
[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: 2517
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

Re: Porting ToME2 to the T4 engine

#112 Post by Zizzo »

Crim, The Red Thunder wrote:I won't even complain about wanting to have my beloved thaumaturges back yet. No really, I won't complain at all. Lovely Lovely meteor strikes.
Ooh, thaumaturgists will be tricky; I'd either have to create random Thaumaturgy spell talents ex nihilo and somehow get them to persist in the savefile, or have a two-stage system with a single Cast Thaumaturgy Spell talent that goes to another dialog that lets you select a spell. That will happen much later, I think.
Crim, The Red Thunder wrote:Also, will it be possible to import the T2 graphic tileset, and upscale the tiles if necessary, or are they protected source material or something?
jenx wrote:pleeeeeaaaaasssssseeeeee do this!
darkgod wrote:Most certainly possible possible to use the tiles yes; let's trike a deal here zizzo, I allow you to use tome2 tiles in your tome2 rewrite provided that you whip yoruself and make the said tome2 rewrite working :>
Well, I can hardly turn down a request like that. :wink: I've cobbled together an implementation that seems to work, and checked it into SVN. As a teaser, here's a quick test of a Half-Ogre Barbarian Swordmaster about to clobber a hapless Pitiful-looking beggar:
Image
This is at 32x32 tile size; 48x48 and 64x64 should also be possible, but I haven't tested those yet.
"Blessed are the yeeks, for they shall inherit Arda..."

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

#113 Post by Crim, The Red Thunder »

Well, a TRULY clunky way to do it, failing anything else, would be to create every possible spell, at every possible level, hardcoded, and then pull randomly from them. There's almost certainly a better one though.

Graphics will make it quite nice, even if they look all low-res. Retro <3! Definitely a good touch!
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.

Zireael
Archmage
Posts: 449
Joined: Tue Jun 18, 2013 7:24 pm

Re: Porting ToME2 to the T4 engine

#114 Post by Zireael »

Will be checking the new release out. Those tiles look spiffy!

... and I really have to learn how to improve level generation based on Angband/ToME2 code...

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

Re: Porting ToME2 to the T4 engine

#115 Post by darkgod »

A better way of doing it would be to make your own system; it's not really a talent it's a randomspell :)

As for the bluriness of the gfx, it's because by default textures in TE4 are scaled with interpolation; I'll add a way to disable that..... DONE !

Code: Select all

Map.tiles.sharp_scaling = true
Add that to your Game:setupDisplayMode and use latest git engine :)
[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: 2517
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

Re: Porting ToME2 to the T4 engine

#116 Post by Zizzo »

darkgod wrote:A better way of doing it would be to make your own system; it's not really a talent it's a randomspell :)
*sigh* I've already got spells and tiles in the air, and now you're tempting me with thaumaturgy ideas... You realize you're just pushing the next release date that much further back, yes? :wink:
darkgod wrote:

Code: Select all

Map.tiles.sharp_scaling = true
Add that to your Game:setupDisplayMode and use latest git engine :)
Done and done. Hmm, on the subject of tiles, do we want faction markers like T4 has? Obviously much less elaborate. of course, but I could probably make something simple to distinguish friend from foe from unique from player. The Angband tile set also includes overlay tiles for displaying player health as a bar, which I might be able to wedge into place here; would we also want that for monster, the way T4 does?
"Blessed are the yeeks, for they shall inherit Arda..."

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

#117 Post by Crim, The Red Thunder »

With an option to turn it off, certainly apply healthbars.

There's also the 'highlight the player option', A similar function could no doubt be used to overlay tactical borders for friends/enemies/uniques/etc. Again, with an option to turn off.

Not sure how well graphics will take to this, especially in some of the clutter you could get in classic tome (summon swarms, among others) compared to the rather elegant and lesser groups in T4. I think it'd be manageable, but I'll hold my breath just in case.

I'm willing to delay my enjoyment of the True Art for a while, if it gets basic spells and gameplay running. Functional and playable beats feature-laden and unfinished, anyday.
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.

rexorcorum
Graphical God
Posts: 482
Joined: Wed Jan 05, 2011 8:05 am
Location: There and Back again

Re: Porting ToME2 to the T4 engine

#118 Post by rexorcorum »

Zizzo, you can play around with my latest tactical border displays, named "flagposts" - they're in the latest git (accessible through Game Options - UI). I think they are minimalist enough to work also here. Nudge me if you need them also in lower res (currently they're 64x64) or if they'll need even more "stripping".

Image

Last, but not least - with the classic tileset, I guess I'll have to revisit my icons ideas (which reminds me that I haven't finished them in the first place :mrgreen:).

All in all, great work so far and more greatness is looming on the future horizons.
~ [ 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) ] ~

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

Re: Porting ToME2 to the T4 engine

#119 Post by Zizzo »

Crim, The Red Thunder wrote:With an option to turn it off, certainly apply healthbars.

There's also the 'highlight the player option', A similar function could no doubt be used to overlay tactical borders for friends/enemies/uniques/etc. Again, with an option to turn off.

Not sure how well graphics will take to this, especially in some of the clutter you could get in classic tome (summon swarms, among others) compared to the rather elegant and lesser groups in T4. I think it'd be manageable, but I'll hold my breath just in case.
You have a point that faction markers and/or health bars on everything could be too "busy". The "highlight the player" option would almost certainly be implemented with a faction marker (which probably won't work in ASCII mode, now that I think of it...); I could also see (optional) faction markers on friendly mobs, and particularly health bars on pets and companions.
rexorcorum wrote:Zizzo, you can play around with my latest tactical border displays, named "flagposts" - they're in the latest git (accessible through Game Options - UI). I think they are minimalist enough to work also here. Nudge me if you need them also in lower res (currently they're 64x64) or if they'll need even more "stripping".
Hmm, that would probably depend on whether we can use different faction markers at different tile sizes. Bear in mind, the original Adam Bolt tiles are 16x16, and I'm making that size available as an option for players with small screens; your markers would get pretty squished at that size.
"Blessed are the yeeks, for they shall inherit Arda..."

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

Re: Porting ToME2 to the T4 engine

#120 Post by Zizzo »

Thinking about faction markers has got me thinking about factions:
  • Presumably we'll need one for pets and companions.
  • One thing that's always bugged me in T2 is that my Eru and Manwe characters always have to pack some sort of charm spell to deal with good monsters that are trying to kill me, but that will dock my piety if I kill them. What do we think about putting good monsers in a faction that would be allied or neutral to Eru and Manwe followers? Note that that would probably lead to them attacking other monsters, as good-flagged unique monsters already do in T2.
  • Some of the minor townsfolk could plausibly be in a neutral faction, for that matter. AFAIK that would still leave them open to "mugging" if the player particularly needed more starting gold. :wink: The heavy hitters like Mean-looking mercenaries and Battle-scarred veterans would still be hostile, of course. :twisted:
Any or all of this may or may not be implemented by the next release, of course... :oops:
"Blessed are the yeeks, for they shall inherit Arda..."

Post Reply