remance/Masendor

error

Hamster-lord opened this issue · 102 comments

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

Thanks for the report, This error should be fixed with the newest update. Made a mistake not checking for the error before commit :P

I got this:
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 744, 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 13, in start_battle
self.battle_game.run_game()
!! File "/Users/Emma/Documents/GitHub/AnchientBattleSimulator/gamescript/battle.py", line 892, in run_game
pygame.mixer.music.load(self.musiclist[self.music_current[self.picked_music]])
!! IndexError: list index out of range

yeah I notice this error. Although I can't commit the update I am working yet. Will let you know when it done.

ok thx

The new update should fix this issue now.

why is there a black box around the caracthers?

or soldiers

Is it still there? I don't see any.

also how to change weapons?

Well that is very weird. Wonder if it related to pygame version or macOS. This never happen in the previous version before rework update right?

To change your character weapon, just press 1 or 2 (the one not on numpad).

For the weird black box, can you try run this code below and post a screenshot to show how it look?

class HeroUI(pygame.sprite.Sprite):
    weapon_sprite_pool = None

    def __init__(self, screen_scale):
        self._layer = 10
        pygame.sprite.Sprite.__init__(self)
        self.screen_scale = screen_scale

        self.image = pygame.Surface((200 * self.screen_scale[0], 200 * self.screen_scale[1]), pygame.SRCALPHA)

        self.health_bar_size = (10 * self.screen_scale[0], self.image.get_height())
        self.health_bar = pygame.Surface(self.health_bar_size, pygame.SRCALPHA)
        self.health_bar.fill((0, 0, 0))
        self.health_bar_original = self.health_bar.copy()
        self.health_bar_rect = self.health_bar.get_rect(topright=(self.image.get_width() - self.health_bar_size[0], 0))
        self.health_bar.fill((200, 0, 0))

        self.health_bar_height = self.health_bar.get_height()

        self.stamina_bar = pygame.Surface(self.health_bar_size, pygame.SRCALPHA)
        self.stamina_bar.fill((0, 0, 0))
        self.stamina_bar_original = self.stamina_bar.copy()
        self.stamina_bar_rect = self.stamina_bar.get_rect(topright=(self.image.get_width(), 0))
        self.stamina_bar.fill((0, 200, 0))
        self.image.blit(self.health_bar, self.health_bar_rect)
        self.image.blit(self.stamina_bar, self.stamina_bar_rect)
        self.rect = self.image.get_rect(topleft=(0, 0))

import pygame

pygame.init()
wndsize = (400, 400)
window = pygame.display.set_mode(wndsize)
clock = pygame.time.Clock()

test = HeroUI((1, 1))
run = True
while run:
    clock.tick(60)

    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            run = False
    window.fill((255, 255, 255))

    window.blit(test.image, test.rect)

    pygame.display.update()

where?

Run it as a new file entirely on its own please. This is just to check if it is pygame related problem.

seem to work fine on that end then. well this is quite weird since it use the same setup. Can you check in game again with the newest update to see if it still has the same bug?

there are still black boxes

Tested the game on another pc and no black box issue. Guess it is likely related to macOS. Will have a test on that later.

maybe

Have you figured out why black boxes are appearing on my screen?

I got !! Traceback (most recent call last):
!! File "/Users/Emma/Documents/GitHub/AnchientBattleSimulator/main.py", line 15, in
game.Game(main_dir, error_log)
!! File "/Users/Emma/Documents/GitHub/AnchientBattleSimulator/gamescript/game.py", line 559, in init
self.change_ruleset()
!! File "/Users/Emma/Documents/GitHub/AnchientBattleSimulator/gamescript/game.py", line 587, in change_ruleset
self.troop_data, self.leader_data, self.faction_data = make_faction_troop_leader_data(self.main_dir,
!! File "/Users/Emma/Documents/GitHub/AnchientBattleSimulator/gamescript/common/game/setup/make_faction_troop_leader_data.py", line 12, in make_faction_troop_leader_data
troop_data = datastat.TroopData(main_dir, weapon_images, ruleset_folder, language)
!! File "/Users/Emma/Documents/GitHub/AnchientBattleSimulator/gamescript/datastat.py", line 252, in init
self.weapon_lore |= {key: value for key, value in weapon_lore_list.items() if key
!! TypeError: unsupported operand type(s) for |=: 'dict' and 'dict'

Unfortunately not, I have no access to macOS to test it yet. The last error is because you need python 3.10 to run the game.

oh ok

did you get a macOS yet to test the error?

Probably will be a little while longer, I don't have access to my pc yet and my laptop is not good enough for virtual machine. Will let you know when I manage to do it. For now, can you try update the game and all python library to see if it work now?

The black boxes might actually be hit boxes.

I also found out the boxes size depends on the units size.

I see thanks for checking, well I should be able to test the game on macOS soon. Will let you know when I mange to get to it.

so I managed to run the game on macOS 12 in my virtual machine and could not manage to replicate the black box issue. So I think the issue may be from outdated requirement on your pycharm. Can you post a screenshot of your package list?

Here is what mine look like: For some reason pygame 2.3 can not be run on my macOS so I had to revert to 2.1 version.
image

Well you should also try run pip install -r requirements.txt too to check if it really is the issue with library.

If that still not work, I will make a new release for macOS for you to test with the release version.

it doesn't work

Just release mac version in the newest update. Can you try it from here?

https://github.com/remance/Masendor/releases/tag/0.6.8.4

it still doesn't work

the background is has no green. it's just grey with curved lines everywhere.

I can't even see the bases

Can you post screenshot? Seem more likely now that it is system related.

Also can you post screenshot for the animation maker too?

So if this blackbox only appear in the newer version, I think this may solve the issue.

Can you try downgrade Pillow library from 9.4.0 to 9.3.0. And maybe all of the following libraries below to these specific version? Maybe the newer one are incompatible with your system.

iniconfig==1.1.1
numpy~=1.22.2
pandas~=1.4.1
Pillow~=9.3.0
pygame~=2.1.2
pyperclip==1.8.2
pywin32-ctypes==0.2.0
screeninfo~=0.8.1
pathfinding~=1.0.1
scipy~=1.8.0

Thank you for the screenshot, the black box around mouse icon make it more obvious now that there is some issue with transparency. Likely with pygame and your system for some reason. I will have a try to make a quick test for this.

What happen when you run Aliens.py game? You can find it in python folder (not sure where it is in your macOS system). Here is an example of where mine is : C:\Program Files (x86)\Python\Lib\site-packages\pygame\examples

In any case, can you post your system spec, the pygame version you are running on? If nothing is working, I think I will have to go ask in a forum or pygame issue. Maybe I can replicate it if I try using the exact same macOS version as well.

So I receive a suggestion to replace pygame with pygame-ce. Can you try update the game, and uninstall pygame from your pycharm and then install pygame-ce instead?

aliens.py does not have any black boxes

Did you try uninstall pygame and install "pygame-ce" instead yet?

It still doesn't work :(

where is the folder that contains the soldiers

Well that is bad to hear :( Can you post screenshot of animation maker?

Do you mean the troop sprite or data (like attack stat and stuff)?

For sprite it is here: data\sprite\subunit

For data it is here: data\ruleset\historical\troop\preset

The issue is not related to troop itself though since even the mouse surface also not working.

Also I am going to submit this issue on pygame-ce github. Can you list the following info below?

  • Operating system (e.g. Windows, Linux(Debian), Linux(Ubuntu), Mac):
  • Python version (e.g. 3.7.9, 3.8.5) : (Shown when run game)
  • SDL version (e.g. SDL 2.0.12): (Shown when run game)
  • PyGame version (e.g. 2.0.0.dev10, 1.9.6): (Shown when run game)
  • Relevant hardware (e.g. if reporting a bug about a controller, tell us the brand & name of it):

what do you meen?

what do you meen?

To which comment are you asking this?

If you mean this one:

Also I am going to submit this issue on pygame-ce github. Can you list the following info below?

  • Operating system (e.g. Windows, Linux(Debian), Linux(Ubuntu), Mac):
  • Python version (e.g. 3.7.9, 3.8.5) : (Shown when run game)
  • SDL version (e.g. SDL 2.0.12): (Shown when run game)
  • PyGame version (e.g. 2.0.0.dev10, 1.9.6): (Shown when run game)
  • Relevant hardware (e.g. if reporting a bug about a controller, tell us the brand & name of it):

Then I need your system information so I can ask the pygame developer to check with this issue we are having.

my mouse and the game mouse does not align and I don't know how to do what you are asking me

You can get your computer system specification by following the step in this link: https://kb.wisc.edu/helpdesk/page.php?id=8208

image

I need to know the information in graphic/display and the one shown in the image above.

Then I need to know your python version and all library version like the one in image below.

image

There is no more info on my mac

That is weird. Do you have other computer to test the game? My guess is that your computer may be too old for new pygame to work properly.

Now that I think about it, have you try testing other games made in pygame so far?

I tried dont touch my presents before. It works like a charm!

Well this is even weirder. Although the game use older version of pygame. I wonder why this game does not work when both use pygame.

yeah

tHE BLACK BOXES ARE REMOVED I THINK, BUT THE BACKGROUND ISN'T LOADING PROPERLY. The background loads properly when you just start the battle, but after about 1 second, the background changes into a more lazy version of the background.

Well somehow that one things fixed itself. Can you post 2 screenshots of before and after the background change?

before
Screen Shot 2023-04-24 at 9 08 42 AM
after
Screen Shot 2023-04-24 at 9 08 25 AM

You should add romans and make the game kind of similar to shield wall on steam: https://store.steampowered.com/app/1216320/Shieldwall/ , because romans were very cool and popular and you should know that romans were pretty famous for their shield wall.

Hmm yes roman battle would be a great addition. What do you think is more interesting, Romans vs barbarian (german or celt), vs carthage, parthia, egypt, greek, or maybe against roman themselves (civil war)?

Hmm yes roman battle would be a great addition. What do you think is more interesting, Romans vs barbarian (german or celt), vs carthage, parthia, egypt, greek, or maybe against roman themselves (civil war)?

A whole campaign against them all ;)

Well if have enough time, sure. At least it is possible to reuse roman troops in all those battle. :)

before Screen Shot 2023-04-24 at 9 08 42 AM after Screen Shot 2023-04-24 at 9 08 25 AM

Can you solve this?

Also. I can't use the map editor.

Hello @Hamster-lord

Is the original Issue with the black boxes solved?

Can we consider that bug fixed, so we can close this issue ticket?

Would it be possible that you report every bug in a different issue ticket?
Like... what do you do to trigger the bug? does it happen 100% of the times with those steps (can it be reproduced)? what's the version you are testing? what are your hardware specs? Any useful attachments, logs or screenshots?

I think it's going to be easier to track and fix them that way.

Thanks!

The issue seem to be related to pygame in someway but is impossible to replicate so far in any other machine. He ran the game on macOS that the only thing I really know.

before Screen Shot 2023-04-24 at 9 08 42 AM after Screen Shot 2023-04-24 at 9 08 25 AM

Can you solve this?

Even the before image already doesn't look right. So I think something is wrong with map effect instead now. I will have a try to fix it.

@remance can you show a screenshot of how it should look like? (ie., how it looks on your local computer)

What's the macOS version you are using @Hamster-lord ?
What about the python interpreter version and the rest of the python libraries @Hamster-lord?

I can try myself to trigger the bug in a Virtual Machine with the problem environment, but first I need to know the details to reproduce it in the same circumstances.
Any information will be of help.

12.6.3

@RybenHill

Here is what mine look like before and after the snow weather effect got added. Actually my previous was misinformed before. The before image seem to be what the game look like few second before the weather effect kick in. And I can see that the blackbox issue is not really fully solved yet. I can still see blackbox around the snow sprite on Hamster-lord screenshot. So there is something between different between the way image is loaded for troops and other sprites that fix the black box issue.

image

@Hamster-lord ok I just tried something. Can you update the game and have a test again? Maybe it (hopefully) fix your issue.

If the new update still does not work. Can you screen shot what this part look like on your system?

image

Screen Shot 2023-04-27 at 7 51 06 PM

not working

this is for huge battle

So two things I manage to derive from the last screenshot. The sprite transparency work fine IF they are blitted on to another surface first (for example weapon icon on top left UI). The transparency issue seem to occur mostly for sprite that are blit on UI interface mostly. But I am not sure why map weather effect transparency also does not work. At least this narrow down what to look for.

OK for the next step, Can you post what this screen look like on your system?

image

for some reason, there is no settings under rename project

never mind I found it

also, the new updates caused the black boxes to come back to the soldiers.

So first thing first, you need to uninstall pygame 2.3.0. Try run the game after that and see how it go.

now it says No module named 'pygame.freetype'

did you delete pygame-ce as well? If so try reinstall only pygame-ce and try again.

I still have pygame-ce installed

Ok, will try to do a bit more test. Will let you know when the next update is.

So here is what I found. You need to uninstall pygame-ce and reinstall it again to make the pygame import work properly.

the black boxes are still there :(

Well that suck :l I wonder what fix the black box issue before. But it is not related to pygame-ce version for sure. Wonder if they actually manage to fix it on normal pygame. Maybe can you try remove pygame-ce and reinstall pygame only again?

the boxes of the soldiers disappeared, but the boxes around everything else is still there.