]>
git.tdb.fi Git - libs/game.git/log
Mikko Rasa [Thu, 11 Jan 2024 21:15:25 +0000 (23:15 +0200)]
Avoid sending a packet to the same connection more than once
To keep things efficient, player IDs are now stored as 32-bit quantities,
with the high 16 bits containing an ID for the client connection. Only
the lower 16 bits are transmitted on the network to avoid leaking
information on which players share the same connection.
Mikko Rasa [Thu, 11 Jan 2024 20:55:17 +0000 (22:55 +0200)]
Streamline the send functions in Replicator a bit
Calling the targeted send function with a target of zero will now forward
to the broadcast function, avoiding the need to branch at call sites.
Mikko Rasa [Thu, 11 Jan 2024 17:11:25 +0000 (19:11 +0200)]
Track the sender of the current packet
Mikko Rasa [Tue, 9 Jan 2024 21:49:59 +0000 (23:49 +0200)]
Add facilities to designate entities as player-controlled
Mikko Rasa [Sat, 30 Dec 2023 11:00:49 +0000 (13:00 +0200)]
Fix errors revealed by gcc 13
Mikko Rasa [Sat, 17 Jun 2023 22:09:30 +0000 (01:09 +0300)]
Rework Landscape to support replication
Mikko Rasa [Sat, 17 Jun 2023 21:58:32 +0000 (00:58 +0300)]
Add a dynamic cast function for Owned
Mikko Rasa [Sat, 17 Jun 2023 21:54:38 +0000 (00:54 +0300)]
Add a callback when an entity is spawned over the network
It can be used by the owner of the spawner to send additional packets
to initialize the entity.
Mikko Rasa [Sat, 17 Jun 2023 21:53:36 +0000 (00:53 +0300)]
Add a mechanism for replicating function calls to clients
Mikko Rasa [Sat, 17 Jun 2023 21:40:21 +0000 (00:40 +0300)]
Support custom lookup functions for retrieving setups in Spawner
Mikko Rasa [Sat, 17 Jun 2023 21:31:16 +0000 (00:31 +0300)]
Give IDs to entities replicated over the network
Mikko Rasa [Sat, 17 Jun 2023 21:03:54 +0000 (00:03 +0300)]
Only send spawns to the target players of the replicator
Mikko Rasa [Sat, 17 Jun 2023 21:02:40 +0000 (00:02 +0300)]
Send spawns of newly-created entities in deferred_tick
Spawn info won't have been set in the component_create event for the
zygote.
Mikko Rasa [Sun, 11 Jun 2023 19:22:34 +0000 (22:22 +0300)]
Add a mechanism for spawning entities over the network
Mikko Rasa [Sun, 11 Jun 2023 14:55:31 +0000 (17:55 +0300)]
Add interfaces for using Networking from the outside
Mikko Rasa [Sun, 11 Jun 2023 14:03:11 +0000 (17:03 +0300)]
Emit events when the other side of a network connection changes stages
Mikko Rasa [Sun, 11 Jun 2023 13:22:14 +0000 (16:22 +0300)]
Rename Networking::next_id to next_player_id
Mikko Rasa [Sun, 11 Jun 2023 13:21:12 +0000 (16:21 +0300)]
Use Networking::set_state in start_server and connect_to_server
This gets the event appropriately emitted.
Mikko Rasa [Sun, 11 Jun 2023 12:42:25 +0000 (15:42 +0300)]
Add string interning to the network protocol
This allows transmitting commonly used strings using short IDs.
Mikko Rasa [Thu, 8 Jun 2023 08:29:07 +0000 (11:29 +0300)]
Identify stages with a name
Mikko Rasa [Thu, 8 Jun 2023 08:26:48 +0000 (11:26 +0300)]
Remove unnecessary std::ref invocations
I got confused by the std::thread constructor, which stores its arguments
in a tuple and creates copies without std::ref. It's not needed in these
cases since the arguments are just forwarded directly.
Mikko Rasa [Thu, 8 Jun 2023 08:21:08 +0000 (11:21 +0300)]
Place Networking after event things in Director
It uses the event bus, so correct order of destruction must be ensured.
Mikko Rasa [Thu, 8 Jun 2023 08:04:12 +0000 (11:04 +0300)]
Rename some events for clarity and consistency
Mikko Rasa [Fri, 19 May 2023 20:38:10 +0000 (23:38 +0300)]
Support adding prop entities to Landscape
Mikko Rasa [Mon, 15 May 2023 20:44:38 +0000 (23:44 +0300)]
Add support for shadows
Mikko Rasa [Mon, 15 May 2023 20:38:04 +0000 (23:38 +0300)]
Track destruction of individual components in Renderer
Mikko Rasa [Mon, 15 May 2023 20:38:13 +0000 (23:38 +0300)]
Allow clearing an Owned by assigning nullptr
Mikko Rasa [Sun, 7 May 2023 17:34:26 +0000 (20:34 +0300)]
Make Owned friendly to other template specializations
Mikko Rasa [Sun, 7 May 2023 17:32:43 +0000 (20:32 +0300)]
Make iterate_objects const
Mikko Rasa [Sun, 7 May 2023 17:32:02 +0000 (20:32 +0300)]
Chain certain pool operations to pools of derived objects
Mikko Rasa [Sun, 7 May 2023 15:07:41 +0000 (18:07 +0300)]
Keep track of object pools for derived types
Mikko Rasa [Sun, 7 May 2023 12:54:30 +0000 (15:54 +0300)]
Make the destructor of PoolBase virtual
Mikko Rasa [Sun, 7 May 2023 12:53:07 +0000 (15:53 +0300)]
Make pools non-movable
I'm not actually using move semantics for them and they're of dubious
value due to polymorphism anyway.
Mikko Rasa [Sun, 7 May 2023 12:27:46 +0000 (15:27 +0300)]
Add a generation number to Reflector
Mikko Rasa [Sun, 7 May 2023 11:17:56 +0000 (14:17 +0300)]
Include generated headers from the installed location
Mikko Rasa [Sun, 12 Mar 2023 15:14:13 +0000 (17:14 +0200)]
Add game setup imports as transitive dependencies
Mikko Rasa [Sun, 12 Mar 2023 15:14:01 +0000 (17:14 +0200)]
Update location of generated source files
Mikko Rasa [Sat, 11 Feb 2023 13:56:06 +0000 (15:56 +0200)]
Add components and systems for creating terrains
Mikko Rasa [Sat, 11 Feb 2023 13:19:00 +0000 (15:19 +0200)]
Make Presenter store pointers to systems, not just renderers
Mikko Rasa [Sat, 11 Feb 2023 13:18:20 +0000 (15:18 +0200)]
Add a component for using dynamic meshes in entities
Mikko Rasa [Sat, 28 Jan 2023 20:54:12 +0000 (22:54 +0200)]
Adjust Bassteroids for the lighting changes
Mikko Rasa [Sat, 28 Jan 2023 19:59:09 +0000 (21:59 +0200)]
Create the rendering sequence dynamically
Sequence templates are a bit too rigid for games where it's desirable to
tune many different graphics quality settings independently.
Mikko Rasa [Sat, 28 Jan 2023 14:28:47 +0000 (16:28 +0200)]
Add components for creating lights
Mikko Rasa [Sat, 28 Jan 2023 12:38:59 +0000 (14:38 +0200)]
Further refactor Renderer and MeshRenderer
The ObjectInstance is now hidden inside MeshRenderer and RAII is used to
remove it from the scene. This limits the instance to being in only a
single scene, but I don't think that will be an issue.
Mikko Rasa [Tue, 24 Jan 2023 13:01:17 +0000 (15:01 +0200)]
Add a transform propagator to stages by default
This is possible now that system dependencies have been implemented.
Mikko Rasa [Sat, 21 Jan 2023 18:44:36 +0000 (20:44 +0200)]
Refactor Renderer to pick up components instead of entities
This makes more sense since there isn't an entity class which always
contains a MeshSource.
Mikko Rasa [Sat, 21 Jan 2023 18:39:20 +0000 (20:39 +0200)]
Have MeshRenderer's constructor take a GL::Object
Mikko Rasa [Sat, 21 Jan 2023 18:31:25 +0000 (20:31 +0200)]
Undefine the API macro at the end of a setup header
Otherwise it may interfere with other setup headers.
Mikko Rasa [Tue, 17 Jan 2023 07:52:25 +0000 (09:52 +0200)]
Add basic networking infrastructure
Currently it only allows running a server, connecting to it and creating
players, but no synchronization yet.
Mikko Rasa [Mon, 9 Jan 2023 09:27:16 +0000 (11:27 +0200)]
Derive GameSetupDefinitions from TemplateFile instead of SourceFile
Builder's InstallMap checks for that class to figure out the install
locations for generated headers.
Mikko Rasa [Sun, 8 Jan 2023 22:34:29 +0000 (00:34 +0200)]
Update .gitignore files
This includes pre-emptive changes for Windows build products.
Mikko Rasa [Sun, 8 Jan 2023 22:33:29 +0000 (00:33 +0200)]
Load the various setups through resources
Mikko Rasa [Sun, 8 Jan 2023 13:11:42 +0000 (15:11 +0200)]
Add dependency to mspmath in Bassteroids
Mikko Rasa [Sun, 8 Jan 2023 13:08:08 +0000 (15:08 +0200)]
Use the setup generator to create setup structs
Mikko Rasa [Sun, 8 Jan 2023 13:01:17 +0000 (15:01 +0200)]
Support API decorations for setups
Mikko Rasa [Sun, 8 Jan 2023 12:55:14 +0000 (14:55 +0200)]
Prefix C++ types with namespaces in the setup generator
Mikko Rasa [Sun, 8 Jan 2023 12:53:07 +0000 (14:53 +0200)]
Add import functionality for setup modules
Also install setup definition files so definitions from libraries can be
used.
Mikko Rasa [Sun, 8 Jan 2023 12:50:45 +0000 (14:50 +0200)]
Refactor the setup generator to store types in modules
Mikko Rasa [Sat, 7 Jan 2023 13:25:13 +0000 (15:25 +0200)]
Create a builder plugin for the setup generator tool
Mikko Rasa [Sat, 7 Jan 2023 13:24:25 +0000 (15:24 +0200)]
Remove a temporary hack
The bug it was for is now fixed.
Mikko Rasa [Sat, 7 Jan 2023 13:23:11 +0000 (15:23 +0200)]
Add an include which is now necessary
Changes in the Variant class require classes retrieved from a collection
to be fully defined.
Mikko Rasa [Sat, 7 Jan 2023 13:19:47 +0000 (15:19 +0200)]
Decorate things which constitute the public API of the library
Mikko Rasa [Sat, 17 Dec 2022 12:17:08 +0000 (14:17 +0200)]
Add a tool for generating setup structs and loaders for them
Mikko Rasa [Wed, 7 Dec 2022 10:03:35 +0000 (12:03 +0200)]
Adjust system dependencies to resolve scheduling ambiguities
Mikko Rasa [Wed, 7 Dec 2022 10:02:59 +0000 (12:02 +0200)]
Schedule systems based on their declared dependencies
Mikko Rasa [Wed, 7 Dec 2022 09:56:51 +0000 (11:56 +0200)]
Add flags for declaring ordering between systems
Mikko Rasa [Wed, 7 Dec 2022 09:52:03 +0000 (11:52 +0200)]
Make it possible to find reflected classes by RTTI
Mikko Rasa [Sun, 4 Dec 2022 21:32:05 +0000 (23:32 +0200)]
Add move constructor and assignment from Owned of derived type
Mikko Rasa [Sun, 4 Dec 2022 21:25:40 +0000 (23:25 +0200)]
Change Owned's constructor to take a pointer to the parent
This avoids some awkwardness with overload resolution
Mikko Rasa [Sun, 4 Dec 2022 20:16:34 +0000 (22:16 +0200)]
Cosmetic fixes
Mikko Rasa [Sun, 4 Dec 2022 20:15:26 +0000 (22:15 +0200)]
Minor optimization to AccessGuard::check
It doesn't need to resize the vector since it can just use the default
flag.
Mikko Rasa [Sun, 4 Dec 2022 20:14:52 +0000 (22:14 +0200)]
Report which system caused invalid access
Mikko Rasa [Sun, 4 Dec 2022 20:13:56 +0000 (22:13 +0200)]
Enforce correct access to buffered components
Mikko Rasa [Sun, 4 Dec 2022 15:12:59 +0000 (17:12 +0200)]
Convert components to buffered where appropriate
Mikko Rasa [Sun, 4 Dec 2022 13:29:57 +0000 (15:29 +0200)]
Implement base support for buffered components
They hold two copies of data, one being read from and the other written
to. This makes it easier to write concurrent and order-independent code.
Systems can declare dependencies to such components to have their prepare
and commit functions called automatically.
Mikko Rasa [Sat, 3 Dec 2022 16:21:21 +0000 (18:21 +0200)]
Plug a memory leak in EventBus
Mikko Rasa [Sat, 3 Dec 2022 16:18:19 +0000 (18:18 +0200)]
Add unit tests for the event bus
Mikko Rasa [Sat, 3 Dec 2022 11:18:11 +0000 (13:18 +0200)]
Add unit tests for reflection
Mikko Rasa [Sat, 3 Dec 2022 08:47:45 +0000 (10:47 +0200)]
Add reflection infrastructure
This allows checking for type relationships at runtime, which will be
useful for annotating system dependencies and iterating over subclasses.
Mikko Rasa [Mon, 28 Nov 2022 12:12:15 +0000 (14:12 +0200)]
Defer creation of bullets until the end of the frame
Mikko Rasa [Mon, 28 Nov 2022 12:08:29 +0000 (14:08 +0200)]
Enforce no creation or destruction of objects during tick
Mikko Rasa [Sun, 27 Nov 2022 21:49:23 +0000 (23:49 +0200)]
Make asteroids take damage when shot and eventually be destroyed
Mikko Rasa [Sun, 27 Nov 2022 21:48:39 +0000 (23:48 +0200)]
Remove destroyed entities from the physics simulation
Mikko Rasa [Sun, 27 Nov 2022 21:45:30 +0000 (23:45 +0200)]
Emit events for colliding physical entities
Mikko Rasa [Sun, 27 Nov 2022 21:39:34 +0000 (23:39 +0200)]
Pass bullet's initial transform values directly to the constructor
Mikko Rasa [Fri, 25 Nov 2022 20:05:23 +0000 (22:05 +0200)]
Disable keyboard autorepeat by default
It's usually undesirable in games, and the setting doesn't affect
character input.
Mikko Rasa [Fri, 25 Nov 2022 20:04:30 +0000 (22:04 +0200)]
Make it possible to shoot bullets in Bassteroids
They don't actually do anything yet except bounce around.
Mikko Rasa [Fri, 25 Nov 2022 19:41:48 +0000 (21:41 +0200)]
Initialize Transform's matrices to identity
Mikko Rasa [Fri, 25 Nov 2022 19:41:31 +0000 (21:41 +0200)]
Fix various cases of bad math
Mikko Rasa [Fri, 25 Nov 2022 19:40:31 +0000 (21:40 +0200)]
Add missing initializer for player ship's moment of inertia
Mikko Rasa [Fri, 25 Nov 2022 19:38:42 +0000 (21:38 +0200)]
Use the correct inertial quantity for calculating velocity change
Mikko Rasa [Fri, 25 Nov 2022 19:38:09 +0000 (21:38 +0200)]
Don't apply more friction than it takes to nullify the velocity
Mikko Rasa [Mon, 21 Nov 2022 11:02:03 +0000 (13:02 +0200)]
Simulate friction in collisions
Mikko Rasa [Mon, 21 Nov 2022 10:02:08 +0000 (12:02 +0200)]
Add a controllable player ship to Bassteroids
Mikko Rasa [Sun, 20 Nov 2022 19:22:40 +0000 (21:22 +0200)]
Allow external forces and torques to be added on rigid bodies
Mikko Rasa [Sun, 20 Nov 2022 19:10:32 +0000 (21:10 +0200)]
Add rotation to physics simulation
There's no friction yet, so colliding objects don't start rotating.
Mikko Rasa [Sun, 20 Nov 2022 13:59:45 +0000 (15:59 +0200)]
Add infrastructure for receiving player input
Mikko Rasa [Sat, 12 Nov 2022 16:07:07 +0000 (18:07 +0200)]
Add playfield boundaries to Bassteroids
Mikko Rasa [Sat, 12 Nov 2022 16:06:14 +0000 (18:06 +0200)]
Implement box colliders in Bassteroids' physics system
Mikko Rasa [Sat, 12 Nov 2022 15:49:27 +0000 (17:49 +0200)]
Provide a way to request events for existing entities and components
The iterate_objects function does not account for derived classes, so
iterating over all Entity instances might not actually give all entities
on the stage.