« first day (3665 days earlier)      last day (1345 days later) » 

2:33 AM
hi
 
 
10 hours later…
12:54 PM
How do we realize progress-tasks in an ecs ? Lets say we want to chop a tree... player moves to the tree and once he collides with that tree we wanna trigger that task... chopping for example takes 15 seconds and once its finished the player receives 1 log... the task stops if the player moves...
With my current knowledge i would simply make that task a entity with a simple condition that destroys the task once the player moves, a callback or event entity every task tick and one callback/event entity once the task was finished.
Would you do it the same way ? Is this considered clean ? :p
 
Does your current solution meet your needs?
 
Im not sure... i have the feeling that its not that clean to fire callbacks or event entities... but it should be flexible enough
 
 
2 hours later…
2:46 PM
@Pikalek I'm not so sure about this :P
 
 
2 hours later…
4:47 PM
Damn... this is a hard one... my update system runs after the saving system in another thread. But sometimes it may happen that theres nothing to save but to update... it collects all objects to update and creates a query... the mainthread modifies a object enlisted for being updated... this results in a broken query which can not get executed, because one of the objects is now referencing another object which is not in the database yet.
 
user92578
If your save system doesn't immediately snapshot, you've introduce a data race anyways?
 
user92578
Update system moves an object -> Save system writes updated X and Y coordinates but previous Z?
 
@Tyyppi_77 Im using a framework to save those classes to the database... as far as i know hibernate only supports "Snapshots" for database acess, not for the objects we wanna save :/
 
user92578
5:08 PM
If there's no way to make a copy of the state, I don't think you can avoid a lock
 
5:34 PM
Damn... thats really, really bad
 
6:18 PM
Soo... it really looks like we only have three valid options... either the lock @Tyyppi_77 mentioned... or that the object that causes this issue simply dont get inserted into its parent till it was saved ( Which causes other gameplay related issues )... or the last one : No constraints... but that could cause database incosistence... thats awfull :/
 
This might be a naive question, but if there's nothing to save, why would the save system try to save?
 
@Pikalek It does not... probably i missed this. It only saves entities marked as "saved"... when theres none, it sleeps :) the problem here is that due to the multithreading the update system contains a object that references another object which has not been safed yet... (Updating all chunks -> Trees spawned and getting inserted into chunks -> During construction of the updating query -> Database error )
 
What happens if there's no indirection? i.e. the update system does something with an object & that object itself has not been saved yet?
 
6:39 PM
@Pikalek That can never happened... i already found a solution for this :)
 
That was point - if something can't happen with a direct conflict, then that would be the first place I would start with in order to prevent a situation involving an indirect conflict.
Since you've solved it though, carry on.
 
@Pikalek The issue with updating a entity referencing an other (not saved) entity is still here ^^ i mean i solved the other issue, that the update system only updates entities which already have been saved
 
Is this referenced entity meant to be saved, and it just hasn't had its turn yet because it's new? Or is it fundamentally not part of the serialized state?
 
@DMGregory Pretty much the first part... pastebin.com/BD1cmXKX heres a little example of how the data-structure looks like... it happens when we update a chunk and a new tree spawned recently but was not saved yet
 
6:54 PM
I'm surprised you save individual trees that the player hasn't had a chance to modify yet.
 
Actually its part of the terrain generation ^^ the terrain gets once generated and stored to the database... once a player visits the same place, it loads the same state as before
some players want to plant trees... or other stuff, so i thought its a good way to realise it this way
 
Usually you wouldn't save it until it's modified. If it hasn't been modified yet, you can just re-run the generator with the same seed and get the same result as loading the saved, unmodified version.
 
@DMGregory Thats new... i guess im doing this totally wrong. I never used anything like seeds. I simply randomly place trees, store them all to the database and once a player visits the area they are getting loaded back in :/ thats why i save them instant, without waiting for being modified ^^
 
7:09 PM
It's also surprising to me that you're querying your database in the middle of your update loop. I'd expect you'd query the DB when moving to a new area that needs to be loaded, but that everything being iterated in your update loop exists in memory.
 
7:27 PM
@DMGregory Oh thats what im doing ^^ Once a player enters a new chunk, we gonna load that chunk and all its objects into the memory... the saving/updating meanwhile occurs during the player loop async... thats why its so much trouble :/
I could probably try a different approach... reflection, simply checking each field and if we detect a referenced object that hasnt been saved yet we simply ignore that entity from being updated... it would work for every object, but could get kinda slow... probably not that important because its not the mainthread at all
 
You might need to explain your broken query in more detail then.
 
 
4 hours later…
11:10 PM
Anyone know how I can put up a dedicated server for my game? I tried AWS but it doesn't work
I'm working with Unity+ Mirror
It works for the more simple games such as the Tanks example from Mirror but it's very laggy
as soon as I add more geometry and scripts it doesn't seem to run at all
 
What was it about AWS that didn't work?
 
I'm not sure, I think I don't have enough memory
When I check task manager I get 1GB of RAM total
but 800MB is taken up by plain just running windows server
which leaves 200MB of RAM for my game
my game isn't that complex but I think it takes up more memory than is available
it's also very laggy but maybe that's just the free server quality
 

« first day (3665 days earlier)      last day (1345 days later) »