• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Design I think I made a map too big o_O

Kezarus

Endless Game Maker
It have nothing to do with GML limits (well, sort of). But it veers more on the game design side.

See, I have a map that is 100x100 squares (each square is 48px). I know by experience that 5 to 10 Towns are good for this size.

Problem is that the map size is variable and can reach 500x500. So... 25 times bigger, so... 125 Towns minumum.

Each Town have it's agents (Troops, Merchants) at 5 maximum of each. Then 625 agents, walking throught the map and having a behavior routine.

Because of the size I couldn't make a properly depth on it that doesn't consume a lot of resources. So, I'm using tiles for it. As it is it's already consuming 300MB of memory and 50% of my CPU.

If this wasn't a big enough red flag, 125 Towns is. It's too much. The player can't hope to even visit them all. And there will be other points of interest.

This is more of a rant. Hop in if you fell like it. =]
 

matharoo

manualman
GameMaker Dev.
As it is it's already consuming 300MB of memory and 50% of my CPU.
Check out YAL's room extension. It allows merging of subrooms and loading of rooms in chunks at runtime.

But on a more basic level, make sure you're deactivating instances outside of the camera, and if there are any that need to be processed, make sure at least their Draw events aren't running.
 

Kezarus

Endless Game Maker
Hi @matharoo! =]

So... the thing is that I want the world to be a living world. Towns interact with each other and grown. So I can't just deactivate them. (maybe a temporal routine, but...)

The main issue is... 125 Towns, it hit me like a train yesterday. In which game do you have 125 places that interact with each other to visit? On my little game it's too too much. x_X

Performance wise I think it's fixable (although it seems like a lot of work). But on the game design level... welp it's too damn much.

And they will grow and expand on their own like an organism. So if I have a big enough room their numbers will explode evetually.
 
Well, you can deactivate the instances, you'd just handle their interactions through data processing while they're deactivated (or all the time, if you wanted to go down that route). So instead of an instance being completely responsible for what it is doing, you'd have a some sort of data structure/structures that hold all the applicable information (for instance, the position each instance should be at, the amount of money they are holding, items they are holding, etc, whatever relates to what you want them to be "doing"). Then when they are out of view, their instance gets deactivated, but you continue performing calculations using just the data structure (so an AI controller would be manipulating the data structures, rather than AI inside of each instance manipulating only that instance).

When your player gets close enough to where the data structure says the instance should be, you reactivate the instance and move it to that position. You could fill all the data into the instance from the data structure (all the things that have changed only in the DS) at that point, or you could simply have the instance be a visual placeholder and just have the calculations and interactions work directly with the DS instead.
 

Kezarus

Endless Game Maker
Hello @RefresherTowel! Yeah, I see how that could be done by data structures.

Problem is: 125 places for the player to be is too much. And we will have points of interest on top of that.

I just talked to my brother about this design issue and we agree that a 300x300 map will bem good enough. It's already 9 times the base, so... 45 to 90 Towns.

Having seasons, day night cycle, weather system, troops and merchants, well I think it's complex enough. 😅

And it's an RPG, not even an RTS. 😅😅😅
 

HayManMarc

Member
Don't forget -- some calculations in games do NOT need to be performed every step. They could be performed every 5th or 10th step, and save on CPU usage. (Won't help RAM much, tho.)
 

YanBG

Member
So the number of tiles will be 300x300? Doesn't seem that much but do you need them all at the same time? How does the map view work? Is it eagle eye or the player only see whatever fits into the screen size?
Add tiles only inside the view and delete them outside the view. That's similar to "infinite" generation with chunk system.
When you have all unit data like positions(x,y), type, graphics etc in list/array or map, then at that point you don't need instances at all. Just do your own drawing of the graphics.
 

Kezarus

Endless Game Maker
@YanBG, the problem is design, not performance. Picture a map with 125 Towns interacting with each other (I was running it yesterday and it's fine). The player will be very hard pressed to visit them all, and he will probably only visit 10 to 20 tops. There will be 3 to 5 Interest Points per Town. That is 625 points to visit and make a quest. It's too damn high. O_O

That's the issue that I realize the other day. Performance-wise it is not pretty, but works. I can save them, load it all, some are script generated, programming-wise on that matter is fine. Even with everyone of the instances running it's ok.

The real problem is that with a 300x300 map there will be 45-90 Towns, 135-450 Interest Points. If the player tries to visit them all and, let's say it takes 1 minute for each(it's waaay much more). It will take 3h-9h just to look at them. On a 500x500 map it would be 125-250 Towns, 375-1250 Interest Points, so 8.3h to 25h.

For a game that focuses in generating new maps it's kind of a waste. That's why I'm moving my focus to a smaller maps instead of generating a humongous experience that nobody will be able to complete. It's more of a rant/complaing about my self-aware shortsight. =o]

I was just trying to make something too big that doesn't need to exists if I cared to look about the gameplay and not just performance. =D
 

kburkhart84

Firehammer Games
It seems like you know what you need then. If its simply too big of a scope for the game, toss it! Its often given advice in gamedev.

That said, some games do it anyway, full knowing that players won't visit every single thing available. Spore did that with the huge galaxy. Freelancer was also pretty big and likely not explored fully by very many people(and then the mods made it worse!). If it isn't necessary to visit everything in a game except for maybe key points, then it can make sense to keep all of that extra content. It makes it a thing for players to discover things other players did not, leading to possible discussion and longer play time. Of course that's made better if there is actually something unique about those non-key places making it worth visiting them.
 

Yal

🐧 *penguin noises*
GMC Elder
Be wary of the "One Thousand Bowls of Oatmeal" problem... it doesn't matter if you can generate infinite maps if the player doesn't notice the change. I feel like both Terraria and Starbound kinda fails in this regard... Terraria has the exact same things generated in every world (one dungeon, one evil biome, one snow zone, one desert, ocean beaches at the left and right sides, etc) and you start recognizing the level generation beats after a few worlds. Starbound has every planet of each biome type contain the same landmarks (e.g. the starting planet is always a grass type with a ruined tower, a mushroom village, and an old mine) and even visiting multiple planets in the same playthrough feels samey.

To make players play through the game repeatedly, it's worth keeping this in mind, and try to make a generator that can make worlds that truly feel different (by sampling only a tiny bit of the generator's vast variety every time)

There's no silver bullet for this, but I've got a bunch of bronze bullets:
  • Exponential explosion by combining several independent system. E.g. instead of basing water on terrain height, make them two independent systems and turn "water with extreme terrain height difference" regions into waterfalls, water in moderately altious regions into rivers, and water in flat regions into lakes.
  • Limit the biomes a world can have so that no seed can have all of them (the drawback of this is that the player might not even realize some biomes exist because they keep getting seeds without it)
  • Add tools that allow the player to customize generation (e.g. they can collect cards to add to the generation deck), the sense of ownership makes them more likely to mess around with the system and they can add more of the things they like (which hopefully leads into a feedback loop of them playing more)
 

Kezarus

Endless Game Maker
Thanks a lot for that @Yal! My map generation is made by a geography algos that I devise using land, type of formation (mountain/forest), humidity and latitude to figure out what biome goes where. There arent so many as I'm using real life biomes. There is a sample here, it's a little dated, but the basic geography is there.

The main thing that I have are the Towns that grow as the time passes. They also could be destroyed too. As they grow, structures are formed and that is what is making every town unique. I explain.

The Town area ia a 5x5 grid (25 squares). Ideally a the max population is 25 if there is no water, forest and mountains. Each 1 population translates to 1 building. The buildings translates to what the player can buy on each Town. The buildings and categories are as follows:
  • Resources:
    • Farm: on Plains, sells Grain
    • Sawmill: on Forest, sells Elm, Oak, Yew
    • Orchard: on Forest, sells Fruit
    • Mine: on Mountain, sells Iron, Adamant, Mithril
    • Quarry: on Desert, sells Crystals
    • Port: on Water, sells Fish
  • Manufacture
    • Smith: sells Steel and tier 2 Martial Weapons
    • Armorer: sells Steel and tier 2 Martial Armor
    • Jeweler: sells tier 2 Arcane Weapons
    • Weaver: sells tier 2 Arcane Armor
  • Martial:
    • War College: Fighting Style Skills
    • Barracks: Weapon Skills
  • Magic
    • White Temple: White Magic
    • Green Henge: Green Magic
    • Blue Tower: Blue Magic
    • Red Tower: Red Magic
    • Black Shrine: Black Magic
  • Housing
    • Nothing, just for looks
There are some rules too.
  • Besides Resources and Housing, no Town can spawn more than 3 of the same building
  • Every extra building beyond the first, gives more wares options
  • Temples have an aversion to one another. Example: if a White Temple spawns, then no Black or Red Temple could spawn on the same Town
Races also grant a difference on each Town:
  • Human: sells everything, high money to trade
  • Dwarf: Smith & Armorer: sells tier 3 Adamant Weapons and Heavy Armor
  • Elven: Jeweler & Weaver: sells tier 3 Arcane Weapons and Armor
  • Sylvan: Smith & Armorer: sells tier 3 Yew/Mithril Weapons and Light Armor
  • Orc: Arena: combat for XP

Phew, that's a lot to unpack! That said, no Town are quite the same... but they are kiiiiinda similar to one another... A Town with 1 Smith or 3 still sells the same things, just in more quantity on 3 Smiths. And they can grow, shrink when attacked, be completely destroyed and expand (spawn another Town close by). I was talking to my brother about this on Sunday and we would like more variety. Maybe we put something like a "personality" on each Town that can offer different quests and have different behaviors toward expansion and conquest, but we don't know yet.

How could we make more varied Towns? I thought about more buildings, but those above are quite round up. Maybe a "personality", but that is not quite visible (even on Race I made different looking housing for each one). @Yal, do you have anymore of those sweet bronze bullets for that? =]
 
I think part of making things feel "non-samey" which has already been kind of pointed out by yal, is too have it so there is more variation than any individual town can represent. So instead of having each town have one of each thing, make it so towns will only spawn one or two things out of a list of 10 or so (that way, you have the chance to visit two towns and they will share no features with each other). Another thing you can do is have unique things that only spawn once per world, so only one town will have the Golden Palace of Might or something. Finally, you can add extra unique things that don't spawn in every world. This relies heavily on players being engaged enough to play through multiple worlds, but if you can pull that feat off, it's extra cool when a player plays through 5 worlds and then suddenly on their 6th a totally new and bizarre thing appears. It makes the game feel waaay bigger than it actually is because just as the player is starting to feel like they understand what can be generated they get thrown a curveball and then it feels like anything could happen.

All of these things definitely take extra work and some players (most if people don't do multiple runs or visit every town) will miss out on some content, but it makes the world a lot more interesting for dedicated players.
 
Top