A 4D Minesweeper game written in godot
gapophustu / 4d-minesweeper Goto Github PK
View Code? Open in Web Editor NEWA 4D Minesweeper game written in godot
License: Mozilla Public License 2.0
A 4D Minesweeper game written in godot
License: Mozilla Public License 2.0
First of all I want to say that this game is great at imaging a 4 dimensional game of minesweeper especially how yoou show to the player wich fields are nearby the mouse.
But performance is a huge issue (more than 7^4 is not really possible and 7^4 already takes extremely long to start). I am not that good at writing code. I rather read the code and search for optimisations.
I was able to find the following:
1: I think a great portion of why the game takes so long to start is the amount of calculations to get the numbers for the fields. This can be improved by making smarter calculations (in the sense of use what has already been calculated tto reduce the total amount of calculations). You are adding all the neighbours with mines up for !EVERY! field. That are 80n^4 calculations (not considering the borders)
you can do better by first going after the first dimension: for field i use the calculation of field i-1 substract 1 if at i-2 is a mine, add 1 if i+1 is a mine. You got numbers for groups of 3 in 2n^4 calculations
now onto groups of 9: basically the same procedure as before but with the next dimension and subtract/add the numbers of the groups of 3. This takes 2n^3 calculations. the next step for groups of 27 takes 2n^2 calculations and the last step takes 2*n calculations. This is again not considering borders but with small n the numbers of calculations are not a problem and with big n the affect of the borders is extremly low.
2: I also noticed that there are a lot of calculations when uncovering a lot of zeros. but i dont really understand how the game handles that. Maybe consider an update queue?
I've build it from source (wanna package it for nixOS) and it runs fine but I can't click any fields.
I can Start the game and the :-)
also uncovers some fields but I can't continue.
The only error I get in the log is the following
ERROR: Condition "cache_id.size < 1" is true.
at: _reload_cache (scene/resources/dynamic_font.cpp:674)
Any idea how to fix this?
Setting scale
to -1 crashes the game and renders it unusable until config manually changed
Could you add build for android devices
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.