navigating the code

All development conversation and discussion takes place here

Moderator: Moderator

Post Reply
Message
Author
farkerhaiku
Posts: 1
Joined: Fri May 31, 2013 3:14 am

navigating the code

#1 Post 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?

Hachem_Muche
Uruivellas
Posts: 744
Joined: Thu Nov 18, 2010 6:42 pm

Re: navigating the code

#2 Post 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.
Author of the Infinite 500 and PlenumTooltip addons, and the joys of Scaling in ToME.

String
Cornac
Posts: 39
Joined: Tue Sep 20, 2011 2:01 pm

Re: navigating the code

#3 Post by String »

I think he might be talking about the corona sdk not the in game corona talent.

Post Reply