Git Product home page Git Product logo

4d-minesweeper's Introduction

4D-Minesweeper

A 4D Minesweeper game written in godot

4d-minesweeper's People

Contributors

double-jumper avatar gapophustu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

4d-minesweeper's Issues

Performance

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 2
n^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?

Unable to click fields

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?

Scale bug

Setting scale to -1 crashes the game and renders it unusable until config manually changed

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.