remance / masendor Goto Github PK
View Code? Open in Web Editor NEWOpen source educational and historical battle action game, All helps accepted
License: MIT License
Open source educational and historical battle action game, All helps accepted
License: MIT License
When executing the main.py, it outputs: "ModuleNotFoundError: No module named 'PIL'"
Map editor tool to create new maps.
The first tool prototype can be a simple bitmap editor allowing the user to create the files required for a battle map:
base.png
feature.png
height.png
place_name.png
with the brush colours restricted to the RGB code matching each terrain type.
Ruleset: Historical, Mode: arcade
Map: Testmap, Source: Modern Historians, Character: 1
!! Traceback (most recent call last):
!! File "/Users/Emma/Documents/GitHub/AnchientBattleSimulator/main.py", line 12, in
game.Game(main_dir, error_log)
!! File "/Users/Emma/Documents/GitHub/AnchientBattleSimulator/gamescript/game.py", line 739, in init
self.run()
!! File "/Users/Emma/Documents/GitHub/AnchientBattleSimulator/gamescript/game.py", line 1150, in run
self.menu_char_select(mouse_left_up, mouse_left_down, mouse_scroll_up,
!! File "/Users/Emma/Documents/GitHub/AnchientBattleSimulator/gamescript/common/game/menu_char_select.py", line 26, in menu_char_select
self.start_battle(self.char_selected)
!! File "/Users/Emma/Documents/GitHub/AnchientBattleSimulator/gamescript/common/game/start_battle.py", line 9, in start_battle
self.battle_game.prepare_new_game(self.ruleset, self.ruleset_folder, self.team_selected,
!! File "/Users/Emma/Documents/GitHub/AnchientBattleSimulator/gamescript/battle.py", line 534, in prepare_new_game
self.subunit_animation_pool = self.main.create_sprite_pool(direction_list, self.main.troop_sprite_size,
!! File "/Users/Emma/Documents/GitHub/AnchientBattleSimulator/gamescript/common/game/create_sprite_pool.py", line 13, in create_sprite_pool
weapon_common_type_list = tuple(set(["" + value["Common"] + "" for key, value in weapon_list.items() if
!! File "/Users/Emma/Documents/GitHub/AnchientBattleSimulator/gamescript/common/game/create_sprite_pool.py", line 13, in
weapon_common_type_list = tuple(set(["" + value["Common"] + "" for key, value in weapon_list.items() if
!! TypeError: can only concatenate str (not "int") to str
why does this happen in the run:
[Errno 2] No such file or directory: '/Users/Emma/Documents/GitHub/HamsterBattleGame/data/map/weather/matter/Wet Fog'
[Errno 2] No such file or directory: '/Users/Emma/Documents/GitHub/HamsterBattleGame/data/map/weather/matter/Sandstorm'
[Errno 2] No such file or directory: '/Users/Emma/Documents/GitHub/HamsterBattleGame/data/map/weather/effect/Sandstorm'
[Errno 2] No such file or directory: '/Users/Emma/Documents/GitHub/HamsterBattleGame/data/map/weather/matter/Wet Fog'
[Errno 2] No such file or directory: '/Users/Emma/Documents/GitHub/HamsterBattleGame/data/map/weather/matter/Sandstorm'
[Errno 2] No such file or directory: '/Users/Emma/Documents/GitHub/HamsterBattleGame/data/map/weather/effect/Sandstorm'
Hello! I saw your game on the Pygame website and it caught my eye - the concept is great and I'm impressed by your progress already! I've made my fair share of games in Pygame and I'm aware of how bare-bone it is - as you may know, it isn't really a game engine. Due to a lack of spare time I've moved on from dabbling in gamedev, but since, I've come to realise that using a "proper" game engine is almost critical if you want your game to scale - writing your own game engine (which you practically must do when using Pygame) is really not a good idea, unless you are really experienced.
I'm not trying to put you off, but in my humble opinion I think using a game engine will get your game a lot further, far quicker, especially when it comes tasks like making the terrain, etc. (your note about it being difficult and long is very accurate!). My personal choice would be Godot for many reasons, amongst others that it is open source, has a very active and productive community (https://www.reddit.com/r/godot/top/?t=all) and has most of the features of professional game engines. It's native scripting language is not Python, but I believe there are addons which allow you to script it using Python. There are also plugins, demos and tutorials for (procedural) terrain generation. Some examples of plugins are https://github.com/Zylann/godot_heightmap_plugin and https://github.com/SirRamEsq/SmartShape2D)
Whatever you decide (and I'm aware the decision will not be a simple one - one that even I would find difficult due to how much I enjoy working with Pygame despite the challenges), I wish you all the best with your project, and I can't wait to see how it turns out!
!! Traceback (most recent call last):
!! File "/Users/Emma/PycharmProjects/Madendor/Masendor-0.6.3.5 2/main.py", line 12, in
runmenu = game.Game(main_dir, error_log)
!! File "/Users/Emma/PycharmProjects/Madendor/Masendor-0.6.3.5 2/gamescript/game.py", line 218, in init
os.makedirs("/profile")
!! File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/os.py", line 221, in makedirs
mkdir(name, mode)
!! OSError: [Errno 30] Read-only file system: '/profile'
Feel free to posting improvement idea here. Also for when idea popup and I can't access the code.
File "/Users/Emma/PycharmProjects/Madendor/Masendor-0.6.2.3 3/gamescript/gamesubunit.py", line 1046, in update
self.melee_target = self.parentunit.attack_target.subunit_sprite[0]
This issue is opened when the current and maybe other recent commits cause the game to crash.
File "/Users/Emma/PycharmProjects/Madendor/Masendor-0.6.2.1/gamescript/gamelongscript.py", line 591, in csv_read
with open(main_dir + folderlist, encoding="utf-8", mode="r") as unitfile:
FileNotFoundError: [Errno 2] No such file or directory: '/Users/Emma/PycharmProjects/Madendor/Masendor-0.6.2.1/gamescript/data/ruleset/historical/map//Users/Emma/PycharmProjects/Madendor/Masendor-0.6.2.1/gamescript/data/ruleset/historical/map/megiddo/info.csv'
You seem to have called 'Font' incorrectly:
File "C:\Users\user\Documents\Masendor\Masendor-0.7.3.1\engine\game\loading_screen.py", line 12, in loading_screen
font = pygame.Font(self.ui_font["main_button"], int(60 * self.screen_scale[1]))
AttributeError: module 'pygame' has no attribute 'Font'
(full traceback not included)
EDIT: this is how I would normally do it:
font = pygame.font.Font(fontFile, fontSize)
doesn't crash with:
font = pygame.font.Font(self.ui_font["main_button"], int(60 * self.screen_scale[1]))
How to set small window mode
Unit editor and army editor nnno work
After destroying all of one team the following error occurs:
Traceback (most recent call last):
File "C:\Users\legot\Documents\GitHub\remanceMasendor\main.py", line 403, in
runmenu.run(maingame)
File "C:\Users\legot\Documents\GitHub\remanceMasendor\main.py", line 347, in run
self.battlegame.rungame()
File "C:\Users\legot\Documents\GitHub\remanceMasendor\gamescript\maingame.py", line 1058, in rungame
self.battalionupdater.update(self.currentweather, self.squad, self.dt, self.camerascale,
File "C:\Users\legot\AppData\Local\Programs\Python\Python38\lib\site-packages\pygame\sprite.py", line 463, in update
s.update(*args)
File "C:\Users\legot\Documents\GitHub\remanceMasendor\gamescript\gamebattalion.py", line 693, in update
getrandom = random.randint(0, len(retreatside) - 1)
File "C:\Users\legot\AppData\Local\Programs\Python\Python38\lib\random.py", line 248, in randint
return self.randrange(a, b+1)
File "C:\Users\legot\AppData\Local\Programs\Python\Python38\lib\random.py", line 226, in randrange
raise ValueError("empty range for randrange() (%d, %d, %d)" % (istart, istop, width))
ValueError: empty range for randrange() (0, 0, 0)
Currently, the module reading function requires the selected module to have the same data structure as the default (historical) module. The game should have a function to selectively read the default module and then selectively replace data from the selected module if they existed.
For example, a fantasy module may have its own troop preset, but everything else is the same as the historical module. Then the game only needs to use troop preset from the fantasy module and use other data from the default module.
This should reduce data redundancy by a lot.
Based on the demo version, the unit sprite visibility is very bad especially in combat. When 2 army collides, it pretty much become almost impossible to distinguish enemy/allies troop.
Not quite sure how to fix it yet. But here are some potential solutions:
The term "source" for battle map historical source is mostly used in code and guides currently. But the word meaning is a bit too closely related to programming terms. It would be better to have a term that is more unique to historical aspects or events.
One possible term that may be more suitable is "scenario".
I seem to be missing some historical map presets that are required before loading:
[Errno 2] No such file or directory: 'C:\\Users\\user\\Documents\\GitHub\\Masendor\\data\\module\\historical\\map\\preset\\norman\\varaville1\\0\\unit_pos.csv'
[Errno 2] No such file or directory: 'C:\\Users\\user\\Documents\\GitHub\\Masendor\\data\\module\\historical\\map\\preset\\norman\\mortemer\\0\\unit_pos.csv'
[Errno 2] No such file or directory: 'C:\\Users\\user\\Documents\\GitHub\\Masendor\\data\\module\\historical\\map\\preset\\norman\\dinan\\0\\unit_pos.csv'
[Errno 2] No such file or directory: 'C:\\Users\\user\\Documents\\GitHub\\Masendor\\data\\module\\historical\\map\\preset\\norman\\varaville2\\0\\unit_pos.csv'
[Errno 2] No such file or directory: 'C:\\Users\\user\\Documents\\GitHub\\Masendor\\data\\module\\historical\\map\\preset\\norman\\fulford\\0\\unit_pos.csv'
[Errno 2] No such file or directory: 'C:\\Users\\user\\Documents\\GitHub\\Masendor\\data\\module\\historical\\map\\preset\\norman\\stamford\\0\\unit_pos.csv'
[Errno 2] No such file or directory: 'C:\\Users\\user\\Documents\\GitHub\\Masendor\\data\\module\\historical\\map\\preset\\ottoman\\mohacs\\0\\unit_pos.csv'
[Errno 2] No such file or directory: 'C:\\Users\\user\\Documents\\GitHub\\Masendor\\data\\module\\historical\\map\\preset\\ottoman\\mohacs\\0\\eventlog.csv'
basically while loading game data you have to include the main_dir path to be able to run using the binary itself without downloading any game data with it as the game data is embedded in the binary BUT the data is stored in a temporary directory so configuration files should be made or accessed in the directory the user is running from on start of the binary wich is already happening
so whats wrong?
instead of just importing game data prepend the main_dir to the path of the data ur loading
Hi,
Game looks Very interesting - wanted to see how it plays but I got an error while running it.
I got the zip file, unzipped, the install the requirements.txt
ran the game with : python main.py
however when I choose a battle and side - before starting the battle I got the following error:
python main.py
pygame 2.0.2 (SDL 2.0.16, Python 3.8.9)
Hello from the pygame community. https://www.pygame.org/contribute.html
Traceback (most recent call last):
File "main.py", line 12, in
runmenu.run()
File "E:\dev\ai\Masendor-master\gamescript\start.py", line 1134, in run
self.battlegame.preparenewgame(self.ruleset, self.ruleset_folder, self.teamselected, self.enactment,
File "E:\dev\ai\Masendor-master\gamescript\tactical\battle.py", line 387, in preparenewgame
longscript.unitsetup(self)
File "E:\dev\ai\Masendor-master\gamescript\tactical\longscript.py", line 298, in unitsetup
subunitgameid = generate_unit(gamebattle, whicharmy, row, control, command, colour, coa, subunitgameid)
File "E:\dev\ai\Masendor-master\gamescript\tactical\longscript.py", line 235, in generate_unit
this_unit = add_unit(np.array([row[1], row[2], row[3], row[4], row[5], row[6], row[7], row[8]]), (row[9][0], row[9][1]), row[0],
File "E:\dev\ai\Masendor-master\gamescript\tactical\longscript.py", line 221, in add_unit
unit = unit.Unit(position, gameid, subunitlist, colour, control, coa, command, abs(360 - startangle), starthp, startstamina, team)
File "E:\dev\ai\Masendor-master\gamescript\tactical\unit.py", line 186, in init
self.front_pos = self.rotationxy(self.base_pos, frontpos, self.radians_angle)
TypeError: rotationxy() takes 3 positional arguments but 4 were given
File "D:\Masendor-master\gamescript\gameunitstat.py", line 169, in init
for row in rd:
UnicodeDecodeError: 'gbk' codec can't decode byte 0x94 in position 47: illegal multibyte sequence
25313 INFO: Appending 'datas' from .spec
Unable to find "c:\REPO\Masendor\gamescript" when adding binary and data files.
In order to make translation and development easier, separate game logic data from translatable strings in .csv files.
Put the translatable strings files in /masendor/data/module/historical/strings/*_en.csv
in ur game a scene is being rendered above the other scene wich may be annoying i think we can fix this easily ill see if i can fix it if someone is already fixing it please comment so we dont have any conflicts in the code
Seem like the main.exe generated with pyinstaller may not work for some people for an unknown reason. I am not certain what caused it or what can be fixed yet. From what I heard, the game may simply not open at all and only command prompt pop up for a second with no error messege.
File "/Users/Emma/PycharmProjects/Madendor/Masendor-0.6.2.3 3/gamescript/gamelongscript.py", line 594, in csv_read
with open(main_dir + folderlist, encoding="utf-8", mode="r") as unitfile:
FileNotFoundError: [Errno 2] No such file or directory: '/Users/Emma/PycharmProjects/Madendor/Masendor-0.6.2.3 3/data/ruleset/historical/map/custom//Users/Emma/PycharmProjects/Madendor/Masendor-0.6.2.3 3/data/ruleset/historical/map/custom/grassland/info.csv'
The current pathing is not generic enough for other OS beside Windows.
When I try and run the mainmenu.py script from the python IDLE, it throws an error saying:
Traceback (most recent call last):
File "C:\Users\legot\Documents\GitHub\Masendor\mainmenu.py", line 11, in
from RTS import maingame
ModuleNotFoundError: No module named 'RTS'
Am I running the game wrong, or is it an actual problem in the code?
Can it be used in something in the cloud online for everyone?
like heroku provider which is partially free?
Then available through the browser
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.