Looking for plugin devs to add features to STI

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
Karai17
Party member
Posts: 930
Joined: Sun Sep 02, 2012 10:46 pm

Looking for plugin devs to add features to STI

Post by Karai17 »

Yo! As many of you already know, I am the developer of Simple Tiled Implementation, a fast and simple Tiled map loader and renderer. I've recently added a very simple plugin system that allows people to extend STI by adding features that probably don't belong in STI proper. For the first plugin, I moved my Box2D processing code out of STI and into a plugin.

And this is where my request comes in. I don't really have much time to work on extending STI, nor do I have extensive knowledge of other libraries that STI should interface with. If anyone out there has used STI, knows how it works, and would like to help extend it, I am looking for, at minimum, the following plugins:
If you can think of more that would be useful, I'd be happy to have them!

Creating a plugin for STI is pretty simple. You just need to return a table with functions and/or properties, preferably namespaced, and you're done! Functions need to have the map as the first argument!

I'm not going to be too picky about code style, but if you want to match STI's style, I use tabs to indent, and spaces to align. I also like to align = signs in code blocks. See below for an example of how I would write a plugin.

Code: Select all

--- Bump plugin for STI
-- @module bump
-- @author Someone Cool
-- @copyright 2015
-- @license MIT/X11

return {
  bump_LICENSE     = "MIT/X11",
  bump_URL         = "https://github.com/someonecool/bump_sti_plugin",
  bump_VERSION     = "3.1.5.0", -- semantic versioning, this implies that it should work with bump 3.1.5 and has not yet been revised.
  bump_DESCRIPTION = "Box2D hooks for STI.",

   bump_init = function(map, arg1, arg2)
      -- some init code!
   end,

   bump_draw = function(map)
      -- draw code!
   end
}
If anyone is up to the task, please let me know! My only stipulation is that the plugin MUST be licensed under the MIT/X11 license (or a compatible license such as BSD-2-Clause), otherwise I cannot include it with STI. You're welcome to credit yourself in the plugin file and all that jazz, it's your code after all!
Last edited by Karai17 on Wed Oct 14, 2015 8:50 pm, edited 3 times in total.
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+

Dev Blog | GitHub | excessive ❤ moé
User avatar
Karai17
Party member
Posts: 930
Joined: Sun Sep 02, 2012 10:46 pm

Re: Looking for plugin devs to add features to STI

Post by Karai17 »

Bump! Added another plugin request. Currently STI does not support tile collections because it would cause problems when dealing with sprite batches and would make rendering the map very slow. The goal here would be to detect when a tileset uses a collection instead of a single image (I already throw an error when tileset.image is not set) and convert the tiles within the tile collection into image data and then into an image.
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+

Dev Blog | GitHub | excessive ❤ moé
Muzz
Citizen
Posts: 54
Joined: Sun Jun 28, 2015 1:24 pm

Re: Looking for plugin devs to add features to STI

Post by Muzz »

Hmm It would be pretty simple, but maybe a jumper interface :)?

I'm gonna be using sti with jumper in the next few days so i may have a look at doing that.
User avatar
s-ol
Party member
Posts: 1077
Joined: Mon Sep 15, 2014 7:41 pm
Location: Cologne, Germany
Contact:

Re: Looking for plugin devs to add features to STI

Post by s-ol »

I'm pretty busy atm but maybe I could write a bump plugin. I don't know how tile collisions are stored in STI/Tiled (always used an object layer for collision) but it would be an interesting exercise (stuff like joining tile boxes together to lower the amount of bump items spawned).

If anyone else is doing it: I suggest that the bump item have the format of something like {type="tile", layer=TILED_LAYER_NAME, tileid=TILE_ID} (or at least include that data).

s-ol.nu /blog  -  p.s-ol.be /st8.lua  -  g.s-ol.be /gtglg /curcur

Code: Select all

print( type(love) )
if false then
  baby:hurt(me)
end
WetDesertRock
Citizen
Posts: 67
Joined: Fri Mar 07, 2014 8:16 pm

Re: Looking for plugin devs to add features to STI

Post by WetDesertRock »

For bump I'd suggest the ability to give it a callable that returns the table that will represent the tile.
So if in my game I want all of my tiles to be entities I do (note fictional STI API because I'm not sure what it is currently):

Code: Select all

function newEntity()
  local ent = {x=2,y=23,id=getUUID(),<more generic entity stuff>}
  return ent
end
sti.plugins.bump.entityFactory = newEntity
and on the STI side:

Code: Select all

local tile = sti.plugins.bump.entityFactory()
tile.layer = layer
tile.tileid = tid
tile.type = "tile"
User avatar
Karai17
Party member
Posts: 930
Joined: Sun Sep 02, 2012 10:46 pm

Re: Looking for plugin devs to add features to STI

Post by Karai17 »

Well the way that the box2d plugin works is that you register custom properties to tile,s objects, layers, etc. in Tiled and the plugin looks through all the data to spit out box2d collision shapes.
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+

Dev Blog | GitHub | excessive ❤ moé
User avatar
Karai17
Party member
Posts: 930
Joined: Sun Sep 02, 2012 10:46 pm

Re: Looking for plugin devs to add features to STI

Post by Karai17 »

BobbyJones am hero! We now have a bump plugin! <3
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+

Dev Blog | GitHub | excessive ❤ moé
Muzz
Citizen
Posts: 54
Joined: Sun Jun 28, 2015 1:24 pm

Re: Looking for plugin devs to add features to STI

Post by Muzz »

Got half the jumper plugin done.

This is some example code for how the implementation works. And here is the really rough first pass. http://hastebin.com/kuvagepita.lua

Of course would need to add in some methods to change the modes of jumper and so on, and possibly allow multiple pathfinders?

Image

Code: Select all


sti = require "lib.sti"
Grid = require 'lib.jumper.grid'
Pathfinder = require 'lib.jumper.pathfinder'

path = {}
path2 = {}

local width = love.graphics.getWidth()
local height = love.graphics.getHeight()

function love.load()
  map = sti.new('assets/testMap.lua',{'jumper'})

  map:jumper_init(Grid,Pathfinder) --init jumper within sti

  path  = map:jumper_calculatePath(10,8,20,25) -- goal and targets
  path2 = map:jumper_calculatePath(5,2,8,25)
end

function love.update(dt)
  world:update(dt)
  map:update(dt)
end

function love.draw()
  bike:draw()

  local translateX = 0
  local translateY = 0

  map:setDrawRange(-translateX, -translateY, width, height)
  map:draw()

  --Use to Draw debug paths.
  map:jumper_draw(path)
  map:jumper_draw(path2)
end
User avatar
Karai17
Party member
Posts: 930
Joined: Sun Sep 02, 2012 10:46 pm

Re: Looking for plugin devs to add features to STI

Post by Karai17 »

Nice! Please make sure to document your code using LDoc/LuaDoc so I can render out documentation. :)
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+

Dev Blog | GitHub | excessive ❤ moé
Muzz
Citizen
Posts: 54
Joined: Sun Jun 28, 2015 1:24 pm

Re: Looking for plugin devs to add features to STI

Post by Muzz »

Sure, I'll try and clean it up when i get some time and i'll do that. :)

-Muzz
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 4 guests