One Hour One Life Forums

a multiplayer game of parenting and civilization building

You are not logged in.

#1 2018-06-13 16:21:13

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

Getting map data out of recordedGame files

Does anybody have information how to get map data out of  recordedGame files?  Or I have to just "read the source, Luke"?

Offline

#2 2018-06-13 19:35:46

ryanb
Member
Registered: 2018-03-08
Posts: 217
Website

Re: Getting map data out of recordedGame files

I would like to know this too. Would be pretty cool to make a tool that parses the recorded game and generates a map.


One Hour One Life Crafting Reference
https://onetech.info/

Offline

#3 2018-06-13 23:55:49

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

Re: Getting map data out of recordedGame files

Recorded games store all the messages that client has received from server (along other things, like all messages sent, all mouse positions and clicks, etc).

What you need is simply parse all the messages that provide, update or otherwise modify map. Quite detailed documentation with full list of messages client can receive from server as well as their format and how data is packed is provided in protocol.txt in game source files.

Offline

#4 2018-06-14 00:13:46

Stripes251
Member
From: Texas
Registered: 2018-03-10
Posts: 38

Re: Getting map data out of recordedGame files

Yes I need map data as well so I can cause the apoca.....

I mean find things easier to help my village.


"O Lord, bless this thy hand grenade, that with it thou mayst blow thine enemies to tiny bits, in thy mercy." - Monty Python

Offline

#5 2018-06-14 04:46:05

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

Re: Getting map data out of recordedGame files

Bear in mind that every recorded game will start at 0,0 so you won't easily be able to combine map information from different game recordings.

Offline

#6 2018-06-14 05:51:49

Morti
Member
Registered: 2018-04-06
Posts: 1,323

Re: Getting map data out of recordedGame files

Uncle Gus wrote:

Bear in mind that every recorded game will start at 0,0 so you won't easily be able to combine map information from different game recordings.

Could if you could find common points.
If we are born to the same family, and your 0,0 equals my -45,-15, then the data could be combined.

Offline

#7 2018-06-14 06:11:12

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

Re: Getting map data out of recordedGame files

Joriom wrote:

Recorded games store all the messages that client has received from server (along other things, like all messages sent, all mouse positions and clicks, etc).

What you need is simply parse all the messages that provide, update or otherwise modify map. Quite detailed documentation with full list of messages client can receive from server as well as their format and how data is packed is provided in protocol.txt in game source files.

Thanks a lot, will take a look.

Offline

#8 2018-06-14 06:16:33

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

Re: Getting map data out of recordedGame files

Uncle Gus wrote:

Bear in mind that every recorded game will start at 0,0 so you won't easily be able to combine map information from different game recordings.

Yeah, I'm aware of this.  It's not trivial, but kind of simple to solve (find overlapping areas).  More difficult may be to handle partial wipes of map, where some areas match and some suddenly change.  Anybody knows how wipes work?  Are terrain tiles affected, or only items?

Offline

#9 2018-06-14 10:20:27

pein
Member
Registered: 2018-03-31
Posts: 4,337

Re: Getting map data out of recordedGame files

maybe monoliths, they seem to be diagonally straight to others, and map seems better near them, some lifes i see 3 of them


https://onehouronelife.com/forums/viewtopic.php?id=7986 livestock pens 4.0
https://onehouronelife.com/forums/viewtopic.php?id=4411 maxi guide

Playing OHOL optimally is like cosplaying a cactus: stand still and don't waste the water.

Offline

#10 2018-06-14 13:32:34

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

Re: Getting map data out of recordedGame files

sc0rp wrote:

More difficult may be to handle partial wipes of map, where some areas match and some suddenly change.  Anybody knows how wipes work?  Are terrain tiles affected, or only items?

Any tile that has not been loaded from database (aka. seen by player, because only tiles in range of players are kept in RAM) for some time (this has varied in the past so I'm not sure for how long. is it still 24h or is it like 3-7 days now?) will be dropped from database next time server reboots (for update or something. not sure if during shutdown or startup, probably the latter).

Next time players sees the same tile (tries to access it from database by presence nearby), it will not be found and will be regenerated by the world generation alghorytm.

Tile will be in its pristine state. All items gone. All natural resources/animals generated again.

sc0rp wrote:

Yeah, I'm aware of this.  It's not trivial, but kind of simple to solve (find overlapping areas).

I was working on exactly the same problem in the past for my bot. If you want to use overlapping areas, focus mostly on features that are always there, no matter what: monoliths, ice holes, cacti, etc. Those can not be removed by players (or in case of monolith can only have few variants but always at the same spot - when modified by player) and those can not be created by players. Use those as anchors. If you're lucky enouch, you could even use belltowers as "global" anchors. Whenever you hear a belltower, knowing your server you're on just use this http://onehouronelife.com/monuments/ as reference. You could try using two bell towers to triangulate your exact global position OR single bell tower and a bit of "map generation magic" looped over all known bell towers (and comparition with currently seen world data) to use single bell tower to get your "global" coordinates.

P.S. Using biome value should work as well, as its constant no matter what, but making hash of bigger areas to speed up comparisions is not really valid as your "0,0" does not share a common offset.

Last edited by Joriom (2018-06-14 13:36:25)

Offline

#11 2018-06-14 13:54:33

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

Re: Getting map data out of recordedGame files

Thanks a lot for info.

Joriom wrote:

Any tile that has not been loaded from database (aka. seen by player, [...]) will be dropped from database next time server reboots [...]

Next time players sees the same tile (tries to access it from database by presence nearby), it will not be found and will be regenerated by the world generation alghorytm.

Tile will be in its pristine state. All items gone. All natural resources/animals generated again.

But it will be the same as original pristine state or different one (I care mainly for terrain types)?

Joriom wrote:

I was working on exactly the same problem in the past for my bot. If you want to use overlapping areas, focus mostly on features that are always there, no matter what: monoliths, ice holes, cacti, etc. Those can not be removed by players (or in case of monolith can only have few variants but always at the same spot - when modified by player) and those can not be created by players. Use those as anchors.

Do they survive partial map wipes?

Joriom wrote:

If you're lucky enouch, you could even use belltowers as "global" anchors. Whenever you hear a belltower, knowing your server you're on just use this http://onehouronelife.com/monuments/ as reference. You could try using two bell towers to triangulate your exact global position OR single bell tower and a bit of "map generation magic" looped over all known bell towers (and comparition with currently seen world data) to use single bell tower to get your "global" coordinates.

Thanks for a hint.  Can I hear more that one bell in one life?

Joriom wrote:

P.S. Using biome value should work as well, as its constant no matter what, but making hash of bigger areas to speed up comparisions is not really valid as your "0,0" does not share a common offset.

Rolling hashes will work fine. Generally the same things that speed up finding matches for compression/diffs.

Offline

Board footer

Powered by FluxBB