Worth using love physics for basic rpg-like map?

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
Eglaios
Prole
Posts: 36
Joined: Mon May 03, 2021 8:45 pm

Worth using love physics for basic rpg-like map?

Post by Eglaios »

I'm still working (and learning) on tilemaps with Simple Tiled Implementation...

So that takes care of all my map's data, then about world interactions, it's designed to work with love.physics (has some plugins included to manage that)

Though, I was only planning basic actions in the map : Collisions, interactions with objects, tile-by-tile movement... the basic stuff...
It's my first experience with love physics, and at first glance, it looks a bit overkill for such features.

So I'd want to hear from more advanced programmers if it would be wise to use love.physics to manage such basic actions, or if I'd be better to simply make my own modules...


Thank you!
Currently working on game music...
togFox
Party member
Posts: 388
Joined: Sat Jan 30, 2021 9:46 am

Re: Worth using love physics for basic rpg-like map?

Post by togFox »

I'm no expert but I suspect doing basic tile-based collisions might be easier. I've used the love physics a few times and it has it's uses but I'm not sure a dungeon crawler is one of them.
User avatar
BrotSagtMist
Citizen
Posts: 62
Joined: Fri Aug 06, 2021 10:30 pm

Re: Worth using love physics for basic rpg-like map?

Post by BrotSagtMist »

This depends on how your world looks:
A chessboard like tilemap that doesnt move> overkill
Free angles and moving objects on a not tiled floor> maybe.

For tiled worlds collision detect is just super easy, it only gets hard when you try to dial with diagonal borders, aka half filled tiles.
The concept basically is:
Take the position of a wall, x and y, divide it by its size and round the number and then use that as a key to set a true:
Walls[math.floor(x/tilesize)][math.floor(y/tilesize)]=true
then you can have your objects walking around by a simple:
if Walls[math.floor(nextstepx/tilesize)][math.floor(nextstepy/tilesize)] then ... apply the step etc.
obey
Eglaios
Prole
Posts: 36
Joined: Mon May 03, 2021 8:45 pm

Re: Worth using love physics for basic rpg-like map?

Post by Eglaios »

BrotSagtMist wrote: Sat Sep 11, 2021 5:10 am A chessboard like tilemap that doesnt move> overkill
Free angles and moving objects on a not tiled floor> maybe.
I guess I'm better not going too complicated for now so I'll try avoid physics, then... [phew!]
BrotSagtMist wrote: Sat Sep 11, 2021 5:10 am Take the position of a wall, x and y, divide it by its size and round the number and then use that as a key to set a true:
Walls[math.floor(x/tilesize)][math.floor(y/tilesize)]=true
then you can have your objects walking around by a simple:
if Walls[math.floor(nextstepx/tilesize)][math.floor(nextstepy/tilesize)] then ... apply the step etc.
I'll probably have to add it myself right into STI, but this is already a pretty good clue, that should be fine!


Once more, thank yall very much to stay around there and help people!
[You can probably guess it already, but this is much appreciated!]
Currently working on game music...
User avatar
pgimeno
Party member
Posts: 2820
Joined: Sun Oct 18, 2015 2:58 pm

Re: Worth using love physics for basic rpg-like map?

Post by pgimeno »

There's also a Bump plugin. Bump is much simpler.
Eglaios
Prole
Posts: 36
Joined: Mon May 03, 2021 8:45 pm

Re: Worth using love physics for basic rpg-like map?

Post by Eglaios »

pgimeno wrote: Sat Sep 11, 2021 11:21 am There's also a Bump plugin. Bump is much simpler.
I gave a try on bump and figured quite a few things (I realized I had to download Bump apart because I thought the bump.lua in STI plugins folder would already contain everything :| )

Do you know if I could make interaction detection on the map through bump? (e.g. NPCs, buttons, sensors)
Currently working on game music...
MrFariator
Party member
Posts: 282
Joined: Wed Oct 05, 2016 11:53 am

Re: Worth using love physics for basic rpg-like map?

Post by MrFariator »

You don't need to do anything special with bump to detect any interactables. Just have some flag (eq. isInteractable) in the objects in the objects you put into the bump world, and then pass a filter that detects them - whether it happens during the player movement step, or as a separate queryRect call.
Post Reply

Who is online

Users browsing this forum: No registered users and 61 guests