## Are there any ways to make openworld?

General discussion about LÖVE, Lua, game development, puns, and unicorns.
JYinc
Prole
Posts: 6
Joined: Fri Feb 17, 2017 9:37 am

### Are there any ways to make openworld?

I know Love2d is great and powerful but im kinda wondering how to make SEAMLESS openworld game with this engine.
If u know any good tutorial about seamless implement, please let me know Thx!

Party member
Posts: 490
Joined: Fri May 03, 2013 6:42 pm
Location: Germany

### Re: Are there any ways to make openworld?

The most obvious answer is - use chunks.
Creating a chunk system is more of an advanced task and requires quite a lot of work before getting useful results.
You need to know what genre you want (Platformer, Top-Down, Isometric) and if you want procedural generated chunks or handcrafted ones (or a mix of both?).
I'm currently trying myself on a multi-purpose chunk system, here is how the basic structure looks like:

The biggest hurdle I'm facing is loading and unloading the chunks - and doing it efficiently. This also requires me to create an editor to generate the required map format which makes this kind of project even harder.
I worked on a map editor using simple chunks (more like multiple spritebatches) last week but I found that my underlying structure wasn't capable of what I wanted it to do. But maybe it might be useful to see the code anyway (see attachment).

Im not aware of any tutorials, maybe because such a huge task can't really be handled in a tutorial. Imo it's more like a topic to fill a book. But you can google it, you might find a couple posts regarding other engines and frameworks which discuss how to create chunks. The techniques often are similar to what you would do in LÖVE/Lua.

erasio
Party member
Posts: 118
Joined: Wed Mar 15, 2017 8:52 am
Location: Germany

### Re: Are there any ways to make openworld?

I don't think anyone can give you a proper answer here.

"How to make open world" is to broad a question. There are a whole lot of differences in how you should approach the issue depending on what you want your open world to be able to do.

Are we talking about Zelda style open world?

Or Terraria?

Chunk based generation is a fantastic way if you want to randomly generate your world. Terraria style. More complex to implement but offers a lot of replayability and value to your game.

Then there's level streaming (or world streaming). Which is more Zelda style. Where you create a world by hand and just allow your player to move around that world somewhat freely.

The team from Firewatch has a fairly good explanation for level streaming in a talk they gave at GDC: Link

But we will need more info to properly advise you. And you should expect for systems such as this to not have tutorials for love if they have code based tutorials at all. They are mostly described theoretically and you will have to implement it yourself.

Also. Warning. Any form of open world implementation is somewhat advanced.

zorg
Party member
Posts: 2325
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

### Re: Are there any ways to make openworld?

Your definition of "SEAMLESS" also needs to be talked about; there are a few things that can mean as well:

- Seamless implementation, as in, you won't sweat blood to get it to work (low chance that anyone has already created something like this that you could use, although you can try out MadByte's prototype, maybe that's the closest you can get to this.

- Seamless map, as in, when you have the world itself looking like a Patchwork Map like someone quilted together squares of different colored textiles haphazardly, at the "edges" of those zones, there wouldn't be glaringly obvious visible discontinuities. (here's an example that does this kind of zoning, although sadly the edges aren't that noticeable in this image: Pic)

- Seamless travel between zones, which is the most probable meaning you might have intended; usually, with a 2D world, chunking fully solves this, whether we're talking about a top-down game, a side-view game, or an isometric game; they just preload chunks differently; the only instance of deliberate zone loading that can happen are when you go inside an interior area, like houses or caves or whatever, just like in the pokemon games, or in a few mario/zelda/castlevania games that were sidescrollers and had the habit of making enterable buildings look small on the "outside" but when you entered, you could make the interior bigger.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.

Beelz
Party member
Posts: 234
Joined: Thu Sep 24, 2015 1:05 pm
Location: New York, USA
Contact:

### Re: Are there any ways to make openworld?

Here is a basic example of world chunking to help get you started, if that's the route you choose. Fair warning, this is not optimized, just a quick mock-up I threw together.

EDIT:
Here's the github for it, as I changed it up a little. https://github.com/adean91/2D-World-Chunking
Attachments
chunking.love
if self:hasBeer() then self:drink()