Welcome to NDACM’s Byte Engine Documentation!#
NDSU’s ACM chapter hosts an annual competition called “Byte-le Royale.” This competition was created by Riley Conlin, Jordan Goetze, Jacob Baumann, Ajay Brown, and Nick Hilger. It promotes working with others and developing critical thinking skills, while challenging competitors under a time limit.
This revamped version of the engine was started by Jean Eckelberg, Ian King, Julia Motzko, and Gunnar Moody, with extra contributions as well. Thank you to everyone who took the time to work on this!
This project provides the framework for developing games for Byte-le. The README document is attached to this page. Refer to that for additional info to what’s here!
README Document#
Byte Engine#
Revamped base game engine for use in NDACM Byte-le Royale games. Changes made in 2023.
Important Changes#
Overall Change
Every file is now type hinted to facilitate the coding process. For future development, type hint any changes made for the same reason.
Item Class
The item class has many parameters that can be used in a few different ways to allow for flexibility.
Value:
This allows for an item to have a value of some sort. This can be used to determine points gained for collecting the item, or its sell price. The meaning can change depending on the project.
Durability:
Durability can represent how many uses an item has. What happens after is determined by the development team.
Quantity:
This allows for consolidating and representing multiple items in a single item object.
Stack Size:
Stack Size determines how many item objects can be consolidated together into a single object at once. This can be thought of as a denominator in a fraction.
Reference the Item class for further documentation.
GameBoard Class
GameBoard Seed Parameter
There is a new parameter in the GameBoard class that allows a specific seed to be set. This can be used to help with testing during game development.
Map Size Parameter
This is a Vector object that is not used as a coordinate, but the dimensions of the entire game map. Vectors are explained later.
Locations Parameter
This parameter allows for user-defined specifications of where to put certain GameObjects on the game map. It is an extensive system used to do this, so refer to the file for further documentation.
Walled Parameter
This is a boolean that determines whether to place Wall objects on the border of the game map.
Occupiable Class
A new class was implemented called Occupiable. This class inherits from GameObject and allows for other GameObjects to “stack” on top of one another. As long as an object inherits this class, it can allow for many objects to be located on the same Tile.
Tile Class
The Tile class inherits from Occupiable, allowing for other GameObjects to stack on top of it. A Tile can be used to represent the floor or any other basic object in the game.
Wall Class
The Wall class is a GameObject that represent an impassable object. Use this object to help define the borders of the game map.
Stations
Station Class
The Station represents a basic Station. They can contain items and be interacted with.
Occupiable Station
Occupiable Stations represent basic Station objects that can be occupied by another GameObject.
Example Classes
The occupiable_station_example, station_example, and station_receiver_example classes are provided to show how their respective files can be used. These can be deleted or used as templates on how to expand on their functionality.
Action Class
This is a class to represent the actions a player takes each turn in object form. This is not implemented in this version of the engine since enums are primarily used.
Avatar Class
The Avatar class is newly implemented in this version of the byte-engine and includes many new features.
Position:
The Avatar class has a parameter called “position” which is a Vector object (explained later in this document). This simply stores the Avatar’s coordinate on the game map.
Inventory:
There is an inventory system implemented in the Avatar class now. You are able to specify the max size of it, and there are methods that are used to pick up items, take items from other objects, and drop the Avatar’s held item.
Held Item:
The held item of an Avatar is an item that the Avatar has in their inventory. This is done by using enums. Reference the enums.py file for more information.
These changes are provided to allow for development to go smoothly. Developers are not obliged to use nor keep any of these changes. The inventory system and any other aspect of the class may be modified or removed as necessary for game development.
Enums File
This file has every significant object being represented as an enum. There are also enums that help with the avatar’s inventory system. Refer to the file for a note on this.
Player Class
The player class now receives a list of ActionType enums to allow for multiple actions to happen in one turn. The enum representation can be replaced with the Action object if needed.
Avatar VS Player Classes
These two classes are often confused with each other. Here are their differences.
Avatar:
The Avatar class represents the character that is in the game. The Avatar is what moves around, interacts with other GameObjects, gains points, and whatever else the developers implement.
Player:
The Player object encapsulates the Avatar class and represents the physical people competing in the competition. This is why it has parameters such as team_name. It is also why the controllers take a Player object as a parameter and not an Avatar object; it helps manage the information gathered for the individual competitors/teams for the final results.
Controllers
Interact Controller Class
This class controls how players interact with the environment and other GameObjects.
Inventory Controller Class
This class controls how players select a certain item in their inventory to then become their held item.
Master Controller Class
This controller is used to manage what happens in each turn and update the overarching information of the game’s state.
Movement Controller Class
This class manages moving the player through the game board by using the given enums.
Generate Game File
This file has a single method that’s used to generate the game map. The generation is slow, so call the method when needed. Change the initialized GameBoard object’s parameters as necessary for the project.
Vector Class
The Vector class is used to simplify handling coordinates. Some new implementations include ways to increase the values of an already existing Vector, adding two Vectors to create a new one, and returning the Vector’s information as a tuple.
Config File
The most notable change in this file is MAX_NUMBER_OF_ACTIONS_PER_TURN. It is used for allowing multiple actions to be taken in one turn. Adjust as necessary.
Development Notes#
Type Hinting
Type hinting is very useful in Python because it prevents any confusion on what type an object is supposed to be, what value a method returns, etc. Make sure to type hint any and everything to eliminate any confusion.
Planning
When planning, it’s suggested to write out pseudocode, create UMLs, and any other documentation that will help with the process. It is easy to forget what is discussed between meetings without a plan.
Write everything that should be implemented, what files need to be created, their purpose in the project, and more. UML diagrams help see how classes will interact and inherit from each other.
Lastly, documentation is a great method to stay organized too. Having someone to write what is discussed in meetings can be useful; you won’t easily lose track of what’s discussed.
How to run#
.\build.bat - will build your code (compile, pretty much)
python .\launcher.pyz g - will generate a map
python .\launcher.pyz r - will run the game
Required Python Version#
Requires Python 3.11 due to type of Self
Test Suite Commands:#
python -m game.test_suite.runner
Manual#
Referenced Examples - https://github.com/topoftheyear/Byte-le-Game-Examples
Previous Byte-le Competitions#
2018 - Dungeon Delvers - https://github.com/jghibiki/Byte-le-Royale-2018
2019 - Space Denizen - https://github.com/topoftheyear/Byte-le-Royale-2019
2020 - Disaster Dispatcher - https://github.com/PixPanz/byte_le_royale_2020
2021 - Traveling Trailsmen - https://github.com/PixPanz/byte_le_royale_2021
2022 - FarTech - https://github.com/HagenSR/byte_le_royale_2022
2023 - Undercooked - https://github.com/amanda-f-ndsu/byte_le_royale_2023
- Game Package Contents
- Subpackages
- Game Common Package
- Subpackages
- Items Package
- Map Package
- Submodules
- GameBoard Class
- Occupiable Class
OccupiableOccupiable.from_json()Occupiable.get_occupied_by()Occupiable.get_stack_list()Occupiable.get_top_of_stack()Occupiable.is_occupied_by_game_object()Occupiable.is_occupied_by_object_type()Occupiable.occupied_byOccupiable.place_on_top_of_stack()Occupiable.remove_game_object_from_occupied_by()Occupiable.remove_object_type_from_occupied_by()Occupiable.to_json()
- Tile Class
- Wall Class
- Module contents
- Stations Package
- Submodules
- Action Class
- Avatar Class
- Enums File
ActionTypeActionType.INTERACT_CENTERActionType.INTERACT_DOWNActionType.INTERACT_LEFTActionType.INTERACT_RIGHTActionType.INTERACT_UPActionType.MOVE_DOWNActionType.MOVE_LEFTActionType.MOVE_RIGHTActionType.MOVE_UPActionType.NONEActionType.PLACE_ITEM_DOWNActionType.PLACE_ITEM_LEFTActionType.PLACE_ITEM_RIGHTActionType.PLACE_ITEM_UPActionType.SELECT_SLOT_0ActionType.SELECT_SLOT_1ActionType.SELECT_SLOT_2ActionType.SELECT_SLOT_3ActionType.SELECT_SLOT_4ActionType.SELECT_SLOT_5ActionType.SELECT_SLOT_6ActionType.SELECT_SLOT_7ActionType.SELECT_SLOT_8ActionType.SELECT_SLOT_9
DebugLevelObjectTypeObjectType.ACTIONObjectType.AVATARObjectType.GAMEBOARDObjectType.ITEMObjectType.NONEObjectType.OCCUPIABLEObjectType.OCCUPIABLE_STATIONObjectType.OCCUPIABLE_STATION_EXAMPLEObjectType.PLAYERObjectType.STATIONObjectType.STATION_EXAMPLEObjectType.STATION_RECEIVER_EXAMPLEObjectType.TILEObjectType.VECTORObjectType.WALL
- GameObject Class
- Player Class
- Module contents
- Subpackages
- Controllers Package
- Test Suite Package
- Subpackages
- Tests Package
- Submodules
- Test Avatar Class
TestAvatarTestAvatar.setUp()TestAvatar.test_avatar_json_with_item()TestAvatar.test_avatar_json_with_none_item()TestAvatar.test_avatar_set_item()TestAvatar.test_avatar_set_item_fail()TestAvatar.test_avatar_set_position()TestAvatar.test_avatar_set_position_None()TestAvatar.test_avatar_set_position_fail()TestAvatar.test_avatar_set_score()TestAvatar.test_avatar_set_score_fail()
- Test Avatar Inventory
TestAvatarInventoryTestAvatarInventory.setUp()TestAvatarInventory.test_avatar_drop_held_item()TestAvatarInventory.test_avatar_drop_held_item_none()TestAvatarInventory.test_avatar_pick_up()TestAvatarInventory.test_avatar_pick_up_extra()TestAvatarInventory.test_avatar_pick_up_full_inventory()TestAvatarInventory.test_avatar_pick_up_return_none()TestAvatarInventory.test_avatar_pick_up_surplus()TestAvatarInventory.test_avatar_set_inventory()TestAvatarInventory.test_avatar_set_inventory_fail_1()TestAvatarInventory.test_avatar_set_inventory_fail_2()TestAvatarInventory.test_avatar_set_max_inventory_size()TestAvatarInventory.test_avatar_set_max_inventory_size_fail()TestAvatarInventory.test_take()TestAvatarInventory.test_take_fail()TestAvatarInventory.test_take_none()
- Test Example Class
- Test Gameboard Class
TestGameBoardTestGameBoard.setUp()TestGameBoard.test_game_board_json()TestGameBoard.test_get_objects_avatar()TestGameBoard.test_get_objects_occupiable_station()TestGameBoard.test_get_objects_occupiable_station_2()TestGameBoard.test_get_objects_station()TestGameBoard.test_get_objects_wall()TestGameBoard.test_locations_fail()TestGameBoard.test_locations_incorrect_fail()TestGameBoard.test_map_size_fail()TestGameBoard.test_seed_fail()TestGameBoard.test_walled_fail()
- Test Gameboard (No Generation)
TestGameBoardTestGameBoard.setUp()TestGameBoard.test_game_board_json()TestGameBoard.test_generate_map()TestGameBoard.test_locations()TestGameBoard.test_locations_fail_type()TestGameBoard.test_map_size()TestGameBoard.test_map_size_fail()TestGameBoard.test_seed()TestGameBoard.test_seed_fail()TestGameBoard.test_walled()TestGameBoard.test_walled_fail()
- Test Initialization Class
- Test Interact Controller Class
- Test Inventory Controller Class
TestInventoryControllerTestInventoryController.check_inventory_item()TestInventoryController.setUp()TestInventoryController.test_select_slot_0()TestInventoryController.test_select_slot_1()TestInventoryController.test_select_slot_2()TestInventoryController.test_select_slot_3()TestInventoryController.test_select_slot_4()TestInventoryController.test_select_slot_5()TestInventoryController.test_select_slot_6()TestInventoryController.test_select_slot_7()TestInventoryController.test_select_slot_8()TestInventoryController.test_select_slot_9()TestInventoryController.test_with_out_of_bounds()TestInventoryController.test_with_wrong_action_type()
- Test Item Class
TestItemTestItem.setUp()TestItem.test_item_json()TestItem.test_pick_up()TestItem.test_pick_up_surplus()TestItem.test_pick_up_wrong_object_type()TestItem.test_set_durability()TestItem.test_set_durability_fail()TestItem.test_set_durability_none()TestItem.test_set_durability_stack_size_fail()TestItem.test_set_quantity()TestItem.test_set_quantity_fail()TestItem.test_set_quantity_fail_greater_than_0()TestItem.test_set_quantity_fail_stack_size()TestItem.test_set_value()TestItem.test_set_value_fail()TestItem.test_stack_size()TestItem.test_stack_size_fail()TestItem.test_stack_size_fail_quantity()
- Test Master Controller Class
- Test Movement Controller Class
- Test Movement Controller with Occupiable Stations the Avatar can Occupy
TestMovementControllerIfOccupiableStationIsOccupiableTestMovementControllerIfOccupiableStationIsOccupiable.setUp()TestMovementControllerIfOccupiableStationIsOccupiable.test_move_down()TestMovementControllerIfOccupiableStationIsOccupiable.test_move_left()TestMovementControllerIfOccupiableStationIsOccupiable.test_move_right()TestMovementControllerIfOccupiableStationIsOccupiable.test_move_up()
- Test Movement Controller with Occupiable Stations
TestMovementControllerIfOccupiableStationsTestMovementControllerIfOccupiableStations.setUp()TestMovementControllerIfOccupiableStations.test_move_down()TestMovementControllerIfOccupiableStations.test_move_down_fail()TestMovementControllerIfOccupiableStations.test_move_left()TestMovementControllerIfOccupiableStations.test_move_left_fail()TestMovementControllerIfOccupiableStations.test_move_right()TestMovementControllerIfOccupiableStations.test_move_right_fail()TestMovementControllerIfOccupiableStations.test_move_up()TestMovementControllerIfOccupiableStations.test_move_up_fail()
- Test Movement Controller with Stations the Avatar Can’t Occupy
TestMovementControllerIfStationsTestMovementControllerIfStations.setUp()TestMovementControllerIfStations.test_move_down()TestMovementControllerIfStations.test_move_down_fail()TestMovementControllerIfStations.test_move_left()TestMovementControllerIfStations.test_move_left_fail()TestMovementControllerIfStations.test_move_right()TestMovementControllerIfStations.test_move_right_fail()TestMovementControllerIfStations.test_move_up_fail()
- Test Movement Controller with Walls
TestMovementControllerIfWallTestMovementControllerIfWall.setUp()TestMovementControllerIfWall.test_move_down()TestMovementControllerIfWall.test_move_down_fail()TestMovementControllerIfWall.test_move_left()TestMovementControllerIfWall.test_move_left_fail()TestMovementControllerIfWall.test_move_right()TestMovementControllerIfWall.test_move_right_fail()TestMovementControllerIfWall.test_move_up()TestMovementControllerIfWall.test_move_up_fail()
- Test Occupiable Class
TestOccupiableTestOccupiable.test_is_occupied_by_game_obj()TestOccupiable.test_is_occupied_by_game_object()TestOccupiable.test_is_occupied_by_object_type()TestOccupiable.test_on_station()TestOccupiable.test_on_top_of_stack()TestOccupiable.test_place_on_stack()TestOccupiable.test_remove_form_occupied_by_2_stack()TestOccupiable.test_remove_from_occupied_by_duplicates()TestOccupiable.test_remove_from_occupied_by_duplicates_2()TestOccupiable.test_remove_from_occupied_twice()TestOccupiable.test_remove_game_obj_from_occupied_by()TestOccupiable.test_remove_obj_type_from_occupied_by()
- Test Occupiable Station Class
- Test Place Controller Class
- Test Player Class
TestPlayerTestPlayer.setUp()TestPlayer.test_actions()TestPlayer.test_actions_empty_list()TestPlayer.test_actions_fail_none()TestPlayer.test_avatar()TestPlayer.test_avatar_fail_string()TestPlayer.test_avatar_none()TestPlayer.test_functional_fail_int()TestPlayer.test_functional_false()TestPlayer.test_functional_true()TestPlayer.test_object_type()TestPlayer.test_object_type_fail_int()TestPlayer.test_object_type_fail_none()TestPlayer.test_player_json()TestPlayer.test_team_name()TestPlayer.test_team_name_fail_int()TestPlayer.test_team_name_none()
- Test Station Class
- Test Tile Class
- Test Utils Class
- Module contents
- Tests Package
- Submodules
- Runner File
- Utils File
- Module contents
- Subpackages
- Utils Package
- Game Common Package
- Submodules
- Config Modules
- Engine Module
- Module contents
- Subpackages
- Visualizer Package
- Subpackages
- Submodules
- Adapter Class
- Config File
- Main Class
ByteVisualiserByteVisualiser.adapterByteVisualiser.bytesprite_factoriesByteVisualiser.bytesprite_mapByteVisualiser.clockByteVisualiser.configByteVisualiser.continue_animation()ByteVisualiser.default_frame_rateByteVisualiser.end_timeByteVisualiser.fullscreenByteVisualiser.load()ByteVisualiser.loop()ByteVisualiser.loop_countByteVisualiser.pausedByteVisualiser.playback_speedByteVisualiser.postrender()ByteVisualiser.prerender()ByteVisualiser.recalc_animation()ByteVisualiser.recordingByteVisualiser.render()ByteVisualiser.save_video()ByteVisualiser.scaledByteVisualiser.screenByteVisualiser.sizeByteVisualiser.skip_startByteVisualiser.tickByteVisualiser.tile_sizeByteVisualiser.turn_endByteVisualiser.turn_logsByteVisualiser.writer
- Module contents
- Server Package
- Subpackages
- Crud Package
- Models Package
- Schemas Package
- Subpackages
- Run Package
- Submission Package
- Submission Run Info Package
- Team Package
- Team Type Package
- Tournament Package
- Turn Package
- University Package
- Module contents
- Subpackages
- Server Unit Tests Package
- Submodules
- Client Runner Class
ClientRunnerClientRunner.buffUpData()ClientRunner.close_server()ClientRunner.count_number_of_game_appearances()ClientRunner.delete_runner_temp()ClientRunner.delete_tournament_cascade()ClientRunner.delete_turns()ClientRunner.external_runner()ClientRunner.get_version_number()ClientRunner.insert_logs()ClientRunner.insert_new_tournament()ClientRunner.insert_run()ClientRunner.insert_submission_run_info()ClientRunner.internal_runner()ClientRunner.read_best_logs_and_insert()ClientRunner.return_team_parings()ClientRunner.run_runner()ClientRunner.update_tournament_finished()
- Database Class
- Main Class
- Runner Utils Class
- Server Config Class
- Visualizer Runner Class
- Module contents
- Subpackages
- DB Viewer File