A game holds everything needed to play actual games. They have certain properties, like marked area's (players will be alerted when they leave the playing field), start and/or end on certain times, etc. Games are in two different flavours:
-
Continuous games
Will continue forever, people can enter and leave at will. The game however continues. -
Boxed games
Game can be limited to a certain time range. Players can also be limited to either registered players, or a fixed number of players.
Somehow, it must be defined how to fail the game. These constraints could be any of a player properties (for instance: lifepoints <= 0, or time-in-game > 5minutes etc). When a game is lost, either a player can respawn, or not.
A game must define how it can be won. If it's a timeboxed game, this could be the player with MAX(objects.value), or player with MAX(distance).
It could also be a player arriving at a certain position, or having finished a list of criteria (visit X number of places) etc.
Either a game can continue when won, or be stopped.
For instance, a timeboxed game could have a winning-criteria of player with MAX(objects.value), but has a timebox of 30 minutes. This means that after 30 minutes, the game stops, and the winning criteria will be matched.
Other winning game types, could be the last player standing, most distance covered, most kills, most objects etc.
Inanimated objects that by itself cannot be moved, but can interact with other objects. They can be moved when being picked up by an animated object such as entities.
Objects have certain properties like values, weight, range and certain statistical properties.
Question: Could an object interact with another object (either implictly or explicitly)? For instance, when a user picks up two objects and merge them together into a new object?
Animated objects (probably not extended from object itself). Entities are either real life players, moving around with a mobile device, or A.I. players, that are being controlled by the game server.
Entities are able to move around by updates of their coordinates. Entities have certain proprerties like a lifespan (lifepoints), a search-range (how far away can you spot objects or other entities). Entities can interact with either other entities (depending on their range) and can interact with other objects (pick up, drop). Entities are only capable of dropping objects that are currently in posession by that entity . You can only pick up objects that are within a certain range of that object. When an object has a certain weight, it's possible that entities by itself cannot pickup that object unless their strength > weight object + (combined weight of all picked up objects). Thus either dropping other objects until the condition is met, or using other type of objects onto itself that can either increase the holding capacity of the entity, or decrease the weight of the object.
An entity can be part of a team. It's up to the game itself to check the players team, and act accordingly.
These are the properties and methods for a given object. They are maintained by the game engine, and used by a game to create your own game.
- visibility_range
What is the range in which entities will "see" this object. 0 for invisible objects, -1 for always visibile. Invisible objects can be usefull for "storage". Only when a entity hits the same coordinates of the object, it will be able to detect the object (there is always a certain range available to counteract GPS accuracy). - Weight
How "heavy" is an object. Depending on the user, it can or cannot be picked up. 0 for no weight, -1 for not being able to be picked up. - Value
The value of the object. 0 for no value. - Location
Lat/Long position of the current object. - Keeper
the entity currently in posession of the object. Location will be updated together with the entity's location. null when object is not in posession of an entity. - Distance
distance moved by this object - Keepers
number of (unique) entities that picked up the object - Pickup_cnt
number of times the object has been picked up - Drop_cnt
number of times the object has been dropped - Ranged
number of times the object was in the vincity of an entity. This number will be 0 when the object has a visibility_range of 0 or -1 - Line_of_sight
the objects and/or entities that are in a CLEAR LINE OF SIGHT of the object (for instance, you could be 20 meters away from an object, but there is a building blocking it). - Spells (todo: find a better name) A list of spells that are attached to this object. A spell can either add, mutate or destroy existing spells that are linked to this object.
- inRangeObject(object, distance)
Called when an object has been brought in range of another object. Will be called on every update as long the object is in range, until this function acknowledge the object (for instance, when you have a range of 100 meters, but only want to respond unless you are in direct line of sight, and closer than 50 mtrs). - inRangeEntity(entity, distance) Called when an entity is in range of an object. Will be called on every update as long as the entity is in range, until this function acknowledge the object.
- outRangeEntity(entity) Called when an entity has left the range of the object. TODO: add hysteresis?
- outRangeObject(entity) Called when an object has left the range of the object. TODO: add hysteresis?
- is_AI
Is this a virtual player? 0 = no, 1 = yes - Name
Name of the player. - Account
Possibly some kind of account linked to this player (null when it's an AI player). Got things like name, email, etc - The players team
- Team name The name of the team
- Players A list of all players on the team
- Rank The current position of the team (if available)
- uses How many times can this spell be used. 1 for only once, -1 for unlimited number of times
- canInteractObject(object) Can this spell interact with the (kind of)object. Maybe only at certain times, at certain points, or for certain players (only one team, for instance).