-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Trackmania: Implement New Game #5525
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
SerialBoxes
wants to merge
70
commits into
ArchipelagoMW:main
Choose a base branch
from
SerialBoxes:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 67 commits
Commits
Show all changes
70 commits
Select commit
Hold shift + click to select a range
332ae91
Test Commit!
SerialBoxes 4e39c55
Initial Setup of Options and World
SerialBoxes dea6a97
Merge branch 'ArchipelagoMW:main' into main
SerialBoxes 9fc53c1
Added Regions & Rules, and got generation working correctly!
SerialBoxes 693a531
Merge branch 'main' of https://github.com/SerialBoxes/ArchipelagoTrac…
SerialBoxes 91a7531
Refactored Region Generation into its own file, started setting up th…
SerialBoxes f3106ab
Got a valid websocket connection working with Trackmania!!! Finally!
SerialBoxes 635ff42
Merge branch 'ArchipelagoMW:main' into main
SerialBoxes d45e473
Small Refactor while testing
SerialBoxes 8ad23fc
Merge remote-tracking branch 'origin/main'
SerialBoxes 1e1a0bd
Add Yaml Options to Slot Data
SerialBoxes 3cc2c85
Added Victory Event, Updated slot data format.
SerialBoxes 37bed62
Added Reroll command, fixed bug with missing icon
SerialBoxes e7ae027
Added difficulties, TM2 tags, minor edits of docs, and sorted options…
SerialBoxes 7c65e3a
Silly Filler Item names
SerialBoxes 6a8bb4a
conformed to style guidelines, removed unused imports, and fixed rule…
SerialBoxes 14d12af
Merge branch 'ArchipelagoMW:main' into main
SerialBoxes d6ddb12
Added "target time progressive item chance" option
SerialBoxes 2485104
Merge remote-tracking branch 'origin/main'
SerialBoxes ddd34c8
Added Generation Tests
SerialBoxes ac6b4ea
replaced icon
SerialBoxes 82bf736
Merge branch 'ArchipelagoMW:main' into main
SerialBoxes 7110c28
No longer hardcoding binding IP, added more filler items
SerialBoxes 9277fba
Merge branch 'ArchipelagoMW:main' into main
SerialBoxes 38f9168
Added support for variable length series & different tags per series!
SerialBoxes dcb4611
Merge remote-tracking branch 'origin/main'
SerialBoxes 2105fa5
Handle TMX search criteria generically, support custom series
KScl aa3e6ef
Remove a sneaky debug print
KScl 7588854
Update based on feedback
KScl 5c3c774
Allow customizing all series search criteria at once
KScl 3e902ed
Map Tags -> Map Search Settings
KScl aa507a9
Merge pull request #1 from KScl/custom-series
SerialBoxes f78fe5e
Merge branch 'ArchipelagoMW:main' into main
SerialBoxes 596c8a3
Default exclude Flagrush and Puzzle, add filler items
SerialBoxes 2039b29
Add "Has Award" setting
SerialBoxes f55a6a1
Add support for "Has Award" option
SerialBoxes 14ebc62
Forgot to update CustomSeries description
SerialBoxes 27d197e
Add support for rerolling maps from the menu
SerialBoxes 76763f2
rename re-roll parameters to be more user friendly
SerialBoxes 27522d7
Add options to remove specific medal types from the randomizer
SerialBoxes 4aa17f4
Support disabling medal locations
SerialBoxes e1bf971
Add support for disabling medals
SerialBoxes ad56ca2
Add support for disabling medals
SerialBoxes 3e93a1a
Bug Fixes
SerialBoxes 5378d2a
Merge pull request #2 from SerialBoxes/dev
SerialBoxes 78942da
Website Fix
SerialBoxes 8972fe1
Merge pull request #3 from SerialBoxes/dev
SerialBoxes b40390b
Fix test failures for series size settings, switch to using World.random
SerialBoxes 9b29550
Add Target Time Discount Item
SerialBoxes 6e4027b
Add Discount Item Percentage
SerialBoxes b2e8488
Change Theme, Remove PlandoItems references for now
SerialBoxes bc126e6
Merge branch 'ArchipelagoMW:main' into main
SerialBoxes 012e38e
Rework Target Time Discount into PB Discount
SerialBoxes e037145
Merge branch 'ArchipelagoMW:main' into main
SerialBoxes 7785184
Customize Map Length, Discount Amount, and Medal Items
SerialBoxes fae6685
Resync Items on Server Reconnect, Fix generating too many items for c…
SerialBoxes 4b13f88
Merge branch 'ArchipelagoMW:main' into main
SerialBoxes c3184ec
Added Manifest File
SerialBoxes e8fb6c8
I can't get manifest files to compile :(
SerialBoxes 4179e8b
MultiWorld type checking
SerialBoxes 950dcad
Update Website, add current tags to template file
SerialBoxes 3e03837
Merge branch 'ArchipelagoMW:main' into main
SerialBoxes a2cd30d
Added manifest file
SerialBoxes e573041
Add details to manifest
SerialBoxes 391bd1e
Added Kaito to authors, small tidy-ups
SerialBoxes 1d5b5fd
Added custom icon I drew!
SerialBoxes 4db4e9e
Merge branch 'ArchipelagoMW:main' into main
SerialBoxes 2abb7fe
Fix file endings, remove List and Dict imports, and reword PB Discoun…
SerialBoxes 920b5e3
Apply suggestions from code review
SerialBoxes 0c46bbe
Update required software and instructions.
SerialBoxes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| from worlds.trackmania.client import launch | ||
| import Utils | ||
| import ModuleUpdate | ||
| ModuleUpdate.update() | ||
|
|
||
| if __name__ == "__main__": | ||
| Utils.init_logging("TrackmaniaClient", exception_logger="Client") | ||
| launch() |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,142 @@ | ||
| import os | ||
|
|
||
| from .options import TrackmaniaOptions, create_option_groups | ||
| from .items import build_items, trackmania_item_groups, create_itempool, create_item, get_filler_item_name | ||
| from .locations import build_locations | ||
| from .regions import create_regions | ||
| from .rules import set_rules | ||
| from worlds.AutoWorld import World, WebWorld | ||
| from worlds.LauncherComponents import Component, components, icon_paths, launch_subprocess, Type | ||
| from Utils import local_path | ||
| from BaseClasses import Item, Tutorial | ||
| from typing import TYPE_CHECKING | ||
|
|
||
| if TYPE_CHECKING: | ||
| from BaseClasses import MultiWorld | ||
|
|
||
| def launch_client(): | ||
| from .client import launch | ||
| launch_subprocess(launch, name="TrackmaniaClient") | ||
|
|
||
| icon_path : str = local_path('data', 'tmicon.ico') | ||
| icon: str = 'icon' | ||
|
|
||
| if os.path.exists(icon_path): | ||
| icon_paths['tmicon'] = icon_path | ||
| icon = 'tmicon' | ||
|
|
||
| components.append(Component("Trackmania Client", "TrackmaniaClient", func=launch_client, | ||
| component_type=Type.CLIENT, icon=icon)) | ||
|
|
||
| class Webmania(WebWorld): | ||
| theme = "grassFlowers" | ||
| option_groups = create_option_groups() | ||
| tutorials = [Tutorial( | ||
| "Multiworld Setup Guide", | ||
| "A guide for setting up Trackmania to be played in Archipelago.", | ||
| "English", | ||
| "setup_en.md", | ||
| "setup/en", | ||
| ["SerialBoxes"] | ||
| )] | ||
| rich_text_options_doc = True | ||
|
|
||
| class TrackmaniaWorld(World): | ||
| """Trackmania is a mechanically deep arcade racing game that is easy to pick up and addicting to master! | ||
| Zoom through hundreds of thousands of user-made tracks as fast as you can!""" | ||
| game = "Trackmania" # name of the game/world | ||
| options_dataclass = TrackmaniaOptions # options the player can set | ||
| options: TrackmaniaOptions # typing hints for option results | ||
| web = Webmania() | ||
|
|
||
| item_name_to_id = build_items() | ||
| location_name_to_id = build_locations() | ||
|
|
||
| item_name_groups = trackmania_item_groups | ||
|
|
||
| def __init__(self, multiworld: "MultiWorld", player: int): | ||
| super().__init__(multiworld, player) | ||
| self.series_data: list = [] | ||
|
|
||
| def create_item(self, name: str) -> Item: | ||
| return create_item(self, name) | ||
|
|
||
| def create_items(self): | ||
| self.multiworld.itempool += create_itempool(self) | ||
|
|
||
| #rules are also generated with the regions | ||
| def create_regions(self): | ||
| create_regions(self) | ||
|
|
||
| def set_rules(self): | ||
| set_rules(self) | ||
|
|
||
| def generate_early(self): | ||
| medal_percent: float = float(self.options.medal_requirement.value) / 100.0 | ||
| base_search_criteria: dict = self.options.custom_series.value.get("all", {}) | ||
|
|
||
| if self.options.series_minimum_map_number.value > self.options.series_maximum_map_number.value: | ||
| temp: int = self.options.series_minimum_map_number.value | ||
| self.options.series_minimum_map_number.value = self.options.series_maximum_map_number.value | ||
| self.options.series_maximum_map_number.value = temp | ||
|
|
||
| if self.options.map_min_length > self.options.map_max_length: | ||
| self.options.map_max_length = self.options.map_min_length+1 | ||
|
|
||
| for series in range(1, self.options.series_number.value + 1): | ||
| map_count: int = self.random.randint(self.options.series_minimum_map_number.value, | ||
| self.options.series_maximum_map_number.value) | ||
| if series == 1 and self.options.first_series_size.value > 0: | ||
| map_count = self.options.first_series_size.value | ||
|
|
||
| medals: int = round(map_count * medal_percent) | ||
| medals = max(1, min(medals, map_count)) # clamp between 1 and map_count | ||
|
|
||
| search_criteria: dict = base_search_criteria.copy() | ||
| search_criteria.update(self.options.custom_series.value.get(series, {})) | ||
|
|
||
| # Fill in global defaults and settings | ||
| if "map_tags" not in search_criteria: | ||
| tags: list = list(self.options.map_tags.value) | ||
| if self.options.random_series_tags > 0 and len(tags) > 1: | ||
| search_criteria["map_tags"] = [self.random.choice(tags)] | ||
| else: | ||
| search_criteria["map_tags"] = tags | ||
|
|
||
| if "map_etags" not in search_criteria: | ||
| search_criteria["map_etags"] = list(self.options.map_etags.value) | ||
|
|
||
| if "map_tags_inclusive" not in search_criteria: | ||
| search_criteria["map_tags_inclusive"] = self.options.map_tags_inclusive.value | ||
|
|
||
| if "difficulties" not in search_criteria: | ||
| search_criteria["difficulties"] = list(self.options.difficulties.value) | ||
|
|
||
| if "max_length" not in search_criteria: | ||
| search_criteria["max_length"] = self.options.map_max_length * 1000 | ||
|
|
||
| if "min_length" not in search_criteria: | ||
| search_criteria["min_length"] = self.options.map_min_length * 1000 | ||
|
|
||
| if "has_award" not in search_criteria: | ||
| search_criteria["has_award"] = self.options.has_award.value | ||
|
|
||
| values : dict = {"MedalTotal": medals, | ||
| "MapCount": map_count, | ||
| "SearchCriteria": search_criteria} | ||
| self.series_data.append(values) | ||
|
|
||
| def fill_slot_data(self) -> dict: | ||
| return { | ||
| "TargetTimeSetting": (float(self.options.target_time.value) / 100.0), | ||
| "DiscountAmount": (float(self.options.discount_amount) / 1000.0), | ||
| "SeriesNumber": self.options.series_number.value, | ||
| "DisableBronze": self.options.disable_bronze_locations.value, | ||
| "DisableSilver": self.options.disable_silver_locations.value, | ||
| "DisableGold": self.options.disable_gold_locations.value, | ||
| "DisableAuthor": self.options.disable_author_locations.value, | ||
| "SeriesData": self.series_data | ||
| } | ||
|
|
||
| def get_filler_item_name(self) -> str: | ||
| return get_filler_item_name(self) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| { | ||
| "game": "Trackmania", | ||
| "authors": ["SerialBoxes","Kaito Sinclaire"], | ||
| "minimum_ap_version": "0.6.0", | ||
| "world_version": "1.3.1" | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.