Designing a game database
Tag : sql , By : barefootChild
Date : March 29 2020, 07:55 AM
I wish this helpful for you I'm trying to design a database to record game histories for a game I'm working on. I have 3 different tables: users, gamehistories, and gamescores. , I would go with something like this SELECT u.displayname OpponentsName,
gsYours.score MyScore,
gs.score OpponenetsSCore
FROM gamescores gs INNER JOIN
(
SELECT gs.gid,
gs.uid,
gs.score
FROM gamescores gs
where gs.uid = yourUserID
) gsYours ON gs.gid = gsYours.gid
AND gs.uid <> gsYours.uid INNER JOIN
users u ON gs.uid = u.uid INNER JOIN
gamehistories gh ON gs.gid = gh.gid AND gh.pubID = whatYouRequireHere
|
Writing/Designing a simple object manager (game context)
Tag : cpp , By : Chris Tattum
Date : March 29 2020, 07:55 AM
this will help Question 1: I don't see anything obviously wrong with that approach. It seems reasonable to me from an efficiency standpoint. Question 2: In C++, specific classes and types are always fixed-sized, so I don't understand your question. When you talk about a type being dynamic-size, I can think of two interpretations: Entity &EntityManager::get( string const &entityId) {
static Entity empty{};
auto found = gameEntities_.find(entityId);
if (found == end(gameEntities_) )
return empty;
return found->second;
}
// (Note that leading underscores are reserved identifiers
// in some contexts and some such identifiers are reserved
// everywhere, so I prefer to avoid them altogether.)
|
Designing MySQL table for multiplayer game with variable number of players
Date : March 29 2020, 07:55 AM
hope this fix your issue You are in need of three tables: A table for your user related datasets. A table for your game related datasets. A table to assign the users to the games (Use IDs).
|
Designing a simple oop game class hierarchy
Date : March 29 2020, 07:55 AM
seems to work fine It kinda depends on the surrounding code, but my instinct is that Ship should be part of Grid. There's a lot of overlap between the information represented by Grid and Ship that doesn't really concern the player: specific grid locations, legal guesses, etc. If you made Ship a part of Player, you'd still have to link the two directly, so that the Grid knows when a ship gets hit or not. There's little point in having a Grid if it doesn't even know where the Ships are. There's no real hard and fast answer to the question: how do I build an object model? I try to imagine what functions/methods/subroutines I'll probably have to write, regardless of the object model. If the same concepts start popping up in the same set of functions, then they should be tied together in the object model.
|
Help in designing simple 2 table database?
Date : March 29 2020, 07:55 AM
|