good practices, good habits

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
shoelace
Prole
Posts: 1
Joined: Sat Feb 02, 2013 5:36 am

good practices, good habits

Post by shoelace »

this came up on irc today:

[23:32] <brandan> are there any aspects of tile map design that i should consider before i design a basic map for a first game, for learning advanced tile loader and hardoncollider?
[23:32] <brandan> such as how the size of a map might affect performance
[23:32] <brandan> or some good practices for using something like tiled to develop a map for a love game?
[23:33] <brandan> like...stuff people wish they had been told before they found out the hard way?

and i am wondering if anybody on the forums can provide some thoughtful input? how can a new user gain some perspective for making an informed decision about tile and map dimensions? are there philosophies or approaches that can inhibit unnecessary trial and error?

are there automated methods for packaging a love game for testing?

is there any sort of faq? a quick search on google reveals nothing, and the forum faq is literally the forum faq.

would it be a good idea to pool such knowledge to form something new users could reference to help ease the process of learning to develop games with love2d? has this already been discussed?!! will i ever stop asking questions about it???!!!1 WOULD YOU LIKE THAT??? you would, wouldn't you?
User avatar
Lafolie
Inner party member
Posts: 809
Joined: Tue Apr 05, 2011 2:59 pm
Location: SR388
Contact:

Re: good practices, good habits

Post by Lafolie »

I would suggest not using Hardoncollider or Advanced Tile Loader and writing it yourself. You'll learn much more that way.
Do you recognise when the world won't stop for you? Or when the days don't care what you've got to do? When the weight's too tough to lift up, what do you? Don't let them choose for you, that's on you.
User avatar
Inny
Party member
Posts: 652
Joined: Fri Jan 30, 2009 3:41 am
Location: New York

Re: good practices, good habits

Post by Inny »

Tiled is shaping up to be the exact tool that people are looking for when it comes to 2d tile based games. I think the only point of confusion that many people have is what to do about the collision mask. Here are the three ways as I see it:

1. Have a separate tile layer that won't be drawn and uses special tiles that will never be displayed during regular gameplay. Collision detection code has to kind of generate the collision squares on the fly as the sprites move around the map.
2. Use the object layer and highlight the walls. Saves on having to dynamically generate the collision rectangles, but demands a broad-phase detection phase for larger maps.
3. Set tile properties to mark them as colliding or non-colliding. This requires the dynamic generation, but doesn't require an extra layer. But if you want walls that can be walked through, you either need to duplicate tiles in the tilesheet, or set a second property on the tile that conditions it.

So, the lesson to be learned before you dive into Tiled is to decide which way you want to deal with. I think the separate tilelayer is the one that most makes sense for me, since it can also double as a entity/trigger layer (entity as in where enemies will spawn, trigger as in the player stepped on a tile that causes a reaction).
User avatar
Dattorz
Citizen
Posts: 66
Joined: Sat Oct 27, 2012 12:32 am
Contact:

Re: good practices, good habits

Post by Dattorz »

Tiled is completely unusable for me until it gains the ability to quickly add pre-defined fixed-size objects into a level. Currently Tiled is optimized for a system where most objects have different sizes, rotations, and other properties versus what most games need, which is most objects of a given type having the same size, etc. They don't even have a system for quickly selecting a "type" of object and then adding multiple instances of that type into a level.

I will probably end up writing my own level editor and format. Honestly, despite Tiled as a program being relatively lean, its feature set is quite bloated and I imagine users like me won't even need or want half of its features or the properties it adds to exported files.
spectralcanine
Citizen
Posts: 65
Joined: Sat Dec 22, 2012 8:17 am

Re: good practices, good habits

Post by spectralcanine »

What I don't like about Tiled and pretty much any other tile-map editor in existence, is that you are forced to input a texture atlas.
You should obviously be given the option to input different images which the editor would make a texture atlas from internally, with an option to export it together with the level.

As to level sizes, it largely depends on the implementation. In Love there is no specialized class for tile maps, but even so using a regular sprite batch is fine for pretty much every level you'd make.
If you have ridiculously big levels, you'd probably split them into chunks, but this is mainly stuff to experiment with in the context of your own game.
If you have only a few thousands of tiles, don't even think about it.
And in general, until you actually face performance issues, just do whatever is easiest to you and don't waste too much time optimizing things that don't need being optimized.

When writing "testing", do you mean for yourself, or for other people? I myself use SciTe (and any other decent text editor can work too) which allows you to pass it commands upon pressing F5, so I just gave it the correct command to run the current directory through love.exe, which means that I can just press F5 on any open lua file in my game's directory and it runs.
If you mean giving an executable to other people, the Game Distribution page answers that.
User avatar
Inny
Party member
Posts: 652
Joined: Fri Jan 30, 2009 3:41 am
Location: New York

Re: good practices, good habits

Post by Inny »

Dattorz wrote:Tiled is ...
The object-layer has a way to put in objects that are the same size at the tiles you use. It's the stamp that looks like a tree in africa (see attached picture). That might not be what you're looking for, but have you tried asking on the Tiled mailing list for this kind of feature? It sounds like it would have some utility to others.
Attachments
insert-tile.png
insert-tile.png (7.12 KiB) Viewed 3352 times
Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 1 guest