JonathanMurray / JonathanMurray/python-2d-game

Screen resolution bug when running the game

Open
#35 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
103
Forks
26
PR merge metrics
No merged PRs in 30d

Description

Hello @JonathanMurray. Hello everyone.
Here I bring a temporary solution when running the game and shows screen resolution bug when running the game.

**To reproduce this problem:**
Just start the game and some incompatibility with the screen resolution identification will appear. Causes a resolution bug, the game is immediately stopped.

**Causes investigated:**
Relatively associated this error with incompatibility of the video driver with openGL applications. I still don't know which video cards can be affected, here I am using the VGA compatible controller for Intel Skylake GT2 [HD Graphics 520].

**Temporary solution:**
Disable the fullscreen at line 47 of the main.py file in the "/python-2d-game-3/pythongame" installation directory of the game.
Change `self.fullscreen = True` to `self.fullscreen = False`

So that it is:
```python
class Main:
def __init__(self, map_file_name: Optional[str], chosen_hero_id: Optional[str], hero_start_level: Optional[int],
start_money: Optional[int]):

cmd_flags = CommandlineFlags(map_file_name, chosen_hero_id, hero_start_level, start_money)

pygame.init()

print("Available display modes: " + str(pygame.display.list_modes()))

self.fullscreen = False
self.pygame_screen = self.setup_screen()
```

**Error message:**
```
X Error of failed request: BadValue (integer parameter out of range for operation)
Major opcode of failed request: 153 (XFree86-VidModeExtension)
Minor opcode of failed request: 10 (XF86VidModeSwitchToMode)
Value in failed request: 0x220000e
Serial number of failed request: 265
Current serial number in output stream: 268
```
**Video card system registration and installed driver:**
```
*-display
description: VGA compatible controller
product: Skylake GT2 [HD Graphics 520]
manufacturer: Intel Corporation
ID: 2
bus information: pci@0000:00:02.0
version: 07
width: 64 bits
clock: 33MHz
capabilities: pciexpress msi pm vga_controller bus_master cap_list rom
configuration: driver=i915 latency=0
resources: irq:156 memória:a0000000-a0ffffff memória:90000000-9fffffff porta de E/S:4000(tamanho=64) memória:c0000-dffff
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with main.py around line 47, then inspect setup_screen(), the fullscreen setting, and the pygame display modes reported before the failure. Reproduce the XFree86 BadValue error with fullscreen enabled and verify that starting the game no longer stops on the screen-resolution setup.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
game-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.