I plan on making a game with physics, and it's going to get bigger as you get farther away from the starting place. What should I do for smallest and largest positions in love.physics.newWorld()?
Thanks
Infinite world
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Infinite world
Box2D has many constants so you're not going to be able to create a super huge physics world populated with bodies.
Even if you could create something like that, the lag of simulating it would make your game unplayable.
What you could try is to generate the physics objects as the player nears them.
Another approach is to split your 'infinate' world into 'screens' like in the original Zelda.
In both cases you would keep the bounds of your Box2D world farily small.
Even if you could create something like that, the lag of simulating it would make your game unplayable.
What you could try is to generate the physics objects as the player nears them.
Another approach is to split your 'infinate' world into 'screens' like in the original Zelda.
In both cases you would keep the bounds of your Box2D world farily small.
Re: Infinite world
You cannot have really infinite world within finite amount of RAM (unless your world is procedural). You need to think about your game design. For the beginning, you can make it "big enough", then splice it as needed.miloguy wrote:I plan on making a game with physics, and it's going to get bigger as you get farther away from the starting place. What should I do for smallest and largest positions in love.physics.newWorld()?
Thanks
My lovely code lives at GitHub: http://github.com/miko/Love2d-samples
- tentus
- Inner party member
- Posts: 1060
- Joined: Sun Oct 31, 2010 7:56 pm
- Location: Appalachia
- Contact:
Re: Infinite world
I should point out that people are always hating on Box2D around here, but in practice you can actually make a pretty big world. The largest subsection in, say, A Link to the Past, is easily within the limits of Box2D.ivan wrote:Box2D has many constants so you're not going to be able to create a super huge physics world populated with bodies.
Even if you could create something like that, the lag of simulating it would make your game unplayable.
What you could try is to generate the physics objects as the player nears them.
Another approach is to split your 'infinate' world into 'screens' like in the original Zelda.
In both cases you would keep the bounds of your Box2D world farily small.
As a functional example, my platformer Kurosuke creates worlds that are 16384 units wide/tall by default. I can go larger, but I want to keep multiplayer running smoothly on netbooks (I have a little Asus that I use for testing).
Kurosuke needs beta testers
- Taehl
- Dreaming in associative arrays
- Posts: 1025
- Joined: Mon Jan 11, 2010 5:07 am
- Location: CA, USA
- Contact:
Re: Infinite world
I faced the same dilemma in my game, miloguy. After a lot of thought and testing, I ended up finding out that the best solution was to drop Box2D and make my own physics system.
Earliest Love2D supporter who can't Love anymore. Let me disable pixel shaders if I don't use them, dammit!
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
- Jasoco
- Inner party member
- Posts: 3727
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: Infinite world
That's what I'm doing for my 2D sidescroller engine. It's coming along pretty well and I haven't even touched Box2D, even for collisions. Box2D never works well, or at least realistically, for platformers. Yet everyone tries to use it.
- BlackBulletIV
- Inner party member
- Posts: 1261
- Joined: Wed Dec 29, 2010 8:19 pm
- Location: Queensland, Australia
- Contact:
Re: Infinite world
Yeah I tried that... didn't work out well. Box2D is about being realistic, and that's not what platformers are.Jasoco wrote:Box2D never works well, or at least realistically, for platformers. Yet everyone tries to use it.
- tentus
- Inner party member
- Posts: 1060
- Joined: Sun Oct 31, 2010 7:56 pm
- Location: Appalachia
- Contact:
Re: Infinite world
I guess Kurosuke is of no count, then.Jasoco wrote:That's what I'm doing for my 2D sidescroller engine. It's coming along pretty well and I haven't even touched Box2D, even for collisions. Box2D never works well, or at least realistically, for platformers. Yet everyone tries to use it.
Seriously, why do we even have Box2D in Love if everyone hates it so much?
Kurosuke needs beta testers
- slime
- Solid Snayke
- Posts: 3166
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: Infinite world
People often misunderstand its uses (or how to use it) because it's essentially a whole new API on top of regular LÖVE. I personally love it, but I also know when to use it and when to stick with my own solution.tentus wrote:Seriously, why do we even have Box2D in Love if everyone hates it so much?
Re: Infinite world
The question is why everyone hates it And why do we have Box2d in Love? Because everyone has it (it is common on iPhone, Android, and in other game engines).tentus wrote:I guess Kurosuke is of no count, then.Jasoco wrote:That's what I'm doing for my 2D sidescroller engine. It's coming along pretty well and I haven't even touched Box2D, even for collisions. Box2D never works well, or at least realistically, for platformers. Yet everyone tries to use it.
Seriously, why do we even have Box2D in Love if everyone hates it so much?
So I guess it is good to have it also in Love (despite the fact that I have never used it).
My lovely code lives at GitHub: http://github.com/miko/Love2d-samples
Who is online
Users browsing this forum: Bing [Bot] and 3 guests