One Hour One Life Forums

a multiplayer game of parenting and civilization building

You are not logged in.

#1 2018-09-26 12:22:28

FounderOne
Member
Registered: 2018-03-16
Posts: 336

map chunk

I was wondering how the objects are shown on my screen. So I looked into the files and just found in the stdout-file a load of a map chunk. When I picked up an object it was also shown in the stdout. But how does it know that on this position is a gooseberry bush for example?


Its a rought world - keep dying untill you live <3

Offline

#2 2018-09-26 14:22:23

sc0rp
Member
Registered: 2018-05-25
Posts: 740

Re: map chunk

Map chunks and map updates include item info as well - you can see full data in replay files, not stdout.  Map chunks are gzip compressed though, so just text editor won't be enough to view it.

Offline

#3 2018-09-26 16:07:31

FounderOne
Member
Registered: 2018-03-16
Posts: 336

Re: map chunk

sc0rp wrote:

Map chunks and map updates include item info as well - you can see full data in replay files, not stdout.  Map chunks are gzip compressed though, so just text editor won't be enough to view it.

Thank you. Hmm.

Jason posted once a picture from a "satellite" view of the map. Could you generate such a pic with the informations stored in this file?

I looked fast gzip up and tried to decode the file, but I guess it's just some text parts that are gziped?

Last edited by FounderOne (2018-09-26 16:21:45)


Its a rought world - keep dying untill you live <3

Offline

#4 2018-09-26 17:32:59

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

Re: map chunk

It's very easy to dump map chunks if you modify the game source (they are decompressed in the game before they are used).

They aren't sent to stdout because they are pretty big.

Offline

#5 2018-09-26 18:18:54

sc0rp
Member
Registered: 2018-05-25
Posts: 740

Re: map chunk

FounderOne wrote:

Jason posted once a picture from a "satellite" view of the map. Could you generate such a pic with the informations stored in this file?

Yep.  Of course only areas you've visited.

FounderOne wrote:

I looked fast gzip up and tried to decode the file, but I guess it's just some text parts that are gziped?

Yes.  Replay format is undocumented (AFAIK), but pretty simple to parse - it's dump of server messages (which does have documentation), mouse movements, key presses, etc.  It's all ascii text, but some larger messages are gzipped.

Offline

#6 2018-09-26 18:32:56

Uncle Gus
Moderator
Registered: 2018-02-28
Posts: 567

Re: map chunk

There are a couple of functions Jason uses for generating those biome maps. They're commented out in server.cpp

Offline

#7 2018-09-27 09:39:15

FounderOne
Member
Registered: 2018-03-16
Posts: 336

Re: map chunk

jasonrohrer wrote:

It's very easy to dump map chunks if you modify the game source (they are decompressed in the game before they are used).

They aren't sent to stdout because they are pretty big.

Okay, I went in the gamesource and then to game.cpp there is the "mapPullMode". So I guess when I activate it and compile the game I can pull the map?

I guess I get a file like the "tutorial1" then? But it wont pull all changes constantly? Its more a momentum?


Its a rought world - keep dying untill you live <3

Offline

#8 2018-09-27 09:43:10

Joriom
Moderator
From: Warsaw, Poland
Registered: 2018-03-11
Posts: 565
Website

Re: map chunk

Map pull is available in client but disabled in settings folder. Even if you enable it, server has to have it enabled in its settings as well to allow map pulls. Official servers have this diabled.

You could somehow reuse this code though to work on map data received during gameplay (generating image on the fly or storing map data and drawing it all at once at the end).

Offline

#9 2018-09-27 10:47:38

FounderOne
Member
Registered: 2018-03-16
Posts: 336

Re: map chunk

Joriom wrote:

Map pull is available in client but disabled in settings folder. Even if you enable it, server has to have it enabled in its settings as well to allow map pulls. Official servers have this diabled.

You could somehow reuse this code though to work on map data received during gameplay (generating image on the fly or storing map data and drawing it all at once at the end).

Ah I see. Well that would be one option. But what about the folderCache.ccp?  There it is compressing data. So before the data gets compressed you could save the raw data maybe and work with it?

Last edited by FounderOne (2018-09-27 10:50:32)


Its a rought world - keep dying untill you live <3

Offline

Board footer

Powered by FluxBB