Page 1 of 1
navigating the code
Posted: Fri May 31, 2013 3:58 am
by farkerhaiku
I'm doing a lightning quick tour of lua so I can help teach my daughter some stuff with corona. I'm an old school moria (and then later angband) junkie, and I wanted to look at ToME because I knew that it was written in lua (I'd never played it though).
Can anyone point me to where the dungeon generation (rooms, paths, etc) is? I think that's the place I'd like to start at. Does ToME use something like the drunken walker method? Or something more sophisticated?
Re: navigating the code
Posted: Fri May 31, 2013 5:15 pm
by Hachem_Muche
The dungeon generation code, like most things in the engine is in multiple places.
Generating a level is triggered in the function _M:newLevel(level_data, lev, old_lev, game) in game\engines\default\engine.Zone.lua. Following through on this function provides a pretty good outline of what the game does to create a level (which is done on the fly as needed for the most part).
The actual generation routines for objects, actors, maps, etc. is handled by code contained in subfolders of game\engines\default\engine\generator (actor, map, object, trap).
To get a feel for how T-Engine and ToME work, it's probably easiest to just dive into the talent code directly. The Corona talent is defined in game\modules\tome\data\talents\celestial\eclipse.lua. Talents are defined as constructed tables that are then translated by the engine into usable data/functions. See
http://te4.org/wiki/Dev-Talents for an introduction to these.
Re: navigating the code
Posted: Sun Jun 09, 2013 1:43 pm
by String
I think he might be talking about the corona sdk not the in game corona talent.