...Backend?
Honestly, do you need a backend? Do you need a database? It's probably easier to just write stuff to a normal save file.
...Backend?
Honestly, do you need a backend? Do you need a database? It's probably easier to just write stuff to a normal save file.
Yeah it took me several hours to figure it out, but it turns out the problem was the physbones were hitting the wolf's main collision box! Cue trying to go every which way at once.
I put them on a different collision layer and that totally fixed the problem. (And then the wolf just crumpled like a taken-off shirt.)
I am tempted to put in an "if (some very small chance), add the physbones to the first layer to make them jitterbounce away"!
-- Frost
Nice goat simulator physics
I think this is what happens when you enable phys bones while animations are still playing? The Godot docs have comments that discuss solutions.
Or just ship it
best game ever made. just take my money
Makes sense, I think getting the proton working well is the main aim for developer looking to maximize their user
wow they god really scared and ran off fast
There was demo for Steam Next Fest but I think it got removed. Maybe in the future it will get bigger discount.
Costs a bit too much for me but looks interesting, is there a limited demo or discount planned soon? Maybe I can get it somewhere other than steam for less money?
Steam is currently down (which is wild). Game is called My Card Is Better Than Your Card!
Current version works with Linux with Proton (that how I play it). I understand the want for Linux build but they are just doing easiest solution based on user numbers.
For some reason the link isnt working. What's the game called so I can search it?
Tell your friend to compile the game for Linux as well.
I changed the IP address from "127.0.0.1" for connection to the server in the configs of the game to the IP adress of the VPS. And in this case the logs from the browser console looks so now:
Blocked loading mixed active content “http://218.14.40.150:777/abilities/active/all%E2%80%9D game.js:9:186044
TypeError: NetworkError when attempting to fetch resource.
create https://example.com/game.js:9
_godot_js_fetch_create https://example.com/game.js:9
callUserCallback https://example.com/game.js:9
runIter https://example.com/game.js:9
Browser_mainLoop_runner https://example.com/game.js:9
game.js:474:18
SCRIPT ERROR: Assertion failed. game.js:474:18
at: HttpHighClient.send_request (res://scripts/common/http/http_high_client.gd:37) game.js:474:18
ERROR: Parse JSON failed. Error at line 0: Unknown error getting token game.js:474:18
at: parse_string (core/io/json.cpp:582) game.js:474:18
�[91m�[1mERROR: �[22mDB API can't read this response: /abilities/active/all�[39m�[0m game.js:459:16
ERROR: DB API can't read this response: /abilities/active/all game.js:474:18
at: push_error (core/variant/variant_utility.cpp:1098) game.js:474:18
But the connection still won't works 🤷♂️
P.S: Some content from the logs was changed for privacy reason.
This is a piece of logs from the browser console:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://127.0.0.1:777/abilities/active/all. (Reason: CORS request did not succeed). Status code: (null).
TypeError: NetworkError when attempting to fetch resource. game.js:474:18
Firefox can’t establish a connection to the server at ws://127.0.0.1:888/. game.js:9:219740
SCRIPT ERROR: Assertion failed. game.js:474:18
at: HttpHighClient.send_request (res://scripts/common/http/http_high_client.gd:37) game.js:474:18
ERROR: Parse JSON failed. Error at line 0: Unknown error getting token game.js:474:18
at: parse_string (core/io/json.cpp:582) game.js:474:18
�[91m�[1mERROR: �[22mDB API can't read this response: /abilities/active/all�[39m�[0m game.js:459:16
Firewall I've already checked.
https://en.m.wikipedia.org/wiki/Shoelace_formula
But don't do this on the fly... do it before you compile your program and use a lookup table at runtime.
You mentioned the areas being countries. This leads me to believe that they are concave figures, correct? If you are unfamiliar, a concave figure is something that has a space that doubles back into the interior of the shape. So an o is convex, and a c is concave, as an example. Convex shapes are much simpler to find the area of. You can use a Riemann Sum as others have suggested. I would probably just pick a point inside the shape and do a bunch of triangles around with the point as an apex and the bases as two points on the edge of the surface, then sum up the areas of each triangle. You could even probably use a triangulation algorithm built into the engine to do this. (I am unfamiliar with the specifics of the Godot engine).
For concave shapes it becomes a little more complex. It has been mentioned that you can draw a bounding box around the shape, so that would allow you to calculate it using a numerical method. Take random samples inside the bounding box and count up the number that are inside the shape and divide by the total number of samples. The value you get will be the % of the area of the bounding rectangle that the shape takes up, so just multiply the easy area by the % and you will get an answer that is close enough. It may take a bit to get the sample count right, but it will get there. Try to make sure the samples are as uniform as possible. You could even scatter the sample points then relax them for a couple iterations before counting to increase accuracy without increasing samples.
Good afternoon! While, I'll be honest, I don't do much video game development as I'm finishing up my Master's program in Computer Science and my Data Science graduate certificate, the best advice I can give you for purposes regarding this problem is to look to the Riemann Sum formula regarding approximation of definite integrals on a two-dimensional plane, which is presented as follows:
∑ᵢ=₁ⁿ f(xᵢ)Δx
(P.S. - This formula was copied and pasted via generative AI, as I struggled to figure out how to write formulas in Lemmy response windows)
I suggest this as the imperfect dimensions of the sizes of countries on a global map appear to suggest necessity of calculations of area by means of integral calculus. While I was exposed to these formula during my high school AP Calculus course several years ago, I will admit I had to look it up again on Google and was reminded with an AI-generate response. Basically, the integral of an imperfect shape that cannot be defined by algebraic equations can be approximated on a curve with a series of rectangle of varying heights with equivalent widths. The more rectangles are placed to approximate the curve, the more accurate your assessment becomes. So, if you're trying to approximate the size of the country on your global map for purposes of a country-surrendering mechanic in your game via Godot Engine, I would highly suggest defining a method that takes in the standard width of all rectangles present in your graph (each represented as a distinct CollisionShape2D component/element) with heights extending just beyond the outline of the country's graph, and returns the approximate summation of the country's area as a whole in a two-dimensional context for purposes of applying your country's surrender limitation game mechanic.
Unfortunately, it looks like drawing a big rectangle is the only method to calculate area that's baked into Godot. You could get the Area2D's CollisionShape2D children, and then for each child you can child.shape.get_rect().get_area()
Now, if you're getting each shape anyway, and you know what kind of shape it is, you can use the appropriate formula to calculate area. For instance, if it's a CircleShape2D, you can check the radius and get something like var area = shape.radius * shape.radius * PI
For a polygon it becomes more complicated. You can get the points of the polygon and then use Geometry2D.triangulate_polygon() to get an array of triangles inside that polygon. You can then calculate the area of each triangle and sum them to get your total area. There's no built-in way to do this, so it's left as an exercise for you.
The question I have to ask: from a design standpoint, is the exact size of each country truly important to the game? For the sake of argument, Canada is a really quite large country, but it's sparsely populated. A lot of the land is frankly not very habitable. If I was going to abstract a surrender-factor, I'd think about "population" filling a role that you're thinking of for "area." If that were the case, you could just attach a property to each country manually. Maybe a little more work upfront depending on how many countries or regions you're including, but it's definitely cognitively simpler.
You can use Geometry2D to triangulate the polygon and then determine the area of each of the triangles from their points. I would do this in an editor script and put that results into a text file or maybe generate a dictionary and keep it directly in code.
This doesn’t super solve your immediate problem, but it might help you keep progress on your game:
Remember — it’s a game. Maybe yes, you could calculate the area of the polygon you drew, and then you’d have it working like that for good. But then what happens if you want to fudge a number, like the area calculates that 2 troops can fit in France but for balance you really want 3? At that point you’re going to need to fudge the calculation, add another factor or redraw your polygon (the latter which might not be possible).
An alternative way to solve this is you can look up on wikipedia the different areas of these countries. You can assign a factor for each one (like Risk does) based on various factors - area, population, etc, but ultimately balance, that allows you to set whatever you want on each country. Not that the math isn’t exciting, but you’re probably going to end up doing this anyway after you figure the math out.
To get the area of a random 2d polygon it's probably easiest to triangulate the area, then sum the area of all the triangles.
Not sure how to program that, but that's how I'd solve it with pen+paper.
Making video games has taught me most of the maths that i missed in school. You really do need those pesky formulas like they told you back then lol.
I think, the Area2D node doesn't have any size. But you can use the underlying shape object.
If it's a basic shape (rectangular, circle) it should be trivial to calculate. If you have a poligon2D as shape, I think there is no build in Godot function, but you could calculate it with shoelace formula, I think.
Does this make sense to you?
Actually, it's based on a new game I've just released: Beyond The Space Wall I will update the store page soon. 😎