Author Topic: How are huge game worlds stored in memory?  (Read 19241 times)

miki151

  • Rogueliker
  • ***
  • Posts: 264
  • Karma: +0/-0
    • View Profile
Re: How are huge game worlds stored in memory?
« Reply #15 on: January 14, 2014, 08:17:45 AM »
With some tricks you can at least reduce the memory consumption of tiles that have never been visited and don't contain any items.

Must be an interesting trick, because usually maps are just simple 2D arrays.
In my case they're 2D arrays of pointers to a Square class that's about a 100 bytes. If my maps become too big, they'll be null pointers with some building info kept on the side, and created ad hoc when needed.
KeeperRL, Dungeon Keeper in roguelike style:
http://keeperrl.com

guest509

  • Guest
Re: How are huge game worlds stored in memory?
« Reply #16 on: January 14, 2014, 12:36:40 PM »
Miki I'm going to say this with a lot of love right now. It's great you are making a game, but you are probably being taught by geezers that think this kind of stuff matters. It just doesn't. Not since before you born.

As a practice in efficiency then yeah, it might matter academically. But if you want to make an RL then system performance is a moot point.

I'm not trying to be a jackwagon by pointing this out, there are going to be a TON of people here with way better programming skills than I have, but most hobby type roguelikes are rolling in at less (far less) than 10 megabytes.

Old dudes who grew up trying to save bits and bytes as a primary skill in programming might not be aware that efficiency is no longer a major skill. And when it comes to tile based, turn based and ascii graphics games efficiency considerations are not an issue.

Nethack and ADOM and Diablo are all much more complex than you will create on your own in the next decade, and they all run fine.

I mean this to be taken as encouragement and i'm sorry if this seems negative.

Make a game. I'll play it.

miki151

  • Rogueliker
  • ***
  • Posts: 264
  • Karma: +0/-0
    • View Profile
Re: How are huge game worlds stored in memory?
« Reply #17 on: January 14, 2014, 02:52:09 PM »
I think you meant to direct your post to the OP, I was just answering a question. But while I'm here...

And when it comes to tile based, turn based and ascii graphics games efficiency considerations are not an issue.
I think you're on par with Bill Gates with this one  ;D
« Last Edit: January 14, 2014, 02:53:47 PM by miki151 »
KeeperRL, Dungeon Keeper in roguelike style:
http://keeperrl.com

IBOL

  • Rogueliker
  • ***
  • Posts: 102
  • Karma: +0/-0
    • View Profile
    • IBOLOGY LLC
    • Email
Re: How are huge game worlds stored in memory?
« Reply #18 on: January 15, 2014, 04:32:37 AM »
just a follow-up to my earlier post,
I went in and changed all my arrays from ranging in the 30's up to the 300's,
making the square ones 1000 times bigger. Game still runs fine. Other stuff does seem a bit slower,
but I have about 12 programs running anyway...
so yeah, all in memory at once seems quite doable, especially for a finite world. ;)
Randomly Approaching The Infinite Realms.
http://ibology.org/

guest509

  • Guest
Re: How are huge game worlds stored in memory?
« Reply #19 on: January 15, 2014, 04:24:39 PM »
I think you meant to direct your post to the OP, I was just answering a question. But while I'm here...

And when it comes to tile based, turn based and ascii graphics games efficiency considerations are not an issue.
I think you're on par with Bill Gates with this one  ;D

Shit. Lol. Yeah.