Compare commits

...

10 Commits

Author SHA1 Message Date
magical 0a1e3e0cad update README 2024-02-03 19:47:48 -08:00
magical 2f2c281265 clean up Fusion_Graph and fix get_path 2024-02-03 03:00:07 -08:00
magical 20e24a40e3 untangle randomize_game
this heart of the randomizer, and it is the most complex function of the
bunch. it seems to function ok now, and the logic mostly makes sense,
but i wouldn't be surprised if there were one or two lingering errors.
2024-02-03 01:58:33 -08:00
magical e7a5af202a update fileHash
the actual function reads a line at a time instead of in fixed chunks,
but this is fine
2024-02-03 01:35:48 -08:00
magical 12a22c8724 untangle start_randomizer
not as bad as some of the functions, but still a couple control flow
errors
2024-02-03 01:28:16 -08:00
magical 707a7b70a1 untangle patch_game 2024-02-03 01:25:28 -08:00
magical afde644b38 untangle find_available_areas 2024-02-03 01:07:16 -08:00
magical 9f22730870 decompile update_requirements 2024-02-03 01:05:33 -08:00
Lucent c4f720c505 reinstated credits on the source 2023-10-20 00:41:11 +02:00
Lucent 409efe14ac actually launch the randomization 2023-10-13 00:27:29 +02:00
6 changed files with 2725 additions and 4640 deletions

View File

@ -1,3 +1,12 @@
# OpenMFOR
# credits manually reinstated due to the comments being lost from the object code decompilation
# Original release is Copyright (C) 2022 Kazuto88
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# Source Generated with Decompyle++
# File: Fusion_Graph.pyc (Python 3.8)
@ -6,7 +15,7 @@ import sys
class Game:
def __init__(self, vanillaGame, randoSettings = (None,)):
def __init__(self, vanillaGame, randoSettings=None):
self.graph = dict()
self.areaConnections = dict()
self.areaConnectionOffsets = dict()
@ -41,7 +50,7 @@ class Game:
sourceDoor = int.from_bytes(sourceRom.read(1), 'little')
targetOffset = sourceRom.tell()
targetArea = int.from_bytes(sourceRom.read(1), 'little')
if sourceArea != 255:
while sourceArea != 255:
self.areaConnections.update({
'S{}-{:02X}'.format(sourceArea, sourceDoor): targetArea })
self.areaConnectionOffsets.update({
@ -82,7 +91,7 @@ class Game:
doorString]
doorNumber += 1
# print('DEBUG: Parsing seemingly done?')
except:
except FileNotFoundError:
print('Error:', vanillaGame, 'could not be opened.')
sys.exit(1)
@ -203,48 +212,44 @@ class Game:
checkRequirement = (start, end)
return self.requirements.get(checkRequirement)
def get_path(self, start, end, LimitArea, path, depth = (False, None, 100)):
def get_path(self, start, end, LimitArea=False, path=None, depth=100):
if path == None:
self.visited.clear()
self.queue.clear()
path = list()
path = path + [
start]
path = path + [start]
if start not in self.graph:
return None
if None == end:
if start == end:
return path
# if None(path) >= depth:
if path >= depth:
if len(path) >= depth:
return None
for point in None.graph[start]:
if point in self.itemLocations and point not in end:
continue
for point in self.graph[start]:
if point in self.itemLocations:
if point not in end:
continue
if point in path:
continue
if LimitArea:
for area in range(0, 7):
if 'S{}'.format(area) in start and 'S{}'.format(area) not in point:
return None
edge = (start, point)
self.queue.append(edge)
if self.queue:
edge = self.queue.pop()
if edge not in self.visited:
self.visited.append(edge)
node = edge[1]
pathReqs = self.get_requirements(start, node)
if pathReqs == None:
newpath = self.get_path(node, end, LimitArea, path, depth)
if newpath:
path = path + [
node]
return newpath
if pathReqs == True:
newpath = self.get_path(node, end, LimitArea, path, depth)
if newpath:
path = path + [
node]
return newpath
if 'S{}'.format(area) in start:
if 'S{}'.format(area) not in point:
return None
edge = (start, point)
self.queue.append(edge)
while self.queue:
edge = self.queue.pop()
if edge not in self.visited:
self.visited.append(edge)
node = edge[1]
pathReqs = self.get_requirements(start, node)
if pathReqs == None:
newpath = self.get_path(node, end, LimitArea, path, depth)
if newpath:
path = path + [node]
return newpath
elif pathReqs == True:
newpath = self.get_path(node, end, LimitArea, path, depth)
if newpath:
path = path + [node]
return newpath

View File

@ -1,3 +1,12 @@
# OpenMFOR
# credits manually reinstated due to the comments being lost from the object code decompilation
# Original release is Copyright (C) 2022 Kazuto88
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# Source Generated with Decompyle++
# File: Fusion_Items.pyc (Python 3.8)

9
GUI.py
View File

@ -1,3 +1,12 @@
# OpenMFOR
# credits manually reinstated due to the comments being lost from the object code decompilation
# Original release is Copyright (C) 2022 Kazuto88
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# Source Generated with Decompyle++
# File: GUI.pyc (Python 3.8)

View File

@ -1,3 +1,12 @@
# OpenMFOR
# credits manually reinstated due to the comments being lost from the object code decompilation
# Original release is Copyright (C) 2022 Kazuto88
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# Source Generated with Decompyle++
# File: MFOR.pyc (Python 3.8)

View File

@ -4,13 +4,23 @@ This is the official unofficial Git repository for the Metroid Fusion Open Rando
Considering the original repository states that the software is GPL-3.0 licensed, but no source was ever released, we're endeavouring on this (potentially failing) task of making MFOR Open Again
## Links
* [OpenMFOR repository][] (This project, in case you are looking at a fork)
* The [original MFOR repository][] on Github
* The [original MFOR thread][] on Metroid Construction
[OpenMFOR]: https://git.inabaudonge.reisen/OpenMFOR/OpenMFOR
[original MFOR repository]: https://github.com/Kazuto88/MFOR
[original MFOR thread]: https://forum.metroidconstruction.com/index.php/topic,5376.0.html
## Project Status
- [x] Decent disassembly
- [x] GUI
- [x] CRC verification
- [ ] Logic
- [ ] Reconstructing missing parts of code
- [x] Logic
- [x] Reconstructing missing parts of code
- [x] Patching
- [ ] Generating BPS patches

File diff suppressed because it is too large Load Diff