One Hour One Life Forums

a multiplayer game of parenting and civilization building

You are not logged in.

#1 2019-02-24 02:13:36

jasonrohrer
Administrator
Registered: 2017-02-13
Posts: 4,805

Update: Turbo Map Load

tyYXGyx.gif

This update has tons of fixes and improvements.  The biggest one is an overhaul to the way the map is loaded.  You may have noticed that, in the past, the first time you loaded a map, it was pretty slow, but in later lives, it was very fast.  This would be true even if you quit the game, as long as you didn't restart your computer.

And by "pretty slow" the first time, I mean very slow, depending on the state of your disk.  60 seconds or more wasn't unheard of, which meant that you were loading through a good portion of your childhood.  This has gotten worse over time, as more sprites have been added.  Subsequent map loads in future lives would be as fast as 4 seconds, thanks to caching.

Reading files from hard drives the first time is slow, there's no way around that.  The game was designed with a lazy, as-needed approach to sprite loading, only keeping the sprites that are absolutely needed in VRAM, and flushing any sprites that haven't been drawn for over ten seconds.  The idea was that, with 10,000 objects, all those sprites are never going to fit in texture memory.  Maybe not, but we're not there yet, and the total size of all the sprites in the game is currently only about 56 MB.  In busier map areas, almost all of these need to be loaded, so we're pretty much using that much texture memory anyway.

It turns out that reading 56 MB from disk isn't slow, generally, but when it's in 1800 separate files, caching prefetches can't help.  Bundling all of these into one huge file makes it much faster, and so does compressing them (TGA files that have a lot of transparent borders are very compressible).  These all fit, together, into just a single 6 MB file.  Might as well load the whole thing at startup, which is what the game client is doing now.  While we're at it, might as well do the same thing with the sound effects (which aren't at all compressible, but still benefit from being in one big file together for caching reasons).

So by the time you get around to "map loading," after logging in, there's really nothing to load.  This means that a progress bar isn't even needed--it's that fast (most of the "3 seconds" quoted above are spent finding the server and connecting to it).

And thinking about the future, we're definitely not going to have 10x more sprites than we do right now, and that worst case would be 560 MB, which still would fit in the VRAM of some pretty old graphics cards.  It might actually be okay to always preload all sprites.

This isn't entirely free, because the compressed glob file has to be made somehow.  Given that, between sprites and sounds, this represents about 25 MB currently, and given that these files will change with every update, building them server-side would dramatically balloon the download sizes of the weekly updates.

So, your client rebuilds these, one time, after every update.  This can take a bit of time, maybe up to a minute, depending on your hard drive, but after that, the game will load quickly.  And furthermore, this process happens before you even login, so it has no impact on your map loading experience.

Okay, what else changed?  Too much to list in detail here. 

Everything after v199 here:

https://github.com/jasonrohrer/OneLife/ … ngeLog.txt

Everything on February 22, 2019 here:

https://github.com/jasonrohrer/OneLifeD … its/master

All reported and reproducible code bugs on GitHub have been fixed now.  I'm still in the process of working through all the content bug reports.

Offline

#2 2019-02-24 09:31:18

InSpace
Member
Registered: 2018-03-02
Posts: 448

Re: Update: Turbo Map Load

Is it how other devs have multiple images in one big image, like this?
dsiege-sprites-tex-samples.jpeg

Offline

#3 2019-02-24 14:09:05

Spoonwood
Member
Registered: 2019-02-06
Posts: 4,369

Re: Update: Turbo Map Load

Wild lassos was silly.  I'm glad to see that was a bug.


Danish Clinch.
Longtime tutorial player.

Offline

#4 2019-02-24 18:55:06

fragilityh14
Member
Registered: 2018-03-21
Posts: 556

Re: Update: Turbo Map Load

I'm having some new problems since these updates. Now there are random disconnects where the screen just goes black suddenly, and I saw someone else lagging into a berry bush. This happened 5 in my last childhood. It hadn't happened the one before where i was in an Eve camp, so it seems to be affected by the number of people and items around.

The screen also doesn't track my character as well now, especially when i'm being held, I'm on the edge of the screen a lot more.


I'll tell you what I tell all my children: Make basket, always carry food.

Listen to your mom!

Offline

#5 2019-02-24 21:56:06

wondaland
Member
Registered: 2019-02-18
Posts: 85

Re: Update: Turbo Map Load

Spoonwood wrote:

Wild lassos was silly.  I'm glad to see that was a bug.

I thought it was pretty funny, but yea a tad in realistic and wayyy too late away to collect extra rope etc.

Offline

#6 2019-02-25 15:52:09

fragilityh14
Member
Registered: 2018-03-21
Posts: 556

Re: Update: Turbo Map Load

are ones that spawned previously still there? The wild lassos? I was on an iron run after this and still saw one. fortunately, it was right where my cart had tipped over, so i'm not complaining


But it was also in a desert biome that had three trapped horses in a small space, so i'm not sure if someone had just biomelocked the horses and left a lasso or what. it didn't seem like anyone had been around.


I'll tell you what I tell all my children: Make basket, always carry food.

Listen to your mom!

Offline

#7 2019-02-25 17:16:02

Spoonwood
Member
Registered: 2019-02-06
Posts: 4,369

Re: Update: Turbo Map Load

fragilityh14 wrote:

are ones that spawned previously still there? The wild lassos? I was on an iron run after this and still saw one. fortunately, it was right where my cart had tipped over, so i'm not complaining


But it was also in a desert biome that had three trapped horses in a small space, so i'm not sure if someone had just biomelocked the horses and left a lasso or what. it didn't seem like anyone had been around.

Someone on the discord said that if someone saw it before the update which corrected the bug, then the wild lasso will still be there.  Wild lasso.  I'm still laughing.


Danish Clinch.
Longtime tutorial player.

Offline

#8 2019-02-26 05:45:12

Peremptive
Member
Registered: 2019-02-14
Posts: 199

Re: Update: Turbo Map Load

I still wish Tarr hadn't told Jason for a couple of days longer, I would have the greatest pine wall in history

Offline

#9 2019-03-01 16:21:39

mrbah
Member
Registered: 2019-01-15
Posts: 156

Re: Update: Turbo Map Load

this new loading system (or just the new patch) causes my game to crash during the "loading sounds" part.
anyone have advice?

Offline

#10 2019-03-02 03:16:26

jasonrohrer
Administrator
Registered: 2017-02-13
Posts: 4,805

Re: Update: Turbo Map Load

Are you on the Steam version, or off-Steam?

If you're off-Steam, you may need to delete these files:

sprites/bin_cache.fcz
sounds/bin_cache.fcz
reverbCache/bin_cache.fcz

If you're on-Steam, and it's really not working, email me:  jasonrohrer AT fastmail.fm

Offline

#11 2019-03-03 11:18:10

Tarr
Banned
Registered: 2018-03-31
Posts: 1,596

Re: Update: Turbo Map Load

Still having the same issue as mrbah using the steam version of the game. If I want to actually want to play the game I have to clear the cache each and every time I load the game otherwise I get stuck at the waiting to be born screen.

I assume my issue is related to using custom sprites but I'm not 100% sure on that one.


fug it’s Tarr.

Offline

#12 2019-03-03 17:46:05

mric
Member
Registered: 2019-03-02
Posts: 21

Re: Update: Turbo Map Load

@tarr
no problem with my steam version of game, therefore that is probably specific to your installation of the game or computer.

Offline

Board footer

Powered by FluxBB