Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Ready] Dynamic submap loading #5840

Merged
merged 17 commits into from
Feb 5, 2014

Conversation

kevingranade
Copy link
Member

Here's the payoff, this makes map loading incremental, which means FAAST.
Additionally saving speed is improved, since it only has to write out submaps that you've been near. Distant submaps remain untouched.
Still to be done is writing submaps out to disk and unloading them to keep memory footprint down, but that can wait for another PR.
The naming for the files is slightly changed, so this won't be compatable with the previous PR.

@dwarfkoala
Copy link

He just did it.

wow.

@KA101
Copy link
Contributor

KA101 commented Jan 31, 2014

Test-compiling now.

@kevingranade
Copy link
Member Author

Still a few issues, it spams map loading dialogs when you're walking around, and I've seen an occasional segfault. I think it's failing to fully populate the active grid sometimes now, probably just need to find a good place to stick a map::load().
Also I need to look at unloading some of those submaps after converting them to keep the memory pressure down a bit.

@Zireael07
Copy link
Contributor

bounce bounce

@i2amroy
Copy link
Contributor

i2amroy commented Jan 31, 2014

Sweet! Nice to see this up and (mostly) ready. :D

@dwarfkoala
Copy link

I say that this has to be in by 0.A. The ability to actually have really really big worlds without the horrendous slowdown and eventual death of worlds is important enough, I think, that we could delay 0.A if necessary.

@ghost ghost assigned kevingranade Feb 2, 2014
@KA101
Copy link
Contributor

KA101 commented Feb 2, 2014

Kevin wanted it in too.

@Zireael07
Copy link
Contributor

0.A is already delayed quite a lot and I agree that it will make a lot of players happy - I mean, the balance changes and the ability to play without "omg the world crashed for ever because it's too big"

@kevingranade
Copy link
Member Author

This should be good to go now, but please put it through a bit of a wringer if you're able. I'm particularly interested in performance on large maps on windows.
When you load a world for the first time with this version, it will read in the whole map, write out the chunked-up map, and then delete the old maps.txt file. It does this so if it crashes when writing the save the maps.txt file will be untouched. Also it throws away the loaded submaps as it writes them to disk to try and reclaim some RAM.
In the future it will also do this if we bump the map version number, because it has to convert all the files over to the new version.

@BevapDin
Copy link
Contributor

BevapDin commented Feb 3, 2014

One issue: the world is not reset/deleted because the code in game::delete_world does not work recursive and only deletes files in the world folder, not in the new maps folder. But creating a new world with the same name will load the already existing maps just fine.

@KA101
Copy link
Contributor

KA101 commented Feb 4, 2014

Second issue: looks like the default-mod list doesn't play well with the directory-assurance code. If you've a better way to resolve that conflict, please do.

http://pastebin.com/QzCPFbrw

@BevapDin
Copy link
Contributor

BevapDin commented Feb 4, 2014

@KA101: In mod_manager.cpp, line 29: the declaration of assure_dir_exist should be removed, as it is now declared in file_wrapper.h that should fix this error.
The declaration was moved and is not recognized by this branch.

@KA101
Copy link
Contributor

KA101 commented Feb 5, 2014

Gave it a once-over with the megafile. Cuts save/load times well over half and retains content. teleporting around suffered no lag over that from usual teleporting.

If I don't hear a reason not to merge this by 11 PM US Eastern, it's going in.

@KA101 KA101 merged commit 4e8957d into CleverRaven:master Feb 5, 2014
@Poetich77
Copy link

The game stops when appears pop up message "Please wait at the map saves"

@kevingranade
Copy link
Member Author

I'm guessing this is due to autosave, if not let me know.
Do you mean it stops indefinitely, or a long time?

@Poetich77
Copy link

Yes, it stops indefinitely. It happen when i'm trying to load my save game
8888

@dwarfkoala
Copy link

I'll make an issue for that

@dwarfkoala
Copy link

Hrm, Poetich77, can you please post a copy of the savegame? For all we know it could be a problem with that specific savegame.
EDIT: https://www.dropbox.com/s/xa612d93yaxfh44/save.rar didn't see that one.

@KA101
Copy link
Contributor

KA101 commented Feb 6, 2014

I'd noticed that it hung a bit, but it completed in a second or two. Chalked it up to my laptop being low-powered. Sorry, Poetich.

@dwarfkoala
Copy link

Curiously, it seems to be hanging indefinitely on my end.
I'm using XP, but my computer is horrendously underpowered so that might be
a factor?

@KA101
Copy link
Contributor

KA101 commented Feb 6, 2014

XP here too. Lemme compile everything since last night and I'll take a shot at it.

@kevingranade
Copy link
Member Author

What exactly is the way to reproduce this, is it just from loading a
particular save?

@dwarfkoala
Copy link

A fix is in the works.
#5948
Seems to be indeed when particular saves are loaded.

On Wed, Feb 5, 2014 at 6:30 PM, Kevin Granade notifications@github.comwrote:

What exactly is the way to reproduce this, is it just from loading a
particular save?

Reply to this email directly or view it on GitHubhttps://github.com//pull/5840#issuecomment-34286391
.

@KA101
Copy link
Contributor

KA101 commented Feb 6, 2014

Yeah, that save was borked or something. Fix seems to do the job, I just merged it.

@Poetich77
Copy link

It`s working in the latest build #802! Thanks for your help, guys!

@kevingranade kevingranade deleted the dynamic-submap-loading branch April 26, 2014 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants