Physics Issues

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.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Physics Issues

Post by bartbes »

It is a physics error and as such has nothing to do with graphics adapters, what might be possible is that the size of objects depend on something, that varies, perhaps it's random, perhaps it's based on framerate.
In any case, the error is called by you creating a shape that is too small.

Also, for I/O outside of the .love and save dir (perhaps you just want to use the save dir, in which case love.filesystem is all you need), you'll need to check out the io functions in the lua manual.
User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: Physics Issues

Post by Nixola »

My CPU is an Intel® Atom™ CPU N280 @ 1.66GHz, Ubuntu doesn't know my graphic card (but two days ago it did :o: )
Wow, wine runs it; it behaves strangely (left arrow moves him right, right arrow moves him left and so, and mouseX and mouseY change when I move the player), but it runs.
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
User avatar
Refpeuk
Citizen
Posts: 91
Joined: Wed Dec 14, 2011 6:16 pm

Re: Physics Issues

Post by Refpeuk »

OK, so graphics adapters aren't the issue; someone else's nVidia worked and I'm running an AMD(ATI). Could it be that I've been setting all the physics shape sizes in whole number pixel sizes and should have at least one significant decimal place? My sensor shapes are only 1 pixel wide, I'll try expanding that a bit and upload a new one.

@Nixola; You're actually moving the camera, which is controlled completely separately from the player right now. ATM the camera is moved with the arrow keys and the player with WASD. I'll add camera tracking later, right now they have nothing to do with each other.

Thanks for your responses, guys!
It was the best of times, it was the worst of times . . .
User avatar
tentus
Inner party member
Posts: 1060
Joined: Sun Oct 31, 2010 7:56 pm
Location: Appalachia
Contact:

Re: Physics Issues

Post by tentus »

Refpeuk wrote:Could it be that I've been setting all the physics shape sizes in whole number pixel sizes and should have at least one significant decimal place? My sensor shapes are only 1 pixel wide, I'll try expanding that a bit and upload a new one.
bartbes wrote:In any case, the error is called by you creating a shape that is too small.
I believe that the rule of thumb is to make shapes at least 3 pixels in size.
Kurosuke needs beta testers
User avatar
Refpeuk
Citizen
Posts: 91
Joined: Wed Dec 14, 2011 6:16 pm

Re: Physics Issues

Post by Refpeuk »

OK, here's one where all the shapes are at least 3 px in both x and y.

Edit: Sorry bartbes, I posted before seeing the end of your post. I was hoping to be able to use the love.filesystem since it seems a lot simpler, but if I have to I can work out the io system. Thanks!
Attachments
platformer.love
(32.49 KiB) Downloaded 68 times
It was the best of times, it was the worst of times . . .
User avatar
MarekkPie
Inner party member
Posts: 587
Joined: Wed Dec 28, 2011 4:48 pm
Contact:

Re: Physics Issues

Post by MarekkPie »

Working. :)
User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: Physics Issues

Post by Nixola »

I tried moving with WASD, but the player didn't move... Anyway, after downloading the last version, running it (without wine) and moving a bit around with WASD the game froze and the terminal gave me this error:

Code: Select all

love: modules/physics/box2d/Source/Collision/Shapes/b2Shape.cpp:102: void b2Shape::CreateProxy(b2BroadPhase*, const b2XForm&): Assertion `inRange' failed.
Aborted
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Physics Issues

Post by bartbes »

This either means you're trying to create something outside of the world, or moving it there.
Another option would be a shape too far from its body (does that even have a max distance?)
User avatar
Refpeuk
Citizen
Posts: 91
Joined: Wed Dec 14, 2011 6:16 pm

Re: Physics Issues

Post by Refpeuk »

@MarekkPie: Glad to hear it's working! Unfortunately I'm not quite sure what to do now when I start to simulate bullets. My plan is to add a bullet time feature in which you can dodge enemy fire; this would only work if each bullet had it's own body/shape, and obviously 3x3 px is far too big for a bullet. Maybe 0.8.0 will fix this feature? How far out is it?

@ Nixola: The player's starting position right now is just slightly below and to the right of the origin. In other words you should walk right along that small platform and fall onto the floor below it before doing too much. If you move outside the physics world the game will crash.

@bartbes: I certainly hope there is no max distance for that! For simplicity's sake I just set a massless (immovable) body for the world at 0,0, meaning all the offsets for the shapes would be identical to their positions on the coordinate plane.
It was the best of times, it was the worst of times . . .
User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: Physics Issues

Post by Nixola »

...What small platform? I can only see the player and a biiiiig, blue background
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 14 guests