• 0 Posts
  • 95 Comments
Joined 1 year ago
cake
Cake day: June 6th, 2024

help-circle



  • second movement takes place in the server, to do so in the client is nuts.

    For the vast majority of games, it’s in between, because the latency if you waited for the server every frame you moved would be way too much.

    It’s something like you have a local model of where everything is, and send updates to the server of where your local model says your character (and whatever else your inputs affect) are. The server receives that data, potentially validates it (server side anti cheat checking that your movement makes sense, similar to the OP post, for example), and then forwards that info to all players. The client side positions of everything are updated based on that info. Usually some interpolation is added to make things move more smoothly.








  • Interesting. Optimizing the factory for your immediate current needs sounds very tedious, because those needs change all the time. I instead optimize for expandability and adaptability. The factory game genre isn’t for everyone, but if you are interested in some tips:

    My solution is usually something like:

    • really long line of basic resources (usually a belt of smelted copper and a belt of smelted iron, eventually adding more stuff and adding more belts of iron and copper as supplies are needed)
    • when I need thing 1, I make a little package that builds it, drawing resources from the line with splitters so the excess can continue down the line
    • thing 2 is an independent little package farther down the line
    • When it’s time for thing 3, I build copies of the packages for building thing 1 and thing 2 as necessary to feed the construction of thing 3, again as separate feeds splitting off the main resource line
    • when it’s time for thing 4, its again independent of the production of things 1-3, except they are splitting off the same main resource belt
    • If the resources on the main belt are insufficient to feed all of those machines, one of three things needs to happen: 1. Add more raw resource processing until your belt is full and backed up at the beginning 2. If that’s not enough, upgrade the belt 3. If you don’t have a belt upgrade available, build another main resource line and use splitters to rebalance it onto the main line

    This construction allows for easy expansion without having to destroy anything. I typically don’t disassemble anything unless it’s actually a problem for some reason or I need the space. This is especially important because you often need some basic components like the level 1 belts even into the late game.

    Also, once you unlock robots, you can literally copy-paste, just select an area to upgrade all belts/arms/etc. in, and a lot of other neat tricks that drastically speed things up.

    And one last peace of advice: Overproduce everything and let belts backing up balance out the resource distribution. Then if you discover that belts that previously were backed up are now sparse, figure out why and optimize it, usually by adding more production of whatever the missing resource is.

    Ultimately throughput is all that matters. Loss of throughput because you don’t need something isn’t wasteful. Loss of throughput because you aren’t producing enough of something is a problem to solve. Things that don’t affect throughput don’t matter and aren’t wasteful.