Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
93ae7b1
Add score reward system with actions and calculations
Fabbernat Jan 8, 2025
76cc9a7
Install Pillow library for image processing
Fabbernat Jan 8, 2025
d888a21
Subject: [PATCH] Install Pillow library for image processing
Fabbernat Jan 8, 2025
59bfcff
Refactor Settings and GameMode handling for better consistency and En…
Fabbernat Jan 10, 2025
9781cf2
Fix: Properly initialize and populate players in the game
Fabbernat Jan 10, 2025
d45f704
Solves: I want to use MVC in my flask app. What are the conventions? …
Fabbernat Jan 11, 2025
e1dffd7
Add basic Flask app structure with navigation routes
Fabbernat Jan 11, 2025
02eb942
Implement basic Minimax functions for Polytopia AI
Fabbernat Jan 17, 2025
67d01be
initial Java commit to this PYthon projevt
Fabbernat Oct 15, 2025
d575cae
v1.0 cimple console app works, with no particular game logic implemented
Fabbernat Oct 15, 2025
644df37
v1.1: significantly improve project structure, still runs all well an…
Fabbernat Oct 27, 2025
4d4919f
v1.2: implemented new game maker logic with ID's. Can make any amount…
Fabbernat Oct 27, 2025
b3d4fe9
v1.3: HUGE update: add guids, pre-stored games TODO: store and delete…
Fabbernat Oct 27, 2025
6be544c
v1.3: move resources into a folder dedicated for them
Fabbernat Oct 27, 2025
086fe1b
v1.4: Fixed a lot of bugs in reading in guidReference.txt and games.t…
Fabbernat Oct 27, 2025
cd15e96
v1.5: games now can also be queried & listed with the "gam" or "games…
Fabbernat Oct 27, 2025
c17f36b
v1.5.1: add missing whitespace
Fabbernat Oct 27, 2025
aa0c809
Revise README for clarity and new contributions
Fabbernat Dec 25, 2025
910e63b
Fix games bug
fabbernatvasvari Jan 15, 2026
3b19fc9
Fixed some bugs and improved code quality
fabbernatvasvari Jan 15, 2026
0fa30b9
Now all game names start with a Capital Letter.
fabbernatvasvari Jan 15, 2026
f44dbf8
TODO: fix problems of this patch
fabbernatvasvari Jan 15, 2026
7a15e06
updated&improved `help` command
fabbernatvasvari Jan 19, 2026
d112765
Add all 12 base tribes' basic stats
fabbernatvasvari Jan 19, 2026
1b762f2
beuatiful 16x16 tiles blue&green grid works, integrated with the cion…
fabbernatvasvari Jan 21, 2026
d040585
v1.6: add Perlin noise via PerlinNoise.java
fabbernatvasvari Jan 21, 2026
11f32fc
v1.6.1: I am pretty satisfied with the algorithm so far
fabbernatvasvari Jan 21, 2026
c1c3b71
v1.6.2: improved logic, capitals now don't spawn at the edge of the map
fabbernatvasvari Jan 21, 2026
8a3590e
v1.6.3: balance changes
fabbernatvasvari Jan 21, 2026
d858b38
v1.6.3.1: better colors
fabbernatvasvari Jan 21, 2026
605f437
v1.6.3.2: add village-filling scratch
fabbernatvasvari Jan 21, 2026
37df499
v1.6.3.2: Village generation now also works, although neighbor cities…
fabbernatvasvari Jan 21, 2026
05fd382
v1.6.3.3: 35 is pretty much the lower limit of how many villages can …
fabbernatvasvari Jan 22, 2026
be77a19
v1.6.3.3.1: same
fabbernatvasvari Jan 22, 2026
b0fcb18
v1.6.3.3.1: increased village spawn logic, and I dont think it will f…
fabbernatvasvari Jan 22, 2026
04803f1
v1.6.3.3.2: good version for lakes
fabbernatvasvari Jan 22, 2026
cc0b2ce
v1.6.3.3.3: simulate bardur gameplay
fabbernatvasvari Jan 22, 2026
e873cc3
v1.6.3.3.4: simulate bardur gameplay even on large maps
fabbernatvasvari Jan 22, 2026
11c87f4
v1.6.3.3.5: every map is drylands right now
fabbernatvasvari Feb 3, 2026
a98197c
v1.6.3.3.6: save before messup
fabbernatvasvari Feb 3, 2026
b3a5659
v1.6.3.3.7: nullPointerException
fabbernatvasvari Feb 3, 2026
11c86e1
v1.6.3.3.8: IT WORKS!!! Finally, it works! TODO: WW runs into infinit…
fabbernatvasvari Feb 3, 2026
b559954
v1.6.3.3.9: first version after IT WORKS!!! Finally, it works! TODO: …
fabbernatvasvari Feb 4, 2026
0765000
v1.6.3.3.10: mountains do not spawn any more on ocean
fabbernatvasvari Feb 4, 2026
098f4e2
v1.6.3.3.10: I meant FORESTS. Last commit I meant FORESTS do not spaw…
fabbernatvasvari Feb 4, 2026
fc8bda9
v1.7: Big improvements on the desktop app. The desktop app's control …
fabbernatvasvari Feb 12, 2026
ac406fe
v1.7: - Feature update: fixed some bugs
fabbernatvasvari Feb 12, 2026
220a4da
Fix links to Polytopia frontend repository
Fabbernat Mar 25, 2026
42a27dc
v1.8: added missing valid commands to the project
Fabbernat Mar 25, 2026
f2debc2
Merge remote-tracking branch 'origin/main'
Fabbernat Mar 25, 2026
32a27b9
Added images and descriptions for various map types including Dryland…
Fabbernat Mar 25, 2026
862a78c
Enhance README with new map types and contributions
Fabbernat Mar 25, 2026
16be09a
Revise map type descriptions in README.md
Fabbernat Mar 25, 2026
0d83b7f
Update headings for map types in README.md
Fabbernat Mar 25, 2026
358d401
v1.8.1: there is a known issue with water worlds
Fabbernat Mar 25, 2026
aefb4d9
Merge remote-tracking branch 'origin/main'
Fabbernat Mar 25, 2026
c200bd0
v1.8.2: fix yadakk tribe
Fabbernat Jun 8, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 42 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,48 @@
## Read Me:
For the frontend see [github.com/Fabbernat/Polytopia-frontend](https://github.com/Fabbernat/Polytopia-frontend)

# Read Me:

Welcome to the `polytopia_python` repo! Have a look around and familiarise yourself with some of the code that's already here.
Welcome to the `polytopia_python` repo! Have a look around and familiarise yourself with some of the code that's already
here.

You'll notice that there's a `game_map.py` file -- this is where all of the logic for generating/interacting with the *map* will be.
You'll notice that there's a `game_map.py` file -- this is where all of the logic for generating/interacting with the
*map* will be.

The `game_simulator.py` script is mostly empty so far, and is where the main game logic will eventually go.

The `map_renderer.py` script is a separate component that you can mostly ignore, and will be responsible for creating a visual representation of the current game state. This won't be necessary for deep learning, and will purely be for debugging and QA purposes.
The `map_renderer.py` script is a separate component that you can mostly ignore, and will be responsible for creating a
visual representation of the current game state. This won't be necessary for deep learning, and will purely be for
debugging and QA purposes.

The `settings.py` file contains some some settings variables that are mostly unused as of now, but the most important of these is the `CHANNEL_ATTRIBUTES` object, which contains descriptions of what each 'channel' in the game state array will correspond to.
The `settings.py` file contains some settings variables that are mostly unused as of now, but the most important of
these is the `CHANNEL_ATTRIBUTES` object, which contains descriptions of what each 'channel' in the game state array
will correspond to.

---
# Fabbernat's contribution:
# <img width="1914" height="1152" alt="image" src="https://github.com/user-attachments/assets/e063eb02-6bdc-4e72-b2ac-7750755d4ca2" />
### The "Lakes" map type and some insight to the code in IntelliJ IDEA 👆
---

# <img width="580" height="586" alt="image" src="https://github.com/user-attachments/assets/0de15548-015f-4e6a-88dc-d970d7dffb5b" />
### The "Drylands" map type 👆
---

# <img width="577" height="585" alt="image" src="https://github.com/user-attachments/assets/f7925ea4-0645-4c31-9a99-101994bde225" />
### The "Continents" map type 👆
---

# <img width="577" height="583" alt="image" src="https://github.com/user-attachments/assets/6fe27709-9ed7-45ba-a4a2-9c5ef99873b0" />
### The "Archipelagos" map type 👆
---

# <img width="1920" height="1160" alt="image" src="https://github.com/user-attachments/assets/6d13d709-33d4-4002-bd22-1e60bd52de0e" />
### The "Continents" map type, but BIGGER 👆
---

- I made a frontend to this at [github.com/Fabbernat/Polytopia-frontend](https://github.com/Fabbernat/Polytopia-frontend) built in ASP.NET
- I added a COMPLETE terrain generation module
- I added a score counter Python module and a Java console consoleApp

## Java console consoleApp
This is intended to be the main consoleApp at some point and will simulate the core logic of the gameplay like map generation, tech tree and even combat
Empty file added app/__init__.py
Empty file.
Empty file added app/hall_of_fame.html
Empty file.
Empty file added app/static/css/styles.css
Empty file.
Binary file added app/static/favicon.ico
Binary file not shown.
Binary file added app/static/images/polyhead_ancient.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/static/images/polytopia-background.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/static/images/polytopia-main-menu.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/static/images/soundfx-ico.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
203 changes: 203 additions & 0 deletions app/templates/about.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,203 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>About Us</title>
</head>
<body>

@{
ViewData["Title"] = "About";
}
<h1>@ViewData["Title"]</h1>

<div class="icons">
<img src="~/css/images/Fabbernat-polyhead-icon.jpg" alt="Fabbernat Polyhead Icon" title="Fabbernat Polyhead Icon" />
</div>
<div class="about-section">
<p><strong>Fabian Team:</strong> A passionate team of developers dedicated to creating engaging and immersive experiences for Polytopia fans.</p>

<h2>Polysseum</h2>
<p>The Polysseum is a platform where strategic minds meet, showcasing the best players and their achievements. It's the ultimate hall of fame for Polytopia enthusiasts.</p>

<h2>Meet the Team</h2>
<p><s>~Midji Team~</s> Fabian Team:</p>
<ul>
<li><strong>Fabian Bernát:</strong> Lead Developer and visionary behind the project.</li>
<li><strong>Midjiwan:</strong> Creator and leader of Polytopia</li>
<li><strong>Zoythrus:</strong>Lead Community Manager, Community Member</li>
<li>
<strong>Midjitone:</strong>Sound, music and ambience. Check out Polytopia music at
<ul>
<li><a href="https://polytopia.io/polytopia-music/">This link,</a></li>
<li><a href="https://polytopia.fandom.com/wiki/Polytopia_Music">and this link!</a></li>

</ul>

</li>
</ul>

<h2>Our Mission</h2>
<p>To create a space where players can share strategies, celebrate victories, and grow the Polytopia community.</p>

</div>
<div class="contact">
<h3>Contact us!</h3>
<ul>
<li>Facebook <a href="https://Facebook.com/Fabbernat">https://Facebook.com/Fabbernat</a></li>
<li>X (Twitter) <a href="https://x.com/Fabbernat">https://x.com/Fabbernat</a></li>
<li>Github: <a href="https://github.com/Fabbernat">https://github.com/Fabbernat</a></li>
</ul>
</div>
<style>
html, body, h1, h2, p, button {
margin: 0;
padding: 0;
border: 0;
box-sizing: border-box;
}


html {
font-size: 14px;
}

html {
font-size: 16px;
}



.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
box-shadow: 0 0 0 0.1rem black, 0 0 0 0.25rem #258cfb;
}

html {
position: relative;
min-height: 100%;
}

body {
margin-bottom: 60px;
background-color: rgb(36,36,36);
color: rgb(231,231,231);
font-size: 12px;
line-height: 1.6;
font-family: "Curlz MF",cursive, serif; /* Goofy font */
color: lightyellow; /* Base text color */
}

.pet-description {
font-size: 1.2em;
color: lemonchiffon;
}

.pet-age {
font-style: italic;
color: lightgoldenrodyellow;
}

/* Category-related styles */
.category-name {
font-size: 2.5em;
color: black;
font-weight: bold;
text-decoration: underline wavy yellow; /* Wavy underline */
padding: 10px;
border: 3px dashed yellow; /* Dashed border */
}

.category-description {
font-size: 1.5em;
color: lightyellow;
margin-bottom: 20px;
}

/* General styles for common elements */
a {
color: yellow;
text-decoration: none;
font-weight: bold;
transition: all 0.2s ease-in-out; /* Smooth transition for hover effect */
}

a:hover {
color: lightyellow;
text-shadow: 0 0 5px yellow;
transform: scale(1.1); /* Slight zoom on hover */
}

h1, h2, h3, h4, h5, h6 {
color: black;
}

h1 {
font-family: "Curlz MF",cursive, serif; /* Goofy font */
}

h2, h3, h4, h5, h6 {
font-family: Impact, Charcoal, sans-serif;
}

main {
padding: 20px;
}

div {
margin-bottom: 15px;
}

p {
line-height: 1.5;
}

table {
border-collapse: collapse;
width: 100%;
margin-top: 20px;
}

th, td {
border: 1px solid yellow;
padding: 8px;
text-align: left;
}

th {
background-color: rgb(50, 50, 50);
color: black;
}

ul {
list-style-position: inside; /* This brings the bullets inside the list item */
padding-left: 0; /* Removes default padding that can create extra space */
}

li {
margin-left: 0; /* Removes any default margin that might be present */
}

form {
padding: 20px;
margin: 20px;
border: 1px solid #ddd; /* Add a border to the form */
}

form div {
padding: 10px; /* Reduce padding within the form's div */
margin: 5px; /* Reduce margin within the form's div */
}

label {
display: block; /* Make labels stack vertically */
margin-bottom: 5px; /* Add space between labels */
}

.no-categories {
text-align: center; /* Center the message */
margin-bottom: 20px; /* Add space below the message */
}
</style>

</body>
</html>
24 changes: 24 additions & 0 deletions app/templates/base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ title }}</title>
</head>
<body>
<nav>
<a href="/">Index</a> |
<a href="/privacy">Privacy</a> |
<a href="/dashboard">Dashboard</a> |
<a href="/about">About</a> |
<a href="/settings">Settings</a> |
<a href="/hall-of-fame">Hall of Fame</a> |
<a href="/throne-room">Throne Room</a>
</nav>
<hr>
<div>
{% block content %}
{% endblock %}
</div>
</body>
</html>
10 changes: 10 additions & 0 deletions app/templates/dashboard.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Dashboard</title>
</head>
<body>

</body>
</html>
10 changes: 10 additions & 0 deletions app/templates/hall_of_fame.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Hall of Fame</title>
</head>
<body>

</body>
</html>
10 changes: 10 additions & 0 deletions app/templates/home.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Home</title>
</head>
<body>
{% header("Location:index.html?redirect=True") %}
</body>
</html>
53 changes: 53 additions & 0 deletions app/templates/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Index</title>
</head>
<body>
{% extends "base.html" %}

{% block content %}
<h1>the Battle of Polytopia</h1>
<p>This is the Index page. Explore other sections using the navigation above.</p>
{% endblock %}
@{
ViewData["Title"] = "Home Page";
}

<div class="text-center">
<h1 class="display-4">The Battle of Polytopia</h1>
<form action="Game/Index.cshtml" method="post">
<label for="my-games" class="toggle">
<input type="submit" name="my-games" value="My games" />
<span class="toggle-btn">

</span>

</label>
</form>

</div>
<style>
.toggle .toggle-btn {
display: inline-block;
width: 60px;
text-align: center;
padding: 5px 0;
font-size: 14px;
font-weight: bold;
color: white;
background-color: lightblue;
border-radius: 5px;
user-select: none;
transition: all 0.3s ease;
}

.toggle .toggle-btn:hover {
background-color: white;
color: black;
border: 1px solid black;
}
</style>
</body>
</html>
16 changes: 16 additions & 0 deletions app/templates/privacy.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
{% extends "base.html" %}

{% block content %}
<h1>Privacy Policy</h1>
<p>This is the Privacy page content.</p>
{% endblock %}

</body>
</html>
Loading