cs381/as8
John Montagu, the 4th Earl of Sandvich da549ff655
Add READMEs
2026-04-05 23:16:09 -07:00
..
generated Add AS8 2026-04-05 11:21:04 -07:00
CMakeLists.txt Add AS8 2026-04-05 17:59:22 -07:00
CO.cpp Add AS8 2026-04-05 11:21:04 -07:00
README.md Add READMEs 2026-04-05 23:16:09 -07:00
as8.cpp Add AS8 2026-04-05 17:59:22 -07:00
component_counter.cpp Add AS8 2026-04-05 11:21:04 -07:00
skybox.cpp Add AS8 2026-04-05 11:21:04 -07:00
skybox.hpp Add AS8 2026-04-05 11:21:04 -07:00

README.md

Building and Running

Clone the repository, navigate to the root of the project, and initialize the submodules:

git clone https://github.com/humanoidsandvichdispenser/cs381.git
cd cs381
git submodule update --init --recursive

Navigate to the as8 directory, create a build directory, and run CMake to generate the build files:

cd as8
mkdir -p build
cd build
cmake ..

Compile the code using make:

make

This should create an executable named as8 in the build directory. You can run the executable with the following command:

./as8

Instructions on how to use the program

Hold W and S to accelerate the selected entity forward and backward. Use A and D to change heading direction. This allows you to steer the entity around the environment.

Use TAB to switch between entities. The currently selected entity will be drawn with a bounding box.

When the eagle is selected, press Q and Z to change the pitch, and R and F to change the roll.

Readme Question

One reason ECS outperforms component-oriented is that it allows for better cache locality. The components are stored a continguous array, so that when a loop iterates over the components, they are likely to be in the cache. In contrast, in a component-oriented design, the components may or may not be stored contiguously, so there could be more cache misses which increases the latency of the program.

In addition, another reason is that ECS allows for parallel systems/processing of components. In an ECS design, two disjoint systems can be processed in parallel without locking or risk of race conditions. In a component-oriented design, behaviors are bundled with components rather than being separate systems that access shared state, so it is more difficult to parallelize the processing of components.