skeletonzombie Posted September 12, 2019 Report Share Posted September 12, 2019 (edited) Hello Friends! About regrowing resources, I would like to discuss how this can be implemented -- or what of it is implemented already. I would like to understand how your engine works with respect to these 'world mechanics'. 1: I think these world update actions belong to the mechanics that the host of a game should act out. it should be updated every few moments. 2: If the host is responsible for this, then the host -- which sets up the parameters of the launched game -- could use its own scripts for this. This would avoid the endless discussions about how berry bushes or trees would regenerate in detail and leave it up to the host of a game to specify it. Just provide some default scripts from a drop down list or so. My questions are now: q1: Do you already have such 'host bound world mechanics' implemented in the game? e.g. birds flying around or so? q2: If yes, how is this split into engine-part (C++?) and script-part (javascript?) in 0ad. More details: There are certainly many nice map-bound or game-bound effects possible, which would simply be registered in a list of actions that is then performed every second or so by the host. Love+Greetings Edited September 12, 2019 by skeletonzombie 1 Quote Link to comment Share on other sites More sharing options...
Stan` Posted September 12, 2019 Report Share Posted September 12, 2019 Greetings, and welcome to the forums 27 minutes ago, skeletonzombie said: About regrowing resources, I would like to discuss how this can be implemented -- or what of it is implemented already. There is a patch by me here https://code.wildfiregames.com/D1718 it's stalled until I rewrite it to use status effects instead. 27 minutes ago, skeletonzombie said: q1: Do you already have such 'host bound world mechanics' implemented in the game? e.g. birds flying around or so? Not really, all the players compute the game state on their own computer (if the host was able to change things during the game, that would make all the players out of sync) There are a few things that runs indepedently of the players. Like the Extinct Volcan map where the water will slowly increase until everything is drown. There are plans to add weather (currently you can only specify the biome on random maps) and day and night. Currently those two need some CPP changes, as one cannot access such things from the simulation. Quote Link to comment Share on other sites More sharing options...
skeletonzombie Posted September 12, 2019 Author Report Share Posted September 12, 2019 (edited) But what about Gaia then? Isnt this controlled/computed by the host? These effects, also like the rising water level, could simply be actions of some Gaia player-like entity. I see the problem now, the host must be trustable for this, so for rated games a dedicated host would be needed. Edited September 12, 2019 by skeletonzombie Quote Link to comment Share on other sites More sharing options...
Stan` Posted September 12, 2019 Report Share Posted September 12, 2019 1 hour ago, skeletonzombie said: But what about Gaia then? Isnt this controlled/computed by the host? Nope computed by all the players 1 hour ago, skeletonzombie said: These effects, also like the rising water level, could simply be actions of some Gaia player-like entity. Well it's different, Gaia entities are controlled by a js script called UnitAI 1 hour ago, skeletonzombie said: I see the problem now, the host must be trustable for this, so for rated games a dedicated host would be needed. That's correct. You mind want to read this https://wildfiregames.com/forum/index.php?/topic/26937-fixing-quitting-in-games/&tab=comments#comment-384284 Quote Link to comment Share on other sites More sharing options...
skeletonzombie Posted September 12, 2019 Author Report Share Posted September 12, 2019 (edited) I'm currently trying to understand how synchronization is done in 0ad. When two players try to pick up a crate (ship-wreck), how is it negotiated who gets it? Edited September 13, 2019 by skeletonzombie 1 Quote Link to comment Share on other sites More sharing options...
Stan` Posted September 12, 2019 Report Share Posted September 12, 2019 Both computers compute the moving units and determine which one got to the crate first 1 Quote Link to comment Share on other sites More sharing options...
Stan` Posted September 13, 2019 Report Share Posted September 13, 2019 @feneur can you lift his post limit ? Thanks. 2 Quote Link to comment Share on other sites More sharing options...
skeletonzombie Posted September 13, 2019 Author Report Share Posted September 13, 2019 ok, so the difference in the computation (fpu) can lead to an out-of-sync, detected on the next synchronization. -- Is it done in this order? (multiplayer): 1: players do their commands; meanwhile simulation runs based on the state of the last turn 2: turn wrap, synchronization (serialization of commands), updating the parameters for the simulation 3: now the simulation runs with the new state and again players can make their commands (~ 1) In other words, player commands effect the simulation only after next synchronization? Quote Link to comment Share on other sites More sharing options...
Stan` Posted September 13, 2019 Report Share Posted September 13, 2019 I couldn't find the wiki page for the network but I believe it's how it works yes 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.