One Hour One Life Forums

a multiplayer game of parenting and civilization building

You are not logged in.

#152 Main Forum » How to make compost » 2018-07-19 06:15:38

sc0rp
Replies: 32

Ok, so what are the currently recomended steps of making compost?  For me it looks something like this:
1. Get yourself a backpack and knife.
2. Feed shorn sheep.
3. Wait 5 seconds and stab the person that shears it.
4. Go to point 2 until there are no people entering the pen without 2 bowls full of berries and carrot per shorn sheep.

You can also go less violent route of hiding shears, but then you need to wait until the town runs out of iron, which seems worse.

#153 Re: Main Forum » Help tracking lag spikes » 2018-07-19 02:53:58

jasonrohrer wrote:

Also, server1 is seeing 80% and higher CPU spikes, where server2 is down below 60% most of the time.

If it was idle waiting on IO, then the CPU would be idle instead of so high, right?

Yeah, so maybe map generation or path finding or something else.  Profiler will tell the truth wink

EDIT: It may be also lots of syscalls to get the data from disk cache in very small chunks.  Again: profiler.

#154 Re: Main Forum » Help tracking lag spikes » 2018-07-19 02:42:00

jasonrohrer wrote:

We can't do anything in parallel here, because there are multiple actors, and the world needs to be consistent.

In theory it can be done - with predicate locking and rollback+retry in case of confilicts.  In practice, I wouldn't go there - it's big ugly can of worms not worth the effort.

jasonrohrer wrote:

I can't pre-fetch a map chunk for you, because it's going to be changed by the time you walk over there.

The server is essentially ordering everyone's actions.  Who grabbed the ax first?  Is the door open or closed when you tried to walk through it?

It's possible to do this while parallelizing IO operations, but with a lot of additional complexity (tracking pre-fetched map chunks and updating them all when tiles change).

By prefetch I meant getting data from db into cache.  You already write-thru all data via cache, so stale data coming from pre-fetch can be discarded here.  Nothing a mutex or two couldn't handle.

jasonrohrer wrote:

The MOVE messages do not send people more map chunks.  They are sent map chunks whenever they arrive at a location outside their current chunk.  MOVE initiates the move.  I think the map chunk fetching happens in a later step, after all incoming messages have been processed.

Thus, those times between MOVES are exclusively for parsing/processing the moves themselves.  Making sure the path is valid, that it connects to the player's existing path, making sure it doesn't go through blocking walls, etc.  Some of that touches the database, along the path, to check tiles.  Gotta figure out whey that's so slow.  300 ms for 14 moves is awful.

Yeah, profiling this to track down real bottleneck is best action now.

#155 Re: Main Forum » Any way to track who let the bear out? » 2018-07-18 19:33:55

Trick wrote:

I have been building trash pits around the bear caves.  Takes smithing for shovel, but it does the trick really well.

Does it need one trash pit or three or what?

Anyway if I'm already smithing, then I'm making bow and arrow already for goose.  So just 4 more milkweed for 2 additonal arrows will bear proof the village.

#156 Re: Main Forum » Help tracking lag spikes » 2018-07-18 17:54:11

jasonrohrer wrote:

Scorp, server is not threaded, at all.  It's running on a single core machine, so threading wouldn't help.

Threading is often used on I/O bound code to have multiple requests issued in parallel.  So it frequently helps even with single core.  Looking at the server code, it wouldn't be a simple change, though.

jasonrohrer wrote:

And I'm not using KISSDB anymore, but a high-optimized replacement that I wrote, STACKDB (which keeps the most-recently-accessed data at the top of the chain for each hash bucket, so performance doesn't degrade so much as the database fills up).

"High-optimized" is a bold statement.  It's better than KissDB at the task at hand, but there is sill plenty of things than can be improved.  I would get rid of random access chains - long chains defeat the purpose of having hash in the first place.  To handle collisions I'd use plain linear probing - the data for next bin is most likely already in the disk cache anyway, so why to have random reads all over the place. If table load gets high or some chain is getting too long, just double the size of hash table.  You need to rehash all entries to do so, but there is a way do to it incrementally, so performance hit is negligible (in short: create table twice as large; new writes go into it; read checks first in new table then in old one; on each write copy/rehash also few elements from old table to new, making sure you don't overwrite new data with stale one).

jasonrohrer wrote:

Glancing over this data, I see some trouble spots like this:

L4 | Tue Jul 17 01:07:51 2018 (466 ms) 
L4 | Tue Jul 17 01:07:51 2018 (770 ms) 

300+ ms between PLAYER_UPDATE messages getting sent out.

There are even worse cases there (450+ ms):

 18  L4 | Tue Jul 17 01:08:11 2018 (515 ms)
  4  L4 | Tue Jul 17 01:08:11 2018 (519 ms)
 15  L4 | Tue Jul 17 01:08:11 2018 (534 ms)
 32  L4 | Tue Jul 17 01:08:11 2018 (566 ms)
 87  L4 | Tue Jul 17 01:08:11 2018 (653 ms)
458  L4 | Tue Jul 17 01:08:12 2018 (111 ms)
 68  L4 | Tue Jul 17 01:08:12 2018 (179 ms)
 18  L4 | Tue Jul 17 01:08:12 2018 (197 ms)
200  L4 | Tue Jul 17 01:08:12 2018 (397 ms)
 34  L4 | Tue Jul 17 01:08:12 2018 (431 ms)
 12  L4 | Tue Jul 17 01:08:12 2018 (443 ms)
--
 19  L4 | Tue Jul 17 01:08:13 2018 (944 ms)
 41  L4 | Tue Jul 17 01:08:13 2018 (985 ms)
 11  L4 | Tue Jul 17 01:08:13 2018 (996 ms)
224  L4 | Tue Jul 17 01:08:14 2018 (220 ms)
230  L4 | Tue Jul 17 01:08:14 2018 (450 ms)
445  L4 | Tue Jul 17 01:08:14 2018 (895 ms)
174  L4 | Tue Jul 17 01:08:15 2018 (69 ms)
 28  L4 | Tue Jul 17 01:08:15 2018 (97 ms)
 12  L4 | Tue Jul 17 01:08:15 2018 (109 ms)
 32  L4 | Tue Jul 17 01:08:15 2018 (141 ms)
  2  L4 | Tue Jul 17 01:08:15 2018 (143 ms)
--
 53  L4 | Tue Jul 17 01:08:25 2018 (888 ms)
  5  L4 | Tue Jul 17 01:08:25 2018 (893 ms)
 71  L4 | Tue Jul 17 01:08:25 2018 (964 ms)
 18  L4 | Tue Jul 17 01:08:25 2018 (982 ms)
270  L4 | Tue Jul 17 01:08:26 2018 (252 ms)
465  L4 | Tue Jul 17 01:08:26 2018 (717 ms)
184  L4 | Tue Jul 17 01:08:26 2018 (901 ms)
 43  L4 | Tue Jul 17 01:08:26 2018 (944 ms)
 16  L4 | Tue Jul 17 01:08:26 2018 (960 ms)
  2  L4 | Tue Jul 17 01:08:26 2018 (962 ms)
 60  L4 | Tue Jul 17 01:08:27 2018 (22 ms)
--
100  L4 | Tue Jul 17 01:08:54 2018 (547 ms)
 53  L4 | Tue Jul 17 01:08:54 2018 (600 ms)
 86  L4 | Tue Jul 17 01:08:54 2018 (686 ms)
  7  L4 | Tue Jul 17 01:08:54 2018 (693 ms)
205  L4 | Tue Jul 17 01:08:54 2018 (898 ms)
468  L4 | Tue Jul 17 01:08:55 2018 (366 ms)
 42  L4 | Tue Jul 17 01:08:55 2018 (408 ms)
 22  L4 | Tue Jul 17 01:08:55 2018 (430 ms)
 14  L4 | Tue Jul 17 01:08:55 2018 (444 ms)
 19  L4 | Tue Jul 17 01:08:55 2018 (463 ms)
 52  L4 | Tue Jul 17 01:08:55 2018 (515 ms)

And worst case latency seen by player can be combined latency from two successive runs (when his request came just shortly after you checked him on first run and is handled late during second run). So 270+465+RTT(150-200 for Europe) - thats nearly a second.

jasonrohrer wrote:

But anyway, there's an unlucky moment when 14 moves come in all at once.

It's not unlucky moment.  You most likely just run head first into perfomance wall, where you can't handle player requests in real time and you lag behind more and more:

 11  L4 | Tue Jul 17 01:08:13 2018 (996 ms)
224  L4 | Tue Jul 17 01:08:14 2018 (220 ms)
230  L4 | Tue Jul 17 01:08:14 2018 (450 ms)
445  L4 | Tue Jul 17 01:08:14 2018 (895 ms)
174  L4 | Tue Jul 17 01:08:15 2018 (69 ms)
 28  L4 | Tue Jul 17 01:08:15 2018 (97 ms)

It does resolve itself only because lag for players becomes so bad, that they stop doing anything.

jasonrohrer wrote:

I'm not sure why each one is taking so long to process, because those don't touch the database at all.... oh, actually, I think they do, to make sure that the requested moves aren't blocked by obstacles.

You probably also sending new map chunks to players that are moving.  That may require additional few hundred reads per player from time to time.  Looks likely that's the case here (handling move far away from birth spot took 100+ ms):

L4 | Tue Jul 17 01:07:51 2018 (510 ms) | general | Got client message from 991383: MOVE 235 -2 -1 1
L4 | Tue Jul 17 01:07:51 2018 (611 ms) | general | Got client message from 991375: MOVE 25 18 -1 0 -2 0 -3 0 -4 -1

There are lots of cases where handling move for player takes 20+ ms.  If that code would be running on client you would burn your whole time budget for a frame (50 fps).  So there is something very inefficient there.

jasonrohrer wrote:

Anyway, this reminds me that MOVE is the most common message type received by the sever, and processing it needs to be fast.  Way faster than this.

I probably need to cache the obstacle flags on the map, or something, to speed it up.

So what's to do next?  I'd recommend to run profiler on the code and check those events where it takes 20+ ms to handle move.  Copy database, clear cache, play for a while with server under profiler.  See where you spend most of the wall clock time handling MOVE.

If profiling will be hard or you want to proceed blindly, I'd recommend following changes:

1. Get rid of long random access chains in db.  Linear probing with doubling the size of table when load gets high should work fine.  It will make it possible to run read request in parallel as a side effect (necessary for point 3).

2. Increase cache size.  Any reason you decided to have itty-bitty tiny cache for map data?  I'd give it half of the RAM.  Instead of 1-way, make it at least N-way or maybe even full LRU (disk reads are very expensive).

3. Run separate thread that will prefetch map data for players.  You send 32x30 tiles.  So prefetch thread should pre-cache map in all directions, something like 96x90.  When player does move in any direction, you should have tile and item data already in the RAM.  Special case Eve spawn to precache all data before she's born.

4. Expliot spatial locality of requests.  Instead of having multiple records per tile (biome, items, subitems, etc.), clump up all information about tiles and items in 8x8 or 16x16 block in one record.  For a some small write amplifictation, it would give you two-three orders of magnitude speed up on reading map data.


If you would prefer to work on game content instead of optimizations, I have some spare time right now.  So I'm open for short-term gig to work on it - just let me know if you're interested.

#157 Re: Main Forum » 50 natural berry bushes nearby and they still starve » 2018-07-18 12:38:05

JonySky wrote:

My experience in the game makes you distrust the other players, if you want it to be done well, do it yourself ... the problem of course is that the camp does not advance

I focus on most difficult task at hand and try to delegate all simpler stuff.

JonySky wrote:

the next game will try again as you say
I hope I do not end up alone in the camp without food ... XD

Sometimes you do.  But if none of your kids could stay alive foraging, then chances are pretty high they wouldn't build the camp either.  They would sponge all the food you brought and then promptly die.

#158 Re: Main Forum » 50 natural berry bushes nearby and they still starve » 2018-07-18 02:44:26

Tane wrote:

I just wish the new players asked more questions. Especially as kids when you can still hold them.

Asking meaningful questions letter at a time is quite a challenge wink

#159 Re: Main Forum » I want to try the “friends” update with my sister but.. » 2018-07-17 23:06:19

golmock wrote:

I've never heard of multiple systems.

?

golmock wrote:

The proposed method is likely to be abused.

It can also be used to introduce game to new players.

golmock wrote:

If you want to play a game, you have to pay.

There are demo versions for a lot of games that let you try it first.

#160 Re: Main Forum » I want to try the “friends” update with my sister but.. » 2018-07-17 23:04:19

TheRedBug wrote:

Plz no
This is a bad idea...

Can you elaborate why?  If you worry about noobs, they may be forced to finish tutorial first.

#161 Re: Main Forum » I want to try the “friends” update with my sister but.. » 2018-07-17 22:17:31

jasonrohrer wrote:

Yeah, you can't share accounts and play at the same time.

That's what you're paying for:  a server account.

An idea how to increase game popularity:

Allow people to invite friends to play with them as twins+, without requirement for invited people having an account.  That may help to viral the game.  People that like the experience will still need an account to play it on their own.  I think this model worked fine for e.g. Starcraft.

INB4: Griefing problems can be solved easily by curse point accumulating on host's account.

#162 Re: Main Forum » Marked graves » 2018-07-17 21:08:10

Marked Grave
[...]
numSlots=1
slotSize=1.000000

So I guess it can contain one small item, i.e. the same ones that you can put 3 of into basket.

#163 Re: Main Forum » 50 natural berry bushes nearby and they still starve » 2018-07-17 18:34:43

JonySky wrote:

I try to collect wild food (I make many trips so that no one dies of hunger) I give them basic instructions so they do not move away from the food and be productive but ... nothing works.

Swap it.  Work only at camp and ask every kid to go forage and bring back some food if he can.  Tell them direction where reed for basket is and where plenty of food is.  Works pretty well usually.  Bonus points for natural selection.  Dumb kids die off.  Smart ones bring back food and can help later with camp.

#164 Re: Main Forum » Starting a farm (tilled row) Help! » 2018-07-17 18:25:40

svagg wrote:

Thank you so much for your time and help!

But if i only use one bowl of soil instead of a basket of soil, i only get a hardened row. hmm

It was already answered in this thread, before you asked question:
https://onehouronelife.com/forums/viewt … 266#p24266

Precogniton or what?

#165 Re: Bug Discussion » Can't move bug » 2018-07-17 18:09:09

What it says as death reason?  Disconnection?

#167 Re: Main Forum » A sit down meal. » 2018-07-17 14:11:19

PunkyFickle wrote:
Anshin wrote:

It would be so nice to see people eating together.

What I like about your idea, besides food variety and bonuses, is the fact that it can imply a time of gathering for the members of the community, which not only can be fun in itself, but also permits to exchange about what is needed at that time and give directions in order to improve the settlement. That is something that really lacks in the game, I think.

I'd like to see people eating together too, but this proposition doesn't do much to encourage it.  They must be at the SAME PLACE at the SAME TIME to exchange ideas.

Maybe yum bonus for each person also sitting at the table when you eat?  That, plus "sitting in a chair could save energy" could do the trick.

#168 Re: Fixed Bugs » Server restart = endless Eve runs » 2018-07-16 21:38:07

How does it work?  What counts as big town?  It's one per server or per player?

#170 Re: Main Forum » Ran into my first pair of twin griefers today. » 2018-07-16 10:55:41

Tarr wrote:

However, I do think that cursing one twin/triplet/quadruplet should lead to the whole group receiving a combined curse point.

+1

Tarr wrote:

Another possible idea is that whenever grouping with friends instead of counting each individual players curse points it adds both players together while queued together to determine whether or not said group has black or white chat bubbles.

+1

#171 Bug Discussion » Towns are dying because of lack of server optimizations » 2018-07-15 15:45:22

sc0rp
Replies: 0

I was playing on server2 as 3rd gen Duchess Greathouse
http://lineage.onehouronelife.com/serve … &id=560153
and then as 16th gen Kato Greathouse
http://lineage.onehouronelife.com/serve … &id=562876

At first I didn't recognize the town, but upon closer inspection, indeed, it was the place I helped to set up.  So how it died?  With the most anticlimatic end that can be - no kids were born.  I had only 2 sons, that promptly suicided upon seeing almost nobody in town.

That can be quickly dismissed as: there are not enough players around.  Nothing to do, right?  Wrong.  There were 50-60 players active at that time.  But split across 2-3 servers.  So there were only 22 players on server2 when I started second run.  Add some lineage ban or somesuch and here you go, nobody is born.

And with current setup, this problem will persist, no matter how many players are playing.  If there will be 500 players playing in the peak, then they will be split across 10+ servers.  And when the player base dips at Europe's dawn/US night, there will be still ~150+ people playing, but only 15 per server.  So all towns will die.  And then they will be proptly wiped out on next server restart.

That's a problem.  If there is no way for towns to last even 24h, there is no chance for late game things to emerge, like prisons:
https://onehouronelife.com/forums/viewtopic.php?id=2750
or penguin hockey arena:
https://onehouronelife.com/forums/viewtopic.php?id=2734

That hurts the game IMO.

#172 Re: Main Forum » Got adopted for the first time! » 2018-07-15 14:39:49

karltown_veteran wrote:

Have you been spying on me? Because I actually once proposed with a headless domestic goose. Never told anyone on forum about it.
It was meant to be a non-headless domestic goose. I put it at her feet and begged her for marriage but then a guy took the goose to the town square and chopped off its head. I chased it back to her. Still bleeding all over the place, legs still kicking I laid it in front of her. She said yes.

I think I've seen only end of it. wink  I've noticed because usually people propose with the live one...

I still think that a headless one is better choice for dower.  It won't run and you can still make a knife with it.  Great asset!

#173 Re: Main Forum » Optional Audible Cues? For audio based off screen tracking. » 2018-07-15 13:48:41

YAHG wrote:

If you gave it a hunger cost per ! with increasing sound range, people won't spam it too hard.
Unless they are trying to eat all the food that is.

But then again you will see what they are up to easier as well.

I like the idea of SHOUTING.  But making it cost hunger bars is very high price in the context where it would be most useful (Eve runs) and matter the least where it can be abused just to annoy people (towns).  We need something with reverse properties.

EDIT: You can shout only shortly after eating onion, budrock, wild carrot, etc.?

#174 Re: Main Forum » fire » 2018-07-15 13:18:29

Great idea, but probably has to wait until trees grow on their own or we can plant them.  Currently it's non-renewable resource.

INB4: Global warming denial.

#175 Re: Main Forum » Trying to clean up » 2018-07-15 13:10:31

Neo wrote:

Yeah well I didn't succeed in the end, Everyone starved anyway. The people probably spent the rest of there lives trying to hunt me down rather then accepting my offer of peace and help me fix the farm.

Did you drop your knife?  I not, that's half assed offer.

Board footer

Powered by FluxBB