Jump to content

Berry Bushes - Regrowing Resources Mechanics


Recommended Posts

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 by skeletonzombie
  • Like 1
Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

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 by skeletonzombie
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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?

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...