Skip to content

Commit

Permalink
Visualizer (#79)
Browse files Browse the repository at this point in the history
* Added base visualizer

* Initial Commit

* Update main.py (#35)

* Update main.py

* Update main.py

* added background color (#34)

* added background color

* Update config.py

* added comments to config

* Update main.py

* Update main.py

* Update main.py

* Update main.py

* Update python-app.yml

* Let me merge (#39)

* Turn_Log list populated

* Added TODOs

* Added more framework code

* Add event method to adapter (#44)

* added events in main and methods for them in adapter

* Config margins (#47)

* Fix merge (#46)

* Fix Merge

* Update config.py

* added margins

* Update config.py

---------

Co-authored-by: Jean A. Eckelberg <[email protected]>

* Implemented spritesheets on bytesprite (#48)

* First changes

Committing first changes for the sprite and bytesheet files

* Spritesheets implemented

Implemented spritesheets into Bytesprite.

* Fixed PR requests

Fixed wanted changes.

* Implement text class visualizer (#45)

* text class created

created class for making text in rect
Default Font: Bauhaus93
Default Color: #daa520
Default Position: Vector(0, 0)

* added getter and setter methods

added getter and setter methods to protect values of text

* added comments

* Update text.py

- fixed constructor
- fixed type hinting
-  added reevaluating to created text when changing values in setters
- allow full support of possible Color parameters

* Update text.py

- fixed some formatting
- fixed wrong check: str -> int

* font_size type hint

* Readme documentation (#51)

* Started documentation updates for README.md.

* Finished

Added documentation for all the files that were changes in revamp's lifespan.

* Development Notes

Added development notes to the README.

* Edits

Made requested changes.

* Plz approve (#57)

* Fix merge (#46)

* Fix Merge

* wip

* needs review

* Fixed it all... hopefully

---------

Co-authored-by: MyFridgeIsFinePleaseStopAsking <[email protected]>

* 58 create 3d list to store bytesprites (#60)

* Added functions to calculate logic and a data structure to store it all

* 59 create an example bytesprite (#65)

* Created example bytesprites, moved files around for a temporary fix, Will need to find a more permanent fix. Investigate a visualizer option when running built launcher?

* Added visualizer to build run with the v subcommand

* Create sidebars (#72)

* Fix merge (#46)

* Fix Merge

* created sidebars

* type safe

* fixed

* Update adapter.py

---------

Co-authored-by: Jean A. Eckelberg <[email protected]>

* Implement button visualizer (#71)

* Fix merge (#46)

* Fix Merge

* Fixed README (#68)

Added more info for the avatar class in the README.

* basic button implementation

- still needs work
- includes some testing in adapter class

* fixes and changes

added:
- better documentation
- background button to text
- padding parameter
- border_radius parameter (to round corners of button
- color parameters for bg button
- changed collision logic to work with bg rect, not text rect

* code clean up + timer

cleaned up code and added timer in button class to help display clicked colors better

* fixed documentation + timer

- relocated documentation to proper location
- fixed button timer to be adjustable and consistent with frame rate

* more timer changes

- reverted back to milliseconds, which do not need to be multiplied by the frame rate
- used math.floor when needed
- changed click_duration to int

---------

Co-authored-by: Jean A. Eckelberg <[email protected]>
Co-authored-by: Ian <[email protected]>

* Start screen (#76)

* Made Start Screen

Made progress on the start screen.

* Made writing logs async.
Allowed position to be set through text and button rect
Changed default background color for button
Renamed start_menu_templates.py to menu_templates.py
Refreshed sidebars in prerender
Added second avatar to generate_game.py
Added End screen to template

* Added interact controller back to master_controller.py

* cleaned up some duplicate code and resized the sidebars

* removed print statement

* Started documentation updates

---------

Co-authored-by: JeanAEckelberg <[email protected]>

* Sphinx documentation (#78)

* Fix merge (#46)

* Fix Merge

* Updated requirements.txt

Updated the requirements for the project.

* Fixed README (#68)

Added more info for the avatar class in the README.

* Starting to document

Starting to add sphinx documentation.

* Created rst files

Created the rst and html files for every file.

* Testing

Testing different things to make the formatting make sense.

* Fixing mistake

Fixed a mistake from a merge conflict.

* Item Docs

Finished the item docs for sphinx.

* Map Directory

Fixed documentation in Map directory. Will need to find solution for visuals.

* Added Stations

Added station docs. May need to expand on their explanations.

* Fixed Formatting

Fixed the formatting for GameBoard docs and README. Thanks Jean.

* Reformatting

Reformatted and made small changes to some files

* Game Package Classes

Fixed docs for Game package classes like enums and avatar

* Test File Docs

Formatted the Test File docs. Will eventually add proper docstrings to the individual files themselves.

* Formatting

This should be the final formats for the rst files.

* Controller Docs

Made changes for the Controller documents

* Test Docs

Made documentation for the tests.

* Test Docs 2

Last bits of the documentation for the test suit files.

* Utils Docs

Started documentation for the Utils files and the last few that are missing

* Changes

Changes for some files and an update to requirements.txt.

* Extra docs

Should be done adding documentation for everything.

* Fixes

Fixing warnings

* Removal

Removed unnecessary files

* Finalized

Should be done with documentation for main engine.

---------

Co-authored-by: Jean A. Eckelberg <[email protected]>

* Playback template (#77)

* Playback Buttons Template Basics

added:
- opencv added to requirements
- playback template for watching visualizer

modified:
- adapter to contain PlaybackButtons
- config file variables
- main to control the results of PlaybackButtons
- type hinting to menu_templates
- button to check if button can be clicked again during click_duration

* Switched to Flags instead of structs

* fixed multi-click bug

* main changes

- more type hinting
- optimized video recording to one frame per turn using bicubic as default setting
- organized methods in main

* Fixed button order

---------

Co-authored-by: Jean Eckelberg <[email protected]>

---------

Co-authored-by: JuliaCaesar <[email protected]>
Co-authored-by: Ian <[email protected]>
Co-authored-by: Gunnar Moody <[email protected]>
  • Loading branch information
4 people authored Sep 2, 2023
1 parent a1a857f commit 1413abb
Show file tree
Hide file tree
Showing 88 changed files with 2,639 additions and 526 deletions.
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# byte_engine
# Byte Engine

Revamped base game engine for use in NDACM Byte-le Royale games.
Changes made in 2023.

Expand All @@ -12,32 +13,40 @@ Changes made in 2023.
* 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.
Expand All @@ -62,9 +71,11 @@ Changes made in 2023.
* 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
Expand All @@ -79,16 +90,20 @@ Changes made in 2023.
* 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.
Expand All @@ -111,6 +126,7 @@ Changes made in 2023.
* 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.
Expand All @@ -122,12 +138,15 @@ Changes made in 2023.
* 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.

Expand Down
2 changes: 1 addition & 1 deletion base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def team_name(self):
Allows the team to set a team name.
:return: Your team name
"""
return 'Team Name'
return 'Team 1'

# This is where your AI will decide what to do
def take_turn(self, turn, actions, world, avatar):
Expand Down
2 changes: 1 addition & 1 deletion base_client_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def team_name(self):
Allows the team to set a team name.
:return: Your team name
"""
return 'Team Name'
return 'Team 2'

# This is where your AI will decide what to do
def take_turn(self, turn, actions, world, avatar):
Expand Down
4 changes: 3 additions & 1 deletion build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
del /q *.pyz

xcopy /s/e/i "game" "wrapper/game"
xcopy /s/e/i "visualizer" "wrapper/visualizer"
python -m zipapp "wrapper" -o "launcher.pyz" -c
del /q/s "wrapper/game"
del /q/s "wrapper/game"
del /q/s "wrapper/visualizer"
9 changes: 6 additions & 3 deletions game/common/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@

class Action:
"""
This class encapsulates the different actions a player can execute while playing the game.
NOTE: This is not currently implemented in this version of the engine. If you want more complex actions, you can
use this class for Objects instead of the enums.
`Action Class:`
This class encapsulates the different actions a player can execute while playing the game.
**NOTE**: This is not currently implemented in this version of the Byte Engine. If you want more complex
actions, you can use this class for Objects instead of the enums.
"""

def __init__(self):
Expand Down
Loading

0 comments on commit 1413abb

Please sign in to comment.