This is my ambitious struggle against Python inefficiencies. An RTS game made with Python 3.6 and Arcade 2.26 Library is my attempt to make something what should NOT be done with this language.
I've decided to use Arcade library because of useful SpriteLists concept and efficient way of drawing Sprites. All advantages and disadvantages of Arcade library are available here: Arcade performance
For now, you have to clone or download this repository. Then create new virtual environment, install requirements and run it by running game.py script in your IDE (e.g. PyCharm) or in terminal.
To be done.
- Window and Views as different 'states' of the game.
- Pathfinding with my A* implementation using PriorityQueue with my efficiency improvement: set of elements contained in PriorityQueue for faster lookups.
- Simple - map-nodes-based - collision avoidance (buggy!).
- Simple debugging logic.
- Pausing game logic.
- Finding files by their names without any paths-constants etc.
- Basic mouse-handling: selecting, unselecting, giving move-orders to Units.
- Scratch of the keyboard-handling.
- Efficient replacements for the arcade.Spritelists allowing me to arbitrary 'activate', 'deactivate' updating and drawing some Sprites to avoid updating and drawing objects which are not on the screen.
- Basic - distance and geometry-based - detection of which Sprites see each other.
- Alternative scheduling calls system to work with the (to be done) saving and loading game.
- Simple permanent group of units is now 'saved' and player can activate them with 0-9 keys press.
- Mouse-drag scrolling the map.
- Small improvement to efficiency by spreading of many pathfinding calls for several update-frames, so no big lag when sending units to the opposite corner of the map.
- Added queueing the pathfinding-requests, and a Pathfinder changed to the Singleton.
- Divided map to the Sectors to avoid visibility-tests between all Units and Buildings in game.
- Scratch of Menu and user interface systems.
- Units are now asking other units for pass if they are blocking their way.
- Pathfinder can now find paths leading to the encircled areas or with entrances blocked by units.
- Working sounds: music background tracks, sound-effects, ui-sound-effects.
- Display currently selected permanent units group number above each unit belonging to this group.
- Units are now 1x8 or 8x8 (tanks with turrets) sprite-sheets, so they can face 8 directions (and other 8 directions for turrets). Each Unit can be spawned in many, various colors, depending on the player's choice.
- Optimized visibility-detection, to reduce cpu overhead.
- Units automatically moving towards detected enemies out of their attack range.
- Subdivided FogOfWar SpriteList to optimize FoW updates performance.
- Shot, hit and destruction graphic effects and sounds.
- Simple minimap showing current viewport position and revealed map area.
- Vehicles leave tires/tracks traces on the ground.
- When Vehicles are destroyed, they leave wrecks.
- Implemented pooling to boost Explosions efficiency.
- Implemented in-game timer displaying how much time passed since game started.
- Implemented new game-loading from file system.
- Added playlists for background music tracks. 10.06.2021:
- Improved mini-map: better resolution, no more ugly big rectangles!
- Saving Trees works now!
- Loading menu with auto-updating list of existing save-files. 28.06.2021:
- UI for Buildings and Units-production added.
- Player can now produce new units.
- Soldiers can enter end leave Buildings.
- UI displays amount of resources, player has. 17.03.2023:
- New UI with icons for resources and units and buildings construction panels.
- Prettier Fog Of War without sharp edges.
- Units are now rotated in 16 directions instead of 8.
- CPU-player can now build Units, having enough resources and proper factories.
- Added two more units prototypes - Truck and APC.
- Minimap and teleporting to the map-locations by clickling on the minimap (was added long time ago, but I missed noticing it).
- Improve visibility-detection by 'communicating' what is seen between friendly Units which are very close to each other.
- Improve collisions-avoidance to get rid off the diagonal-movements-collisions.
- Better collision-avoidance to replace tiles-reserving system - flocking maybe? How to make it working with pathfinding?
- Units-radiochatter sounds - DONE. Battle sounds.
- Skirmish mission customisation submenu (this is the only available game mode for now).
- Playlist for background music tracks - DONE.
- Better Ai for Units autonomous behaviour.
- Flocking for Soldier class.
- Implement Jump Point Search to optimize A* performance.
- Less cpu-heavy VehicleThreads.
- Nicer MiniMap without ugly rectangles representing discovered area - DONE.
- User-interface. (currently being developed)
- Menu! (currently being developed)
- AI (with finite-state=-machine?)
- Saving and loading game (with shelve?) - DONE
- Sounds and music - DONE
- Multiplayer.
- "Playing" section above.
- Installer/executable for Windows and Linux.
- Docker image.
- Many various resources consumed to produce units and maintain infrastructure and extracted in different ways.
- Technological advancement system - researching new technologies allows player to build better units and buildings.
- Conscription system: to build units, especially infantry, player needs to create recruitments facilities near civilian villages and protect them from enemies.
- Supply-transportation and storage system. Units do not have infinite ammunition and fuel and require to be resupplied from base by the supply-transporting vehicles. Protecting supply-lines is required.
Rafał "Akapkotel" Trąbski