Skip to content

New Developer's Guide

Son Guhun edited this page Dec 17, 2020 · 9 revisions

This is a guide mostly pertaining to LoP development in the World Editor. It will not talk about python scripts and their functionality in depth.

Titan Land: LoP is a project with tens of thousands of lines of code, more than 100 libraries and hundreds of triggers. Therefore, it can take a while to be able to fully grasp how the project works. Hopefully this learning period can be reduced by following this guide.

Basic Libraries

These libraries are used pretty much everywhere, and knowing what they do is required in order to understand the codebase.

Hashtable Libraries

Hashtables are probably the most important feature ever added to JASS, as arrays are very limited in the language (for example, they can't be passed as arguments and have a maximum size of 32768). Without Hashtables, LoP would be practically impossible, as many data structures in the map have sizes that vastly outscale the maximum size allowed for JASS arrays and a lot of data is stored using handle IDs, which are also greater than the array index limit.

One of the most revolutionary libraries ever created for JASS was NewTable, made by the user Bribe. It allows for the easy instantiation of 1D tables (static tables can be created using vJASS keys) and provides a convenient API to access elements of any type, which also makes it ideal for use with textmacros.

Titan Land LoP makes extensive use of the Table, and also defines a couple of libraries that are based on Table: ConstTable and HashtableWrapper. Both of these libraries use an API that is identical to Table's, so if you learn one API you should be capable of using the others.

Data Structures

JASS has no standard library that defines useful data structures, so LoP uses it's own. All data structures in LoP are hashtable-based, so there is virtually no limit to the number of instances and the number of stored elements.

  • ArrayList
    • A 0-indexed List of elements implemented as a continuous segment in a Table. Normally contains integers, but has the ability to define lists for other types (generics).
  • LinkedHashSet
    • A Set of integers which remembers the order elements were added in, and in which elements can be inserted at any point. Cannot contain the value 0.