What I did today

Added a test of road connectedness to my village generator.

Currently the generator just tests to see which roads are connected to a random root road, but next week I will add a calculation of a fully connected graph. I think I will just start will all roads paved, and then prune the grid randomly until the minimum number of roads are paved with all mandatory (next to building) road sections connected together.

Well thanks, my friend told me the same thing at the beginning but i didn’t listen to him, but now that i’ve tested it, it’s a lot better without branches pushing towards the ground. ( And just because i wanted to say it although it doesn’t matter it was [ max(-Ļ€; angle_of_parent_branch - Ļ€/2) ; min(Ļ€, angle_of_parent_branch + Ļ€/2) ] ).

NB : i didn’t include the source in the jar because i’m too ashamed of my code to show it. But for those interested by the program the jar is updated and available : here

It does look better now!

That’s what you get for trying to post code without rereading it ::slight_smile:

As a side note, decompiling class files is a thing, you know.
Here is the beginning of [icode]org.machine.life.Wind[/icode] ;D :


package org.machine.life;

import org.machine.life.Drawer;
import org.minus.FastMath;
import org.minus.FastRand;
import org.minus.FastTrig;

public class Wind {
    private float dx = FastRand.randFloat() * 10.0f - 5.0f;
    private float dy = FastRand.randFloat() * 10.0f - 5.0f;
    private static float TICK_UNIT = 10.0f;

    public float getIntensity() {
        return FastMath.hypot((float)this.dx, (float)this.dy);
    }

J0 :slight_smile:

Soooo… only did some bugfixing and small things on my project to let it sleep… for some days.
Because we just finished packing our luggage for our vacation: 3 weeks Japan :slight_smile: I hope the +7 hours don’t hit me too hard and that the 14h (in summary for all flights as we have to switch 2 times to reach Japan) flight is also ok (I’m 1.85m tall, for some planes this is already hard at the limit of coziness)

As a side note, decompiling class files is a thing, you know.
Here is the beginning of [icode]org.machine.life.Wind[/icode] ;D :


package org.machine.life;

import org.machine.life.Drawer;
import org.minus.FastMath;
import org.minus.FastRand;
import org.minus.FastTrig;

public class Wind {
    private float dx = FastRand.randFloat() * 10.0f - 5.0f;
    private float dy = FastRand.randFloat() * 10.0f - 5.0f;
    private static float TICK_UNIT = 10.0f;

    public float getIntensity() {
        return FastMath.hypot((float)this.dx, (float)this.dy);
    }

J0 :slight_smile:
[/quote]
Haha it’s a trap ;D, well just don’t look at Tree :persecutioncomplex:, in fact i did try to add some Wind last weekend like real world physics and i used real volumic mass of wood. But the output was that when the trees were growing they were completly pushed on the floor by the wind ( which was only 1m/s ) but when they reached their full size, they were not affected at all, even the branches. So i just removed it but didn’t remove the class. When i’ll have the time, i might try to re-implement it with some pseudo-simulation of wind.

I’m 5cm smaller than you, and when i took the plane to China with Lufthansa, i can tell you that the seats were a bit small for my legs. But on the way back, i got promoted to first class so no problem 8). I don’t know if you will wait long between your planes but in airports if you look for it you can find machines which gives free hot chocolate or coffe. Feel free to abuse it :stuck_out_tongue:

I finished my first internship yesterday, so I have to go back to school this week :P.

When I went home, I noticed the raspberry pi zero is not out of stock anymore, so I bought a kit. That should be fun.

I also made a script that corrupts IP cameras.

https://camo.githubusercontent.com/8149e75fd9bdd45ff471ea79676e0449768e7500/68747470733a2f2f7468756d62732e6766796361742e636f6d2f5370616e6973684a6f696e74416d7068696269616e2d73697a655f726573747269637465642e676966

https://camo.githubusercontent.com/417bf7b05d25ef08b9fa67081d82017410e24249/68747470733a2f2f7468756d62732e6766796361742e636f6d2f4578686175737465644c696e6564416d65726963616e7761726d626c6f6f642d73697a655f726573747269637465642e676966

@matt_p 186 cm here, I know the struggle…

@leSpace Good luck with the wind then!

@wessles Now you just need to inject that in some closed-circuit CCTV system and steal shit ;D

New personal best on the Rubiks Cube - 6.97. First sub 7! Joy :slight_smile:
I’m working on college admissions, it’s… stressful to say the least. Lots to do.

I have received an offer from Google for full-time employment starting next year! Hooray!!

I got back into making my dream application, a drag and drop game development tool for absolute beginners. Just started an hour ago.

I will be using this as my dream application, and also as the final project for college. I still have one year and eight months to complete this. The good thing is that this will have the ability to create Java sources once done making a prototype for faster development.

Finished off my village generator. It now generates a grid of connected roads for all buildings. The grid is not optimum, but I guess that’s more realistic anyway.

`
: Grass

: Tree

v : Vegetable patch
h : Hovel
c : Cottage
l : Longhouse
H : Hall
G : Great Hall
S : Stronghold
M : Market
. : Square
City plan:
c h| h v| h #
| |
-----
| # # #
| #
---------------
#| # h| h #
| v|
----- -----
| . .| # M | #
| . .| H H| #
---------------

h| h v| |

v| | | #


h v # | h |
# | |
-----
| h c h
# | v

`

I -finally- got my enemy pathfinding to work, which is exciting. I also made some basic effects in sfxr so there’s actually audio in my game.

I highlighted two vertices of your path in red; it’s not very visible, so just in case, their coordinates in the path grid, from bottom-left, would be (1,2) and (2,2).
These points could easily be connected by just one path, but right now you can only — staying on the paths — go from one to the other by travelling along 9 paths.
I think you should try to prevent that; although the grid not being optimum is indeed more realistic, I reckon this is beyond realistic ;D

J0 :slight_smile:

It’s very realistic. Olaf Ragnarson lives there and he’s one scary dude with a big axe. It’s safest to take the scenic route.

A simple brute-force way would be to run the path generation several times and then pick the result with the least number of paths. Another way would be to prune paths with connections to mandatory roads last.

If I calculate the total distance to a point in the graph, I can then add paths back in and see what addition lowers the total distance most.

But hey, the Vangardians don’t even walk on the paths yet :slight_smile:

Woohoo! This is what I did yesterday:

Sure, screen-space ambient occlusion is a pretty old technique, but it’s my very first time doing global illumination!

SSAO is always good, even on top of real GI.

You’re looking for something between a Shortest Path Tree (efficient movement) and a Minimum Spanning Tree (least road construction).

If your villages are small enough for a quadratic algorithm then I’d do:

  • for every pair of locations
    • add the shortest path between them, where existing paths cost 0.1 and non-paths cost 1.0

That sounds like a very good and simple algorithm. I like the fact that it is based on what real people would do - take the shortest distance, unless there is an already existing path nearby. I can refine it by giving buildings a weight. So all buildings strongly generate the shortest path to the market or temple, and strongly favor existing paths for less popular buildings (like the village beggar’s hut).

I’m moving on to other aspects now, but I’ve added your suggestion as a //todo in the code.

Had my first C++ lesson at University today :slight_smile: I’m actually surprised by the apparent similarity between Java and C++!

Both Java and C++ belong to the same family of C-like languages (well, actually Java is meant to be simplified C++ with most of its advantages and less flaws), so expect lots of similarities…

…Well, at least until you will dive deeper. C++ concepts of memory, objects, references etc. are VERY different. :slight_smile: