KaenguruuDev
KaenguruuDev
CC#
Created by KaenguruuDev on 2/2/2025 in #help
Duplicate objects in a DB Query
thank you so much for the help
32 replies
CC#
Created by KaenguruuDev on 2/2/2025 in #help
Duplicate objects in a DB Query
when I first heard of that it sounded way too scary so I just decided to not bother -- in hindsight not the smartest way of thinking
32 replies
CC#
Created by KaenguruuDev on 2/2/2025 in #help
Duplicate objects in a DB Query
oh I see
32 replies
CC#
Created by KaenguruuDev on 2/2/2025 in #help
Duplicate objects in a DB Query
can you explain what you mean with that?
32 replies
CC#
Created by KaenguruuDev on 2/2/2025 in #help
Duplicate objects in a DB Query
ok that makes sense
32 replies
CC#
Created by KaenguruuDev on 2/2/2025 in #help
Duplicate objects in a DB Query
no anybody can unlock the achievement (I just realized something I missed to tell you: This table isn't a good representation of how it would normally look since in a normal test we'd only have one entry for each achievement for the user)
32 replies
CC#
Created by KaenguruuDev on 2/2/2025 in #help
Duplicate objects in a DB Query
I hope that isn't too confusing
32 replies
CC#
Created by KaenguruuDev on 2/2/2025 in #help
Duplicate objects in a DB Query
So we have a User table but the achievement id there is from a json file because they are managed by someone who isn't very familiar with dbs. So basically if a user triggers an event that would unlock an achievement, it will check the database if for that user, there already is an entry in this achievements table (which is also used to display a list of all achievements the user has unlocked)
32 replies
CC#
Created by KaenguruuDev on 2/2/2025 in #help
Duplicate objects in a DB Query
ok let me try
32 replies
CC#
Created by KaenguruuDev on 2/2/2025 in #help
Duplicate objects in a DB Query
create table achievements
(
userId bigint not null,
achievementId int not null,
achievedAt datetime default CURRENT_TIMESTAMP not null
);
create table achievements
(
userId bigint not null,
achievementId int not null,
achievedAt datetime default CURRENT_TIMESTAMP not null
);
public DbSet<Achievement> Achievements { get; set; }

protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<Achievement>().ToTable("achievements");
}
public DbSet<Achievement> Achievements { get; set; }

protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<Achievement>().ToTable("achievements");
}
32 replies
CC#
Created by KaenguruuDev on 2/2/2025 in #help
Duplicate objects in a DB Query
It seemed to work for some time but today it just suddendly broke
32 replies
CC#
Created by KaenguruuDev on 2/2/2025 in #help
Duplicate objects in a DB Query
I'm not yet that deep in this and basically just put efc on an existing mysql db
32 replies
CC#
Created by KaenguruuDev on 2/2/2025 in #help
Duplicate objects in a DB Query
manually
32 replies
CC#
Created by KaenguruuDev on 2/2/2025 in #help
Duplicate objects in a DB Query
I've already dropped the table and created it so I really don't know whats happening here, the issue is not present on other tables which leads me to believe it's an issue related to the table
32 replies
CC#
Created by KaenguruuDev on 7/31/2024 in #help
Determine the positions of nodes inside of a graph
Unfortunately I don't know any good references for this, I'm mostly just trying stuff. If you take a look at the links I provided, you'll probably find that the authors of these articles/papers used a similar data structure
28 replies
CC#
Created by KaenguruuDev on 7/31/2024 in #help
Determine the positions of nodes inside of a graph
The graph structure comes through how you build the references between instances of these classes. So your "On Component Begin Overlap (Box)" would be a ProductionStep instance that has in it's Children list the == and the "Branch" node as instances of ProductionStep. The == has in their Parents list the "On Component Begin Overlap (Box)" and "Get Player Pawn" and the "Branch" node as child and so on and so forth
28 replies
CC#
Created by KaenguruuDev on 7/31/2024 in #help
Determine the positions of nodes inside of a graph
So in my code, the FactoryTree class looks like this:
public class FactoryTree
{
ProductionStep root;
Recipe recipe;

public FactoryTree(Recipe recipe)
{
this.recipe = recipe;
root = new ProductionStep(recipe, 1);
}
}
public class FactoryTree
{
ProductionStep root;
Recipe recipe;

public FactoryTree(Recipe recipe)
{
this.recipe = recipe;
root = new ProductionStep(recipe, 1);
}
}
And then the ProductionStep class looks like this (there are some more specific parts removed, but for the basic understanding this should be enough):
public class ProductionStep
{
public Recipe Recipe;
public List<ProductionStep> Children;
public ProductionStep Parent;

public ProductionStep(Recipe recipe, float count)
{
Recipe = recipe;
Children = new List<ProductionStep>();
}
}
public class ProductionStep
{
public Recipe Recipe;
public List<ProductionStep> Children;
public ProductionStep Parent;

public ProductionStep(Recipe recipe, float count)
{
Recipe = recipe;
Children = new List<ProductionStep>();
}
}
This is basically enough. If you have multiple inputs (so multiple parent nodes) you would replace ProductionStep Parent with List<ProductionStep> Parents etc.
28 replies
CC#
Created by KaenguruuDev on 7/31/2024 in #help
Determine the positions of nodes inside of a graph
Could you elaborate on what you mean with that exactly? The code I use to generate the graph looks like this:
28 replies
CC#
Created by KaenguruuDev on 7/31/2024 in #help
Determine the positions of nodes inside of a graph
No description
28 replies
CC#
Created by KaenguruuDev on 7/31/2024 in #help
Determine the positions of nodes inside of a graph
I've found this blog post here: https://rachel53461.wordpress.com/2014/04/20/algorithm-for-drawing-trees/ Which seems to be enough for my understanding. I'm looking through the code right now and it looks like I can relatively easily adapt my current code to work with this implementation
28 replies