cwrest.blogg.se

Dwarf fortress tileset repository
Dwarf fortress tileset repository












  1. #Dwarf fortress tileset repository full
  2. #Dwarf fortress tileset repository code

Simply access your DF graphics folder and copy the name of the square tileset. But of course this can be used for any other tile based game too. Dwarf fortress already has a square tileset available to you. I created an example lua file that can be used as a very simple base to render roguelike ascii games: gist. Spritebatch:set(smap, quads], i*12, j*12) Check if the map table is different than the cache table and only then set the spritebatch tile. Featuring over 15000 unique sprites for most creatures, professions and job titles, as well as environments. You can do this by having two map tables. This is a Dwarf Fortress tileset for 32x32. It’s probably a good idea to only use spritebatch:set when something has changed.

#Dwarf fortress tileset repository code

Slime explains: “The FFI array is probably slower because the loop it’s used in can’t be compiled by the JIT (since C API functions – all of LÖVE’s API, for example – prevent JIT compilation for the block of code they’re called in.)” One more thing for spritebatch Spritebatch, ffi array 2.13035 0 spritebatch, lua table 0.577013 -1.553337įFI Arrays are a lot slower, so you should stick to tables if you want to draw tiles fast. Using Luajit tables is a lot faster than using FFI arrays: Time("spritebatch, ffi array", function() We use the ffi.new functions to generate a 2 Dimensional uint8_t array for the character display grid and uint16_t for the id grid. Spritebatch:set(idmap, quads], i*12, j*12) Time("spritebatch, lua table", function() Idmap = spritebatch:add(quads], i*12, j*12) Map is our display grid and idmap will store the id returned by adding the cells. We need two arrays: one to store the id and one to store the ascii value of the cell. We can also use the bind and unbind function on the spritebatch to bind the spritebatch into memory before we loop through the whole display grid. Local spritebatch = (img, 87*25, "stream") I used Alloy_curses_12x12 from the dwarf fortress tileset repository. This should resolve all corruption issues, but is a little bit trickier to install. It will use FONT for text, but it will use FULLFONT for tiles.

#Dwarf fortress tileset repository full

We will generate a spritebatch with a tilesheet image(aka texture atlas) and use the spritebatches add/set method to change the content. This plugin will override Dwarf fortress so that it can use the full text set (both ASCII and Extended) for both FONT and FULLFONT. If title = "clear" then last = nil return end It uses os.clock to measure the time before the execution and again after the execution. It is an extended example from kikitos time function. I will use the following code to measure the performance. I will use this to create an ascii display.

dwarf fortress tileset repository

In this article I want to compare tilemap implementations in Löve 0.9.1 using spritebatches. In Löve you can implement those in a variety of ways. A usual pattern in 2D games is the use of tilemaps.














Dwarf fortress tileset repository