-
One giant, seamless 'level'?
Hi all -- I've been playing around with Sonic Worlds Delta V1.2B, a platform for making Sonic the Hedgehog-style games and levels in MMF2.
I'm wondering -- would it possible to have my game be one giant, non-linear level, rather than consisting of many separate levels?
I'm worried that as the level grows increasingly large, this might pose a memory problem, perhaps?
Would there be any way around that?
-
Re: One giant, seamless 'level'?
This is generally done through 'streaming loading', where the game is actually broken up into levels or otherwise areas, but these areas are cached and streamed into the memory at runtime as you approach them, in order to seamlessly load to the next area.
For example, as you approach a door to a house in a village, the game would anticipate that you wanted to enter that house and start loading all the information for it into memory, and when you opened the door, it would either all already be there, or if you were too fast somehow, it would just do a momentary 'loading' to catch up.
You can't possibly expect to load an entire large game all into memory- thats inefficient and would not work on even moderately sized games. People only have so much RAM at disposal, and all matters in CSci are tradeoffs between processing and memory. So by caching your levels and buffering them on demand, you can give the appearance of a fully seamless game while still fragmenting the memory into levels.
-
Re: One giant, seamless 'level'?
Knytt is one big seamless level, and it works fine, though I'm close to limitations with the frame width and edit-time maximum number of object. I also had to make sure that all the actives were set to inactivate when out of frame, and avoid using events to control most objects (enemies and creatures used the path movement).
However, if you have something larger, more dynamic, and with more event controlled content, I guess you have to do what Pixelthief suggests.
-
Re: One giant, seamless 'level'?
Whoa, it's Nifflas! I'm actually a huge, huge fan of Knytt's design, especially the way in which the secret areas were handled. :)
The thing about Knytt, though, is that I'm not sure it does the same thing as what I'm proposing -- there are still 'screens' you move between in Knytt, where you exit the top of one screen and arrive on the bottom of the next, etc.
I'm trying to do something more akin to the game being like one giant Sonic the Hedgehog level -- no 'screen exit/entrances', just seamless scrolling the entire way.
I like Pixelthief's approach -- I'm not planning on having a massive amount of open-air space, so I could funnel the player through tunnels at key loading/unloading points so the game is never 'ambushed' by the player loading unexpected data. I'm more going after that 'feeling of seamlessness' than anything, it's not like the player will be instantly able to move from any area of the world to any other. My main goal is visual -- I never want the player to see the character run off the edge of one screen, and then onto the next.
I'm curious why you had to avoid using events to control most objects -- could you have used Pixelthief's method to deactivate them whenever the player wasn't nearby, and thus had things similarly work out nicely? Did the method you chose limit your ability to design your enemies' behaviors?
(Also, was Knytt made with HWA? Does that change the equation at all?)
-
Re: One giant, seamless 'level'?
Knytt was not made with HWA. And the scrolling is negligible (You can scroll any way, it doesn't affect performance)
-
Re: One giant, seamless 'level'?
Does having HWA as an option change any of the stuff we're talking about here?
And Jacob, could you elaborate a bit on what you mean by 'the scrolling is negligible'? If the player character is literally -- for the course of the entire game -- never moving off the edge of one screen and onto the next (a convenient 'level load point'), if it's all just continuous scrolling, it's still negligible as a concern?
-
Re: One giant, seamless 'level'?
Its a much more fundamental design question than anything specific to MMF2, much less HWA concerns. Many games in the past have done streaming loading.
The algorithm is very simple for a linear game, and only slightly complicated for anything more open ended (For example, something that might be useful for a large MMORPG).
Say you have a game where all levels go from left to right. Within a certain distance of the right exit of a level, the game should start buffering the memory of that level. Within a smaller distance from the boundary in both directions, the game should start displaying both areas, overlapping the two. And after traveling a distance beyond that limit, you can erase the buffer.
http://tvtropes.org/pmwiki/pmwiki.php/Main/DynamicLoading
-
Re: One giant, seamless 'level'?
Yeah, we're on the same page in terms of the underlying theoretical concept. :)
I'm mainly wondering to what extent MMF2 can do that, and if MMF2 won't do it easily, to what extent I might have to compromise the game's design in one area or another.
-
Re: One giant, seamless 'level'?
Theres no limitations to MMF2 to stop it from doing it any more than any other programming language, besides inefficiencies as a HLL, but you might find it more difficult to build it using the built in level editor than you would doing your own custom level editor.
-
Re: One giant, seamless 'level'?
Gotcha. World-building wise, if I were to first lay out the whole world (in the default editor), and then after the whole thing's done go back in and add in rules for dynamic loading, will that work? Or will I be royally screwed for some reason or another if I'm not handling this as I go along?
-
Re: One giant, seamless 'level'?
Fairly screwed, yes. There would be ways to create minor effects like this through the level editor, but I don't think you'd find anything efficient or seamless without either losing crux functionality or doing it from the ground up.
For example, you could do a minor 'fake' effect by having your game load the 'next' level inside of a subapplication without the player visible, and putting that subapp at an X/Y offset from the screen, leaving large empty borders on each level for it to overlap, so that you can appear to 'peek' into the next level, but in reality that level doesn't really exist in your memory until you reach it. Not to mention it would be horribly inefficient
-
Re: One giant, seamless 'level'?
Gotcha. So it wouldn't be able to have an event when you reach a certain point that says "When you pass through tunnel XYZ heading east, un-load the western half of the word, and when you pass through this same tunnel heading west, un-load the eastern half of the world", that sort of thing?
What if I were to start world-building now, and then import that into a custom level-editor later to add in dynamic loading features?
(Also, I assume building a custom level editor for an MMF2 project is a difficult task that would probably require the hiring of a talented coder?)
-
Re: One giant, seamless 'level'?
I believe Sonic the Headghog is updated on the fly, the level is generated, it's not already a big map filled in.
-
Re: One giant, seamless 'level'?
Televangelist: I'm not entirely sure you understand how a custom level editor would work. Essentially, you use a custom editor so you can export the position of your level data (and their properties) to a file that stores all that data. Then your game would load in that data when it needs it. It is a simple enough concept, but not very simple to implement if you are new to MMF or coding in general. There are lots of level editor examples floating around if you want to research how to approach making one. Just do a search in the forums. But also keep in mind that the "seamless" levels you see in other games are just tricks. No game really loads in everything at one time. It is up to you as a game maker to figure out the clever tricks that make people think your game is seamless. ;)
-
Re: One giant, seamless 'level'?
Even a simple trick like I was talking about can give a good impression. Imagine a setup that looks like this. Say you have a 480x480 game window, with large levels. Then on each level, you'd put a big empty 240 pixel margin on the edge of it. So if you had a 10000x10000 size level, you'd make it 10480x10480, with 240 pixels of say black quick backdrop on the top, bottom, left & right borders.
Then on each border, put a subapplication that opens the level to that side as a 480x480 window. Make sure its only active when you are within range of it (load on call might suffice), and have it open the level and flag the player to be invisible somehow (might take some trick), and pause that subapp. Then when the player moves to each left/right/top/bottom side, he'll see the next level.
Of course, to make this efficient you might want to make the subapp only load the level when you get in range of it and close that level when you're out of range again
Another remarkably easy way to do it is to just make each level have a border that looks like the previous level. So in each level, you might see 240 pixels that match up exactly the same as the previous level, and you just switch levels halfway through them, so it gives the impression of not having done anything but pausing to load for a fraction of a second as you cross the boundary.
Streaming loading is nothing new, and its just the same task in MMF2 as it is in any other language. If you're familiar with the concept, it shouldn't be any more difficult
-
Re: One giant, seamless 'level'?
Quote:
Originally Posted by 00J
I believe Sonic the Headghog is updated on the fly, the level is generated, it's not already a big map filled in.
You mean the Sonic Worlds MMF2 engine specifically?
-
Re: One giant, seamless 'level'?
Quote:
Originally Posted by mobichan
Televangelist: I'm not entirely sure you understand how a custom level editor would work. Essentially, you use a custom editor so you can export the position of your level data (and their properties) to a file that stores all that data. Then your game would load in that data when it needs it. It is a simple enough concept, but not very simple to implement if you are new to MMF or coding in general. There are lots of level editor examples floating around if you want to research how to approach making one. Just do a search in the forums. But also keep in mind that the "seamless" levels you see in other games are just tricks. No game really loads in everything at one time. It is up to you as a game maker to figure out the clever tricks that make people think your game is seamless. ;)
I fully understand what seemingly-seamless levels actually entail -- but you're right, I don't understand how one goes about building a custom editor in MMF. I have enough experience "around" various types of coding to understand the basic concepts (primarily VB and Perl), and I've done work with various scripting languages and other game creation systems, but I'm not sure in the context of MMF how one would go about creating a custom level editor, which is why I'm poking around at that.
Right now I'm starting with a project idea, and then poking around to try and determine the best middleware for that project; I've looked at Construct (and the proposed direction of Construct 2), MMF2, and GM8, and as best I can tell MMF2 comes the closest to offering me the features I'm looking for in a form that I could reasonably hope to exploit (in other words, even if I could theoretically code everything we're talking about here in C++, I wouldn't reasonably be learning C++ for this project).
So until I take the plunge, commit to MMF2, and buy a license, I can only ask abstract questions to try and understand exactly what would go into making a custom level editor for MMF2 -- I don't have the software in front of me to play around with.
Your last sentence though sort of hits the point directly:
Quote:
It is up to you as a game maker to figure out the clever tricks that make people think your game is seamless.
I'm fully onboard with this -- I'm mainly trying to figure out just how feasible those tricks are with MMF2, and to what extent I'd have to sacrifice design-wise to make those tricks work. The fact that they're tricks is fine; the visual effect of seamlessness is what I'm going for, more than anything.
-
Re: One giant, seamless 'level'?
Quote:
Originally Posted by Pixelthief
Another remarkably easy way to do it is to just make each level have a border that looks like the previous level. So in each level, you might see 240 pixels that match up exactly the same as the previous level, and you just switch levels halfway through them, so it gives the impression of not having done anything but pausing to load for a fraction of a second as you cross the boundary.
Okay, this is perfect! I didn't realize that MMF2 was this flexible in how you determine under what circumstances a new level should load; a technique like this could work perfectly well. (Especially if the visual distinctions between areas didn't match up with actual level boundaries, so the switch felt more subtle...)
-
Re: One giant, seamless 'level'?
Like all the other languages, everything can be triggered through any sort of events you want. You can have the level change when you exit off a border, or when you're within range of a border, or when you hit a button, or 10 seconds after pressing the Q key, or after the game is finishing calculating a taylor series to approximate PI. Theres no real limits to any of that stuff.
Theres tricks you could use to approximate the same effect while still using the built in MMF2 level editor, or theres stronger and more elegant ways to do it while creating custom levels.
Heck, pasting your tiles through an active picture object, you could simply wipe entire areas and paste/repaste the next sections as you approach them with very little overhead loading from different level files. It wouldn't be "easy" to write- not by the longest stretch, but it would be no harder than doing it in any other language.